Skip to content

Commit

Permalink
Apply formatter to get consistent import suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Oct 8, 2024
1 parent 43662be commit d7c9403
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
import org.openrewrite.java.RemoveAnnotationVisitor;
import org.openrewrite.java.search.FindAnnotations;
import org.openrewrite.java.search.UsesType;
import org.openrewrite.java.tree.Expression;
import org.openrewrite.java.tree.J;
import org.openrewrite.java.tree.JavaType;
import org.openrewrite.java.tree.Space;
import org.openrewrite.java.tree.TypeUtils;
import org.openrewrite.java.tree.*;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ct
if (arg instanceof J.Assignment) {
J.Assignment assignment = (J.Assignment) arg;
if (assignment.getVariable() instanceof J.Identifier &&
"type".equals(((J.Identifier) assignment.getVariable()).getSimpleName()) &&
assignment.getAssignment() instanceof J.Literal) {
"type".equals(((J.Identifier) assignment.getVariable()).getSimpleName()) &&
assignment.getAssignment() instanceof J.Literal) {
String fqTypeName = (String) ((J.Literal) assignment.getAssignment()).getValue();
J.Identifier identifier = new J.Identifier(
Tree.randomId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MigrateBooleanMappingsTest implements RewriteTest {
public void defaults(RecipeSpec spec) {
spec.recipe(new MigrateBooleanMappings())
.parser(JavaParser.fromJavaVersion()
.classpathFromResources(new InMemoryExecutionContext(),"hibernate-core", "jakarta.persistence-api")
.classpathFromResources(new InMemoryExecutionContext(), "hibernate-core", "jakarta.persistence-api")
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ void groupIdHypersistenceUtilsRenamedAndPackageUpdated() {
</dependency>
</dependencies>
</project>
""".formatted(matcher.group(1));
""".formatted(matcher.group(1));
})
),
//language=java
srcMainJava(
java("""
import com.vladmihalcea.hibernate.type.json.JsonBinaryType;
public class TestApplication {
}
""", """
import io.hypersistence.utils.hibernate.type.json.JsonBinaryType;
public class TestApplication {
}
"""
Expand Down
Loading

0 comments on commit d7c9403

Please sign in to comment.