When the recipe below is ran against the test case the generated JavaTemplate.Matcher doesn't find a match.
I've also tried boolean[] items but it made no difference
Recipe
@RecipeDescriptor(
name = "`Booleans.asList` to `Arrays.asList`",
description = "Migrate from Guava `Booleans.asList` to `Arrays.asList`."
)
public static class BooleanAsList {
@BeforeTemplate
List<Boolean> before(boolean... items) {
return Booleans.asList(items);
}
@AfterTemplate
List<Boolean> after(Boolean... items) {
return Arrays.asList(items);
}
}
Test case
@Test
void replaceBoolean() {
//language=java
rewriteRun(
java(
"""
import com.google.common.primitives.Booleans;
class Test {
List<Boolean> bools = Booleans.asList(true, false);
}
""",
"""
class Test {
List<Boolean> bools = Arrays.asList(true, false);
}
"""
)
);
}
When the recipe below is ran against the test case the generated JavaTemplate.Matcher doesn't find a match. I've also tried
boolean[] items
but it made no differenceRecipe
Test case
Java template code String