Community
Participate
Working Groups
When writing an annontation and trying to use content assist on 'this', org.eclipse.jdt.ui.JavaNoTypeCompletionProposalComputer throws a runtime exception. Example: @Description("Some description for " + this.getName()) ^ Using content assist will cause runtime exception here. Of course, one should not use 'this' in such a situation, but a proper error message should be displayed instead of the runtime exception dialog.
*** Bug 154992 has been marked as a duplicate of this bug. ***
Please provide more info, see: http://www.eclipse.org/eclipse/platform-text/development/bug-incomplete.htm
Version: 3.2.0 Build id: M20060629-1905 Other plug-ins: EclipseME Compiler compliance level: 5.0 Log entry: !ENTRY org.eclipse.jdt.ui 2 0 2006-08-24 10:16: 45.598 !MESSAGE The 'org.eclipse.jdt.ui.JavaNoTypeCompletionProposalComputer' proposal computer from the 'org.eclipse.jdt.ui' plug-in did not complete normally. The extension has thrown a runtime exception. !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.codeassist.CompletionEngine.findLocalMethods(CompletionEngine.java:3999) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findMethods(CompletionEngine.java :4708) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findFieldsAndMethods(CompletionEngine.java:2832) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1004) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1766) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:123) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete (CompilationUnit.java:313) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:306) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals (JavaCompletionProposalComputer.java:213) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals (JavaCompletionProposalComputer.java:193) at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals (CompletionProposalComputerDescriptor.java:300) at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals (CompletionProposalCategory.java:263) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals (ContentAssistProcessor.java:218) at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:187) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals (ContentAssistant.java:1612) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:473) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$17 (CompletionProposalPopup.java:470) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:405) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java :67) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:399) at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:347) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java :3325) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java :1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java :92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Reproduction: Description.java - package test; public @interface Description { String value(); } Test.java - This is ok package test; public class Test { @Description("Some description") public void method() { } } Test.java - This will produce the error when pressing '.' after 'this' package test; public class Test { String description = "Some description"; @Description(this.description) public void method() { } }
changed the severity from trivial to minor as this is not a cosmetic problem
Can reproduce.
See also older bug 132665.
Created attachment 54161 [details] Proposed fix
Released for 3.3 M4. Test added CompletionTest_1_5#test0297() No completion must be proposed when the completion node is a CompleteOnMemberAccess and the completion occurs inside an annotation.
+1 for 3.2.2
Reopen to be backported to 3.2.2.
Created attachment 54165 [details] Proposed fix for 3.2.2
Released for 3.2.2. Test added CompletionTest_1_5#test0297()
Leave a RESOLVED FIXED for verification during 3.2.2 verification pass
Verified for 3.2.2 using build M20060112-1200.