Community
Participate
Working Groups
I closed some projects to get rid of nagging exceptions from duplicate META-INF/aop.xml files. I'm using the latest dev build with 3.2M6. Incremental recompilation produced: java.lang.StackOverflowError at java.util.Vector.addElement(Vector.java:581) at java.util.Stack.push(Stack.java:44) at org.aspectj.bridge.context.CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.java:178) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collectAllITDsAndDeclares(AjLookupEnvironment.java:319) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.doSupertypesFirst(AjLookupEnvironment.java:301) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collectAllITDsAndDeclares(AjLookupEnvironment.java:329) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.doSupertypesFirst(AjLookupEnvironment.java:301) at ... (repeats many times) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.doSupertypesFirst(AjLookupEnvironment.java:301) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collectAllITDsAndDeclares(AjLookupEnvironment.java:322) StackOverflowError thrown: null
It turns out I get this one with a full rebuild even when using ant. I must have some kind of cyclic dependency in the source with some recent edits I made. Lots of fun to debug...
p.s. In use cases like this, I really miss the old AJDT build configuration files, which made it a lot easier to build a changing subset of files to track down compiler bugs.
I have narrowed this bug down (by debugging the ajc run in an Eclipse workspace with the AspectJ modules checked out). This pure Java code causes the same stack overflow in ajc, but runs properly with javac: public interface StatisticsType { } public class StatisticsTypeImpl implements StatisticsType { static class UIStatisticsType extends UofwStatisticsType { }; public static void main(String argz[]) { System.out.println(new UIStatisticsType().toString()); } } public class UofwStatisticsType extends StatisticsTypeImpl { } C:\devel\scratch\funWithTypes>javac *.java C:\devel\scratch\funWithTypes>java StatisticsTypeImpl StatisticsTypeImpl$UIStatisticsType@182f0db C:\devel\scratch\funWithTypes>ajc *.java C:\devel\scratch\funWithTypes\UofwStatisticsType.java [error] Internal compiler error java.lang.StackOverflowError at org.aspectj.bridge.context.CompilationAndWeavingContext.enteringPhase (CompilationAndWeavingContext.java:176) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collect AllITDsAndDeclares(AjLookupEnvironment.java:319) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.doSuper typesFirst(AjLookupEnvironment.java:301) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collect AllITDsAndDeclares(AjLookupEnvironment.java:329) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.doSuper typesFirst(AjLookupEnvironment.java:301) ...
fix committed. Remove the type earlier in the process so we don't loop round thinking we still need to deal with it. Still might cause a problem with some wierd configuration of inter-dependendant types (wont overflow, but may fail to correctly apply ITDs).
fix available.