-
Notifications
You must be signed in to change notification settings - Fork 108
feat: convert any equals and hashcode to the lombok annotation, ignore implementation #647
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
feat: convert any equals and hashcode to the lombok annotation, ignore implementation #647
Conversation
src/main/java/org/openrewrite/java/migrate/lombok/NegligentlyConvertEquals.java
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/lombok/NegligentlyConvertEquals.java
Outdated
Show resolved
Hide resolved
4ab6051 to
68838e4
Compare
src/main/java/org/openrewrite/java/migrate/lombok/NegligentlyConvertEquals.java
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/lombok/NegligentlyConvertEquals.java
Outdated
Show resolved
Hide resolved
4d5d678 to
4194a9d
Compare
|
Now there is a seemingly unrelated error in /home/runner/work/rewrite-migrate-java/rewrite-migrate-java/src/main/java/org/openrewrite/java/migrate/javax/AddColumnAnnotation.java:92: Maybe a rebase on |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
7b8ffe4 to
51ffbc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 6501-6500
|
This PR is stale because it has been open for 90 days with no activity. Remove |
src/main/java/org/openrewrite/java/migrate/lombok/NegligentlyConvertEquals.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/lombok/NegligentlyConvertEquals.java
Outdated
Show resolved
Hide resolved
|
This PR is stale because it has been open for 90 days with no activity. Remove |
|
Thanks again for your efforts here; I think this one might have been a bit too much of a risk to adopt, as it's quite common for folks to deliberately only use some fields for their equals/hashcode, which is perhaps tough to judge correctly with a recipe given the amount of variation. |
What's changed?
What's your motivation?
To convert classes to
@Valueor@Datathey need to have@EqualsAndHashCode.But this annotation is probably not there.
equals()andhashCode()are if defined hard to validate, so this recipe assumes that manual work is necessary and adds@EqualsAndHashCodeto any class that implements eitherequals()orhashCode()regardless of how they are implemented. The user has to review each class, but saves the effort of finding and replacing.Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist