Bug 86179 - [1.5] Type parameters lost with nested inheritance and generics
Summary: [1.5] Type parameters lost with nested inheritance and generics
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-22 13:36 EST by Kory Markevich CLA
Modified: 2005-03-31 09:20 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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