[
https://issues.apache.org/jira/browse/GROOVY-11854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11854.
----------------------------------
Fix Version/s: 5.0.5
Resolution: Fixed
https://github.com/apache/groovy/commit/3015f5e5cc7b2e27ed581ccfa7a88b23ba03c83c
> 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)