Community
Participate
Working Groups
public aspect OuterAspect { private pointcut isSetter() : execution(void set*(..)); public static aspect InnerAspect pertarget(isSetter()) { } } java.lang.IllegalStateException at org.aspectj.apache.bcel.classfile.GenericSignatureParser.parseFieldTypeSignature(GenericSignatureParser.java:163) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.parseTypeArgument(GenericSignatureParser.java:253) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.maybeParseTypeArguments(GenericSignatureParser.java:261) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.parseClassTypeSignature(GenericSignatureParser.java:208) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.parseAsClassSignature(GenericSignatureParser.java:56) at org.aspectj.apache.bcel.classfile.Signature.asClassSignature(Signature.java:315) at org.aspectj.apache.bcel.classfile.JavaClass.getGenericClassTypeSignature(JavaClass.java:973) at org.aspectj.weaver.bcel.BcelObjectType.initializeFromJavaclass(BcelObjectType.java:164) at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.java:131) at org.aspectj.weaver.bcel.BcelWorld.buildBcelDelegate(BcelWorld.java:337) at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:395) at org.aspectj.weaver.bcel.BcelWeaver.addIfAspect(BcelWeaver.java:263) at org.aspectj.weaver.bcel.BcelWeaver.addAspectsFromDirectory(BcelWeaver.java:255) at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:205) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:698) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:223) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:199) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:170) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) IllegalStateException thrown: Expecting [,L, or T, but found Pjava while unpacking Ljava/util/AbstractSet<Pjava/util/Map$Entry<TK;TV;>;>;
Are you on 1.5.2 or a dev build of 1.5.3? I tried just compiling the aspect you included, worked fine. Given that the signature it has trouble with is "Ljava/util/AbstractSet<Pjava/util/Map$Entry<TK;TV;>;>;" something else must be involved - since your aspect doesn't use collection classes. How are you compiling that aspect? Are you weaving rt.jar?
I can't reproduce it anymore. I'm using AspectJ 1.5.2 with AJDT 1.4 on Eclipse 3.2. I was not trying to weave into rt.jar. I'll reopen this bug if I come across it again and can make a reproducible test case for you.
Created attachment 49854 [details] Testcase: Ant driven This small project demonstrate the BCEL exception for this bug. The project assumes a lib directory with the AspectJ jars (I used aspectj-DEVELOPMENT-20060907092616.jar for this).
I've added a test case that demonstrates this bug.
thanks for the testcase - I've been able to work out how the rogue signature is getting into the class output during the first compilation.
I stripped down the testcase to the bare minimum. Basically you need to have some type that implements/extends a generic type, eg. Foo extends List<Set<String>> (and the generic reference has to be nested, can't be List<String> - needs to be more complex). That type must be affected by a declare parents to cause the signature to change, this will result in a broken signature on disk (so assume declare parents: Foo implements Serializable): Ljava/util/List<Pjava/util/Set<Ljava/lang/String;>;>; (see the rogue P) then that has to be used in a subsequent weave and the weaver will blow up when unpacking it. The fix is trivial ;) Test and fix checked in - the fix is likely to address any/all related bugs that suffer this same illegal state exception.
fix available in AJ dev builds.
Still getting this problem, but only from AJDT - it seems to work perfectly well in Ant/AspectJ. I'll attach a Team Project Set file with two projects that generate this failure. Sorry for the moderate download size. (Depends on Subclipse for Subversion access). The stack trace is a little different from Eclipse as well, here is a copy: java.lang.IllegalStateException at org.aspectj.apache.bcel.classfile.GenericSignatureParser.parseFieldTypeSignature(GenericSignatureParser.java:163) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.parseTypeArgument(GenericSignatureParser.java:253) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.maybeParseTypeArguments(GenericSignatureParser.java:261) at org.aspectj.apache.bcel.classfile.GenericSignatureParser.pars ... teException thrown: Expecting [,L, or T, but found Pjava while unpacking Ljava/lang/ThreadLocal<Pjava/util/Set<Ldash/obtain/provider/ObtainLookup;>;>;
Created attachment 50611 [details] Team Project Set file for failing case This Team Project Set file points to two Eclipse projects that demonstrate the failure in AJDT.
i dont believe AJDT has been upgraded with the most recent AspectJ build... hence it is still failing...
The latest 1.4 and 1.5 AJDT dev builds now contain this fix.