Bug 237680 - NPE in AbstractTextEditor$TextEditorSavable.isDirty
Summary: NPE in AbstractTextEditor$TextEditorSavable.isDirty
Status: CLOSED DUPLICATE of bug 569286
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 244881 245279 334441 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-18 14:57 EDT by Ismael Juma CLA
Modified: 2021-06-28 08:59 EDT (History)
17 users (show)

See Also:


Attachments
stacktrace (6.00 KB, text/plain)
2015-07-13 14:03 EDT, Eric Biggers CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ismael Juma CLA 2008-06-18 14:57:36 EDT
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:
Comment 1 Dani Megert CLA 2008-06-19 06:28:36 EDT
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.
Comment 2 Michael Valenta CLA 2008-06-19 06:42:05 EDT
Dani, I think you cited the wrong bug. 
Comment 3 Dani Megert CLA 2008-06-19 06:54:41 EDT
>Dani, I think you cited the wrong bug. 
Indeed. Correct is bug 233921.
Comment 4 Tomasz Zarna CLA 2008-06-20 08:06:10 EDT
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.
Comment 5 Ismael Juma CLA 2008-06-20 08:10:29 EDT
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.
Comment 6 Dani Megert CLA 2008-07-08 05:36:42 EDT
Ismael, what kind of install do you have (plain SDK, WTP...)? Also, can you remember which editors you used when this happened?
Comment 7 Ismael Juma CLA 2008-07-11 07:50:12 EDT
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).
Comment 8 Stefan Rufer CLA 2008-07-22 05:16:22 EDT
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)
...


Comment 9 Josh Devins CLA 2008-08-05 14:19:41 EDT
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.
Comment 10 Josh Devins CLA 2008-08-05 14:21:48 EDT
See similar bug found by Adobe Flex team: http://bugs.adobe.com/jira/browse/FB-13654
Comment 11 Brian Hurley CLA 2008-08-21 19:09:40 EDT
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)
Comment 12 Dani Megert CLA 2008-08-22 03:14:14 EDT
Can you provide reproducible steps?
Comment 13 Brian Hurley CLA 2008-08-22 12:54:15 EDT
(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.

Comment 14 Tomasz Zarna CLA 2008-08-28 06:43:02 EDT
*** Bug 245279 has been marked as a duplicate of this bug. ***
Comment 15 Tomasz Zarna CLA 2008-10-01 05:53:50 EDT
*** Bug 244881 has been marked as a duplicate of this bug. ***
Comment 16 Scott Ellis CLA 2010-05-05 12:33:42 EDT
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()
Comment 17 Oleg Besedin CLA 2011-01-17 09:37:34 EST
*** Bug 334441 has been marked as a duplicate of this bug. ***
Comment 18 Eric Biggers CLA 2015-07-13 14:03:00 EDT
Created attachment 255174 [details]
stacktrace
Comment 19 Eric Biggers CLA 2015-07-13 14:04:19 EDT
Bug is still present in Eclipse Luna Service Release 2 (4.4.2).  Attached stacktrace.
Comment 20 Dani Megert CLA 2015-07-15 05:08:14 EDT
(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?
Comment 21 Andrey Loskutov CLA 2021-06-28 08:59:14 EDT

*** This bug has been marked as a duplicate of bug 569286 ***