You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Apologies for the minor suggestion, but I noticed that when generating Java enum classes using the spring generator, the fields representing the enum values are not declared as final. While this does not cause runtime issues, it goes against Java best practices for immutability and correctness. In idiomatic Java code, enum fields are typically declared as private final, ensuring they are immutable once initialized.
Describe the solution you'd like
I would like the code generation templates to be updated so that enum value fields are declared as private final. For example, the following generated code:
private String value;
should be updated to:
private final String value;
This change improves immutability and consistency with standard Java practices.
Describe alternatives you've considered
Manually updating the generated code after each generation (not ideal, especially in CI environments).
Using custom templates to override enum generation behavior (adds maintenance overhead).
Creating a post-processing script to modify the generated files (fragile and error-prone).
Additional context
Nothing...
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Apologies for the minor suggestion, but I noticed that when generating Java enum classes using the spring generator, the fields representing the enum values are not declared as final. While this does not cause runtime issues, it goes against Java best practices for immutability and correctness. In idiomatic Java code, enum fields are typically declared as private final, ensuring they are immutable once initialized.
Describe the solution you'd like
I would like the code generation templates to be updated so that enum value fields are declared as private final. For example, the following generated code:
should be updated to:
This change improves immutability and consistency with standard Java practices.
Describe alternatives you've considered
Manually updating the generated code after each generation (not ideal, especially in CI environments).
Using custom templates to override enum generation behavior (adds maintenance overhead).
Creating a post-processing script to modify the generated files (fragile and error-prone).
Additional context
Nothing...
The text was updated successfully, but these errors were encountered: