Community
Participate
Working Groups
Eclipse 3.1M2 will not parse or compile the following code, but JDK1.5 does, and the construct does appear to be valid. GenericTest.java line 6: The method baz(Vector<?>) in the type GenericTest is not applicable for the arguments (new Vector<Object>(){}) 1. import java.util.Vector; 2. public class GenericTest { 3. public void foo() { 4. Vector<Object> objectVector = new Vector<Object>() { 5. protected void bar() { 6. baz(this); /* ERROR */ 7. } 8. }; 9. baz(objectVector); 10. baz(new Vector<Object>()); 11. } 12. public void baz(Vector<?> mysteryVector) { } 13.} Note that lines 9 and 10 compile without error.
*** This bug has been marked as a duplicate of 73963 ***