Add a null-safe static factory method to "jdk.test.lib.net.SimpleSSLContext"

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • 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.

            Assignee:
            Volkan Yazici
            Reporter:
            Volkan Yazici
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: