From dee0916560b4d36e06ba1dd38b780ee497e153e3 Mon Sep 17 00:00:00 2001 From: Konstantin Nisht Date: Mon, 15 Dec 2025 12:22:29 +0100 Subject: [PATCH] [threading] IJPL-223866: Add write-intent into `MethodCellRenderer` GitOrigin-RevId: 9cfeee76a7f4c352cfb801e62381610a4ac94e39 --- .../intellij/refactoring/ui/MethodCellRenderer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/ui/MethodCellRenderer.java b/java/java-impl/src/com/intellij/refactoring/ui/MethodCellRenderer.java index 38ae239de730..2f54e293872b 100644 --- a/java/java-impl/src/com/intellij/refactoring/ui/MethodCellRenderer.java +++ b/java/java-impl/src/com/intellij/refactoring/ui/MethodCellRenderer.java @@ -1,6 +1,7 @@ // 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.ui; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.util.Iconable; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiSubstitutor; @@ -22,10 +23,12 @@ public class MethodCellRenderer extends DefaultListCellRenderer { PsiMethod method = (PsiMethod) value; - final String text = PsiFormatUtil.formatMethod(method, PsiSubstitutor.EMPTY, - PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME | - PsiFormatUtilBase.SHOW_PARAMETERS, - PsiFormatUtilBase.SHOW_TYPE); + final String text = ReadAction.compute(() -> + PsiFormatUtil.formatMethod(method, PsiSubstitutor.EMPTY, + PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME | + PsiFormatUtilBase.SHOW_PARAMETERS, + PsiFormatUtilBase.SHOW_TYPE)); + setText(text); Icon icon = method.getIcon(Iconable.ICON_FLAG_VISIBILITY);