Community
Participate
Working Groups
I just upgraded from 3.1.1 to 3.2.0 Build id: M20060629-1905 The code that used to compile OK in 3.1.1 is now generating a compilation error. It might be a flavor of Bug#100869 I have: public interface IFilter<T> { <E extends T> boolean select(E obj); <E extends T> List<E> filter(List<E> elements); } public abstract class AbstractFilter<T> implements IFilter<T> { public final <E extends T> boolean select(E obj) { return true; // For simplicity } public final <E extends T> List<E> filter(List<E> elements) { if ((elements == null) || (elements.size() == 0)) { return elements; } List<E> okElements = new ArrayList<E>(elements.size()); for (E obj : elements) { if (select(obj)) { okElements.add(obj); } } return okElements; } } I am gettin the error: The method select(E) is ambiguous for the type AbstractFilter<T> for the line where I am calling select() in the loop; The fix will be highly appreciated.
Released for 3.3 M1 in HEAD. Released for 3.2.1 in R3_2_maintenance branch. Added AmbiguousMethodTest #17.
Verified for 3.3 M1 using build I20060807-0010.
Verified for 3.2.1 using build M20060908-1655.
I still get this error in Eclipse 3.2.1 and Eclipse 3.2.2 using JDK 1.6.0-b105. My project is heavily using generics. I have the following method: public static <_T extends Jdo> JdoEntityMetaData<_T> forClass(Class<_T> jdoClass) { return (JdoEntityMetaData<_T>) JavaType.forClass(jdoClass); } The calling class is getting the error: The method forClass(Class) is ambiguous for the type JdoEntityMetaData The calling method looks like this: private void setJdoListCore(gras.heidi.jdo.JdoList<_J> jdoList, Class jdoClass) { this.jdoList = jdoList; JdoEntityMetaData md = JdoEntityMetaData.forClass(jdoClass); ....
Please open a new bug with a complete reproduceable testcase.