apple / apple/pkl

codegen-java: Support generating record classes

Open
#804 4 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
11.5k
Forks
402
Avg merge
1d 15h
Merged PRs (30d)
20

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start in the codegen-java implementation and compare its generation behavior with codegen-kotlin, which already generates data classes when possible. Review the backward-compatibility question around a —generate-records flag versus changing the default. Done means record classes are supported whenever possible and the compatibility and default behavior are decided.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.