Skip to content

Commit

Permalink
Use ImportService rather than ShortenFullyQualifiedTypeReferences
Browse files Browse the repository at this point in the history
(cherry picked from commit f64aea9)
  • Loading branch information
knutwannheden committed Nov 21, 2023
1 parent dc42627 commit e69126c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import org.openrewrite.ExecutionContext;
import org.openrewrite.TreeVisitor;
import org.openrewrite.java.JavaVisitor;
import org.openrewrite.java.ShortenFullyQualifiedTypeReferences;
import org.openrewrite.java.cleanup.SimplifyBooleanExpressionVisitor;
import org.openrewrite.java.cleanup.UnnecessaryParenthesesVisitor;
import org.openrewrite.java.service.ImportService;
import org.openrewrite.java.tree.J;

import java.util.EnumSet;
Expand All @@ -42,7 +42,7 @@ protected J embed(J j, Cursor cursor, ExecutionContext ctx, EmbeddingOption... o
j = new MinimumViableParentheses().visitNonNull(j, ctx, cursor.getParentOrThrow());
}
if (optionsSet.contains(EmbeddingOption.SHORTEN_NAMES)) {
doAfterVisit(ShortenFullyQualifiedTypeReferences.modifyOnly(j));
doAfterVisit(service(ImportService.class).shortenFullyQualifiedTypeReferencesIn(j));
}
if (optionsSet.contains(EmbeddingOption.SIMPLIFY_BOOLEANS)) {
j = new SimplifyBooleanExpressionVisitor().visitNonNull(j, ctx, cursor.getParentOrThrow());
Expand Down

0 comments on commit e69126c

Please sign in to comment.