Skip to content

Commit

Permalink
ConditionalOperatorConverter: Remove redundant startInWriteAction()
Browse files Browse the repository at this point in the history
karollewandowski committed Sep 5, 2023
1 parent 1cde070 commit bfad7b7
Showing 1 changed file with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -19,26 +19,6 @@
@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 void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement
}

/**
* 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.
*/
@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 {@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
* @return the intention family name.
*/
public boolean startInWriteAction() {
return true;
@NotNull
public String getFamilyName() {
return "SDK: Convert ternary operator to if statement";
}

}

0 comments on commit bfad7b7

Please sign in to comment.