Bug 108448

Summary: IllegalStateException: Undeclared type variable when hiding
Product: [Tools] AspectJ Reporter: Wes Isberg <wes>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.5.0M3   
Target Milestone: 1.5.0 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
ajcore text file none

Description Wes Isberg CLA 2005-08-31 02:35:46 EDT
ISE thrown compiling http://sourceforge.net/projects/collections 4.0beta3 source.
javac issues two warnings, but Eclipse 3.1 (JDT) issues *many* for type
parameter hiding types (perhaps bug 103783).  I haven't isolated a test case or
tried it on earlier releases - sorry.
Comment 1 Wes Isberg CLA 2005-08-31 02:36:43 EDT
Created attachment 26684 [details]
ajcore text file
Comment 2 Adrian Colyer CLA 2005-08-31 05:45:47 EDT
I recognise that stack trace :)

The collections project looks like a good way of hammering our generics support.
I'll download it and give it a spin...
Comment 3 Adrian Colyer CLA 2005-08-31 06:17:02 EDT
I've improved the error handling inside ajc so that we get much better
diagnostics on errors like this in the future. The compiler now fails with an
IllegalStateException that says:

"While determing the generic superinterfaces of
org.apache.commons.collections15.list.FastArrayList$SubList$SubListIter with
generic signature Ljava/lang/Object;Ljava/util/ListIterator<TE;>; the following
error was detected: Undeclared type variable in signature: E"

Much more like it :)
Now I can go ahead and make the fix (not chasing up *all* the outer types to
find type variables, we are only looking at immediate enclosing types at the
moment), and if we encounter similar situations in the future we should be able
to debug much more directly from the error report.
Comment 4 Adrian Colyer CLA 2005-08-31 07:34:13 EDT
Put in place a straightforward fix to walk *all* outer types while looking for
type variables in scope. ajc now compiles the collections project without error.
Just running the full suite before commiting...
Comment 5 Adrian Colyer CLA 2005-08-31 09:20:04 EDT
fix now available in latest published build on the downloads page.