IDEA-136480 Debugger: Show vaues in editor: show hex values for primitives option...
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Thu, 28 May 2015 16:16:47 +0000 (19:16 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Thu, 28 May 2015 16:17:56 +0000 (19:17 +0300)
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java

index d0d5aaabeeac90537cecc3e14f8f2434b5b21123..dc638dc682fdcccec673f57ee817a880a555cbf7 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.ui.ColoredTextContainer;
 import com.intellij.ui.SimpleTextAttributes;
 import com.intellij.util.NotNullFunction;
 import com.intellij.util.ThreeState;
+import com.intellij.util.ui.tree.TreeUtil;
 import com.intellij.xdebugger.XDebugSession;
 import com.intellij.xdebugger.XSourcePosition;
 import com.intellij.xdebugger.frame.*;
@@ -124,6 +125,10 @@ public class XValueNodeImpl extends XValueContainerNode<XValue> implements XValu
 
   @Override
   public void applyPresentation(@Nullable Icon icon, @NotNull XValuePresentation valuePresentation, boolean hasChildren) {
+    // extra check for obsolete nodes - tree root was changed
+    // too dangerous to put this into isObsolete - it is called from anywhere, not only EDT
+    if (isObsolete() || !TreeUtil.isAncestor(getTree().getRoot(), this)) return;
+
     setIcon(icon);
     myValuePresentation = valuePresentation;
     myRawValue = XValuePresentationUtil.computeValueText(valuePresentation);