Bug 89602 - NPE in CompletionEngine.findLocalMethods(..) when completing annotation element value
Summary: NPE in CompletionEngine.findLocalMethods(..) when completing annotation eleme...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 89612
  Show dependency tree
 
Reported: 2005-03-30 12:04 EST by Markus Keller CLA
Modified: 2005-05-31 05:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-03-30 12:04:27 EST
I20050330-0500

import java.lang.annotation.Retention;

public class Try {
    @Retention(value=/*<-ContentAssist*/)
    void n() {}
}

Error 2005-03-30 19:00:41.240 The command for the key you pressed failed
java.lang.NullPointerException
at
org.eclipse.jdt.internal.codeassist.CompletionEngine.findLocalMethods(CompletionEngine.java:2815)
at
org.eclipse.jdt.internal.codeassist.CompletionEngine.findMethods(CompletionEngine.java:3317)
at
org.eclipse.jdt.internal.codeassist.CompletionEngine.findVariablesAndMethods(CompletionEngine.java:4059)
at
org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:468)
at
org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1167)
at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:119)
at
org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:300)
at
org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:293)
at
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.internalComputeCompletionProposals(JavaCompletionProcessor.java:335)
at
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletionProposals(JavaCompletionProcessor.java:313)
at
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1470)
at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:250)
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:1319)
at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:183)
at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:1003)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
at
org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:108)
at org.eclipse.core.commands.Command.execute(Command.java:331)
at
org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:396)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:452)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:741)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:784)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:543)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:486)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:110)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:777)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:841)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:851)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:879)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:875)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1182)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3126)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3029)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3466)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1549)
at org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:648)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1625)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2525)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
at org.eclipse.core.launcher.Main.run(Main.java:887)
at org.eclipse.core.launcher.Main.main(Main.java:871)
Comment 1 David Audel CLA 2005-05-31 05:11:33 EDT
The NPE cannot occur anymore because methods aren't proposed anymore inside an
annotation.

Tested with RC1