Community
Participate
Working Groups
3.6M6. Try ctrl+space just before the comment in the code below. The default constructor for class Test is one of the proposals. This is wrong and will lead to an error if selected. ---------------------------------------------------------- public class Test { Object obj = new Object() { // completion here proposed the default constructor for test which is wrong. }; }
The default constructor proposal is synthesized by the UI in org.eclipse.jdt.internal.ui.text.java.MethodDeclarationCompletionProposal.evaluateProposals(IType, String, int, int, int, Set, Collection) and is not a direct proposal from the JDT/Core CompletionEngine. Passing on to JDT/UI for comment and follow up.
org.eclipse.jdt.core.CompletionContext.getEnclosingElement() returns the wrong context: instead of the anonymous source type it returns the initializer.
Created attachment 163399 [details] Patch under consideration Ayush, please review.
Patch looks good
Released in HEAD for 3.6M7
Verified for 3.6M7 using I20100425-2000