mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[threading] IJPL-222254: Fix read access in MoveInstanceMethodDialogBase
GitOrigin-RevId: 2a750ee2231794bbe4ac31d2155961e35c6843ac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eb8344321f
commit
86117c23cd
+9
-6
@@ -1,8 +1,9 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.refactoring.move.moveInstanceMethod;
|
||||
|
||||
import com.intellij.java.refactoring.JavaRefactoringBundle;
|
||||
import com.intellij.lang.findUsages.DescriptiveNameUtil;
|
||||
import com.intellij.openapi.application.WriteIntentReadAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
@@ -137,11 +138,13 @@ public abstract class MoveInstanceMethodDialogBase extends MoveDialogBase {
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
if (value instanceof PsiVariable psiVariable) {
|
||||
final String text = PsiFormatUtil.formatVariable(psiVariable,
|
||||
PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE,
|
||||
PsiSubstitutor.EMPTY);
|
||||
setIcon(psiVariable.getIcon(0));
|
||||
setText(text);
|
||||
WriteIntentReadAction.run(() -> {
|
||||
final String text = PsiFormatUtil.formatVariable(psiVariable,
|
||||
PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE,
|
||||
PsiSubstitutor.EMPTY);
|
||||
setIcon(psiVariable.getIcon(0));
|
||||
setText(text);
|
||||
});
|
||||
}
|
||||
else if (value instanceof @NlsSafe String s) {
|
||||
setText(s);
|
||||
|
||||
Reference in New Issue
Block a user