--- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java Sun Jun 10 21:22:05 2018 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java Mon Jun 11 07:24:50 2018 -0700
@@ -38,7 +38,9 @@
/**
* Implementation of an SSLContext.
*
- * Instances of this class are immutable after the context is initialized.
+ * Implementation note: Instances of this class and the child classes are
+ * immutable, except that the context initialization (SSLContext.init()) may
+ * reset the key, trust managers and source of secure random.
*/
public abstract class SSLContextImpl extends SSLContextSpi {
@@ -411,7 +413,7 @@
}
}
- return Arrays.asList(suites.toArray(new CipherSuite[0]));
+ return new ArrayList<>(suites);
}
/*
@@ -937,10 +939,9 @@
}
} else {
// Use the customized TLS protocols.
- candidates = new ProtocolVersion[refactored.size()];
- candidates = refactored.toArray(candidates);
+ candidates =
+ refactored.toArray(new ProtocolVersion[refactored.size()]);
}
- System.out.println(refactored.toString());
return getAvailableProtocols(candidates);
}