Community
Participate
Working Groups
I20050627-1435 (3.1) Method override checks fail with raw subtype and type variable as type bound. Javac accepts these classes, which is IMO correct. interface IStructuredContentProvider<I, E extends I> { public E[] getElements(I inputElement); public E[] getChildren(E parent); } class MyContentProvider implements IStructuredContentProvider { // eclipse error: The type MyContentProvider must implement the inherited // abstract method IStructuredContentProvider.getChildren(I) public Object[] getElements(Object inputElement) { // eclipse error: The return type is incompatible with // IStructuredContentProvider.getElements(Object) return null; } public Object[] getChildren(Object parent) { // eclipse error: Name clash: The method getChildren(Object) of type // MyContentProvider has the same erasure as getChildren(E) of type // IStructuredContentProvider<I,E> but does not override it return null; } }
Raw type binding should use formal parameter bound erasures instead of their upper bound (i.e. E --> Object, and not I). Added MethodVerifyTest#test063-064
Fixed
Verified for 3.2M1 (I20050808-2000)
Verified using M20050923-1430 for 3.1.1