Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-3
-
Fix Version/s: 1.0-beta-3
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
I added another test to the bug class below that attempts to update a static variable from with a closure in a static method. The result of the new test is this Error:
java.lang.NoSuchFieldError: owner
at UseStaticInClosureBug$2.doCall(C:\dev\cvsviews\groovy\groovy-core\target\test-classes\groovy\bugs\UseStaticInClosureBug.groovy)
class UseStaticInClosureBug extends GroovyTestCase {
static stuff = [:]
void testBug() {
[1,2,3].each
assert stuff.size() == 3
assert stuff[2] == "dog"
}
void testBug2() { doStatic() }
static doStatic() {
[1,2,3].each { stuff[it] = "dog" }
assert stuff.size() == 3
assert stuff[2] == "dog"
}
}
I updated the test case UseStaticInClosureBug.groovy to include your failure & I think this is now fixed. Let me konw if its not & we can reopen