Bug 258629

Summary: NullPointerException at isAspect(ReferenceType.java:165)
Product: [Tools] AspectJ Reporter: Jochen Wuttke <jochen.wuttke>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: 1.6.2   
Target Milestone: 1.6.3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Aspect causing the exception none

Description Jochen Wuttke CLA 2008-12-12 04:54:35 EST
java.lang.NullPointerException
at org.aspectj.weaver.ReferenceType.isAspect(ReferenceType.java:165)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager$4.acceptResult(AjBuildManager.java:1032)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.acceptResult(AjPipeliningCompilerAdapter.java:383)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterProcessing(AjPipeliningCompilerAdapter.java:356)
at org.asp ... AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Compile error: NullPointerException thrown: null
Comment 1 Jochen Wuttke CLA 2008-12-12 04:55:41 EST
Created attachment 120295 [details]
Aspect causing the exception
Comment 2 Jochen Wuttke CLA 2008-12-12 04:59:37 EST
I get this exception every time I rebuild the project in Eclipse. It is unclear whether this is related to some error in the asepct (one of the methods being called does not exist in this example), or a true bug. 

Assuming it is due to a syntax error I would expect a much more helpful error message.
Comment 3 Andrew Clement CLA 2008-12-12 11:18:17 EST
Are you on AspectJ 1.6.2 as it says in the bug report?

This looks like bug 251940 which is already fixed in AspectJ 1.6.3 dev builds, please update.

A NullPointerException is never a sign of intended behaviour, so yes you should be setting a better error if it is a syntax error.
Comment 4 Andrew Clement CLA 2009-01-31 19:57:44 EST
I believe I fixed all code paths that could lead to this NPE during 1.6.3 development.  Please reopen if you see it again on a recent build.