Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java5
3 files changed, 11 insertions, 2 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
index 8d89714e7..871c84a2c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
@@ -232,7 +232,9 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
protected boolean doEquals(ViewerUpdateMonitor update) {
return
update instanceof ChildrenCountUpdate &&
- getViewerInput().equals(update.getViewerInput()) &&
+ // Bug 380288 - workaround a race condition where update is initialized with null input.
+ ((getViewerInput() == null && update.getViewerInput() == null) ||
+ (getViewerInput() != null && getViewerInput().equals(update.getViewerInput()))) &&
getElementPath().equals(getElementPath());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
index 857c2a49a..07351334e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
@@ -223,7 +223,9 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
update instanceof ChildrenUpdate &&
((ChildrenUpdate)update).getOffset() == getOffset() &&
((ChildrenUpdate)update).getLength() == getLength() &&
- getViewerInput().equals(update.getViewerInput()) &&
+ // Bug 380288 - workaround a race condition where update is initialized with null input.
+ ((getViewerInput() == null && update.getViewerInput() == null) ||
+ (getViewerInput() != null && getViewerInput().equals(update.getViewerInput()))) &&
getElementPath().equals(getElementPath());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
index 65f29abe8..5719f8e5c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.viewers.model;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.debug.internal.core.commands.Request;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.viewers.AsynchronousSchedulingRuleFactory;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
@@ -81,6 +82,10 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
*/
public ViewerUpdateMonitor(TreeModelContentProvider contentProvider, Object viewerInput, TreePath elementPath, Object element, IElementContentProvider elementContentProvider, IPresentationContext context) {
fContext = context;
+ // Bug 380288: Catch and log a race condition where the viewer input is null.
+ if (viewerInput == null) {
+ DebugUIPlugin.log(new NullPointerException("Input to viewer update should not be null")); //$NON-NLS-1$
+ }
fViewerInput = viewerInput;
fElementContentProvider = elementContentProvider;
fContentProvider = contentProvider;

Back to the top