Community
Participate
Working Groups
Build ID: I20080613-2000 Steps To Reproduce: I am not sure how I managed to trigger this NPE, but I was performing some actions in the Synchronize view when it happened. Hopefully the stacktrace helps: java.lang.NullPointerException at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:6893) at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3520) at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3493) at org.eclipse.ui.ide.IDE$1.run(IDE.java:1186) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1174) at org.eclipse.team.ui.synchronize.SynchronizeModelAction.saveAllEditors(SynchronizeModelAction.java:248) at org.eclipse.team.ui.synchronize.SynchronizeModelAction.run(SynchronizeModelAction.java:91) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) 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:1158) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:382) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) More information:
This looks similar to bug 101945 where the same NPE happens when Team/CVS tries to save all editors. I doubt however, that the problem is in the SaveAll. Rather, I suspect some problems (mismatches) with the savables when several different editors are opened (and closed) on the same file. Moving to team for investigation since we only see this in combination with Team and or CVS. What we really need is a reproducible test case.
Dani, I think you cited the wrong bug.
>Dani, I think you cited the wrong bug. Indeed. Correct is bug 233921.
I've been doing crazy things with multiple editors opened in the last 30 minutes, with no result. Definitely, a reproducible scenario would be very helpful here.
I wish I could help. Although I hit this a few times, I couldn't really come up with a reproducible scenario and once I restarted I haven't seen it again. I wish I could provide more information. If no-one else can reproduce it, I am ok with closing it.
Ismael, what kind of install do you have (plain SDK, WTP...)? Also, can you remember which editors you used when this happened?
Eclipse classic with WTP, ECF, Mylyn from Ganymede and quite a few external plugins too (Spring IDE, Subclipse, findBugs, EclEmma, Scala). I was using the Java and Compare editors. I looked in my logs and I haven't seen any errors since I restarted so this looks like something that requires very specific circumstances to happen. Given that it has only happened once to me and a restart fixes it, I would suggest closing this until it happens again (to me or someone else).
Sorry, can not come up with a reproducible scenario either. But the bug shows up in my installation too: Eclipse Ganymede 3.4.0, WinXP SP3, Sun JRE 1.6.0_6, WTP 3.0. For the reference, stacktrace with the CVSAction: !ENTRY org.eclipse.ui.ide 4 2 2008-07-22 11:02:34.645 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.ide". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:6893) at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3520) at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3493) at org.eclipse.ui.ide.IDE$1.run(IDE.java:1186) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1174) at org.eclipse.team.internal.ccvs.ui.actions.CVSAction$6.run(CVSAction.java:573) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:178) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4251) 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:548) ...
I can confirm that this is happening to me as well, but I have not found and way to accurately describe how to reproduce this. Restarting has not helped though.
See similar bug found by Adobe Flex team: http://bugs.adobe.com/jira/browse/FB-13654
I'm seeing the same thing here. (Eclipse J2EE v3.4) I get this when I'm commiting on multiple CVS projects. I've closed all open files and I get the same thing. It looks like the CVS commit works but it's a pain. java.lang.NullPointerException at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:6893) at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3520) at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3493) at org.eclipse.ui.ide.IDE$1.run(IDE.java:1186) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1174) at org.eclipse.team.internal.ccvs.ui.mappings.CVSModelProviderAction.saveAllEditors(CVSModelProviderAction.java:104) at org.eclipse.team.internal.ccvs.ui.mappings.CVSModelProviderAction.saveDirtyEditors(CVSModelProviderAction.java:61) at org.eclipse.team.internal.ccvs.ui.mappings.CVSModelProviderAction.run(CVSModelProviderAction.java:128) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) 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:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:382) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Can you provide reproducible steps?
(In reply to comment #12) > Can you provide reproducible steps? After an entire reboot of my laptop the problem has gone away. I am not able to reproduce the problem at the moment but will let you know if I can in the future.
*** Bug 245279 has been marked as a duplicate of this bug. ***
*** Bug 244881 has been marked as a duplicate of this bug. ***
Just looking at the code in AbstractTextEditor.TextEditorSavable, the only time fTextEditor is set to null is in the method disconnectEditor(). So there must be a timing issue that causes disconnectEditor() to sometimes get called BEFORE isDirty() is called from Workbench.getFilteredSaveables()
*** Bug 334441 has been marked as a duplicate of this bug. ***
Created attachment 255174 [details] stacktrace
Bug is still present in Eclipse Luna Service Release 2 (4.4.2). Attached stacktrace.
(In reply to Eric Biggers from comment #19) > Bug is still present in Eclipse Luna Service Release 2 (4.4.2). Attached > stacktrace. Can you provide steps?
*** This bug has been marked as a duplicate of bug 569286 ***