Bug 86179

Summary: [1.5] Type parameters lost with nested inheritance and generics
Product: [Eclipse Project] JDT Reporter: Kory Markevich <vulcannis>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Kory Markevich CLA 2005-02-22 13:36:00 EST
Under 3.1M5a, the following code:

class Base< T > {
    class InnerBase {
        java.util.List< String > list;
    }
}

class Derived extends Base< Integer > {
    class InnerDerived extends InnerBase {
        void method( )
        {
            list.add( "Hi" ); // Warning on this method call
        }
    }
}

Produces the warning "Type safety: The method add(Object) belongs to the raw
type List. References to generic type List<E> should be parameterized." 
Compiling with "javac -Xlint" does not produce any warnings.

If the type parameter is removed from class Base, no warning is produced.
Comment 1 Philipe Mulet CLA 2005-02-22 18:34:02 EST
Added GenericTypeTest#test517
Problem was in #convertToRawType which was converting non generic types when
members of generic type.

Fixed
Comment 2 David Audel CLA 2005-03-31 09:20:25 EST
Verified in I20050330-0500