< prev index next >

src/java.base/share/classes/java/net/URL.java

Print this page

        

*** 1391,1405 **** if (handler == null) { handler = lookupViaProperty(protocol); } } - synchronized (streamHandlerLock) { if (handler == null) { // Try the built-in protocol handler handler = defaultFactory.createURLStreamHandler(protocol); ! } else { URLStreamHandler handler2 = null; // Check again with hashtable just in case another // thread created a handler since we last checked handler2 = handlers.get(protocol); --- 1391,1406 ---- if (handler == null) { handler = lookupViaProperty(protocol); } } if (handler == null) { // Try the built-in protocol handler handler = defaultFactory.createURLStreamHandler(protocol); ! } ! ! synchronized (streamHandlerLock) { URLStreamHandler handler2 = null; // Check again with hashtable just in case another // thread created a handler since we last checked handler2 = handlers.get(protocol);
*** 1424,1434 **** // Insert this handler into the hashtable if (handler != null) { handlers.put(protocol, handler); } - } return handler; } /** --- 1425,1434 ----
< prev index next >