You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/11/01 09:29:00 UTC
[jira] [Commented] (GROOVY-8367) @Memoized not working for inner
classes
[ https://issues.apache.org/jira/browse/GROOVY-8367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16233835#comment-16233835 ]
ASF GitHub Bot commented on GROOVY-8367:
----------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/groovy/pull/624
> @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
> Priority: Major
>
> {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
(v6.4.14#64029)