Bug 324804 - NullPointerException at AspectJElementHierarchy.java:677
Summary: NullPointerException at AspectJElementHierarchy.java:677
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 1.6.10   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 18:30 EDT by Jesse Englert CLA
Modified: 2010-09-09 12:24 EDT (History)
1 user (show)

See Also:


Attachments
JVM Error Log (19.70 KB, application/octet-stream)
2010-09-08 18:41 EDT, Jesse Englert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Englert CLA 2010-09-08 18:30:31 EDT
Build Identifier: 20100617-1415

After removing a "throws" clause from the constructor of a class and then saving I got the following error:

java.lang.NullPointerException
at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677)
at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641)
at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572)
at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Compile error: NullPointerException thrown: null

Reproducible: Didn't try
Comment 1 Jesse Englert CLA 2010-09-08 18:41:43 EDT
Created attachment 178463 [details]
JVM Error Log

I was able to reproduce this error when adding or removing the throws clause from the constructor...until Eclipse eventually crashed. Attaching the JVM hs_err log. The JVM identified the following: 

# Problematic frame:
# J  org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(Ljava/util/Set;)V
Comment 2 Andrew Clement CLA 2010-09-09 12:24:56 EDT
Possibly a threading issue with an AJDT thread affecting the handleMap which the compiler is in the middle of processing.  A guard would seem to suffice here as null effectively means the same as the check the code was going to perform.

Not sure why a simple NPE would lead to a vm crash.

I've committed a guard on null to stop this occurring.