On Wed, 8 May 2024 15:11:38 GMT, Sean Coffey <[email protected]> wrote:
>> src/java.base/share/classes/sun/security/ssl/CertificateMessage.java line
>> 504:
>>
>>> 502: thisSubjectAltNames =
>>> thisCert.getSubjectAlternativeNames();
>>> 503: } catch (CertificateParsingException cpe) {
>>> 504: if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake"))
>>> {
>>
>> It looks like all of these checks for `SSLLogger.isOn` are unnecessary
>> because the `isOn()` method also checks if logging is enabled. Is this to
>> avoid the method call if the log is disabled?
>
> I think it might be the latter. `isOn` is stored as `static final` and I
> guess we can assume that it's going to be `false` in majority of cases.
> Probably an optimization.
That is my recollection. This was done to short-circuit as quickly as possible
to reduce logging overhead.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18764#discussion_r1841338661