Skip to content

Commit

Permalink
Drop now unnecessary SimplifyConstantTernaryExecution
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Oct 27, 2024
1 parent c81972d commit ee9fc7b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.Set;

import static org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor.EmbeddingOption.SHORTEN_NAMES;
import static org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor.EmbeddingOption.SIMPLIFY_BOOLEANS;

public class BufferedWriterCreation extends Recipe {

Expand Down Expand Up @@ -139,13 +140,12 @@ public J visitNewClass(J.NewClass elem, ExecutionContext ctx) {
JavaTemplate.Matcher matcher;
if ((matcher = before.matcher(getCursor())).find()) {
maybeRemoveImport("java.io.FileWriter");
J j = embed(
return embed(
after.apply(getCursor(), elem.getCoordinates().replace(), matcher.parameter(0), matcher.parameter(1)),
getCursor(),
ctx,
SHORTEN_NAMES
SHORTEN_NAMES, SIMPLIFY_BOOLEANS
);
return (J) new SimplifyConstantTernaryExecution().getVisitor().visitNonNull(j, ctx, getCursor().getParentOrThrow());
}
return null;
}
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit ee9fc7b

Please sign in to comment.