Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328919

Summary: NPE while trying to get latest changes from CVS
Product: [Eclipse Project] e4 Reporter: Paul Webster <pwebster>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Remy Suen <remy.suen>
Severity: critical    
Priority: P3 CC: daniel_megert, emoffatt, remy.suen
Version: unspecified   
Target Milestone: 4.1 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Workbench patch v1 none

Description Paul Webster CLA 2010-10-28 07:56:25 EDT
I went to the sync view, sync'ed, and then got all changes.  I got the update dialog and an NPE error.

eclipse.buildId=I20101028-0304
java.fullversion=JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr8-20100401_55940 (JIT enabled, AOT enabled)
J9VM - 20100401_055940
JIT  - r9_20100401_15339
GC   - 20100308_AA
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86 -data /opt/pwebster/workspaces/e4


Error
Thu Oct 28 07:59:59 EDT 2010
Problems occurred when invoking code from plug-in: "org.eclipse.ui.ide".

java.lang.NullPointerException
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7180)
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3252)
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3223)
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1272)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1261)
at org.eclipse.team.internal.ui.mapping.MergeAllActionHandler.saveAllEditors(MergeAllActionHandler.java:121)
at org.eclipse.team.internal.ui.mapping.MergeAllActionHandler.saveDirtyEditors(MergeAllActionHandler.java:100)
at org.eclipse.team.internal.ui.mapping.MergeAllActionHandler.execute(MergeAllActionHandler.java:87)
at org.eclipse.team.internal.ui.mapping.MergeIncomingChangesAction.runWithEvent(MergeIncomingChangesAction.java:58)
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$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3538)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:783)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:692)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:104)
at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:540)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
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:369)
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:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
Comment 1 Paul Webster CLA 2010-10-28 07:57:47 EDT
Even doing a SHIFT+F10 e h generated the NPE:

eclipse.buildId=I20101028-0304
java.fullversion=JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr8-20100401_55940 (JIT enabled, AOT enabled)
J9VM - 20100401_055940
JIT  - r9_20100401_15339
GC   - 20100308_AA
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86 -data /opt/pwebster/workspaces/e4


Error
Thu Oct 28 08:02:26 EDT 2010
Problems occurred when invoking code from plug-in: "org.eclipse.ui.ide".

java.lang.NullPointerException
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7180)
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3252)
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3223)
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1272)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1261)
at org.eclipse.team.internal.ccvs.ui.actions.CVSAction$6.run(CVSAction.java:573)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4280)
at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.saveAllEditors(CVSAction.java:568)
at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.beginExecution(CVSAction.java:216)
at org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction.beginExecution(WorkspaceAction.java:56)
at org.eclipse.team.internal.ccvs.ui.actions.CVSAction.run(CVSAction.java:111)
at org.eclipse.team.internal.ui.actions.TeamAction.runWithEvent(TeamAction.java:549)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
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.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3538)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:783)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:692)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:104)
at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:540)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
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:369)
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:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
Comment 2 Remy Suen CLA 2010-10-28 08:04:43 EDT
Caused by fix for bug 328720.
Comment 3 Remy Suen CLA 2010-10-28 08:16:18 EDT
Problem occurs if you have uninitialized editors and you close them with the context menu or the 'X' button instead of 3.x "stuff" like Ctrl+Shift+W.
Comment 4 Remy Suen CLA 2010-10-28 08:23:09 EDT
Created attachment 181928 [details]
Workbench patch v1

Workaround is to close all editors and then restart Eclipse so that all stale data is flushed. However, if you generally close editors with the mouse instead of the keyboard (as pointed out by comment 3), you will make this problem resurface again.
Comment 5 Remy Suen CLA 2010-10-28 08:29:21 EDT
(In reply to comment #3)
> Problem occurs if you have uninitialized editors and you close them with the
> context menu or the 'X' button instead of 3.x "stuff" like Ctrl+Shift+W.

Correction, the problem will occur regardless of whether the editors have been fully initialized or not.
Comment 6 Remy Suen CLA 2010-10-28 09:29:57 EDT
(In reply to comment #4)
> Created an attachment (id=181928) [details]
> Workbench patch v1

Patch released to CVS HEAD.
Comment 7 Dani Megert CLA 2012-08-03 08:29:52 EDT
The fix is not good: all editors that don't implement ISaveablesSource (e.g. multi page editors like the PDE editors) are busted i.e. won't get saved.

Filed bug 386566 to track this.
Comment 8 Dani Megert CLA 2012-08-15 05:29:40 EDT
NOTE: This fix got reverted and as per bug 386566 comment 2, this bug here can no longer be reproduced in 'master'.