Community
Participate
Working Groups
v_542 To reproduce, use JDT/UI from HEAD and enable debug option org.eclipse.jdt.ui/debug/useCoreBindingGetJavaElement (and also the checkCoreBinding.. options, if you want) - optionally, set a breakpoint in Bindings.findMethod(IMethodBinding, IJavaProject) to watch the bug - xy/DD.java: package xy; import java.util.ArrayList; public class DD extends ArrayList<String> { } - Source > Add Constructor from Superclass - select the interesting one that takes a Collection<? extends String>, press OK -> IMethodBinding#getJavaElement() converts the IMethodBinding with key "Ljava/util/ArrayList<Ljava/lang/String;>;.(Ljava/util/Collection;)V" into an inexistent IMethod with name="ArrayList<String>" and parameterTypes=[Ljava.util.Collection;] => The exception below is logged, and the generated constructor parameter name is "arg0" instead of "c". Java Model Exception: Java Model Status [ArrayList<String>(java.util.Collection) [in ArrayList [in ArrayList.class [in java.util [in C:\java\jdk1.5.0_01\jre\lib\rt.jar [in zz1.5]]]]] does not exist] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:467) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:498) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:231) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:217) at org.eclipse.jdt.internal.core.BinaryMethod.getParameterNames(BinaryMethod.java:200) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.suggestArgumentNames(StubUtility2.java) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createParameters(StubUtility2.java:526) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createConstructorStub(StubUtility2.java:101) at org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedConstructorsOperation.run(AddUnimplementedConstructorsOperation.java:243) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:34)
Changed MethodBinding#getJavaElement() to use the compiler binding's selector (or the declaring type name if it is a constructor) and the compiler binding's parameters (instead of its signature). Added regression test ASTModelBridgeTests#testParameterizedBinaryMethod()
*** Bug 88765 has been marked as a duplicate of this bug. ***
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.