Bug 262218 - Compiler error thrown during incremental compilation
Summary: Compiler error thrown during incremental compilation
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.6.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-23 13:41 EST by Andrew Eisenberg CLA
Modified: 2009-01-23 15:39 EST (History)
1 user (show)

See Also:


Attachments
Project that exhibits this behavior (3.70 KB, application/octet-stream)
2009-01-23 13:49 EST, Andrew Eisenberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2009-01-23 13:41:46 EST
This error is being thrown during incremental compilation of MyAspect.aj

-----------------
java.lang.NullPointerException
at org.aspectj.weaver.NewConstructorTypeMunger.equals(NewConstructorTypeMunger.java:46)
at org.aspectj.weaver.ConcreteTypeMunger.equivalentTo(ConcreteTypeMunger.java:38)
at org.aspectj.weaver.CrosscuttingMembers.replaceWith(CrosscuttingMembers.java:366)
at org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect(CrosscuttingMembersSet.java:77)
at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment ... AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Compile error: NullPointerException thrown: null
-----------------
Steps to reproduce:

1. import attached project
2. full build (it works)
3. open test.MyAspect
4. make whitespace change to fike
5. save
6. error is reliably thrown
Comment 1 Andrew Eisenberg CLA 2009-01-23 13:49:19 EST
Created attachment 123575 [details]
Project that exhibits this behavior

I thought that this behavior comes from the declare @type, but even when I remove that line, this error is still happening.
Comment 2 Andrew Clement CLA 2009-01-23 14:25:59 EST
i love incremental bugs.
Comment 3 Andrew Clement CLA 2009-01-23 15:39:27 EST
can of worms.

1) Fixed the NPE - bad logic in equality check comparing the constructor type munger between the full compile and the incremental compile

But with the NPE addressed it is not an incremental build... worth digging into why:

2) Changed the comparison logic - cannot consider the explicitConstructor in the incremental compilation comparison, since it will not have been set by that time for the eclipsetypemunger.  Added equivalentTo() check in NewConstructorTypeMunger

3) Declare softs are not there in the incremental comparison.  For some reason they answer true to isAdviceLikeDeclares() - I can't think why that would be since they are more like type mungers and required to keep the type structure consistent. Changed it to return false.

4) Once they are included in the comparison we discover duplication because the DeclareSofts are stored in a List in CrosscuttingMembers when it should be a Set - fixed this.

Finally an incremental build on a whitespace change to the aspect.

All committed.