diff options
author | Pawel Piech | 2012-10-04 22:12:32 +0000 |
---|---|---|
committer | Pawel Piech | 2012-10-04 22:15:55 +0000 |
commit | edfab47671de30ab12d17294cb58ff12f3e7b4c4 (patch) | |
tree | 01e091dd6c2aa7c28cfc5d46cae896d631f748f0 /org.eclipse.debug.ui/ui/org/eclipse | |
parent | 65d0355c6752ef05db3c570823b5ea00d3b0b574 (diff) | |
download | eclipse.platform.debug-edfab47671de30ab12d17294cb58ff12f3e7b4c4.tar.gz eclipse.platform.debug-edfab47671de30ab12d17294cb58ff12f3e7b4c4.tar.xz eclipse.platform.debug-edfab47671de30ab12d17294cb58ff12f3e7b4c4.zip |
Bug 380288 - NPE switching to the Breakpoints View
Added guard to prevent updating viewer while input == null.
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse')
3 files changed, 6 insertions, 7 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 871c84a2c..8d89714e7 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,9 +232,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU protected boolean doEquals(ViewerUpdateMonitor update) { return update instanceof ChildrenCountUpdate && - // Bug 380288 - workaround a race condition where update is initialized with null input. - ((getViewerInput() == null && update.getViewerInput() == null) || - (getViewerInput() != null && getViewerInput().equals(update.getViewerInput()))) && + 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 07351334e..6397a2bdc 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,16 +223,13 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda update instanceof ChildrenUpdate && ((ChildrenUpdate)update).getOffset() == getOffset() && ((ChildrenUpdate)update).getLength() == getLength() && - // Bug 380288 - workaround a race condition where update is initialized with null input. - ((getViewerInput() == null && update.getViewerInput() == null) || - (getViewerInput() != null && getViewerInput().equals(update.getViewerInput()))) && + getViewerInput().equals(update.getViewerInput()) && getElementPath().equals(getElementPath()); } protected int doHashCode() { return (int)Math.pow( (getClass().hashCode() + getViewerInput().hashCode() + getElementPath().hashCode()) * (getOffset() + 2), - getLength() + 2); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java index f488f32e6..b95ffa248 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java @@ -426,6 +426,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon } public void updateModel(IModelDelta delta, int mask) { + // Processing deltas with null input leads to NPEs + // (Bug 380288 - NPE switching to the Breakpoints View) + if (getViewer() == null || getViewer().getInput() == null) return; + IModelDelta[] deltaArray = new IModelDelta[] { delta }; updateNodes(deltaArray, mask & (IModelDelta.REMOVED | IModelDelta.UNINSTALL)); updateNodes(deltaArray, mask & ITreeModelContentProvider.UPDATE_MODEL_DELTA_FLAGS |