RFR: 8345954: Revisit Class Initializers and Locking in X509TrustManagerImpl [v2]
Artur Barashev
abarashev at openjdk.org
Thu Jan 29 19:59:20 UTC 2026
On Thu, 22 Jan 2026 23:51:42 GMT, Koushik Muthukrishnan Thirupattur <duke at openjdk.org> wrote:
>> Refactor sun.security.provider.X509Factory cache access to avoid coarse-grained locking and reduce contention during certificate/CRL interning and parsing.
>>
>> As per request in [the PR](https://github.com/openjdk/jdk/pull/22616#issuecomment-2524971845), re-visit "the initialisation and locking in this area, e.g. addToCache is a static synchronized method so very coarse locking."
>
> Koushik Muthukrishnan Thirupattur has updated the pull request incrementally with one additional commit since the last revision:
>
> 8345954: Addressing review comments
src/java.base/share/classes/sun/security/provider/X509Factory.java line 414:
> 412: X509CRLImpl crl = new X509CRLImpl(encoding);
> 413: byte[] enc = crl.getEncodedInternal();
> 414: return addIfNotPresent(crlCache, enc, crl);
Why we call `addIfNotPresent` if we already checked above that it's not present?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29181#discussion_r2743279133
More information about the security-dev
mailing list