Community
Participate
Working Groups
Hi! In 3.1M3 the overwriting of methods is broken. Example: return new DragEditPartsTracker(this) { perf{cursor} }; If I hit Ctrl+Space on the cursor position I can select a method of a super class to overwrite. But if I select a method and hit ENTER, an invalid method declation will be generated without a method body and without JavaDoc. return new DragEditPartsTracker(this) { protected void performConditionalSelection(){cursor} }; In 3.0 a complete method including JavaDoc and body which calls the super implementation was generated. In 3.1M3 this is broken. Nothing is logged and no exception occurs.
Maybe this type comes from a JAR which has no source? please see also: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-text-home/development/bug-incomplete.htm
Well it comes from a jar but it has source attached (it's a plug-in jar added to the classpath by the PDE container). Note that it works in regular types and non complicated typs I only have seen this in types with a lot source code and there only in anonymous inner types. I tried to reproduce it but came across another issue: Steps to repeat (3.1 M3): 1. Create new pluz-in project ("test") 2. Create new class "TestImpl" which implements "IWorkbenchAdapter" (don't overwrite any methods) public class TestImpl implements IWorkbenchAdapter { get[cursor] } 3. Invoke content assist to overwrite "getChildren.." -> works 4. go into get Children: public Object[] getChildren(Object o) { Object anon = new Ob[cursor] // TODO Auto-generated method stub return null; } 5. Invoke contant assist at cursor position, select "java.lang.Object", type "(" public Object[] getChildren(Object o) { Object anon = new Object([cursor]) // TODO Auto-generated method stub return null; } 6. Invoke contant assist at cursor position -> exception: java.lang.NullPointerException at java.lang.String.<init>(Unknown Source) at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findMethodParame terNames(InternalCompletionProposal.java:185) at org.eclipse.jdt.core.CompletionProposal.findParameterNames (CompletionProposal.java:1169) at org.eclipse.jdt.internal.codeassist.CompletionRequestorWrapper.accept (CompletionRequestorWrapper.java:223) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findConstructors (CompletionEngine.java:1350) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findAnonymousType (CompletionEngine.java:1158) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete (CompletionEngine.java:706) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete (CompletionEngine.java:1043) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:119) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete (CompilationUnit.java:286) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete (CompilationUnit.java:201) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete (CompilationUnit.java:192) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.internalComputeCo mpletionProposals(JavaCompletionProcessor.java:358) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletion Proposals(JavaCompletionProcessor.java:332) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposal s(ContentAssistant.java:1472) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals (CompletionProposalPopup.java:251) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7 (CompletionProposalPopup.java:247) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run (CompletionProposalPopup.java:206) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals (CompletionProposalPopup.java:201) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions (ContentAssistant.java:1320) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewe r.doOperation(CompilationUnitEditor.java:182) at org.eclipse.ui.texteditor.ContentAssistAction$1.run (ContentAssistAction.java:82) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
What's the compiler compliance setting (1.4 or 5.0)? If there was an NPE during content assist then the initially described behavior is expected. Moving to J Core to investigate the NPE.
1.4
*** This bug has been marked as a duplicate of 78801 ***
Verified for 3.1 M4 using build I200412140800.