RFR: 8254105: allow static members in inner classes, add binary compatibility tests

Vicente Romero vromero at openjdk.java.net
Fri Oct 9 03:58:27 UTC 2020

On Fri, 9 Oct 2020 00:01:12 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Please review the fix for [JDK-8254105](https://bugs.openjdk.java.net/browse/JDK-8254105). The intention of the fix is
> to allow static members to be declared inside inner classes. The spec allowing this change can be seen at [Local and
> Nested Static
> Declarations](http://cr.openjdk.java.net/~gbierman/8246771/8246771-20200928/specs/local-statics-jls.html). This change
> is part of the [Records JEP](https://openjdk.java.net/jeps/395). The idea is to allow not only records to be defined
> inside inner classes but also interfaces, enums, static classes and methods.  TIA, Vicente  PS: the records spec can be
> accessed here [Record Classes](http://cr.openjdk.java.net/~gbierman/8246771/8246771-20200928/specs/records-jls.html).
> This patch also adds a test to check the changes in the Records spec to Chapter 13 "Binary Compatibility". I'm OK
> moving that test to a separate PR.

Hi David,

This issue is a subtask of JEP 395 along with JDK-8246774. JDK-8246774 is basically removing all the preview
annotations from record's code and preview options from the related tests so that records can be used as a standard
feature in Java. But issues like this one, and probably another I'm still working on related to annotations on record
components, was, IMO, complex enough to deserve a separate review process. I'm OK with creating an umbrella issue, if
that sounds better to you, that contains all implementation tasks and make JDK-8246774 and this current task subtasks
of that umbrella issue.



PR: https://git.openjdk.java.net/jdk/pull/571

More information about the compiler-dev mailing list