-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add equals and hashCode methods to Microprofile #20011
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
Add equals and hashCode methods to Microprofile #20011
Conversation
|
This is ready for review now. |
--- a/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml
+++ b/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml
@@ -9,3 +9,4 @@ additionalProperties:
configKey: petstore
microprofileRestClientVersion: "3.0"
hideGenerationTimestamp: true
+ useReflectionEqualsHashCode: true
I did a test with the above change, updated the samples but then I got errors when running Does it work for you locally? |
|
please also update bin/configs/java-microprofile-rest-client-3.0-jackson.yaml with |
|
Good catch, I missed that. The commons-lang3 dependency was missing in the pom. There are actually quite a lot of libraries (all except okhttp in fact) where that dependency is missing. I suppose I'll create an issue for that. The 3.0 pom is also missing the mutiny dependency, but I suggest just fixing that with the other issues in another PR |
yes please 🙏 |
Closes #19910
Added
equalsandhashCodemethods to the Java Microprofile generator. The methods were copied over from the Java generator. As I suggested in the issue, I added a new template for this so it is easier to customize these if needed. I decided to also put thetoStringmethod in there to allow for easy customization as well. So all of the pojo'sObjectmethod overrides are now in that template.This is a draft for now as I still need to do testing.PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)