| Summary: | [Undo] NPE in OperationHistoryActionHandler$HistoryListener when deleting multiple unsaved Java editors | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Keller <markus.kell.r> | ||||
| Component: | UI | Assignee: | Susan McCourt <susan> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, frederic_fusier, jeffmcaffer, michschn, Olivier_Thomann, pwebster | ||||
| Version: | 3.5 | ||||||
| Target Milestone: | 3.5 M6 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
*** Bug 265290 has been marked as a duplicate of this bug. *** Fixed in HEAD >20090306. Note: I couldn't reproduce the NPE in the log on WinXP, Build id: I20090304-0834, following the steps described in comment #0. I tried three times. However I think the code is safer/cleaner/simpler, so I am releasing the change. Markus, were you able to get this to happen every time or can you think of a reason why I was not able to reproduce? *** Bug 267541 has been marked as a duplicate of this bug. *** I "verified" on WinXP, I20090310-0100, that I never saw this NPE during test pass, however I was unable to make it happen in the first place. Markus, do you feel you can verify this fix? I was able to reproduce the NPE using 3.5 M5 and verified that it is fixed in I20090312-0100. thanks, Dani. |
Created attachment 120352 [details] Proposed Fix I20081211-1908 - open a .java file - press Space - open another .java file - press Space - select the files in the Package Explorer - press Delete - click 'OK' (confirm delete) - click 'Continue' (confirm unsaved files warning) => NPE in log A difference to 3.5M3 is that the notification now happens in the ModalContextThread, and not in the UI thread. AFAICS, the problem is that the OperationHistoryActionHandler is already disposed when HistoryListener.historyNotification(..) gets called. java.lang.NullPointerException at org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener.historyNotification(OperationHistoryActionHandler.java:123) at org.eclipse.core.commands.operations.DefaultOperationHistory$2.run(DefaultOperationHistory.java:939) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyListeners(DefaultOperationHistory.java:928) at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyDone(DefaultOperationHistory.java:1002) at org.eclipse.core.commands.operations.DefaultOperationHistory.closeOperation(DefaultOperationHistory.java:1371) at org.eclipse.ltk.internal.core.refactoring.UndoManager2.changePerformed(UndoManager2.java:152) at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:267) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:308) at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:92) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:220) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)