From 3e8d07eab8e2f47ae99ef4350d845e5249cae50d Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 22 Oct 2025 08:54:39 +0000 Subject: [PATCH] OpenRewrite recipe best practices Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl Co-authored-by: Moderne --- .../resources/META-INF/rewrite/examples.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/resources/META-INF/rewrite/examples.yml b/src/main/resources/META-INF/rewrite/examples.yml index fb9ee482fa..6381142063 100644 --- a/src/main/resources/META-INF/rewrite/examples.yml +++ b/src/main/resources/META-INF/rewrite/examples.yml @@ -3777,6 +3777,30 @@ examples: language: java --- type: specs.openrewrite.org/v1beta/example +recipeName: org.openrewrite.java.migrate.guava.NoGuavaPredicatesAndOr +examples: +- description: '`NoGuavaPredicatesAndOrTest#replacePredicatesAnd`' + sources: + - before: | + import com.google.common.base.Predicate; + import com.google.common.base.Predicates; + + class Test { + Predicate isNotNull = s -> s != null; + Predicate isNotEmpty = s -> !s.isEmpty(); + Predicate combined = Predicates.and(isNotNull, isNotEmpty); + } + after: | + import com.google.common.base.Predicate; + + class Test { + Predicate isNotNull = s -> s != null; + Predicate isNotEmpty = s -> !s.isEmpty(); + Predicate combined = isNotNull.and(isNotEmpty); + } + language: java +--- +type: specs.openrewrite.org/v1beta/example recipeName: org.openrewrite.java.migrate.guava.NoGuavaPrimitiveAsList examples: - description: '`NoGuavaPrimitiveAsListTest#replaceBoolean`'