Community
Participate
Working Groups
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
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.
i love incremental bugs.
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.