RFR: 8375183: Remove unused SSLConfiguration.maximumProtocolVersion variable

Mikhail Yankelevich myankelevich at openjdk.org
Tue Jan 13 18:12:33 UTC 2026


On Tue, 13 Jan 2026 14:26:37 GMT, Artur Barashev <abarashev at openjdk.org> wrote:

>> src/java.base/share/classes/sun/security/ssl/TransportContext.java line 147:
>> 
>>> 145:         // initial security parameters
>>> 146:         this.conSession = new SSLSessionImpl();
>>> 147:         this.protocolVersion = this.sslConfig.maximumProtocolVersion;
>> 
>> Wouldn't this make `protocolVersion` unassigned? I can't see it being set anywhere here, am I missing something?
>
> It will have a default `null` value. It's being assigned to the negotiated protocol outside of this file.

Won't it require additional null checks then? Now it essentially defaults to a max protocol version, which was always present (`ProtocolVersion.NONE` by default)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29192#discussion_r2687520708


More information about the security-dev mailing list