RFR: 8372661: Add a null-safe static factory method to "jdk.test.lib.net.SimpleSSLContext" [v2]

Volkan Yazici vyazici at openjdk.org
Fri Dec 12 18:56:33 UTC 2025


On Thu, 11 Dec 2025 18:55:05 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Reverted all changes and only kept `SimpleSSLContext` enhancements
>
> test/lib/jdk/test/lib/net/SimpleSSLContext.java line 159:
> 
>> 157:         }
>> 158:     }
>> 159: 
> 
> I believe you need to keep the `ssl` instance variable here, and return that if not null.  Or set it in the constructor. As we have seen with httpclient test sharing the same context can lead to subtle behavioral difference, so it would be better if this change didn't bring behavioral changes to the old API.
> 
> In other words - you should be able to assert that:
> 
> 
> new SimpleSSLContext().get() != new SimpleSSLContext().get()
> 
> 
> and that
> 
> 
> var context = new SimpleSLLContex();
> context.get() == context.get();

Right. Introduced `ssl` instance field back in b52e442fe6a.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28765#discussion_r2615246395


More information about the net-dev mailing list