[ 
https://issues.apache.org/jira/browse/GROOVY-8367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-8367.
-----------------------------

> @Memoized not working for inner classes
> ---------------------------------------
>
>                 Key: GROOVY-8367
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8367
>             Project: Groovy
>          Issue Type: Bug
>          Components: xforms
>    Affects Versions: 2.5.0-beta-2
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 2.5.0-beta-3
>
>
> {code}
> import groovy.transform.Memoized
> class Outer {
>   private static class Inner {
>     @Memoized
>     static calc(int arg1, int arg2) { arg1 + arg2}
>   }
> }
> println Outer.Inner.calc(3, 4)
> {code}
> Works with 2.4.12 but for 2.5+, results in:
> {noformat}
> groovy.lang.GroovyRuntimeException: NPE while processing ConsoleScript12
>       at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:286)
> ...
> Caused by: java.lang.NullPointerException
>       at 
> org.codehaus.groovy.classgen.asm.ClosureWriter.getClosureSharedVariables(ClosureWriter.java:360)
>       at 
> org.codehaus.groovy.classgen.asm.ClosureWriter.createClosureClass(ClosureWriter.java:194)
>       at 
> org.codehaus.groovy.classgen.asm.ClosureWriter.getOrAddClosureClass(ClosureWriter.java:156)
> ...
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to