-
Notifications
You must be signed in to change notification settings - Fork 57
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
"Writing a Java refactoring recipe" Should not use Lombok #252
Comments
I agree with you there! We should at least be consistent in our use, and ideally not require additional tools when folks want to learn about OpenRewrite. Thanks for pointing those out! /cc @mike-solomon |
@timtebeek Do you have any examples of recipes that don't use Lombok or what is necessary if you don't include those annotations? I know that people need to ensure it's serializable -- but I'm not really sure how someone would do that and if anything else is needed there. |
As soon as recipes use fields we typically use Lombok for convenience; to create a sample without Lombok from writing-a-java-refactoring-recipe you can remove the annotations, then have your IDE generate a getter, equals, hashcode and toString function. For brevity we could do this only for the completed visito on a separate tab that does not use Lombok. That might help to show but common use (with Lombok), and still provide an option without Lombok. |
Not sure if you spoke to Jonathan @asaikali , but we're now enforcing a common standard with regards to the use of |
The tutorial at Writing a Java refactoring recipe is hard to understand / follow with Lombok, please consider removing the usage of Lombok. As a user I visited this page to learn how to write a recipe I want all my mental energy focused on learning how to write a recipe not contemplating what is this Lombok annotation doing.
I understand the argument from folks who use lombok every day that they know what the annotations do, for those of us who don't use lombok everyday its a pain to try and remember what those annotations do. My efforts to learn how to write a recipe are derailed by having to learn what the lombok annotations do.
Annotations like
@EqualsAndHashCode(callSuper = true)
in the sample template for recipes makes me guess that there is complex contract that is not well defined in the tutorial, for example the visitor requires an implementation of hashCode equals that behaves a certain way.I generated the project from the recommend template project which the recipe below
The Recipe tutorial has the code below, in the final full recipe implementation.
One has
callSuper = true
and the othercallSuper = false
as a user it is very confusing what is the contract that OpenRewrite excepts from recipe?By removing Lombok from the recipe tutorial you will make the tutorial easier to understand, clearer, and less ambiguous for a wider range of readers.
The text was updated successfully, but these errors were encountered: