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/03/10 07:30:04 UTC

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

    [ https://issues.apache.org/jira/browse/GROOVY-8043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15904614#comment-15904614 ] 

ASF GitHub Bot commented on GROOVY-8043:
----------------------------------------

GitHub user paulk-asert opened a pull request:

    https://github.com/apache/groovy/pull/511

    GROOVY-8043: NPE compiling Memoized method with AIC

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paulk-asert/groovy groovy8043

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/511.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #511
    
----
commit 6a30bb254f63fe949ed60f5b173220e88aad2c62
Author: paulk <pa...@asert.com.au>
Date:   2017-03-10T07:27:55Z

    GROOVY-8043: NPE compiling Memoized method with AIC

----


> 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.15#6346)