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

Alan Bateman alanb at openjdk.java.net
Wed Feb 24 08:54:42 UTC 2021


On Wed, 17 Feb 2021 16:38:03 GMT, Сергей Цыпанов <github.com+10835776+stsypanov at openjdk.org> wrote:

>> Non-static classes hold a link to their parent classes, which in many cases can be avoided.
>
> Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8261880: Remove static from declarations of Holder nested classes

src/java.base/windows/classes/sun/nio/ch/PipeImpl.java line 67:

> 65:     private final SinkChannel sink;
> 66: 
> 67:     private static class Initializer

This one is okay to do.

src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java line 51:

> 49:      * Represents a service provider in the services catalog.
> 50:      */
> 51:     public static final class ServiceProvider {

This one is okay to do.

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

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


More information about the security-dev mailing list