mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
[debugger] yet one less getSourcePosition usage
GitOrigin-RevId: ef504cb768b93f9e1292887d733dfd3f81268835
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6b729379f5
commit
6edeceeac8
@@ -388,8 +388,13 @@ public abstract class BreakpointWithHighlighter<P extends JavaBreakpointProperti
|
||||
}
|
||||
|
||||
protected String getFileName() {
|
||||
XSourcePosition sourcePosition = myXBreakpoint.getSourcePosition();
|
||||
return sourcePosition != null ? sourcePosition.getFile().getName() : "";
|
||||
VirtualFile file = getVirtualFile();
|
||||
return file != null ? file.getName() : "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected VirtualFile getVirtualFile() {
|
||||
return ObjectUtils.doIfNotNull(ObjectUtils.doIfNotNull(myXBreakpoint, XBreakpoint::getSourcePosition), XSourcePosition::getFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -226,11 +226,10 @@ public class LineBreakpoint<P extends JavaBreakpointProperties> extends Breakpoi
|
||||
}
|
||||
|
||||
private boolean isInScopeOf(DebugProcessImpl debugProcess, String className) {
|
||||
final SourcePosition position = getSourcePosition();
|
||||
if (position != null) {
|
||||
final VirtualFile breakpointFile = position.getFile().getVirtualFile();
|
||||
VirtualFile breakpointFile = getVirtualFile();
|
||||
if (breakpointFile != null) {
|
||||
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
|
||||
if (breakpointFile != null && fileIndex.isUnderSourceRootOfType(breakpointFile, JavaModuleSourceRootTypes.SOURCES)) {
|
||||
if (fileIndex.isUnderSourceRootOfType(breakpointFile, JavaModuleSourceRootTypes.SOURCES)) {
|
||||
if (debugProcess.getSearchScope().contains(breakpointFile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,11 @@ public class RunToCursorBreakpoint extends SyntheticLineBreakpoint implements St
|
||||
return myCustomPosition.getFile().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable VirtualFile getVirtualFile() {
|
||||
return myCustomPosition.getFile().getVirtualFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRestoreBreakpoints() {
|
||||
return myRestoreBreakpoints;
|
||||
|
||||
Reference in New Issue
Block a user