RFR: 8314877: Make fields final in 'java.net' package

Alan Bateman alanb at openjdk.org
Wed Aug 23 10:43:25 UTC 2023


On Mon, 21 Aug 2023 08:47:11 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> A few classes in `java.net` package have non-final fields which could easily be marked `final`.

src/java.base/share/classes/java/net/URL.java line 1592:

> 1590:      * A table of protocol handlers.
> 1591:      */
> 1592:     static final Hashtable<String,URLStreamHandler> handlers = new Hashtable<>();

Can you check if this can also be changed to be private?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15358#discussion_r1302829784


More information about the net-dev mailing list