[jira] [Resolved] (GROOVY-8043) NPE compiling Memoized method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (GROOVY-8043) NPE compiling Memoized method

JIRA jira@apache.org

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

Paul King resolved GROOVY-8043.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.5.0-beta-1

Proposed PR merged. Thanks for spotting the issue.

> NPE compiling Memoized method
> -----------------------------
>
>                 Key: GROOVY-8043
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8043
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.7
>            Reporter: Isaac Dooley
>            Assignee: Paul King
>             Fix For: 2.5.0-beta-1
>
>
> {code:title=Reproducable Example groovy code that fails to compile}
> class A {    
> }
> new A() {
>   @groovy.transform.Memoized()
>   String a() {
>     return "a"
>   }
> }
> {code}
> {code:title=Exception I get when compiling the groovy script}
> groovy.lang.GroovyRuntimeException: NPE while processing Script71.groovy
>      at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:258)
>      at org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:813)
>      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1053)
>      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
>      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
>      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
>      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
>      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
>      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
>      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
>      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:584)
>      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)
>      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)
>      ...
> Caused by: java.lang.NullPointerException
>      at org.codehaus.groovy.classgen.asm.ClosureWriter.createClosureClass(ClosureWriter.java:190)
>      at org.codehaus.groovy.classgen.asm.ClosureWriter.getOrAddClosureClass(ClosureWriter.java:156)
>      at org.codehaus.groovy.classgen.asm.ClosureWriter.writeClosure(ClosureWriter.java:87)
>      at org.codehaus.groovy.classgen.AsmClassGenerator.visitClosureExpression(AsmClassGenerator.java:657)
>      at org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:45)
>      at org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareSiteAndReceiver(CallSiteWriter.java:235)
>      at org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareSiteAndReceiver(CallSiteWriter.java:224)
>      at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:272)
>      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
>      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:392)
>      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:104)
>      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:88)
>      at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:459)
>      at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:767)
>      at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
>      at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateEqual(BinaryExpressionHelper.java:316)
>      at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:84)
>      at org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:638)
>      at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
>      at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:612)
>      at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:357)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)