> I have the same reaction to this proposal, but when I have to defend this
> point of view rationally I just can't do it. Yes, those 2 words don't seem
> to add up, but why does it seem like that? It's 2 words. It's utter and
> complete boilerplate - it adds absolutely nothing. Of course every field in
> a @Value-style class is private (if we're generating getters and withers,
> why make em public? Speed reasons? That seems like a pretty bad reason to
> do that). This is why I'm strongly considering releasing this feature with
> the default-field-access feature in place. If we get lots of whines on the
> topic we can revisit it when / if @Value is promoted from .experimental to
> main package.
>
Of course, it is boileplate. I am only a bit concerned since this
behavior differs from @Data when it comes to field visibility.
If data had got this right in the first place, this would seem
completely logical.
But having 2 different approaches to visibility seems odd.
However, i completely agree on adding the final modifier, since that
does not break the symmetry, as values are expected to be immutable
anyway.
> Right, every so often you WANT package private access to your inner fields.
> But why, really? It's less consistent and a modern hotspot compiler
> eliminates the method call.
I just gave this example as why package visibily is not a problem if
you forgot to add final manually.
Its still a closed, controllable scope.
And visibilty on final fields usually does not pose any kind of
problems.
Thats why I do not care that much about setting them automatically to
private.