mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-101710 Exception Breakpoints | Any Exception with Multiple Class Filters doesn't work
fixed test
This commit is contained in:
@@ -33,7 +33,10 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.ui.classFilter.ClassFilter;
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.BooleanValue;
|
||||
import com.sun.jdi.ObjectReference;
|
||||
import com.sun.jdi.VMDisconnectedException;
|
||||
import com.sun.jdi.Value;
|
||||
import com.sun.jdi.event.LocatableEvent;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -173,8 +176,8 @@ public abstract class FilteredRequestor implements LocatableEventRequestor, JDOM
|
||||
}
|
||||
|
||||
if (CLASS_FILTERS_ENABLED) {
|
||||
Location location = event.location();
|
||||
if (!typeMatchesClassFilters(location.declaringType().name())) return false;
|
||||
String typeName = calculateEventClass(context, event);
|
||||
if (!typeMatchesClassFilters(typeName)) return false;
|
||||
}
|
||||
|
||||
if (CONDITION_ENABLED && getCondition() != null && !"".equals(getCondition().getText())) {
|
||||
@@ -214,7 +217,11 @@ public abstract class FilteredRequestor implements LocatableEventRequestor, JDOM
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean typeMatchesClassFilters(@Nullable String typeName) {
|
||||
protected String calculateEventClass(EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
|
||||
return event.location().declaringType().name();
|
||||
}
|
||||
|
||||
private boolean typeMatchesClassFilters(@Nullable String typeName) {
|
||||
if (typeName == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,22 +319,19 @@ public class LineBreakpoint extends BreakpointWithHighlighter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean evaluateCondition(EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
|
||||
if(CLASS_FILTERS_ENABLED){
|
||||
String className = null;
|
||||
final ObjectReference thisObject = (ObjectReference)context.getThisObject();
|
||||
if(thisObject != null) {
|
||||
className = thisObject.referenceType().name();
|
||||
}
|
||||
else {
|
||||
final StackFrameProxyImpl frame = context.getFrameProxy();
|
||||
if (frame != null) {
|
||||
className = frame.location().declaringType().name();
|
||||
}
|
||||
}
|
||||
if (!typeMatchesClassFilters(className)) return false;
|
||||
protected String calculateEventClass(EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
|
||||
String className = null;
|
||||
final ObjectReference thisObject = (ObjectReference)context.getThisObject();
|
||||
if (thisObject != null) {
|
||||
className = thisObject.referenceType().name();
|
||||
}
|
||||
return super.evaluateCondition(context, event);
|
||||
else {
|
||||
final StackFrameProxyImpl frame = context.getFrameProxy();
|
||||
if (frame != null) {
|
||||
className = frame.location().declaringType().name();
|
||||
}
|
||||
}
|
||||
return className;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user