#16 NPE when opening editor

UI
closed
None
7
2006-01-21
2005-11-17
No

Eclipse 3.2 M4:

The editor doesn't open. The following exception is
reported.

java.lang.NullPointerException
at
org.eclipse.ui.texteditor.BasicTextEditorActionContributor.doSetActiveEditor(BasicTextEditorActionContributor.java:213)
at
org.eclipse.ui.texteditor.BasicTextEditorActionContributor.setActiveEditor(BasicTextEditorActionContributor.java:243)
at
org.antlr.eclipse.ui.editor.AntlrActionContributor.doSetActiveEditor(AntlrActionContributor.java:149)
at
org.antlr.eclipse.ui.editor.AntlrActionContributor.setActivePage(AntlrActionContributor.java:132)
at
org.eclipse.ui.part.MultiPageEditorPart.pageChange(MultiPageEditorPart.java:505)
at
org.antlr.eclipse.ui.editor.AntlrMultiPageEditor.pageChange(AntlrMultiPageEditor.java:138)
at
org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:580)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:244)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:598)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:374)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
at
org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:285)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:263)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:387)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1130)
at
org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1083)
at
org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1288)
at
org.eclipse.ui.internal.PartStack.add(PartStack.java:453)
at
org.eclipse.ui.internal.EditorStack.add(EditorStack.java:101)
at
org.eclipse.ui.internal.PartStack.add(PartStack.java:440)
at
org.eclipse.ui.internal.EditorStack.add(EditorStack.java:110)
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:60)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:214)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:204)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:743)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:650)
at
org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:613)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2380)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2315)
at
org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2307)
at
org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2293)
at
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2288)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2269)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:372)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:335)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:253)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:138)
at
org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
at
org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:169)
at
org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:153)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:222)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:296)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:869)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:741)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at
org.eclipse.core.runtime.Platform.run(Platform.java:783)
at
org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at
org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:739)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:968)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1067)
at
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:243)
at
org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:238)
at
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:277)
at
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:896)
at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3236)
at
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2856)
at
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1774)
at
org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1738)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:376)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at
org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165)
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:338)
at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

Discussion

  • Logged In: YES
    user_id=372260

    The plug-in version is 4.0.0.b2.

     
    • priority: 5 --> 7
     
  • Logged In: YES
    user_id=372260

    This patch fixes the problem. It seems that
    BasicTextEditorActionContributor is not reusable that way.
    It needs at least the #init method called to set the IActionBar.

    I've refactored the AntlrActionContributor to inherit from
    BasicTextEditorActionContributor and do the multi page
    handling itself.

     
  • patch for org.antlr.eclipse.ui

     
    Attachments
    • assigned_to: nobody --> tjuerge
     
  • Logged In: YES
    user_id=372260

    Please review and apply the patch.

    Thanks, Gunnar

     
  • Ed Burnette
    Ed Burnette
    2005-11-30

    Logged In: YES
    user_id=708305

    I got the same exception. Is there a binary update available
    so I don't have to pull and rebuild the source?

     
  • Brannon King
    Brannon King
    2005-12-08

    Logged In: YES
    user_id=720081

    So the patch is for b2 or b2 includes the patch? You say
    3.2M4? Where did you get that on 11/17?! I have 3.2M3 and
    cannot seem to make it work with or without the patch.

     
  • Brannon King
    Brannon King
    2005-12-08

    Logged In: YES
    user_id=720081

    Scrap that last comment I made. The patch works fine. I had
    installed it incorrectly.

     
  • Logged In: YES
    user_id=230522

    I started to update the plugin to the real antlr 2.7.6
    this weekend, but I've still got some testing to do on it.
    I've got to make sure this patch doesn't break the plugin
    in supported eclipse versions as well. (And I need to
    determine which eclipse versions we still can support)

     
  • Logged In: YES
    user_id=230522

    Thanks for the patch!

    I applied the patch and verified that the plugin works
    against eclipse 3.0.2, 3.1.1. and 3.2M4.

    It's now the current download on the update site.

     
    • status: open --> closed