Community
Participate
Working Groups
Compiling the following two files (in package member_conflict) with ajc -Xlint -incremental -sourceroots member_conflict yeilds a well-formed error. Files: ---- public class SomeClass { public String toString() { return "from SomeClass"; } } public aspect Conflicter { public String SomeClass.toString() { return "from Conflicter"; } public static void main(String[] args) { int i = 0; } } However, modifying Conflicter so that it reads: public aspect Conflicter { // public String SomeClass.toString() { // return "from Conflicter"; // } public static void main(String[] args) { int i = 0; } } saving the file and invoking the incremental compilation yeilds a NullPointerException (full output below). C:\aopbook_tech\aop7>ajc -Xlint -incremental -sourceroots member_conflict inter-type declaration from member_conflict.Conflicter conflicts with existing member: java.lang.String member_conflict. SomeClass.toString() inter-type declaration from member_conflict.Conflicter conflicts with existing member: java.lang.String member_conflict. SomeClass.toString() 2 errors press enter to recompile (q to quit): Exception thrown from AspectJ 1.1beta4 This might be logged as a bug already -- see the bug database at http://dev.eclipse.org (product: AspectJ, component: compiler) Bugs for exceptions thrown have titles File:line from the top stack, e.g., "SomeFile.java:243" If you don't find the exception below in a bug, please add a new bug To make the bug a priority, please include a test program that can reproduce this exception. null java.lang.NullPointerException at org.eclipse.jdt.internal.core.builder.State.copyFrom(State.java:60) at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.<init>(IncrementalImageBuilder.java:41) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$IncrementalBuilder.<init>(AjBuildManager.java:661) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.getIncrementalBuilder(AjBuildManager.java:127) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:159) at org.aspectj.ajdt.ajc.AjdtCommand.repeatCommand(AjdtCommand.java:90) at org.aspectj.tools.ajc.Main.run(Main.java:203) at org.aspectj.tools.ajc.Main.runMain(Main.java:138) at org.aspectj.tools.ajc.Main.main(Main.java:58) 1 fail|abort, 2 errors
this bug is fixed in the current cvs tree with a test in scripts/incr.py this bug revealed some more serious issues in the handling of types across incremental compiles and between the compiler and the weaver that must be addressed before any candidate