Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.4, 1.8-beta-1
-
None
-
None
Description
The outer property access and method invocations from inner class seem to be resulting in NPE, as shown by examples below:
Case 1: Outer property access from inner class
class ReflectionToolboxTest { static final PROPERTY_VALUE = "property_value" class Bean { String property = PROPERTY_VALUE } def bean = new Bean() } def test = new ReflectionToolboxTest()
results in
java.lang.NullPointerException at ReflectionToolboxTest$Bean.propertyMissing(Script1.groovy) at ReflectionToolboxTest$Bean.<init>(Script1.groovy) at ReflectionToolboxTest.<init>(Script1.groovy:7) at Script1.run(Script1.groovy:10)
Case 2: Outer method access from inner class
class Dummy { def foo(){} class Bean { String property = foo() } def bean = new Bean() } new Dummy()
results in
java.lang.NullPointerException at Dummy$Bean.methodMissing(Script1.groovy) at Dummy$Bean.<init>(Script1.groovy:4) at Dummy.<init>(Script1.groovy:6) at Script1.run(Script1.groovy:8)