Community
Participate
Working Groups
While compiling single simple annotation or enum, weaver goes into infinitive loop, which ends with StackOverFlowException. I attached sources (Annotation.java and Enum.java) and ajcore.*.txt files from Sun JDK 1.5.0.02 and JRockit 1.5, since they give different ajcore files (different stack trace). So archive contains 4 ajcore files. I'm using Linux with JDK JRockit 1.5 and AspectJ 1.5.0M2.
Created attachment 19690 [details] sources and ajcore files
The cause of the problem is the name of annotation and enum ('Annotation', 'Enum'). When I change those names, the problem dissapears.
take a look in the parser when its open for Eclipse M6 compiler integration
I tried to create annotation named 'Annotation' with eclipse 3.1M6 and ajdt 1.2.0.20050407142843, and I got similar error (but in dialog): 'StackOverflowError: null'. The same for enum named 'Enum'.
enum AnEnum {A,B,C} // ok //enum Enum {A,B,C} // dies @interface anInterface {} // ok //@interface Annotation {} // dies ============= for the enum called Enum: java.lang.StackOverflowError at java.util.HashMap.hash(HashMap.java:264) at java.util.HashMap.get(HashMap.java:320) at org.aspectj.weaver.World$TypeMap.get(World.java:543) at org.aspectj.weaver.World.resolve(World.java:124) at org.aspectj.weaver.World.resolve(World.java:109) at org.aspectj.weaver.World.resolve(World.java:152) at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1034) at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1037) at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1037) ... etc ============================ for the annotation called Annotation: java.lang.StackOverflowError at java.util.HashMap.get(HashMap.java:320) at org.aspectj.weaver.World$TypeMap.get(World.java:543) at org.aspectj.weaver.World.resolve(World.java:124) at org.aspectj.weaver.World.resolve(World.java:109) at org.aspectj.weaver.World.resolve(World.java:152) at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1034) at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1045) at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1045) ... etc
Think I've fixed this. I've sent my patch+test to Andy Clement, who'll maybe put it in the dev version some time. The problem was in BcelWeaver.java where it tries weaving the parent types for things. It was confusing the names you declared (Enum etc) with the names of classes declared inside AspectJ. To fix this ambiguity I prefixed all the names of types with their package.
Fix checked in - waiting on build before closing.
Fix available in latest dev build.