Bug 62201 - NPE in MethodScope
Summary: NPE in MethodScope
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-13 19:51 EDT by Luc Bourlier CLA
Modified: 2004-05-18 11:42 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 Luc Bourlier CLA 2004-05-13 19:51:13 EDT
I200404131200 + jdt.debug.ui from HEAD

You need jdt.debug.ui from HEAD, otherwise the completion is not run on the
correct type, you need org.eclipse.text or a plug-in that requires
org.eclipse.text in your workspace.
1. open the detail formatters preference page (prefs>Java>Debug>Detail Formatters)
2. 'add...'
3. type 'org.eclipse.jface.text.IDocument' as name
4. give the focus to the text area
5. hit [Ctrl+Space]

The following stack trace is added to the log

!ENTRY org.eclipse.ui 4 4 May 13, 2004 16:22:41.631
!MESSAGE Unhandled event loop exception
!ENTRY org.eclipse.ui 4 0 May 13, 2004 16:22:41.632
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
        at java.lang.Throwable.<init>(Throwable.java)
        at java.lang.Throwable.<init>(Throwable.java)
        at java.lang.NullPointerException.<init>(NullPointerException.java:60)
        at
org.eclipse.jdt.internal.compiler.lookup.MethodScope.createMethod(MethodScope.java:299)
        at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildMethods(ClassScope.java:221)
        at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildFieldsAndMethods(ClassScope.java:124)
        at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildFieldsAndMethods(CompilationUnitScope.java:61)
        at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:227)
        at
org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:813)
        at org.eclipse.jdt.internal.core.BinaryType.codeComplete(BinaryType.java:91)
        at org.eclipse.jdt.internal.core.BinaryType.codeComplete(BinaryType.java:58)
        at
org.eclipse.jdt.internal.debug.ui.DetailFormatterCompletionProcessor.computeCompletionProposals(DetailFormatterCompletionProcessor.java:50)
        at
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1457)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:244)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:240)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:199)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:194)
        at
org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1308)
        at
org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:683)
        at
org.eclipse.jdt.internal.debug.ui.DetailFormatterDialog$1.execute(DetailFormatterDialog.java:150)
        at org.eclipse.ui.internal.commands.Command.execute(Command.java:132)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:886)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:927)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:545)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:493)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:258)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:948)
        at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:2284)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:1784)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:441)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(Native Method)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_iteration(Native Method)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:668)
        at org.eclipse.jface.window.Window.open(Window.java:648)
        at
org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersPreferencePage.addType(JavaDetailFormattersPreferencePage.java:262)
        at
org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersPreferencePage$6.handleEvent(JavaDetailFormattersPreferencePage.java:193)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:668)
        at org.eclipse.jface.window.Window.open(Window.java:648)
        at
org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:72)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
        at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:899)
        at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:850)
        at
org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:769)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:939)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1353)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1324)
        at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:243)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90)
        at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:298)
        at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:249)
        at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:126)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
        at java.lang.reflect.Method.invoke(Method.java:386)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:269)
        at org.eclipse.core.launcher.Main.run(Main.java:722)
        at org.eclipse.core.launcher.Main.main(Main.java:706)
Comment 1 David Audel CLA 2004-05-14 07:25:59 EDT

*** This bug has been marked as a duplicate of 50686 ***
Comment 2 Luc Bourlier CLA 2004-05-14 14:55:24 EDT
Now that bug 50686 is fixed, I get this exception :

java.lang.ArrayIndexOutOfBoundsException
        at java.lang.Throwable.<init>(Throwable.java)
        at java.lang.Throwable.<init>(Throwable.java)
        at
java.lang.ArrayIndexOutOfBoundsException.<init>(ArrayIndexOutOfBoundsException.java:60)
        at
org.eclipse.jdt.internal.core.TypeConverter.convert(TypeConverter.java:193)
        at
org.eclipse.jdt.internal.core.TypeConverter.buildTypeDeclaration(TypeConverter.java:52)
        at
org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:790)
        at org.eclipse.jdt.internal.core.BinaryType.codeComplete(BinaryType.java:91)
        at org.eclipse.jdt.internal.core.BinaryType.codeComplete(BinaryType.java:58)
        at
org.eclipse.jdt.internal.debug.ui.DetailFormatterCompletionProcessor.computeCompletionProposals(DetailFormatterCompletionProcessor.java:50)
        at
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1457)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:244)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:240)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:199)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
        at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:194)
        at
org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1308)
        at
org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:683)
        at
org.eclipse.jdt.internal.debug.ui.DetailFormatterDialog$1.execute(DetailFormatterDialog.java:150)
        at org.eclipse.ui.internal.commands.Command.execute(Command.java:132)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:886)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:927)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:545)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:493)
        at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:258)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:948)
        at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:2284)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:1784)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:441)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(Native Method)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_iteration(Native Method)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:668)
        at org.eclipse.jface.window.Window.open(Window.java:648)
        at
org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersPreferencePage.addType(JavaDetailFormattersPreferencePage.java:262)
       at
org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersPreferencePage$6.handleEvent(JavaDetailFormattersPreferencePage.java:193)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:668)
        at org.eclipse.jface.window.Window.open(Window.java:648)
        at
org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:72)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
        at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:899)
        at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:850)
        at
org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:769)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:939)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1353)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1324)
        at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:243)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90)
        at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:298)
        at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:249)
        at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:126)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
        at java.lang.reflect.Method.invoke(Method.java:386)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:269)
        at org.eclipse.core.launcher.Main.run(Main.java:722)
        at org.eclipse.core.launcher.Main.main(Main.java:706)
Comment 3 David Audel CLA 2004-05-17 06:00:16 EDT
Fixed and test added
  SnippetCompletionTests#testCodeSnippetAssistForClassFileInInterface2()
Comment 4 Olivier Thomann CLA 2004-05-18 11:42:41 EDT
Verified in 200405180816