From 18660377fda05abbcc35fd539fb59eaf8db46a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= Date: Wed, 13 Dec 2023 17:55:02 +0100 Subject: [PATCH] Format --- .../recipes/RewriteRecipeDiscovery.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spring-rewrite-commons-launcher/src/main/java/org/springframework/rewrite/recipes/RewriteRecipeDiscovery.java b/spring-rewrite-commons-launcher/src/main/java/org/springframework/rewrite/recipes/RewriteRecipeDiscovery.java index b8ab92d1e..277a2450b 100644 --- a/spring-rewrite-commons-launcher/src/main/java/org/springframework/rewrite/recipes/RewriteRecipeDiscovery.java +++ b/spring-rewrite-commons-launcher/src/main/java/org/springframework/rewrite/recipes/RewriteRecipeDiscovery.java @@ -161,27 +161,30 @@ public List findRecipesByTag(String tag) { */ public Optional findRecipeByName(String name) { List filteredRecipes = getFilteredRecipes(r -> r.getName().equals(name)); - if(filteredRecipes.size() > 1) { + if (filteredRecipes.size() > 1) { throw new IllegalStateException("Found more than one recipe with name '%s'".formatted(name)); - } else if(filteredRecipes.isEmpty()) { + } + else if (filteredRecipes.isEmpty()) { return Optional.empty(); - } else { + } + else { return Optional.of(filteredRecipes.get(0)); } } public Recipe getRecipeByName(String name) { List filteredRecipes = getFilteredRecipes(r -> r.getName().equals(name)); - if(filteredRecipes.size() > 1) { + if (filteredRecipes.size() > 1) { throw new IllegalArgumentException("Found more than one recipe with name '%s'".formatted(name)); - } else if(filteredRecipes.isEmpty()) { + } + else if (filteredRecipes.isEmpty()) { throw new IllegalArgumentException("No recipe found with name '%s'".formatted(name)); - } else { + } + else { return filteredRecipes.get(0); } } - @NotNull public static List getFilteredRecipes(Predicate filterPredicate) { ResourceLoader resourceLoader = new ClasspathScanningLoader(new Properties(), new String[] {}); @@ -190,7 +193,7 @@ public static List getFilteredRecipes(Predicate filterPredicate) return recipes; } - // class AbstractRewriteMojoHelper extends AbstractRewriteMojo { + // class AbstractRewriteMojoHelper extends AbstractRewriteMojo { // // public AbstractRewriteMojoHelper(MavenProject mavenProject) { // super.project = mavenProject;