Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.8.6
-
None
-
None
Description
The following code produces NPE when the second object is created:
abstract class C { public abstract String f(Object o); private void g(Object val) { println f(val) // NPE when 'y' is created !!! } public C() {this('DEF')} public C(Object val) { g(val) } } class D extends C { public String f(Object o) { return o ? 'Not null' : 'Is null' } } def x = new D() def y = [ 'f' : { it -> return '123' + it } ] as C
Somehow 'this' becomes null when 'f' is invoked in 'g'.