RFR: 8314261: Make fields final in sun.net.www [v4]

Jaikiran Pai jpai at openjdk.org
Wed Aug 16 07:24:11 UTC 2023


On Tue, 15 Aug 2023 15:16:46 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> A few classes in `sun.net.www` package have non-final fields which could easily be marked `final`.
>
> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8314261: Make fields final in sun.net.www
>   
>   fix B5045306 test failure

src/java.base/share/classes/sun/net/www/http/HttpClient.java line 107:

> 105:     // retryPostProp is true by default so as to preserve behavior
> 106:     // from previous releases.
> 107:     private static final boolean retryPostProp;

At first sight the changes to `retryPostProp` and `keepAliveProp` appear to change the default values here. However, the `static` block of this class does set these two properties to default to `true` when the corresponding system properties aren't set. So this change is fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14977#discussion_r1295480984


More information about the net-dev mailing list