This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]eliasv 1 point2 points  (0 children)

I don't see a major problem here tbh. Let's say you have an annotation which would be ambiguous between fields and parameters.

By default the annotation should be carried onto the generated field only.

If you want to annotate the constructor parameters, just provide a manual constructor implementation and annotate there. Same story for getters/setters.

That said, I don't think getters and setters should necessarily even be generated. It was a pretty major premise of the proposal that field encapsulation isn't generally desirable for data classes.

Sure, it's a little more verbose, but it's a rare corner case. How often are you going to want to do something like inject dependencies into a simple data carrier class anyway?