IDEA-192430 Breakpoint intentions [Stop/don't stop in the class] parent class is displayed instead of caller class

This commit is contained in:
Egor Ushakov
2018-05-22 19:19:02 +03:00
parent 351dd46995
commit 7405fdceaf
3 changed files with 9 additions and 10 deletions
@@ -17,6 +17,7 @@ import com.intellij.debugger.settings.CapturePoint;
import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.debugger.settings.NodeRendererSettings;
import com.intellij.debugger.ui.breakpoints.Breakpoint;
import com.intellij.debugger.ui.breakpoints.BreakpointIntentionAction;
import com.intellij.debugger.ui.impl.watch.*;
import com.intellij.debugger.ui.tree.render.DescriptorLabelListener;
import com.intellij.lang.java.JavaLanguage;
@@ -188,6 +189,7 @@ public class JavaStackFrame extends XStackFrame implements JVMStackFrameInfoProv
final ObjectReference thisObjectReference = myDescriptor.getThisObject();
if (thisObjectReference != null) {
ValueDescriptorImpl thisDescriptor = myNodeManager.getThisDescriptor(null, thisObjectReference);
myDescriptor.putUserData(BreakpointIntentionAction.THIS_TYPE_KEY, thisObjectReference.type().name());
children.add(JavaValue.create(thisDescriptor, evaluationContext, myNodeManager));
}
else if (location != null) {
@@ -95,6 +95,9 @@ internal abstract class BreakpointIntentionAction(protected val myBreakpoint: XB
@JvmField
val CALLER_KEY = Key.create<String>("CALLER_KEY")
@JvmField
val THIS_TYPE_KEY = Key.create<String>("THIS_TYPE_KEY")
@JvmStatic
fun getIntentions(breakpoint: XBreakpoint<*>, currentSession: XDebugSession?): List<AnAction> {
val process = currentSession?.debugProcess
@@ -104,7 +107,8 @@ internal abstract class BreakpointIntentionAction(protected val myBreakpoint: XB
val currentStackFrame = currentSession.currentStackFrame
if (currentStackFrame is JavaStackFrame) {
val frameDescriptor = currentStackFrame.descriptor
frameDescriptor.typeName?.let {
frameDescriptor.getUserData(THIS_TYPE_KEY)?.let {
res.add(AddClassFilter(breakpoint, it))
res.add(AddClassNotFilter(breakpoint, it))
}
@@ -31,7 +31,6 @@ public class StackFrameDescriptorImpl extends NodeDescriptorImpl implements Stac
private final StackFrameProxyImpl myFrame;
private int myUiIndex;
private String myName = null;
private String myTypeName = null;
private Location myLocation;
private MethodsTracker.MethodOccurrence myMethodOccurrence;
private boolean myIsSynthetic;
@@ -116,17 +115,12 @@ public class StackFrameDescriptorImpl extends NodeDescriptorImpl implements Stac
}
return null;
}
@Override
public String getName() {
return myName;
}
@Nullable
public String getTypeName() {
return myTypeName;
}
@Override
protected String calcRepresentation(EvaluationContextImpl context, DescriptorLabelListener descriptorLabelListener) throws EvaluateException {
DebuggerManagerThreadImpl.assertIsManagerThread();
@@ -148,8 +142,7 @@ public class StackFrameDescriptorImpl extends NodeDescriptorImpl implements Stac
String name;
try {
ReferenceType refType = myLocation.declaringType();
myTypeName = refType != null ? refType.name() : null;
name = myTypeName;
name = refType != null ? refType.name() : null;
}
catch (InternalError e) {
name = e.toString();