Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346655 - [xtext][compare] NPE when closing the compare editor
Summary: [xtext][compare] NPE when closing the compare editor
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: RC2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 08:06 EDT by Sebastian Zarnekow CLA
Modified: 2017-09-19 17:05 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
proposed patch (2.19 KB, patch)
2011-05-23 08:59 EDT, Michael Clay CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2011-05-20 08:06:23 EDT
Choose two items from the local history which are both not the current version:

java.lang.NullPointerException
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingHelper.uninstall(HighlightingHelper.java:88)
	at org.eclipse.xtext.ui.editor.XtextEditor.uninstallHighlightingHelper(XtextEditor.java:421)
	at org.eclipse.xtext.ui.editor.XtextEditor.dispose(XtextEditor.java:436)
	at org.eclipse.xtext.ui.compare.DefaultMergeViewer.disposeEditors(DefaultMergeViewer.java:136)
	at org.eclipse.xtext.ui.compare.DefaultMergeViewer.handleDispose(DefaultMergeViewer.java:127)
	at org.eclipse.jface.viewers.ContentViewer$2.widgetDisposed(ContentViewer.java:214)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4121)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1476)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1295)
	at org.eclipse.swt.widgets.Control.release(Control.java:2804)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:903)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1298)
	at org.eclipse.swt.widgets.Control.release(Control.java:2804)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:903)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1298)
	at org.eclipse.swt.widgets.Control.release(Control.java:2804)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:662)
	at org.eclipse.compare.internal.CompareEditor.doSetInput(CompareEditor.java:283)
	at org.eclipse.compare.internal.CompareEditor.setInput(CompareEditor.java:254)
	at org.eclipse.compare.internal.CompareUIPlugin$1.run(CompareUIPlugin.java:513)
	at org.eclipse.compare.internal.CompareUIPlugin.syncExec(CompareUIPlugin.java:1263)
	at org.eclipse.compare.internal.CompareUIPlugin.internalOpenEditor(CompareUIPlugin.java:534)
	at org.eclipse.compare.internal.CompareUIPlugin.openEditorInBackground(CompareUIPlugin.java:504)
	at org.eclipse.compare.internal.CompareUIPlugin.openCompareEditor(CompareUIPlugin.java:493)
	at org.eclipse.compare.CompareUI.reuseCompareEditor(CompareUI.java:199)
	at org.eclipse.compare.CompareUI.reuseCompareEditor(CompareUI.java:180)
	at org.eclipse.team.internal.ui.actions.CompareRevisionAction.openInCompare(CompareRevisionAction.java:139)
	at org.eclipse.team.internal.ui.actions.CompareRevisionAction.run(CompareRevisionAction.java:102)
	at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4121)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1476)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1461)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1266)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3967)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3606)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Sebastian Zarnekow CLA 2011-05-20 08:07:53 EDT
Tested with Eclipse 3.7RC1
Comment 2 Sebastian Zarnekow CLA 2011-05-20 08:09:49 EDT
I misinterpreted the exception trace:

It happens as soon as you try to close the compare editor and does not depend on the fact that both versions are not the current version.
Comment 3 Michael Clay CLA 2011-05-23 08:59:15 EDT
Created attachment 196331 [details]
proposed patch
Comment 4 Michael Clay CLA 2011-05-23 09:00:20 EDT
pushed to master
Comment 5 Karsten Thoms CLA 2017-09-19 16:54:49 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:05:39 EDT
Closing all bugs that were set to RESOLVED before Neon.0