# HG changeset patch # User coffeys # Date 1543316993 0 # Node ID 93afbb11063bb338e0356e86be8924933a13ebdc # Parent 0037ea3c73222ccdff897e0b318c3971581a87f0 8214295: Populate handlers while holding streamHandlerLock Reviewed-by: chegar diff -r 0037ea3c7322 -r 93afbb11063b src/java.base/share/classes/java/net/URL.java --- 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; }