EA-31451: - AIOOBE: XDebuggerTreeNode.getChildAt

This commit is contained in:
nik
2011-11-21 11:54:38 +04:00
parent 1af4ac79cc
commit 642365d6f9

View File

@@ -134,15 +134,17 @@ public class XWatchesView extends XDebugViewBase implements DnDNativeTarget {
public void removeWatches(final List<? extends XDebuggerTreeNode> nodes) {
List<? extends WatchNode> children = myRootNode.getAllChildren();
int minIndex = Integer.MAX_VALUE;
List<XDebuggerTreeNode> toRemove = new ArrayList<XDebuggerTreeNode>();
if (children != null) {
for (XDebuggerTreeNode node : nodes) {
int index = children.indexOf(node);
if (index != -1) {
toRemove.add(node);
minIndex = Math.min(minIndex, index);
}
}
}
myRootNode.removeChildren(nodes);
myRootNode.removeChildren(toRemove);
List<? extends WatchNode> newChildren = myRootNode.getAllChildren();
if (newChildren != null && newChildren.size() > 0) {