From f64aea94231d55c6fd48d5ffe8691905e30e3d11 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Fri, 17 Nov 2023 09:29:33 +0100 Subject: [PATCH] Use `ImportService` rather than `ShortenFullyQualifiedTypeReferences` --- .../java/template/internal/AbstractRefasterJavaVisitor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openrewrite/java/template/internal/AbstractRefasterJavaVisitor.java b/src/main/java/org/openrewrite/java/template/internal/AbstractRefasterJavaVisitor.java index 70bdacb8..1a7d5a10 100644 --- a/src/main/java/org/openrewrite/java/template/internal/AbstractRefasterJavaVisitor.java +++ b/src/main/java/org/openrewrite/java/template/internal/AbstractRefasterJavaVisitor.java @@ -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; @@ -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());