From bfad7b781dc8ff9aa26ba5b3937e59007a3867f3 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 5 Sep 2023 16:35:06 +0200 Subject: [PATCH] ConditionalOperatorConverter: Remove redundant startInWriteAction() --- .../ConditionalOperatorConverter.java | 42 +++++++------------ 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java b/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java index 0eb570f3c..e2b5509e7 100644 --- a/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java +++ b/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java @@ -19,26 +19,6 @@ import org.jetbrains.annotations.Nullable; @NonNls public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction implements IntentionAction { - /** - * If this action is applicable, returns the text to be shown in the list of intention actions available. - */ - @NotNull - public String getText() { - return getFamilyName(); - } - - /** - * Returns text for name of this family of intentions. - * It is used to externalize "auto-show" state of intentions. - * It is also the directory name for the descriptions. - * - * @return the intention family name. - */ - @NotNull - public String getFamilyName() { - return "SDK: Convert ternary operator to if statement"; - } - /** * Checks whether this intention is available at the caret offset in file - the caret must sit just before a "?" * character in a ternary statement. If this condition is met, this intention's entry is shown in the available @@ -210,13 +190,23 @@ public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction } /** - * Indicates this intention action expects the Psi framework to provide the write action context for any changes. - * - * @return {@code true} if the intention requires a write action context to be provided or {@code false} if this - * intention action will start a write action + * If this action is applicable, returns the text to be shown in the list of intention actions available. */ - public boolean startInWriteAction() { - return true; + @NotNull + public String getText() { + return getFamilyName(); + } + + /** + * Returns text for name of this family of intentions. + * It is used to externalize "auto-show" state of intentions. + * It is also the directory name for the descriptions. + * + * @return the intention family name. + */ + @NotNull + public String getFamilyName() { + return "SDK: Convert ternary operator to if statement"; } }