Skip to content

Commit

Permalink
fix: Use a stable recipe order for NullableRecipe.getRecipeList()
Browse files Browse the repository at this point in the history
Avoids shuffling the order in the docs.
  • Loading branch information
timtebeek authored and triceo committed Dec 4, 2024
1 parent 9d25467 commit 07cc41d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public String getDescription() {
@Override
public List<Recipe> getRecipeList() {
var packageName = "ai.timefold.solver.core.api.score.stream";
var methodsToRename = Map.ofEntries(
var methodsToRename = List.of(
Map.entry("ConstraintFactory forEachIncludingNullVars(Class)",
"forEachIncludingUnassigned"),
Map.entry("uni.UniConstraintStream ifExistsIncludingNullVars(..)",
Expand All @@ -50,9 +50,9 @@ public List<Recipe> getRecipeList() {
"ifNotExistsIncludingUnassigned"));

var result = new ArrayList<Recipe>();
methodsToRename.forEach((oldPattern, newMethodName) -> {
var pattern = packageName + "." + oldPattern;
result.add(new ChangeMethodName(pattern, newMethodName, null, null));
methodsToRename.forEach(entry -> {
var pattern = packageName + "." + entry.getKey();
result.add(new ChangeMethodName(pattern, entry.getValue(), null, null));
});
result.add(new ChangeAnnotationAttributeName("ai.timefold.solver.core.api.domain.variable.PlanningVariable", "nullable",
"allowsUnassigned"));
Expand Down

0 comments on commit 07cc41d

Please sign in to comment.