Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java11
2 files changed, 6 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 63de96058..b392b2538 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -592,7 +592,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
if (element == null) {
if (refChildren[i] instanceof BreakpointContainer) {
BreakpointContainer.addChildContainer(container, (BreakpointContainer) refChildren[i], containerDelta);
- } else {
+ } else if(refChildren[i] instanceof IBreakpoint) {
BreakpointContainer.addBreakpoint(container, (IBreakpoint) refChildren[i], containerDelta);
if (newBreakpoint == null)
newBreakpoint = (IBreakpoint) refChildren[i];
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 59b22baad..bcb706129 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, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -153,19 +153,18 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @return the index of the breakpoint in the cache, -1 if the breakpoint already exist
*/
private int insertBreakpoint(IBreakpoint breakpoint) {
- if (fBreakpoints.contains(breakpoint))
+ if (fBreakpoints.contains(breakpoint) || breakpoint == null) {
return -1;
-
+ }
int index = fBreakpoints.size();
for (; fComparator != null && index > 0; index--) {
if (fComparator.compare(fBreakpoints.get(index-1), breakpoint) < 0)
break;
}
-
- if (index < 0)
+ if (index < 0) {
index = 0;
+ }
fBreakpoints.add(index, breakpoint);
-
return index;
}

Back to the top