[
https://issues.apache.org/jira/browse/GROOVY-11854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-11854.
------------------------------
> Enclosing method not set for AIC in script statements
> -----------------------------------------------------
>
> Key: GROOVY-11854
> URL: https://issues.apache.org/jira/browse/GROOVY-11854
> Project: Groovy
> Issue Type: Bug
> Components: class generator
> Affects Versions: 5.0.4
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.5
>
>
> Consider the following:
> {code:groovy}
> def fun = { -> }
> println fun.getClass().getEnclosingClass() // the script
> println fun.getClass().getEnclosingMethod() // the run() method
> {code}
> {code:groovy}
> def obj = new Object() {}
> println obj.getClass().getEnclosingClass() // the script
> println obj.getClass().getEnclosingMethod() // null
> {code}
> At the time the AIC is created, the script class and run method are not
> available, so the metadata is incomplete.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)