RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected [v3]
Michael McMahon
michaelm at openjdk.org
Mon Mar 27 16:08:03 UTC 2023
On Mon, 27 Mar 2023 11:19:37 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
>> Michael McMahon has updated the pull request incrementally with one additional commit since the last revision:
>>
>> review updates
>
> test/jdk/sun/net/www/protocol/http/AuthCache.java line 52:
>
>> 50: private final String username;
>> 51: private final String password;
>> 52: private AtomicBoolean wasCalled = new AtomicBoolean();
>
> `wasCalled` is accessed only from `synchronized` methods. We can use plain `boolean` instead
Okay, thanks. I'm actually going to investigate a different way of fixing this, by creating a separate `AuthCacheImpl` attached directly to each `Authenticator` rather than having a single static cache and this complicated way of separating the key space with Strings generated by AuthenticatorKeys. It could end being much simpler and not needing Cleaners or PhantomReferences.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13159#discussion_r1149475815
More information about the net-dev
mailing list