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

Support non-String values in fromValue() methods of generated enum classes #235

Merged

Conversation

Chrimle
Copy link
Owner

@Chrimle Chrimle commented Dec 1, 2024

Fixed 2 bugs related to the fromValue()-method in generated enum classes. The first, affected all generated enum classes where the type-property was not set to string. The fromValue()-method would always generate the method parameter as String, leading to issues caused by comparing incompatible types. The second issue is encountered under the same conditions, but when the configOption useEnumCaseInsensitive is set to true. This would invoke equalsIgnoreCase on non-String objects - which caused compilation errors. Both of these bug fixes are contained to the fromValue()-method and are fully backwards-compatible.

Checklist

@Chrimle Chrimle added bug Something isn't working PATCH Backwards-compatible bug fix or refactoring labels Dec 1, 2024
@Chrimle Chrimle self-assigned this Dec 1, 2024
@Chrimle Chrimle linked an issue Dec 1, 2024 that may be closed by this pull request
Copy link
Owner Author

@Chrimle Chrimle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Owner Author

@Chrimle Chrimle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Chrimle
Copy link
Owner Author

Chrimle commented Dec 1, 2024

Perhaps split these 2 bug fixes into 2 PRs?

@Chrimle Chrimle merged commit 14b56d2 into main Dec 1, 2024
1 check passed
@Chrimle Chrimle deleted the 234-generated-fromvalue-methods-cannot-support-non-string-types branch December 1, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PATCH Backwards-compatible bug fix or refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated fromValue()-methods cannot support non-String types
1 participant