Closed Stephan202 closed 5 months ago
Thanks for the report! We will look into a fix and create a patch release.
OpenRewrite now allows Refaster rules without after templates. The corresponding recipes are used to find matches in the code base. As you noticed there was a big in the annotation processor. That is now fixed. I assume you were seeing this as you have some Refaster rules without after template on purpose to test that your tooling is robust when it comes to illegal input.
Wow, that was fast :rocket:
I assume you were seeing this as you have some Refaster rules without after template on purpose to test that your tooling is robust when it comes to illegal input.
It was part of test code indeed :smile: (Not about handling invalid inputs (it's valid for a Refaster rule to not have an @AfterTemplate
), but as a stand-in for an "arbitrary Refaster rule" to test our test framework.)
See upgrade PR PicnicSupermarket/error-prone-support#1153 for a reproducer. After the upgrade, OpenRewrite generates recipes that contain the statement
return SearchResult.found(elem);
, without the requisiteimport org.openrewrite.marker.SearchResult;
statement.I assume that this is caused by 6b9ac4c330a20349ccb5c333d96ff36ed992a5c0 (was this change merged without a PR? :eyes:), but right now I won't have time to dive into the code. (Could try to find some time EOW, but no promises :).)