Skip to content
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

Pojo with additionalProperties and more than one property genrerate a borken hashCode function with empty parameters #336

Closed
etremblay opened this issue Nov 22, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@etremblay
Copy link

Affect master, 3.4.8

Expected :

return java.util.Objects.hash(this.additionalProperties, prop1, prop2);

got

return java.util.Objects.hash(this.additionalProperties, , , prop1, prop2);

The modelPojo.mustache template can be fxed by replacing

return java.util.Objects.hash({{#vendorExtensions.additionalPropertiesMap}}this.additionalProperties{{#vars}}, {{/vars}}...

by

return java.util.Objects.hash({{#vendorExtensions.additionalPropertiesMap}}this.additionalProperties{{#vars.size}}, {{/vars.size}}...
@etremblay
Copy link
Author

Probably caused by #315

@sschnabe sschnabe self-assigned this Dec 24, 2023
@sschnabe sschnabe added the bug Something isn't working label Dec 24, 2023
sschnabe added a commit that referenced this issue Dec 24, 2023
@sschnabe
Copy link
Member

@etremblay Thx for your report. PR is created.

sschnabe added a commit that referenced this issue Dec 24, 2023
sschnabe added a commit that referenced this issue Dec 24, 2023
sschnabe added a commit that referenced this issue Dec 24, 2023
sschnabe added a commit that referenced this issue Dec 24, 2023
sschnabe added a commit that referenced this issue Dec 24, 2023
sschnabe added a commit that referenced this issue Dec 25, 2023
sschnabe added a commit that referenced this issue Dec 25, 2023
* Add test case for #336

* Fix hashCode for `additionalProperties`, fix #336
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants