Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-09-19 11:53:20 -0400
committerUwe Stieber2012-09-20 06:11:01 -0400
commit8cbf38809424e597d40f1c67a553f43e38cdcfdf (patch)
tree1a0a839cb94c5f8ac26dc50ee4002e356a748684
parent24c9d7d60ff5efc982bea4541b00c7d396db883c (diff)
downloadorg.eclipse.tcf-8cbf38809424e597d40f1c67a553f43e38cdcfdf.tar.gz
org.eclipse.tcf-8cbf38809424e597d40f1c67a553f43e38cdcfdf.tar.xz
org.eclipse.tcf-8cbf38809424e597d40f1c67a553f43e38cdcfdf.zip
TCF Debugger: Fix an NPE if the id of the node passed to getAutoExpandNode(...) is null
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java
index b5591f105..8c2619756 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java
@@ -76,6 +76,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
private final Runnable timer = new Runnable() {
+ @Override
public void run() {
posted = false;
if (pending_node != null) return;
@@ -103,36 +104,45 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
IStatus status;
+ @Override
public Object getElement() {
return null;
}
+ @Override
public TreePath getElementPath() {
return null;
}
+ @Override
public IPresentationContext getPresentationContext() {
return TCFModelProxy.this.getPresentationContext();
}
+ @Override
public Object getViewerInput() {
return TCFModelProxy.this.getInput();
}
+ @Override
public void cancel() {
}
+ @Override
public void done() {
}
+ @Override
public IStatus getStatus() {
return status;
}
+ @Override
public boolean isCanceled() {
return false;
}
+ @Override
public void setStatus(IStatus status) {
this.status = status;
}
@@ -142,6 +152,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
int count;
+ @Override
public void setChildCount(int count) {
this.count = count;
}
@@ -157,14 +168,17 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
this.children = length == 0 ? EMPTY_NODE_ARRAY : new TCFNode[length];
}
+ @Override
public int getLength() {
return length;
}
+ @Override
public int getOffset() {
return 0;
}
+ @Override
public void setChild(Object child, int offset) {
children[offset] = (TCFNode)child;
}
@@ -172,18 +186,22 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
private final IViewerUpdateListener update_listener = new IViewerUpdateListener() {
+ @Override
public void viewerUpdatesBegin() {
if (!model.getWaitForViewsUpdateAfterStep()) return;
launch.addPendingClient(this);
}
+ @Override
public void viewerUpdatesComplete() {
launch.removePendingClient(this);
}
+ @Override
public void updateStarted(IViewerUpdate update) {
}
+ @Override
public void updateComplete(IViewerUpdate update) {
}
};
@@ -206,6 +224,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
((TreeViewer)viewer).addTreeListener(this);
}
Protocol.invokeAndWait(new Runnable() {
+ @Override
public void run() {
assert !installed;
assert !disposed;
@@ -222,6 +241,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
public void dispose() {
if (isDisposed()) return;
Protocol.invokeAndWait(new Runnable() {
+ @Override
public void run() {
assert !disposed;
if (installed) {
@@ -307,7 +327,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
boolean getAutoExpandNode(String id, boolean user_request) {
Boolean expand = null;
synchronized(expanded_nodes) {
- expand = expanded_nodes.get(id);
+ expand = id != null ? expanded_nodes.get(id) : null;
if (expand == null) {
if (user_request) {
expand = Boolean.FALSE;
@@ -454,6 +474,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
}
private final Comparator<IModelDelta> delta_comparator = new Comparator<IModelDelta>() {
+ @Override
public int compare(IModelDelta o1, IModelDelta o2) {
int f1 = o1.getFlags();
int f2 = o2.getFlags();
@@ -484,6 +505,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
final Set<TCFNode> save_expand_state = auto_expand_removed_nodes;
auto_expand_removed_nodes = null;
asyncExec(new Runnable() {
+ @Override
public void run() {
if (save_expand_state != null && save_expand_state.size() > 0) {
Viewer viewer = getViewer();
@@ -495,6 +517,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
}
if (expanded.size() > 0) {
Protocol.invokeLater(new Runnable() {
+ @Override
public void run() {
auto_expand_set.addAll(expanded);
}
@@ -519,6 +542,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
// Deltas do NOT work without the launch item.
asyncExec(new Runnable() {
boolean found;
+ @Override
public void run() {
if (getViewer() instanceof InternalTreeModelViewer) {
found = ((InternalTreeModelViewer)getViewer()).findElementIndex(TreePath.EMPTY, launch) >= 0;
@@ -527,6 +551,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
found = ((InternalVirtualTreeModelViewer)getViewer()).findElementIndex(TreePath.EMPTY, launch) >= 0;
}
Protocol.invokeLater(new Runnable() {
+ @Override
public void run() {
if (disposed) return;
if (found) realized = true;
@@ -609,6 +634,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
node2children.clear();
}
+ @Override
public void run() {
postDelta();
if (!posted && pending_node == null) {

Back to the top