Bug 106634 - regression: argument causes BcelGenericSignatureToTypeXConverter.java:203
Summary: regression: argument causes BcelGenericSignatureToTypeXConverter.java:203
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-10 11:04 EDT by Samuel Gélineau CLA
Modified: 2005-08-18 05:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Gélineau CLA 2005-08-10 11:04:45 EDT
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.
Comment 1 Samuel Gélineau CLA 2005-08-10 15:37:05 EDT
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)
Comment 2 Adrian Colyer CLA 2005-08-11 05:24:29 EDT
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.
Comment 3 Adrian Colyer CLA 2005-08-11 06:47:05 EDT
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.
Comment 4 Andrew Clement CLA 2005-08-18 05:12:51 EDT
Dev build is available with fix in, closing this bug