Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-2
-
None
-
None
Description
The following simple iterator:
class bug10 implements Iterator {
int i = 0
Object next()
{ i++ return [ i, i*10, i*100 ] as Integer[] }boolean hasNext()
{ i < 5 }void remove() { }
static public void main(String[] args) {
def b = new bug10()
b.each
{ println it }}
}
throws a NullPointerException in Closure.callViaReflection(). Oddly, calling a closure directly with an Object[] works just fine, e.g.:
c = { println it }
x = [3, 4, 5] as Object[]
c