Skip to content

Commit 8c21316

Browse files
authored
Merge pull request #243 from openrewrite/fix-ternary
Improve SimplifyTernary names and descriptions
2 parents f1e53d2 + d24a0db commit 8c21316

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/org/openrewrite/staticanalysis/SimplifyTernary.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
import com.google.errorprone.refaster.annotation.BeforeTemplate;
2020
import org.openrewrite.java.template.RecipeDescriptor;
2121

22+
@RecipeDescriptor(
23+
name = "Simplify ternary expressions",
24+
description = "Simplifies various types of ternary expressions to improve code readability."
25+
)
2226
public class SimplifyTernary {
2327

2428
@RecipeDescriptor(
25-
name = "Simplify ternary expressions",
26-
description = "Simplify `expr ? true : false` to `expr`."
29+
name = "Replace `booleanExpression ? true : false` with `booleanExpression`",
30+
description = "Replace ternary expressions like `booleanExpression ? true : false` with `booleanExpression`."
2731
)
2832
public static class SimplifyTernaryTrueFalse {
2933

@@ -39,8 +43,8 @@ boolean after(boolean expr) {
3943
}
4044

4145
@RecipeDescriptor(
42-
name = "Simplify ternary expressions",
43-
description = "Simplify `expr ? false : true` to `!expr`."
46+
name = "Replace `booleanExpression ? false : true` with `!booleanExpression`",
47+
description = "Replace ternary expressions like `booleanExpression ? false : true` with `!booleanExpression`."
4448
)
4549
public static class SimplifyTernaryFalseTrue {
4650

0 commit comments

Comments
 (0)