From 95887d5ee86082dc035bd76cbf6225e1607dc852 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 31 Jul 2024 17:51:51 +0200 Subject: [PATCH 1/4] Match method overrides in precondition --- .../template/processor/RefasterTemplateProcessor.java | 2 +- src/test/resources/refaster/ArraysRecipe.java | 2 +- src/test/resources/refaster/EscapesRecipes.java | 4 ++-- src/test/resources/refaster/GenericsRecipes.java | 2 +- src/test/resources/refaster/MatchingRecipes.java | 2 +- .../resources/refaster/MultipleDereferencesRecipes.java | 2 +- src/test/resources/refaster/PicnicRulesRecipes.java | 2 +- src/test/resources/refaster/RefasterAnyOfRecipes.java | 4 ++-- src/test/resources/refaster/ShouldAddImportsRecipes.java | 8 ++++---- .../refaster/ShouldSupportNestedClassesRecipes.java | 4 ++-- src/test/resources/refaster/SimplifyBooleansRecipe.java | 2 +- src/test/resources/refaster/UseStringIsEmptyRecipe.java | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) 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 b3b22820..d46ea226 100644 --- a/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java +++ b/src/main/java/org/openrewrite/java/template/processor/RefasterTemplateProcessor.java @@ -568,7 +568,7 @@ private Set getImportsAsStrings(Map> imp } String methodName = method.name.toString(); methodName = methodName.equals("") ? "" : methodName; - usesVisitors.add("new UsesMethod<>(\"" + method.owner.getQualifiedName().toString() + ' ' + methodName + "(..)\")"); + usesVisitors.add("new UsesMethod<>(\"" + method.owner.getQualifiedName().toString() + ' ' + methodName + "(..)\", true)"); } preconditions.put(beforeTemplate.method.name.toString() + (arity == 1 ? "" : "$" + i), usesVisitors); diff --git a/src/test/resources/refaster/ArraysRecipe.java b/src/test/resources/refaster/ArraysRecipe.java index cc148018..389a4d0c 100644 --- a/src/test/resources/refaster/ArraysRecipe.java +++ b/src/test/resources/refaster/ArraysRecipe.java @@ -84,7 +84,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String join(..)"), + new UsesMethod<>("java.lang.String join(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/EscapesRecipes.java b/src/test/resources/refaster/EscapesRecipes.java index 1683f7f8..943ac50e 100644 --- a/src/test/resources/refaster/EscapesRecipes.java +++ b/src/test/resources/refaster/EscapesRecipes.java @@ -117,7 +117,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("com.sun.tools.javac.util.Convert", true), - new UsesMethod<>("java.lang.String format(..)"), + new UsesMethod<>("java.lang.String format(..)", true) new UsesMethod<>("com.sun.tools.javac.util.Convert quote(..)") ), javaVisitor @@ -174,7 +174,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String split(..)"), + new UsesMethod<>("java.lang.String split(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/GenericsRecipes.java b/src/test/resources/refaster/GenericsRecipes.java index 1da4fc3a..7fafbd48 100644 --- a/src/test/resources/refaster/GenericsRecipes.java +++ b/src/test/resources/refaster/GenericsRecipes.java @@ -113,7 +113,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("java.util.List", true), - new UsesMethod<>("java.util.Iterator next(..)"), + new UsesMethod<>("java.util.Iterator next(..)", true) new UsesMethod<>("java.util.List iterator(..)") ), javaVisitor diff --git a/src/test/resources/refaster/MatchingRecipes.java b/src/test/resources/refaster/MatchingRecipes.java index 885193d4..035b059e 100644 --- a/src/test/resources/refaster/MatchingRecipes.java +++ b/src/test/resources/refaster/MatchingRecipes.java @@ -139,7 +139,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( Preconditions.and( - new UsesMethod<>("java.lang.String isEmpty(..)"), + new UsesMethod<>("java.lang.String isEmpty(..)", true) new UsesMethod<>("java.lang.String substring(..)") ), javaVisitor diff --git a/src/test/resources/refaster/MultipleDereferencesRecipes.java b/src/test/resources/refaster/MultipleDereferencesRecipes.java index 3cd7a686..97129ca6 100644 --- a/src/test/resources/refaster/MultipleDereferencesRecipes.java +++ b/src/test/resources/refaster/MultipleDereferencesRecipes.java @@ -172,7 +172,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String isEmpty(..)"), + new UsesMethod<>("java.lang.String isEmpty(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/PicnicRulesRecipes.java b/src/test/resources/refaster/PicnicRulesRecipes.java index 3e16bd62..4ebbccdd 100644 --- a/src/test/resources/refaster/PicnicRulesRecipes.java +++ b/src/test/resources/refaster/PicnicRulesRecipes.java @@ -111,7 +111,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String replaceAll(..)"), + new UsesMethod<>("java.lang.String replaceAll(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/RefasterAnyOfRecipes.java b/src/test/resources/refaster/RefasterAnyOfRecipes.java index 4edc59e8..d2ed4b9d 100644 --- a/src/test/resources/refaster/RefasterAnyOfRecipes.java +++ b/src/test/resources/refaster/RefasterAnyOfRecipes.java @@ -124,7 +124,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)"), + new UsesMethod<>("java.lang.String length(..)", true) javaVisitor ); } @@ -271,7 +271,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( Preconditions.or( - new UsesMethod<>("java.lang.String valueOf(..)"), + new UsesMethod<>("java.lang.String valueOf(..)", true) new UsesMethod<>("java.lang.String copyValueOf(..)") ), javaVisitor diff --git a/src/test/resources/refaster/ShouldAddImportsRecipes.java b/src/test/resources/refaster/ShouldAddImportsRecipes.java index 0b4895b7..8e4374cf 100644 --- a/src/test/resources/refaster/ShouldAddImportsRecipes.java +++ b/src/test/resources/refaster/ShouldAddImportsRecipes.java @@ -116,7 +116,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String valueOf(..)"), + new UsesMethod<>("java.lang.String valueOf(..)", true) javaVisitor ); } @@ -245,7 +245,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.util.Objects hash(..)"), + new UsesMethod<>("java.util.Objects hash(..)", true) javaVisitor ); } @@ -302,7 +302,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("java.nio.file.Path", true), - new UsesMethod<>("java.io.File exists(..)"), + new UsesMethod<>("java.io.File exists(..)", true) new UsesMethod<>("java.nio.file.Path toFile(..)") ), javaVisitor @@ -351,7 +351,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String isEmpty(..)"), + new UsesMethod<>("java.lang.String isEmpty(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java b/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java index 0f6552cf..4cbcd22e 100644 --- a/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java +++ b/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java @@ -113,7 +113,7 @@ public J visitBinary(J.Binary elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)"), + new UsesMethod<>("java.lang.String length(..)", true) javaVisitor ); } @@ -168,7 +168,7 @@ public J visitBinary(J.Binary elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)"), + new UsesMethod<>("java.lang.String length(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/SimplifyBooleansRecipe.java b/src/test/resources/refaster/SimplifyBooleansRecipe.java index 9be76be0..1890af9a 100644 --- a/src/test/resources/refaster/SimplifyBooleansRecipe.java +++ b/src/test/resources/refaster/SimplifyBooleansRecipe.java @@ -84,7 +84,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String replaceAll(..)"), + new UsesMethod<>("java.lang.String replaceAll(..)", true) javaVisitor ); } diff --git a/src/test/resources/refaster/UseStringIsEmptyRecipe.java b/src/test/resources/refaster/UseStringIsEmptyRecipe.java index 8b1c21b9..b48620a2 100644 --- a/src/test/resources/refaster/UseStringIsEmptyRecipe.java +++ b/src/test/resources/refaster/UseStringIsEmptyRecipe.java @@ -84,7 +84,7 @@ public J visitBinary(J.Binary elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)"), + new UsesMethod<>("java.lang.String length(..)", true) javaVisitor ); } From e75530563104f12b4eb36558f4179faa54fbeea6 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 31 Jul 2024 18:07:37 +0200 Subject: [PATCH 2/4] Adopt com.netflix.nebula.release --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5aec76af..1567fb82 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { signing id("nebula.maven-resolved-dependencies") version "17.3.2" - id("nebula.release") version "15.3.1" + id("com.netflix.nebula.release") version "19.0.10" id("io.github.gradle-nexus.publish-plugin") version "1.0.0" id("com.github.hierynomus.license") version "0.16.1" From 2459265df10321d4479e7a2e6940cf78c38e194b Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 31 Jul 2024 18:07:56 +0200 Subject: [PATCH 3/4] Expect more UsesMethod with true argument --- src/test/resources/refaster/EscapesRecipes.java | 2 +- src/test/resources/refaster/FindListAddRecipe.java | 2 +- src/test/resources/refaster/GenericsRecipes.java | 2 +- src/test/resources/refaster/MatchingRecipes.java | 2 +- src/test/resources/refaster/MethodThrowsRecipe.java | 2 +- .../resources/refaster/MultipleDereferencesRecipes.java | 2 +- src/test/resources/refaster/NestedPreconditionsRecipe.java | 4 ++-- src/test/resources/refaster/RefasterAnyOfRecipes.java | 6 +++--- src/test/resources/refaster/ShouldAddImportsRecipes.java | 6 +++--- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/test/resources/refaster/EscapesRecipes.java b/src/test/resources/refaster/EscapesRecipes.java index 943ac50e..76a4a58b 100644 --- a/src/test/resources/refaster/EscapesRecipes.java +++ b/src/test/resources/refaster/EscapesRecipes.java @@ -118,7 +118,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { Preconditions.and( new UsesType<>("com.sun.tools.javac.util.Convert", true), new UsesMethod<>("java.lang.String format(..)", true) - new UsesMethod<>("com.sun.tools.javac.util.Convert quote(..)") + new UsesMethod<>("com.sun.tools.javac.util.Convert quote(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/FindListAddRecipe.java b/src/test/resources/refaster/FindListAddRecipe.java index cd04485b..caaaafb2 100644 --- a/src/test/resources/refaster/FindListAddRecipe.java +++ b/src/test/resources/refaster/FindListAddRecipe.java @@ -79,7 +79,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("java.util.List", true), - new UsesMethod<>("java.util.List add(..)") + new UsesMethod<>("java.util.List add(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/GenericsRecipes.java b/src/test/resources/refaster/GenericsRecipes.java index 7fafbd48..5e5274e1 100644 --- a/src/test/resources/refaster/GenericsRecipes.java +++ b/src/test/resources/refaster/GenericsRecipes.java @@ -114,7 +114,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { Preconditions.and( new UsesType<>("java.util.List", true), new UsesMethod<>("java.util.Iterator next(..)", true) - new UsesMethod<>("java.util.List iterator(..)") + new UsesMethod<>("java.util.List iterator(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/MatchingRecipes.java b/src/test/resources/refaster/MatchingRecipes.java index 035b059e..4a5dcaff 100644 --- a/src/test/resources/refaster/MatchingRecipes.java +++ b/src/test/resources/refaster/MatchingRecipes.java @@ -140,7 +140,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesMethod<>("java.lang.String isEmpty(..)", true) - new UsesMethod<>("java.lang.String substring(..)") + new UsesMethod<>("java.lang.String substring(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/MethodThrowsRecipe.java b/src/test/resources/refaster/MethodThrowsRecipe.java index 45abb0e8..7ff3d20a 100644 --- a/src/test/resources/refaster/MethodThrowsRecipe.java +++ b/src/test/resources/refaster/MethodThrowsRecipe.java @@ -88,7 +88,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { new UsesType<>("java.nio.file.Files", true), new UsesType<>("java.nio.charset.StandardCharsets", true), new UsesType<>("java.nio.file.Path", true), - new UsesMethod<>("java.nio.file.Files readAllLines(..)") + new UsesMethod<>("java.nio.file.Files readAllLines(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/MultipleDereferencesRecipes.java b/src/test/resources/refaster/MultipleDereferencesRecipes.java index 97129ca6..60a88d53 100644 --- a/src/test/resources/refaster/MultipleDereferencesRecipes.java +++ b/src/test/resources/refaster/MultipleDereferencesRecipes.java @@ -116,7 +116,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { Preconditions.and( new UsesType<>("java.nio.file.Files", true), new UsesType<>("java.nio.file.Path", true), - new UsesMethod<>("java.nio.file.Files delete(..)") + new UsesMethod<>("java.nio.file.Files delete(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/NestedPreconditionsRecipe.java b/src/test/resources/refaster/NestedPreconditionsRecipe.java index 33dab390..fc34b8f5 100644 --- a/src/test/resources/refaster/NestedPreconditionsRecipe.java +++ b/src/test/resources/refaster/NestedPreconditionsRecipe.java @@ -101,11 +101,11 @@ public J visitNewClass(J.NewClass elem, ExecutionContext ctx) { Preconditions.or( Preconditions.and( new UsesType<>("java.util.HashMap", true), - new UsesMethod<>("java.util.HashMap (..)") + new UsesMethod<>("java.util.HashMap (..)", true) ), Preconditions.and( new UsesType<>("java.util.LinkedHashMap", true), - new UsesMethod<>("java.util.LinkedHashMap (..)") + new UsesMethod<>("java.util.LinkedHashMap (..)", true) ) ) ), diff --git a/src/test/resources/refaster/RefasterAnyOfRecipes.java b/src/test/resources/refaster/RefasterAnyOfRecipes.java index d2ed4b9d..7a380656 100644 --- a/src/test/resources/refaster/RefasterAnyOfRecipes.java +++ b/src/test/resources/refaster/RefasterAnyOfRecipes.java @@ -197,11 +197,11 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { Preconditions.or( Preconditions.and( new UsesType<>("java.util.LinkedList", true), - new UsesMethod<>("java.util.LinkedList (..)") + new UsesMethod<>("java.util.LinkedList (..)", true) ), Preconditions.and( new UsesType<>("java.util.Collections", true), - new UsesMethod<>("java.util.Collections emptyList(..)") + new UsesMethod<>("java.util.Collections emptyList(..)", true) ) ) ), @@ -272,7 +272,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.or( new UsesMethod<>("java.lang.String valueOf(..)", true) - new UsesMethod<>("java.lang.String copyValueOf(..)") + new UsesMethod<>("java.lang.String copyValueOf(..)", true) ), javaVisitor ); diff --git a/src/test/resources/refaster/ShouldAddImportsRecipes.java b/src/test/resources/refaster/ShouldAddImportsRecipes.java index 8e4374cf..7a3701e3 100644 --- a/src/test/resources/refaster/ShouldAddImportsRecipes.java +++ b/src/test/resources/refaster/ShouldAddImportsRecipes.java @@ -186,9 +186,9 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { Preconditions.or( Preconditions.and( new UsesType<>("java.util.Objects", true), - new UsesMethod<>("java.util.Objects equals(..)") + new UsesMethod<>("java.util.Objects equals(..)", true) ), - new UsesMethod<>("java.lang.Integer compare(..)") + new UsesMethod<>("java.lang.Integer compare(..)", true) ), javaVisitor ); @@ -303,7 +303,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { Preconditions.and( new UsesType<>("java.nio.file.Path", true), new UsesMethod<>("java.io.File exists(..)", true) - new UsesMethod<>("java.nio.file.Path toFile(..)") + new UsesMethod<>("java.nio.file.Path toFile(..)", true) ), javaVisitor ); From a9a90ae097364a00a8fb07b0236b0efa5ee33aef Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 31 Jul 2024 18:12:53 +0200 Subject: [PATCH 4/4] Fix compilation on input sources --- src/test/resources/refaster/ArraysRecipe.java | 2 +- src/test/resources/refaster/EscapesRecipes.java | 4 ++-- src/test/resources/refaster/GenericsRecipes.java | 2 +- src/test/resources/refaster/MatchingRecipes.java | 2 +- .../resources/refaster/MultipleDereferencesRecipes.java | 2 +- src/test/resources/refaster/PicnicRulesRecipes.java | 2 +- src/test/resources/refaster/RefasterAnyOfRecipes.java | 4 ++-- src/test/resources/refaster/ShouldAddImportsRecipes.java | 8 ++++---- .../refaster/ShouldSupportNestedClassesRecipes.java | 4 ++-- src/test/resources/refaster/SimplifyBooleansRecipe.java | 2 +- src/test/resources/refaster/UseStringIsEmptyRecipe.java | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/resources/refaster/ArraysRecipe.java b/src/test/resources/refaster/ArraysRecipe.java index 389a4d0c..7703ba76 100644 --- a/src/test/resources/refaster/ArraysRecipe.java +++ b/src/test/resources/refaster/ArraysRecipe.java @@ -84,7 +84,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String join(..)", true) + new UsesMethod<>("java.lang.String join(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/EscapesRecipes.java b/src/test/resources/refaster/EscapesRecipes.java index 76a4a58b..4ebdb5b8 100644 --- a/src/test/resources/refaster/EscapesRecipes.java +++ b/src/test/resources/refaster/EscapesRecipes.java @@ -117,7 +117,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("com.sun.tools.javac.util.Convert", true), - new UsesMethod<>("java.lang.String format(..)", true) + new UsesMethod<>("java.lang.String format(..)", true), new UsesMethod<>("com.sun.tools.javac.util.Convert quote(..)", true) ), javaVisitor @@ -174,7 +174,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String split(..)", true) + new UsesMethod<>("java.lang.String split(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/GenericsRecipes.java b/src/test/resources/refaster/GenericsRecipes.java index 5e5274e1..0ec34848 100644 --- a/src/test/resources/refaster/GenericsRecipes.java +++ b/src/test/resources/refaster/GenericsRecipes.java @@ -113,7 +113,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("java.util.List", true), - new UsesMethod<>("java.util.Iterator next(..)", true) + new UsesMethod<>("java.util.Iterator next(..)", true), new UsesMethod<>("java.util.List iterator(..)", true) ), javaVisitor diff --git a/src/test/resources/refaster/MatchingRecipes.java b/src/test/resources/refaster/MatchingRecipes.java index 4a5dcaff..3f83f1b9 100644 --- a/src/test/resources/refaster/MatchingRecipes.java +++ b/src/test/resources/refaster/MatchingRecipes.java @@ -139,7 +139,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( Preconditions.and( - new UsesMethod<>("java.lang.String isEmpty(..)", true) + new UsesMethod<>("java.lang.String isEmpty(..)", true), new UsesMethod<>("java.lang.String substring(..)", true) ), javaVisitor diff --git a/src/test/resources/refaster/MultipleDereferencesRecipes.java b/src/test/resources/refaster/MultipleDereferencesRecipes.java index 60a88d53..9b7aba22 100644 --- a/src/test/resources/refaster/MultipleDereferencesRecipes.java +++ b/src/test/resources/refaster/MultipleDereferencesRecipes.java @@ -172,7 +172,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String isEmpty(..)", true) + new UsesMethod<>("java.lang.String isEmpty(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/PicnicRulesRecipes.java b/src/test/resources/refaster/PicnicRulesRecipes.java index 4ebbccdd..ba73c718 100644 --- a/src/test/resources/refaster/PicnicRulesRecipes.java +++ b/src/test/resources/refaster/PicnicRulesRecipes.java @@ -111,7 +111,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String replaceAll(..)", true) + new UsesMethod<>("java.lang.String replaceAll(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/RefasterAnyOfRecipes.java b/src/test/resources/refaster/RefasterAnyOfRecipes.java index 7a380656..d1711b59 100644 --- a/src/test/resources/refaster/RefasterAnyOfRecipes.java +++ b/src/test/resources/refaster/RefasterAnyOfRecipes.java @@ -124,7 +124,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)", true) + new UsesMethod<>("java.lang.String length(..)", true), javaVisitor ); } @@ -271,7 +271,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( Preconditions.or( - new UsesMethod<>("java.lang.String valueOf(..)", true) + new UsesMethod<>("java.lang.String valueOf(..)", true), new UsesMethod<>("java.lang.String copyValueOf(..)", true) ), javaVisitor diff --git a/src/test/resources/refaster/ShouldAddImportsRecipes.java b/src/test/resources/refaster/ShouldAddImportsRecipes.java index 7a3701e3..cdcb5146 100644 --- a/src/test/resources/refaster/ShouldAddImportsRecipes.java +++ b/src/test/resources/refaster/ShouldAddImportsRecipes.java @@ -116,7 +116,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String valueOf(..)", true) + new UsesMethod<>("java.lang.String valueOf(..)", true), javaVisitor ); } @@ -245,7 +245,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.util.Objects hash(..)", true) + new UsesMethod<>("java.util.Objects hash(..)", true), javaVisitor ); } @@ -302,7 +302,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { return Preconditions.check( Preconditions.and( new UsesType<>("java.nio.file.Path", true), - new UsesMethod<>("java.io.File exists(..)", true) + new UsesMethod<>("java.io.File exists(..)", true), new UsesMethod<>("java.nio.file.Path toFile(..)", true) ), javaVisitor @@ -351,7 +351,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String isEmpty(..)", true) + new UsesMethod<>("java.lang.String isEmpty(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java b/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java index 4cbcd22e..b021f0a8 100644 --- a/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java +++ b/src/test/resources/refaster/ShouldSupportNestedClassesRecipes.java @@ -113,7 +113,7 @@ public J visitBinary(J.Binary elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)", true) + new UsesMethod<>("java.lang.String length(..)", true), javaVisitor ); } @@ -168,7 +168,7 @@ public J visitBinary(J.Binary elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)", true) + new UsesMethod<>("java.lang.String length(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/SimplifyBooleansRecipe.java b/src/test/resources/refaster/SimplifyBooleansRecipe.java index 1890af9a..727ad80c 100644 --- a/src/test/resources/refaster/SimplifyBooleansRecipe.java +++ b/src/test/resources/refaster/SimplifyBooleansRecipe.java @@ -84,7 +84,7 @@ public J visitMethodInvocation(J.MethodInvocation elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String replaceAll(..)", true) + new UsesMethod<>("java.lang.String replaceAll(..)", true), javaVisitor ); } diff --git a/src/test/resources/refaster/UseStringIsEmptyRecipe.java b/src/test/resources/refaster/UseStringIsEmptyRecipe.java index b48620a2..1e2bd4d4 100644 --- a/src/test/resources/refaster/UseStringIsEmptyRecipe.java +++ b/src/test/resources/refaster/UseStringIsEmptyRecipe.java @@ -84,7 +84,7 @@ public J visitBinary(J.Binary elem, ExecutionContext ctx) { }; return Preconditions.check( - new UsesMethod<>("java.lang.String length(..)", true) + new UsesMethod<>("java.lang.String length(..)", true), javaVisitor ); }