Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-74

method invocation passing a String[] seems to barf when there is more than one element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-2
    • None
    • None

    Description

      James Birchfield found this script seems to fail...

      import java.util.Arrays

      public class test {

      static void main(args) {
      println("Called main with ${args}")
      listFiles(Arrays.asList(args))
      }

      static String getPath(file)

      { return file.absolutePath }

      static void listFiles(dirs) {
      println("called with ${dirs}")

      for(dir in dirs) {
      println("dir: ${dir}")

      f = new java.io.File(dir)

      for (f in f.listFiles())

      { println(getPath(f)) }


      }
      }
      }

      This is actually an occurrance of this bug...

      http://cvs.groovy.codehaus.org/viewcvs.cgi/groovy/groovy-core/src/test/groovy/ToArrayBug.groovy?rev=1.3&root=codehaus&view=auto

      There's another test case to check it here

      http://cvs.groovy.codehaus.org/viewcvs.cgi/groovy/groovy-core/src/test/groovy/ArrayMethodCallBug.groovy

      Attachments

        Activity

          People

            Unassigned Unassigned
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: