RFR: JDK-8236598: javac rejects record component with 'final' modifier

Paul Sandoz paul.sandoz at oracle.com
Thu Jan 2 19:46:31 UTC 2020


If you allow redundant declaration of “final” would the same reasoning apply to “private”?

I notice the spec does not specify an optionally private modifier but does declare that the associated implicit field is private.

It feels inconsistent. Did you consider the opposite direction and change the spec?

Paul.

> On Jan 2, 2020, at 10:41 AM, Vicente Romero <vicente.romero at oracle.com> wrote:
> 
> Hi,
> 
> Please review a simple fix to a bug in the records code. Basically the spec allows record components to redundantly declare the `final` modifier. The current implementation is not allowing this. This patch is fixing this issue.
> 
> Thanks,
> Vicente
> 
> http://cr.openjdk.java.net/~vromero/8236598/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8236598



More information about the compiler-dev mailing list