-
Notifications
You must be signed in to change notification settings - Fork 92
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
base: main
Are you sure you want to change the base?
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
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
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
What's changed?
What's your motivation?
To convert classes to
@Value
or@Data
they 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@EqualsAndHashCode
to 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