Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 120352 Details for
Bug 258679
[Undo] NPE in OperationHistoryActionHandler$HistoryListener when deleting multiple unsaved Java editors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed Fix
OperationHistoryActionHandler_patch.txt (text/plain), 4.12 KB, created by
Markus Keller
on 2008-12-12 13:11:21 EST
(
hide
)
Description:
Proposed Fix
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2008-12-12 13:11:21 EST
Size:
4.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java,v >retrieving revision 1.53 >diff -u -r1.53 OperationHistoryActionHandler.java >--- Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java 5 Sep 2008 17:49:04 -0000 1.53 >+++ Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java 12 Dec 2008 18:01:10 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -12,6 +12,11 @@ > > import java.lang.reflect.InvocationTargetException; > >+import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.OperationCanceledException; >+ > import org.eclipse.core.commands.ExecutionException; > import org.eclipse.core.commands.operations.IAdvancedUndoableOperation2; > import org.eclipse.core.commands.operations.IOperationHistory; >@@ -19,15 +24,13 @@ > import org.eclipse.core.commands.operations.IUndoContext; > import org.eclipse.core.commands.operations.IUndoableOperation; > import org.eclipse.core.commands.operations.OperationHistoryEvent; >-import org.eclipse.core.runtime.IAdaptable; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.OperationCanceledException; >-import org.eclipse.jface.action.Action; >-import org.eclipse.jface.operation.IRunnableWithProgress; >-import org.eclipse.osgi.util.NLS; >+ > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; >+ >+import org.eclipse.jface.action.Action; >+import org.eclipse.jface.operation.IRunnableWithProgress; >+ > import org.eclipse.ui.IPartListener; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchPartSite; >@@ -42,6 +45,8 @@ > import org.eclipse.ui.part.MultiPageEditorSite; > import org.eclipse.ui.statushandlers.StatusManager; > >+import org.eclipse.osgi.util.NLS; >+ > /** > * <p> > * OperationHistoryActionHandler implements common behavior for the undo and >@@ -120,14 +125,20 @@ > > private class HistoryListener implements IOperationHistoryListener { > public void historyNotification(final OperationHistoryEvent event) { >- Display display = getWorkbenchWindow().getWorkbench().getDisplay(); >+ IWorkbenchWindow workbenchWindow = getWorkbenchWindow(); >+ if (workbenchWindow == null) >+ return; >+ >+ Display display = workbenchWindow.getWorkbench().getDisplay(); >+ if (display == null) >+ return; >+ > switch (event.getEventType()) { > case OperationHistoryEvent.OPERATION_ADDED: > case OperationHistoryEvent.OPERATION_REMOVED: > case OperationHistoryEvent.UNDONE: > case OperationHistoryEvent.REDONE: >- if (display != null >- && event.getOperation().hasContext(undoContext)) { >+ if (event.getOperation().hasContext(undoContext)) { > display.asyncExec(new Runnable() { > public void run() { > update(); >@@ -136,8 +147,7 @@ > } > break; > case OperationHistoryEvent.OPERATION_NOT_OK: >- if (display != null >- && event.getOperation().hasContext(undoContext)) { >+ if (event.getOperation().hasContext(undoContext)) { > display.asyncExec(new Runnable() { > public void run() { > if (pruning) { >@@ -162,7 +172,7 @@ > } > break; > case OperationHistoryEvent.OPERATION_CHANGED: >- if (display != null && event.getOperation() == getOperation()) { >+ if (event.getOperation() == getOperation()) { > display.asyncExec(new Runnable() { > public void run() { > update();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 258679
: 120352