Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

Claes Redestad-2
On Wed, 17 Feb 2021 16:35:02 GMT, liach <[hidden email]> wrote:

>> I'll just revert them
>
> For static methods, since in java language you cannot declare static method in instance inner classes, I'd say making them static makes more sense language-wise. Also making them static reduces compiler synthetic instance field and constructors.

Incidentally, Java-the-language allows static methods in inner instance classes since JDK 16. And I'm not sure this was ever a restriction at the JVMS level since we've been generating static methods (using ASM) into these inner instance classes since at least JDK 9.

-------------

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