You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Isaac Dooley (JIRA)" <ji...@apache.org> on 2017/01/10 16:52:58 UTC

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

Isaac Dooley created GROOVY-8043:
------------------------------------

             Summary: 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


{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.4#6332)