diff --git a/src/main/java/org/openrewrite/java/template/internal/TemplateCode.java b/src/main/java/org/openrewrite/java/template/internal/TemplateCode.java index 12e980ff..5a9a46ac 100644 --- a/src/main/java/org/openrewrite/java/template/internal/TemplateCode.java +++ b/src/main/java/org/openrewrite/java/template/internal/TemplateCode.java @@ -90,9 +90,7 @@ public TemplateCodePrinter(Writer writer, List declaredPa public void visitIdent(JCIdent jcIdent) { try { Symbol sym = jcIdent.sym; - Optional param = declaredParameters.stream() - .filter(p -> p.sym == sym) - .findFirst(); + Optional param = declaredParameters.stream().filter(p -> p.sym == sym).findFirst(); if (param.isPresent()) { print("#{" + sym.name); if (seenParameters.add(param.get())) { diff --git a/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java b/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java index c65e7c5e..bded4201 100644 --- a/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java +++ b/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java @@ -329,7 +329,6 @@ public void visitClassDef(JCTree.JCClassDecl classDecl) { out.write("import org.openrewrite.java.JavaVisitor;\n"); out.write("import org.openrewrite.java.search.*;\n"); out.write("import org.openrewrite.java.template.Primitive;\n"); - out.write("import org.openrewrite.java.template.Semantics;\n"); out.write("import org.openrewrite.java.template.function.*;\n"); out.write("import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor;\n"); out.write("import org.openrewrite.java.tree.*;\n"); diff --git a/src/test/java/org/openrewrite/java/template/RefasterTemplateProcessorTest.java b/src/test/java/org/openrewrite/java/template/RefasterTemplateProcessorTest.java index 373fb211..8e74d6c7 100644 --- a/src/test/java/org/openrewrite/java/template/RefasterTemplateProcessorTest.java +++ b/src/test/java/org/openrewrite/java/template/RefasterTemplateProcessorTest.java @@ -140,7 +140,6 @@ void inline() { "import org.openrewrite.java.JavaVisitor;\n" + "import org.openrewrite.java.search.*;\n" + "import org.openrewrite.java.template.Primitive;\n" + - "import org.openrewrite.java.template.Semantics;\n" + "import org.openrewrite.java.template.function.*;\n" + "import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor;\n" + "import org.openrewrite.java.tree.*;\n" + diff --git a/src/test/resources/refaster/ArraysRecipe.java b/src/test/resources/refaster/ArraysRecipe.java index eb553c69..f4283a73 100644 --- a/src/test/resources/refaster/ArraysRecipe.java +++ b/src/test/resources/refaster/ArraysRecipe.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/CharacterEscapeAnnotationRecipe.java b/src/test/resources/refaster/CharacterEscapeAnnotationRecipe.java index 296e0f30..541aa369 100644 --- a/src/test/resources/refaster/CharacterEscapeAnnotationRecipe.java +++ b/src/test/resources/refaster/CharacterEscapeAnnotationRecipe.java @@ -25,7 +25,6 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; @@ -54,7 +53,7 @@ public String getDisplayName() { @Override public String getDescription() { - return "A multiline annotation.\nSupported here too!\nIt also supports escaped quotations: \"I think therefore I am\" - Descartes.\nAnd escaped backslashes: C:\\Users\\JohnDoe\\Documents\\\nAnd escaped tabs: \"This is a string with a tab character\t\".\nAnd escaped carriage returns: \"This is a string with a carriage return character\r\".\nAnd escaped form feeds: \"This is a string with a form feed character\f\".\nAnd escaped backspace characters: \"This is a string with a backspace character\b\".\nAnd escaped null characters: \"This is a string with a null character \".\nAnd escaped octal characters: \"This is a string with an octal characterS\".\nAnd escaped unicode characters: \"This is a string with a unicode characterሴ\".\nAnd raw emoji: \"This is a string with an emoji😀\".\nAnd emojis: \"This is a string with an emoji😀\"."; + return "A multiline annotation.\nSupported here too!\nIt also supports escaped quotations: \"I think therefore I am\" - Descartes.\nAnd escaped backslashes: C:\\Users\\JohnDoe\\Documents\\\nAnd escaped tabs: \"This is a string with a tab character\t\".\nAnd escaped carriage returns: \"This is a string with a carriage return character\r\".\nAnd escaped form feeds: \"This is a string with a form feed character\f\".\nAnd escaped backspace characters: \"This is a string with a backspace character\b\".\nAnd escaped null characters: \"This is a string with a null character\u0000\".\nAnd escaped octal characters: \"This is a string with an octal characterS\".\nAnd escaped unicode characters: \"This is a string with a unicode character\u1234\".\nAnd raw emoji: \"This is a string with an emoji\uD83D\uDE00\".\nAnd emojis: \"This is a string with an emoji\uD83D\uDE00\"."; } @Override diff --git a/src/test/resources/refaster/EscapesRecipes.java b/src/test/resources/refaster/EscapesRecipes.java index 826a5628..f66fc224 100644 --- a/src/test/resources/refaster/EscapesRecipes.java +++ b/src/test/resources/refaster/EscapesRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/GenericsRecipes.java b/src/test/resources/refaster/GenericsRecipes.java index b6d9df93..bd5153fb 100644 --- a/src/test/resources/refaster/GenericsRecipes.java +++ b/src/test/resources/refaster/GenericsRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/MatchingRecipes.java b/src/test/resources/refaster/MatchingRecipes.java index 8eeb003d..7064ed13 100644 --- a/src/test/resources/refaster/MatchingRecipes.java +++ b/src/test/resources/refaster/MatchingRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/MethodThrowsRecipe.java b/src/test/resources/refaster/MethodThrowsRecipe.java index 724cca0b..c9c1171a 100644 --- a/src/test/resources/refaster/MethodThrowsRecipe.java +++ b/src/test/resources/refaster/MethodThrowsRecipe.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/MultipleDereferencesRecipes.java b/src/test/resources/refaster/MultipleDereferencesRecipes.java index 326efa48..3eb865f1 100644 --- a/src/test/resources/refaster/MultipleDereferencesRecipes.java +++ b/src/test/resources/refaster/MultipleDereferencesRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/NestedPreconditionsRecipe.java b/src/test/resources/refaster/NestedPreconditionsRecipe.java index 17c9bbf7..8f9835f2 100644 --- a/src/test/resources/refaster/NestedPreconditionsRecipe.java +++ b/src/test/resources/refaster/NestedPreconditionsRecipe.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/ParameterReuseRecipe.java b/src/test/resources/refaster/ParameterReuseRecipe.java index 686edeb2..da56b237 100644 --- a/src/test/resources/refaster/ParameterReuseRecipe.java +++ b/src/test/resources/refaster/ParameterReuseRecipe.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/ShouldAddImportsRecipes.java b/src/test/resources/refaster/ShouldAddImportsRecipes.java index 73ce60b9..904843f3 100644 --- a/src/test/resources/refaster/ShouldAddImportsRecipes.java +++ b/src/test/resources/refaster/ShouldAddImportsRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java b/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java index 7447c839..bf9a4ab4 100644 --- a/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java +++ b/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/SimplifyBooleansRecipe.java b/src/test/resources/refaster/SimplifyBooleansRecipe.java index 1b2134be..46227cfb 100644 --- a/src/test/resources/refaster/SimplifyBooleansRecipe.java +++ b/src/test/resources/refaster/SimplifyBooleansRecipe.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/SimplifyTernaryRecipes.java b/src/test/resources/refaster/SimplifyTernaryRecipes.java index 1f9e17b5..674aa4f1 100644 --- a/src/test/resources/refaster/SimplifyTernaryRecipes.java +++ b/src/test/resources/refaster/SimplifyTernaryRecipes.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/UnnamedPackageRecipe.java b/src/test/resources/refaster/UnnamedPackageRecipe.java index e2673010..7ba0b392 100644 --- a/src/test/resources/refaster/UnnamedPackageRecipe.java +++ b/src/test/resources/refaster/UnnamedPackageRecipe.java @@ -23,7 +23,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*; diff --git a/src/test/resources/refaster/UseStringIsEmptyRecipe.java b/src/test/resources/refaster/UseStringIsEmptyRecipe.java index 0b4b3353..64ebc830 100644 --- a/src/test/resources/refaster/UseStringIsEmptyRecipe.java +++ b/src/test/resources/refaster/UseStringIsEmptyRecipe.java @@ -25,7 +25,7 @@ import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.search.*; import org.openrewrite.java.template.Primitive; -import org.openrewrite.java.template.Semantics; + import org.openrewrite.java.template.function.*; import org.openrewrite.java.template.internal.AbstractRefasterJavaVisitor; import org.openrewrite.java.tree.*;