Community
Participate
Working Groups
Generic support is going better every day! But the following case appears to be legal but is rejected: Some interfaces: interface IKey { String getKey(); } interface IFactory<T extends IKey> { T create(); } Based on a default (abstract) implementation of IFactory: abstract class DefaultFactory<T extends IKey> implements IFactory<T> { } and a concrete implementation of IKey: class Key implements IKey { ... } I want to make a specialized factory for Key: class KeyFactory extends DefaultFactory<Key> { ... public Key create() {...} } The create() method raises the compile error: Type safety: The return type Key of the method create() of type KeyFactory needs unchecked conversion to conform to the return type T of inherited method This set of classes compiles and works as expected under the Sun javac. Eclipse JDT behaves like if the method signature is not resolved through the hierarchy of classes that implements generic interfaces.
*** This bug has been marked as a duplicate of 79687 ***