NPE while applying more than one root recipes selected in eclipse
This commit is contained in:
@@ -124,6 +124,7 @@ public class RecipeTreeModel {
|
||||
return recipes[0];
|
||||
} else {
|
||||
RecipeDescriptor aggregate = new RecipeDescriptor();
|
||||
aggregate.name = recipes.length + " recipes";
|
||||
aggregate.displayName = recipes.length + " recipes";
|
||||
aggregate.description = "Multiple recipes to be applied. Number of recipes " + recipes.length;
|
||||
aggregate.tags = Arrays.stream(recipes).flatMap(r -> r.tags.stream()).collect(Collectors.toSet());
|
||||
|
||||
@@ -349,10 +349,17 @@ public class RewriteRecipeRepository implements ApplicationContextAware {
|
||||
throw new RuntimeException("No recipes found to perform!");
|
||||
} else if (aggregateRecipe.getRecipeList().size() == 1) {
|
||||
Recipe r = aggregateRecipe.getRecipeList().get(0);
|
||||
String progressToken = params.getWorkDoneToken() == null || params.getWorkDoneToken().getLeft() == null ? r.getName() : params.getWorkDoneToken().getLeft();
|
||||
String progressToken = params.getWorkDoneToken() == null
|
||||
|| params.getWorkDoneToken().getLeft() == null
|
||||
? (r.getName() == null ? UUID.randomUUID().toString() : r.getName())
|
||||
: params.getWorkDoneToken().getLeft();
|
||||
return apply(r, uri, progressToken);
|
||||
} else {
|
||||
String progressToken = params.getWorkDoneToken() == null || params.getWorkDoneToken().getLeft() == null ? aggregateRecipe.getName() : params.getWorkDoneToken().getLeft();
|
||||
String progressToken = params.getWorkDoneToken() == null
|
||||
|| params.getWorkDoneToken().getLeft() == null
|
||||
? (aggregateRecipe.getName() == null ? UUID.randomUUID().toString()
|
||||
: aggregateRecipe.getName())
|
||||
: params.getWorkDoneToken().getLeft();
|
||||
return apply(aggregateRecipe, uri, progressToken);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user