changeset 52717:93afbb11063b

8214295: Populate handlers while holding streamHandlerLock Reviewed-by: chegar
author coffeys
date Tue, 27 Nov 2018 11:09:53 +0000
parents 0037ea3c7322
children 99eb43bc3595
files src/java.base/share/classes/java/net/URL.java
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/net/URL.java	Mon Nov 26 17:35:35 2018 +0100
+++ b/src/java.base/share/classes/java/net/URL.java	Tue Nov 27 11:09:53 2018 +0000
@@ -1421,13 +1421,12 @@
                 // this thread created.
                 handler = handler2;
             }
+
+            // Insert this handler into the hashtable
+            if (handler != null) {
+                handlers.put(protocol, handler);
+            }
         }
-
-        // Insert this handler into the hashtable
-        if (handler != null) {
-            handlers.put(protocol, handler);
-        }
-
         return handler;
     }