-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StringIsEmpty with Refaster test fails #66
Comments
Hi @Uriziel47 ; thanks for the detailed report! This is indeed a bug, that we'll track against the refaster template processor: Let's continue the conversation there! Any fix & release would also resolve that issue here, without a need for changes in this project beyond bumping the version. |
Hi @timtebeek, thank you very much for the fast feedback and fix! |
You're welcome; your report made it easy to pick up. You'll have noticed I also released a new version of rewrite-templating and bumped the versions here. We'll do a full new release this Wednesday. Thanks again! |
Good Morning,
I just wanted to get started on openrewrite. So I decided to check this Repository first and get my hands dirty.
Unfortunately I got stucked in the first try using Refaster.
So after writing the Refaster recipe of
StringIsEmpty
. I didn't get the testcase,StringIsEmpty::standardizeStringIsEmpty
to pass. Either the case ofstring.equals("")
orstring.length == 0
case is wrong.So after inspecting the generated class. I realized, that the first
@BeforeTemplate
annotation decides which visitor method will be used for all@BeforeTemplate
annotated methods.In case
string.equals("")
the visitor methodvisitMethodInvocation
is been used. And in case ofstring.length == 0
the visitor methodvisitBinary
is been used.So I am just curious, if I misunderstood the documentation, used the wrong version, or is this a bug, which I did not find in the issues.
For clarification I created a branch in my learning repository: link to repo.
In there the discussed variants with the testcases.
equals
andlength
into refaster subclasses)Thanks for your answers in advance.
The text was updated successfully, but these errors were encountered: