RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected [v9]

Michael McMahon michaelm at openjdk.org
Thu Apr 13 07:44:57 UTC 2023


On Wed, 12 Apr 2023 11:58:44 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Michael McMahon has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - error in test
>>  - Jai's review
>
> src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java line 229:
> 
>> 227:         this.realm = realm;
>> 228:         this.path = null;
>> 229:         this.authcache = acache == null ? defCache : acache;
> 
> Do we really need that field? Now that AuthCacheValue instances are held in separate caches, there should be no need to have a field referring to the authenticator/cache in the auth value.
> This let me thinks that some more refactoring could further simplify everything.
> Having the value point to the cache in which it's been added seems wrong.

That structure is not related to this change though. Previously, the value added itself to the single static cache, but now to add itself, it needs a reference to the cache instance. We could certainly reorganise this code, but I'm not sure that work belongs in this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13159#discussion_r1165130860


More information about the net-dev mailing list