Skip to content

Commit

Permalink
Trim RecipeDescriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Nov 15, 2024
1 parent 3e89b4a commit 5aea1f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rewrite-core/src/main/java/org/openrewrite/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ public final RecipeDescriptor getDescriptor() {

protected RecipeDescriptor createRecipeDescriptor() {
List<OptionDescriptor> options = getOptionDescriptors();
List<RecipeDescriptor> recipeList1 = new ArrayList<>();
ArrayList<RecipeDescriptor> recipeList1 = new ArrayList<>();
for (Recipe next : getRecipeList()) {
recipeList1.add(next.getDescriptor());
}
recipeList1.trimToSize();
URI recipeSource;
try {
recipeSource = getClass().getProtectionDomain().getCodeSource().getLocation().toURI();
Expand All @@ -233,7 +234,7 @@ private List<OptionDescriptor> getOptionDescriptors() {
recipe = ((DelegatingRecipe) this).getDelegate();
}

List<OptionDescriptor> options = new ArrayList<>();
ArrayList<OptionDescriptor> options = new ArrayList<>();

for (Field field : recipe.getClass().getDeclaredFields()) {
Object value;
Expand All @@ -255,6 +256,7 @@ private List<OptionDescriptor> getOptionDescriptors() {
value));
}
}
options.trimToSize();
return options;
}

Expand Down

0 comments on commit 5aea1f4

Please sign in to comment.