Bug 489192 - NPE in ImplicitNullAnnotationVerifier.java:97
Summary: NPE in ImplicitNullAnnotationVerifier.java:97
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-08 04:22 EST by Stanislav Spiridonov CLA
Modified: 2016-12-14 15:58 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Spiridonov CLA 2016-03-08 04:22:10 EST
java.lang.NullPointerException
at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ImplicitNullAnnotationVerifier.checkImplicitNullAnnotations(ImplicitNullAnnotationVerifier.java:97)
at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:832)
at org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1020)
at org.aspectj.org.eclipse.jdt.internal.compiler.ast.Abstract ... oBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Compile error: NullPointerException thrown: null
Comment 1 Andrew Clement CLA 2016-03-08 13:47:53 EST
Looks like scope is null at that line. I'll probably need some sample code to trigger it in order to fix it. It is possible a JDT upgrade will also fix it (since that will pick up lots of fixes in the underlying compiler) but that isn't due until closer to Neon release.
Comment 2 Stanislav Spiridonov CLA 2016-03-08 13:59:59 EST
>I'll probably need some sample code to trigger it in order to fix it. 
It is big internal project. Think it is not possible :( Will try.

>It is possible a JDT upgrade will also fix it.
Not sure that understand it correct. But anyway: the Eclipse a going under Java 8 (1.8.0_74) the target JVM is Java 6.
Comment 3 Andrew Clement CLA 2016-03-14 12:53:31 EDT
>> It is possible a JDT upgrade will also fix it.
> Not sure that understand it correct. But anyway: the Eclipse a going under Java 8 (1.8.0_74) the target JVM is Java 6.

Inside AspectJ is a modified version of the Eclipse JDT compiler. The Eclipse JDT compiler receives fixes over time. They are not instantly applied to AspectJ, they are picked up during periodic updates to AspectJ that pick up the latest version of the JDT compiler. The problem you are seeing may occur in AspectJ but is in fact a JDT issue. If JDT have fixed it and we rebase AspectJ on that version, you'd pick up the fix too.
Comment 4 Stanislav Spiridonov CLA 2016-10-18 03:19:49 EDT
The error still exists in Eclipse Neon.1 (4.6.1). 

May by the following will help. The error appears only while "Enable annotation-based null analysis" is enabled.
Comment 5 Andrew Clement CLA 2016-11-07 15:00:10 EST
I've just upgraded AspectJ to a recent JDT (Neon.1 and a bit) so the 1.8.10 release will include all their latest fixes. As I can't recreate this, I can't tell if it will fix the problem but it'll be worth trying when the release happens (in a few days time I think).
Comment 6 Andrew Clement CLA 2016-12-09 12:04:21 EST
AJDT dev builds for 4.6 and AspectJ 1.8.10 now include Neon.2, which may affect this.
Comment 7 Andreas Höhmann CLA 2016-12-14 06:46:59 EST
Today I updated to the lates ajdt (Version: 1.8.10.201612122115, Version: 2.2.4.201612122115)

Similar effect:

java.lang.NullPointerException
at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.evaluateNullAnnotations(SourceTypeBinding.java:2202)
at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:710)
at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getAnnotationTagBits(SourceTypeBinding.java:1082)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAda ... oBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Compile error: NullPointerException thrown: null
Comment 8 Andrew Clement CLA 2016-12-14 15:58:13 EST
thanks for trying that out. I'll have another look when I get a moment but without testcode that triggers it, might be tough to properly address.