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

codegen-java: Support generating record classes #804

Open
odenix opened this issue Nov 12, 2024 · 2 comments
Open

codegen-java: Support generating record classes #804

odenix opened this issue Nov 12, 2024 · 2 comments

Comments

@odenix
Copy link
Contributor

odenix commented Nov 12, 2024

codegen-java should support generating record classes instead of regular classes whenever possible.
(codegen-kotlin already generates data classes whenever possible.)

I have this almost working, but one important question remains: how to deal with backward compatibility?

One option is to introduce a —generate-records flag and only generate record classes if this flag is set.
Another option is to ask users to stay on the 0.27 code generator until they are ready to switch to record classes.
In any case, generating record classes should eventually become the default.

@bioball
Copy link
Contributor

bioball commented Nov 13, 2024

Yeah, definitely. Now with Java 11 dropped, the code generator should generate records. I think this is okay as a breaking change (generate java records by default, require flag to retain old behavior).

@odenix
Copy link
Contributor Author

odenix commented Nov 19, 2024

Blocked on #790.

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

No branches or pull requests

2 participants