[
https://issues.apache.org/jira/browse/GROOVY-7885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-7885.
-------------------------------
Resolution: Not A Problem
As per Reporter's comments, no longer an issue.
> referencing method in outer class from inner class throws Exception when
> using newInstance()
> --------------------------------------------------------------------------------------------
>
> Key: GROOVY-7885
> URL: https://issues.apache.org/jira/browse/GROOVY-7885
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.6
> Reporter: Jörg Prante
> Priority: Minor
>
> This code throws an error
> class A {
> Object o
> A() {
> def b = B.newInstance()
> o = "Hello"
> b.execute()
> }
> Object val() {
> o
> }
> class B {
> void execute() {
> println val()
> }
> }
> }
> def a = new A()
> groovy Test.groovy
> Caught: java.lang.NullPointerException
> java.lang.NullPointerException
> at A$B.methodMissing(Test.groovy)
> at A$B.execute(Test.groovy:18)
> at A$B$execute.call(Unknown Source)
> at A.<init>(Test.groovy:9)
> at Test.run(Test.groovy:24)
> but this code works
> class A {
> Object o
> A() {
> def b = new B()
> o = "Hello"
> b.execute()
> }
> Object val() {
> o
> }
> class B {
> void execute() {
> println val()
> }
> }
> }
> def a = new A()
> Is this expected?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)