Community
Participate
Working Groups
Sorry its difficult to be specific as i'm not sure exactly what about the class it's having problems with. Easiest thing is to post some examples of what does and doesn't work. I'm on sun jre1.5.0_03 Eclipse 3.11 (tried the lastest build of JDT core 3.2 i coud find too) /* *Eclipse JDT will not compile the following class declertion *It claims i have not implemented the iterator() method. (which i have) */ public class test<A extends Collection & Serializable > implements Collection /* * The following definitions however do work correctly * public class test<A extends Cloneable & Serializable > implements Collection * public class test<A extends Collection & Serializable > * public class test<A extends Serializable > implements Collection * public class test<A extends Collection > implements Collection */
Created attachment 28990 [details] Example code
Looking at it class files do seem to be being produced for the source however the UI is telling me its an error. Also if i create a new class extending the above it claims i have implemented the iterator() method twice.
This is fixed in latest. Only 8 warnings are reported: ---------- 1. WARNING in D:\tests_sources\X.java (at line 9) public class X<A extends Collection & Serializable > implements Collection ^^^^^^^^^^ Collection is a raw type. References to generic type Collection<E> should be parameterized ---------- 2. WARNING in D:\tests_sources\X.java (at line 9) public class X<A extends Collection & Serializable > implements Collection ^^^^^^^^^^ Collection is a raw type. References to generic type Collection<E> should be parameterized ---------- 3. WARNING in D:\tests_sources\X.java (at line 37) public Iterator iterator() ^^^^^^^^ Iterator is a raw type. References to generic type Iterator<E> should be parameterized ---------- 4. WARNING in D:\tests_sources\X.java (at line 49) public Object[] toArray(Object[] arg0) ^^^^^^^^ Type safety: The return type Object[] for toArray(Object[]) from the type X<A> needs unchecked conversion to conform to T[] from the type Collection<E> ---------- 5. WARNING in D:\tests_sources\X.java (at line 67) public boolean containsAll(Collection arg0) ^^^^^^^^^^ Collection is a raw type. References to generic type Collection<E> should be parameterized ---------- 6. WARNING in D:\tests_sources\X.java (at line 73) public boolean addAll(Collection arg0) ^^^^^^^^^^ Collection is a raw type. References to generic type Collection<E> should be parameterized ---------- 7. WARNING in D:\tests_sources\X.java (at line 79) public boolean removeAll(Collection arg0) ^^^^^^^^^^ Collection is a raw type. References to generic type Collection<E> should be parameterized ---------- 8. WARNING in D:\tests_sources\X.java (at line 85) public boolean retainAll(Collection arg0) ^^^^^^^^^^ Collection is a raw type. References to generic type Collection<E> should be parameterized ---------- 8 problems (8 warnings) Kent, could this be a duplicate of a bug we fixed lately?
*** This bug has been marked as a duplicate of 113273 ***
Added regression test org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test868
Verified for 3.1.2 using build M20060109-1200.