EA-465329 - INRE: LineBreakpoint.findClassCandidatesInSourceContent - breakpoint

GitOrigin-RevId: cab2016ed12e37d2aacd7cc291889e01c70dc7a3
This commit is contained in:
Egor Ushakov
2024-02-02 19:14:39 +00:00
committed by intellij-monorepo-bot
parent f6b11f11b9
commit 21b52d4e0c
@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
/*
* Class LineBreakpoint
@@ -20,6 +20,7 @@ import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
@@ -281,7 +282,7 @@ public class LineBreakpoint<P extends JavaBreakpointProperties> extends Breakpoi
private Collection<VirtualFile> findClassCandidatesInSourceContent(final String className, final GlobalSearchScope scope, final ProjectFileIndex fileIndex) {
final int dollarIndex = className.indexOf("$");
final String topLevelClassName = dollarIndex >= 0 ? className.substring(0, dollarIndex) : className;
return ReadAction.compute(() -> {
return DumbService.getInstance(myProject).runReadActionInSmartMode(() -> {
final PsiClass[] classes = JavaPsiFacade.getInstance(myProject).findClasses(topLevelClassName, scope);
if (LOG.isDebugEnabled()) {
LOG.debug("Found " + classes.length + " classes " + topLevelClassName + " in scope " + scope);