ConditionalOperatorConverter: Remove redundant startInWriteAction()

This commit is contained in:
Karol Lewandowski 2023-09-05 16:35:06 +02:00
parent 1cde070dd6
commit bfad7b781d

View File

@ -19,26 +19,6 @@ import org.jetbrains.annotations.Nullable;
@NonNls @NonNls
public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction implements IntentionAction { 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 "?" * 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 * 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. * If this action is applicable, returns the text to be shown in the list of intention actions available.
*
* @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
*/ */
public boolean startInWriteAction() { @NotNull
return true; 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";
} }
} }