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

Replace values() with entries() with in enums #340

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

Palleas
Copy link
Contributor

@Palleas Palleas commented Dec 17, 2024

Hi there - I was digging into the generated code and I realized there was a recommendation to replace values() with entries when using enums: https://www.jetbrains.com/help/inspectopedia/EnumValuesSoftDeprecate.html

Since I wanted to contribute back to this library that we started using recently, I figured it was worth a shot. The tests are failing right now because I couldn't figure out how to rebuild the expected models in src/test/resources/examples, if you can point me toward the way to do that, I'll finish the work on this pull-request, assuming that's something you'd like.

@cjbooms
Copy link
Owner

cjbooms commented Dec 17, 2024

I'm afraid it's a manual task, we never built anything that overwrites them with the new value. Use find and replace, or you could try to add a function to the tests to correct the files

@Palleas
Copy link
Contributor Author

Palleas commented Dec 17, 2024

Oh cool, at least that means I haven't missed anything! I'll do a manual replace first and maybe I can contribute something in a future PR, if that works for you?

@Palleas Palleas changed the title Replace values() with entries() with generated enums Replace values() with entries() with in enums Dec 17, 2024
@Palleas
Copy link
Contributor Author

Palleas commented Dec 17, 2024

Updated!

@cjbooms cjbooms merged commit 89f6d46 into cjbooms:master Dec 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants