mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Avoid 'Test-only called in production' warning
Review ID: IDEA-CR-57707 GitOrigin-RevId: ba8a9d8e0443134fa78a6a0112f343d9cf356b9f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b3fcd861d8
commit
e6b4980e02
@@ -75,7 +75,7 @@ public class InlineLocalHandler extends JavaInlineActionHandler {
|
||||
public void inlineElement(Project project, Editor editor, PsiElement element) {
|
||||
final PsiReference psiReference = TargetElementUtil.findReference(editor);
|
||||
final PsiReferenceExpression refExpr = psiReference instanceof PsiReferenceExpression ? (PsiReferenceExpression)psiReference : null;
|
||||
inlineVariable(project, editor, (PsiVariable)element, refExpr);
|
||||
doInline(project, editor, (PsiVariable)element, refExpr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +85,7 @@ public class InlineLocalHandler extends JavaInlineActionHandler {
|
||||
@NotNull final Editor editor,
|
||||
@NotNull PsiLocalVariable local,
|
||||
PsiReferenceExpression refExpr) {
|
||||
inlineVariable(project, editor, local, refExpr);
|
||||
doInline(project, editor, local, refExpr);
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@@ -93,6 +93,13 @@ public class InlineLocalHandler extends JavaInlineActionHandler {
|
||||
@NotNull final Editor editor,
|
||||
@NotNull PsiVariable var,
|
||||
PsiReferenceExpression refExpr) {
|
||||
doInline(project, editor, var, refExpr);
|
||||
}
|
||||
|
||||
private static void doInline(@NotNull final Project project,
|
||||
@NotNull final Editor editor,
|
||||
@NotNull PsiVariable var,
|
||||
PsiReferenceExpression refExpr) {
|
||||
if (!CommonRefactoringUtil.checkReadOnlyStatus(project, var)) return;
|
||||
Collection<PsiElement> allRefs = ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||
() -> ReferencesSearch.search(var).mapping(PsiReference::getElement).findAll(),
|
||||
|
||||
Reference in New Issue
Block a user