groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8367) @Memoized not working for inner classes
Date Mon, 30 Oct 2017 09:53:00 GMT

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

Paul King updated GROOVY-8367:
------------------------------
    Affects Version/s:     (was: 2.4.12)
                       2.5.0-beta-2

> @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
>
> {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}
> 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
(v6.4.14#64029)

Mime
View raw message