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) {