mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
limit location filtering by method name to java files only
This commit is contained in:
@@ -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");}); <breakpoint at this line>
|
||||
//
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user