Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-4
-
None
-
None
-
Windows 2K,
groovy -v :
Groovy Version: 1.0-jsr-04-SNAPSHOT JVM: 1.4.2_06-b03
Description
As discussed on the user-Mailinglist, there seems to be a problem with vargs.
The following code snippets (first from me, second from Jochen Theodorou)
present it:
-----------------------------------------------
Code snippet:
def path = new File("D:/test")
def content = Arrays.asList( path.list() )
content.each
Result:
{"One.txt", "Three.txt", "Two.txt"}Expected result:
One.txt
Three.txt
Two.txt
-----------------------------------------------
Code snippet:
def foo(String[] a)
def bar(Object[] a)
{ println a.length } def l = ["a","b"] as String[]
foo(l)
bar(l)
Result:
2
1
Expected result:
2
2