Community
Participate
Working Groups
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.
Added GenericTypeTest#test517 Problem was in #convertToRawType which was converting non generic types when members of generic type. Fixed
Verified in I20050330-0500