groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8204) @Delegate on arrays causes NPE during compilation
Date Thu, 25 May 2017 13:39:04 GMT

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

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

GitHub user paulk-asert opened a pull request:

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

    GROOVY-8204: @Delegate on arrays causes NPE during compilation

    

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

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

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

    https://github.com/apache/groovy/pull/551.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 #551
    
----
commit 8af2cf43dcf41d1614e75c1bb17046351c048472
Author: paulk <paulk@asert.com.au>
Date:   2017-05-25T13:37:14Z

    GROOVY-8204: @Delegate on arrays causes NPE during compilation

----


> @Delegate on arrays causes NPE during compilation
> -------------------------------------------------
>
>                 Key: GROOVY-8204
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8204
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.11
>            Reporter: Krzysztof SzafraƄski
>            Priority: Minor
>
> I have stumbled upon this bug partly by accident, and I'm not convinced it's a valid
use case, but either way it should not crash the compiler with a NPE.
> Trying to compile the following simple class:
> {code}
> import groovy.lang.Delegate
> class BugsMe {
> 	@Delegate
> 	byte[] file
> }
> {code}
> Results in the following exception:
> {code}
> >>> a serious error occurred: BUG! exception in phase 'canonicalization' in
source unit 'BugsMe.groovy' unexpected NullpointerException
> >>> stacktrace:
> BUG! exception in phase 'canonicalization' in source unit 'BugsMe.groovy' unexpected
NullpointerException
> 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1070)
> 	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
> 	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
> 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
> 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:537)
> 	at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:61)
> 	at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:217)
> 	at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:150)
> 	at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:180)
> 	at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:164)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
> 	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
> Caused by: java.lang.NullPointerException
> 	at org.codehaus.groovy.ast.ClassHelper.getNextSuperClass(ClassHelper.java:454)
> 	at org.codehaus.groovy.ast.ClassHelper.getNextSuperClass(ClassHelper.java:449)
> 	at org.codehaus.groovy.ast.tools.GenericsUtils.extractSuperClassGenerics(GenericsUtils.java:444)
> 	at org.codehaus.groovy.transform.DelegateASTTransformation.addDelegateMethod(DelegateASTTransformation.java:233)
> 	at org.codehaus.groovy.transform.DelegateASTTransformation.visit(DelegateASTTransformation.java:129)
> 	at org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:134)
> 	at org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:178)
> 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
> 	... 15 more
> {code}



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

Mime
View raw message