IDEA-140341 Debugger stops in anonymous class constructor

This commit is contained in:
Egor.Ushakov
2015-05-15 17:33:23 +03:00
parent 960a3d468a
commit c2bc5f0039
@@ -67,6 +67,7 @@ import javax.swing.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.regex.Pattern;
public class LineBreakpoint extends BreakpointWithHighlighter {
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.breakpoints.LineBreakpoint");
@@ -188,8 +189,16 @@ public class LineBreakpoint extends BreakpointWithHighlighter {
updateUI();
}
private static Pattern ourAnonymousPattern = Pattern.compile(".*\\$\\d*$");
private static boolean isAnonymousClass(ReferenceType classType) {
if (classType instanceof ClassType) {
return ourAnonymousPattern.matcher(classType.name()).matches();
}
return false;
}
protected boolean acceptLocation(DebugProcessImpl debugProcess, ReferenceType classType, Location loc) {
return true;
return !(loc.method().isConstructor() && isAnonymousClass(classType));
}
private boolean isInScopeOf(DebugProcessImpl debugProcess, String className) {