jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java
changeset 10128 f505a8514bd7
parent 9514 bdb24db75fe8
child 10336 0bb1999251f8
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Tue Jul 19 17:45:11 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Tue Jul 19 21:47:23 2011 -0700
@@ -2443,11 +2443,12 @@
             entrySet, HandshakeCompletedEvent e) {
 
             super("HandshakeCompletedNotify-Thread");
-            targets = entrySet;
+            targets = new HashSet<>(entrySet);          // clone the entry set
             event = e;
         }
 
         public void run() {
+            // Don't need to synchronize, as it only runs in one thread.
             for (Map.Entry<HandshakeCompletedListener,AccessControlContext>
                 entry : targets) {