Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (19 sloc) 590 Bytes
package groovy
class ToArrayBugTest extends GroovyTestCase {
void testToArrayBug() {
def array = getArray()
callArrayMethod(array)
}
protected def getArray() {
def list = [1, 2, 3, 4]
def array = list.toArray()
assert array != null
return array
}
protected def callArrayMethod(array) {
System.out.println("Called method with ${array}")
def list = Arrays.asList(array)
assert list.size() == 4
assert list == [1, 2, 3, 4]
}
}
Something went wrong with that request. Please try again.