# HG changeset patch # User xuelei # Date 1528727090 25200 # Node ID 12e20a7d6e265a354f5a73e5f021006734de85a5 # Parent da9979451b7a219e7d0f5506b1ceb55f039b1441 Clean up of SSLContextImpl diff -r da9979451b7a -r 12e20a7d6e26 src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java --- 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); }