-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 26
-
Component/s: core-libs
`SimpleSSLContext::get` can return null, and hence, every call site is decorated with
sslContext = new SimpleSSLContext().get();
if (sslContext == null) {
throw new AssertionError("Unexpected null sslContext");
}
Introduce a new `newSSLContext` static factory method that is guaranteed to return a non-null `SSLContext`, or throw an exception if it fails to do so. Note that `newSSLContext` can also safely be imported as a static method without much of a chance for a name conflict.
sslContext = new SimpleSSLContext().get();
if (sslContext == null) {
throw new AssertionError("Unexpected null sslContext");
}
Introduce a new `newSSLContext` static factory method that is guaranteed to return a non-null `SSLContext`, or throw an exception if it fails to do so. Note that `newSSLContext` can also safely be imported as a static method without much of a chance for a name conflict.