Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-05-03 20:16:03 +0000
committerDarin Wright2010-05-03 20:16:03 +0000
commita3a2d1fe06229fce36f67787c1f6fe96d9fc93cd (patch)
tree4a3239e8f3dd7f97e79413e624246e32804354b6 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views
parent898af1b7329c1237c1b73f7b810c03c9a5522112 (diff)
downloadeclipse.platform.debug-a3a2d1fe06229fce36f67787c1f6fe96d9fc93cd.tar.gz
eclipse.platform.debug-a3a2d1fe06229fce36f67787c1f6fe96d9fc93cd.tar.xz
eclipse.platform.debug-a3a2d1fe06229fce36f67787c1f6fe96d9fc93cd.zip
Bug 311384 - NPE toggling breakpoints
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java55
1 files changed, 27 insertions, 28 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
index dd7f9096b..caf556e3b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 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
@@ -323,39 +323,38 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @param delta the root delta of this container
* @see addBreakpoint
*/
- public void removeBreakpoint(IBreakpoint breakpoint, ModelDelta rootDelta) {
+ public boolean removeBreakpoint(IBreakpoint breakpoint, ModelDelta rootDelta) {
boolean removed = fBreakpoints.remove(breakpoint);
if (removed) {
boolean addRemoveBpDelta = getContainers().length == 0;
- if (removed) {
- Iterator it = fChildContainers.iterator();
- while (it.hasNext()) {
- BreakpointContainer container = (BreakpointContainer) it.next();
-
- // if the breakpoint contains in the container and it is the only breakpoint,
- // than remove the container from the collection
- if (container.contains(breakpoint)) {
- ModelDelta childDelta = null;
- if ((!container.isDefaultContainer()) && (container.getBreakpoints().length <= 1)) {
- it.remove();
- childDelta = rootDelta.addNode(container, IModelDelta.REMOVED|IModelDelta.UNINSTALL);
-
- } else {
- childDelta = rootDelta.addNode(container, IModelDelta.STATE);
- }
-
- // remove the breakpoint from the nested containers
- container.removeBreakpoint(breakpoint, childDelta);
- }
- }
-
- if (addRemoveBpDelta) {
- rootDelta.addNode(breakpoint, IModelDelta.REMOVED|IModelDelta.UNINSTALL);
- }
- }
+ Iterator it = fChildContainers.iterator();
+ while (it.hasNext()) {
+ BreakpointContainer container = (BreakpointContainer) it.next();
+
+ // if the breakpoint contains in the container and it is the only breakpoint,
+ // than remove the container from the collection
+ if (container.contains(breakpoint)) {
+ ModelDelta childDelta = null;
+ if ((!container.isDefaultContainer()) && (container.getBreakpoints().length <= 1)) {
+ it.remove();
+ childDelta = rootDelta.addNode(container, IModelDelta.REMOVED|IModelDelta.UNINSTALL);
+
+ } else {
+ childDelta = rootDelta.addNode(container, IModelDelta.STATE);
+ }
+
+ // remove the breakpoint from the nested containers
+ container.removeBreakpoint(breakpoint, childDelta);
+ }
+ }
+
+ if (addRemoveBpDelta) {
+ rootDelta.addNode(breakpoint, IModelDelta.REMOVED|IModelDelta.UNINSTALL);
+ }
}
+ return removed;
}
/**

Back to the top