From acf05c7364a42168d1e950debca805e95ca1bbd4 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 28 Oct 2013 18:00:29 +0100 Subject: [PATCH] limit location filtering by method name to java files only --- .../debugger/ui/breakpoints/LineBreakpoint.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 2af48c43fb99..d45517db5f0e 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 @@ -211,7 +211,8 @@ public class LineBreakpoint extends BreakpointWithHighlighter { protected boolean acceptLocation(DebugProcessImpl debugProcess, ReferenceType classType, Location loc) { final OwnerMethod owner = myOwnerMethod; - if (owner != null) { + if (owner != null && owner.isJavaFile) { + // Additional filtering applicable to java files only. // Consider: // proc(()->{System.out.println("Task 1");}, ()->{System.out.println("Task 2");}); // @@ -445,7 +446,7 @@ public class LineBreakpoint extends BreakpointWithHighlighter { @Override public OwnerMethod compute() { final PsiMethod method = DebuggerUtilsEx.findPsiMethod(file, offset); - return method != null? new OwnerMethod(method) : null; + return method != null? new OwnerMethod(method, file instanceof PsiJavaFile) : null; } }); } @@ -583,14 +584,16 @@ public class LineBreakpoint extends BreakpointWithHighlighter { @NotNull final String name; final boolean isConstructor; + final boolean isJavaFile; - OwnerMethod(@NotNull PsiMethod method) { - this(method.getName(), method.isConstructor()); + OwnerMethod(@NotNull PsiMethod method, boolean isJavaFile) { + this(method.getName(), method.isConstructor(), isJavaFile); } - OwnerMethod(@NotNull String name, boolean isConstructor) { + OwnerMethod(@NotNull String name, boolean isConstructor, boolean isJavaFile) { this.name = name; this.isConstructor = isConstructor; + this.isJavaFile = isJavaFile; } boolean matches(Location loc) {