diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestor.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestor.java index e83d7096347c..8aa57bd351d8 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestor.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FilteredRequestor.java @@ -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; } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java index c273457c7521..307b9629b99f 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java @@ -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() {