Community
Participate
Working Groups
the following reported a compile error using AspectJ Compiler DEVELOPMENT built on Monday Jun 20, 2005 at 08:14:57 GMT but now crashes using AspectJ Compiler DEVELOPMENT built on Wednesday Aug 10, 2005 at 13:12:53 GMT import java.util.Vector; // works if java.util.* is used public class Bug extends Vector { // works if Vector is not extended void test(DoesNotExist argument) {} // works without the argument } also, the bug only appears if the -1.5 flag is used.
update: also fails if "java.util.*" is used after all, and the argument type doesn't have to be non-existent. so, an updated test case would be: import java.util.*; public class Bug extends Vector { void test(Object argument) {} } ajc -1.5 Bug.java ./Bug.java [error] Internal compiler error java.lang.IllegalStateException: Undeclared type variable in signature: E at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeVariableSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:203) at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.fieldTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:120) at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeArgument2TypeX(BcelGenericSignatureToTypeXConverter.java:163) at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:75) at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:40) at org.aspectj.weaver.bcel.BcelObjectType.unpackGenericSignature(BcelObjectType.java:514)
The problem seems to be in unpacking the generic signatures of Vector and its super types. In particular, Vector extends ArrayList<E>, which has a nested type Itr<E>. The "E" used it ArrayList$Itr<E> comes from the outer type, which we are failing to look in when trying to resolve type parameters.
Fix commited in tree, will close when available in a published build. Thanks for the clear bug report - we're making good headway on the generics implementation now and hope to start giving much better service on bug reports again soon.
Dev build is available with fix in, closing this bug