changeset 57686:8afcea1a586e

8228548: Normalize normalization for all Reviewed-by: chegar, rhalade, igerasim
author dfuchs
date Thu, 08 Aug 2019 16:47:55 +0100
parents a1010ad4e589
children 114c4bc33596
files src/java.base/share/classes/java/net/URL.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/net/URL.java	Fri Jul 19 14:51:04 2019 +0800
+++ b/src/java.base/share/classes/java/net/URL.java	Thu Aug 08 16:47:55 2019 +0100
@@ -45,6 +45,7 @@
 
 import jdk.internal.access.JavaNetURLAccess;
 import jdk.internal.access.SharedSecrets;
+import jdk.internal.misc.VM;
 import sun.net.util.IPAddressUtil;
 import sun.security.util.SecurityConstants;
 import sun.security.action.GetPropertyAction;
@@ -1431,7 +1432,7 @@
         boolean checkedWithFactory = false;
         boolean overrideableProtocol = isOverrideable(protocol);
 
-        if (overrideableProtocol && jdk.internal.misc.VM.isBooted()) {
+        if (overrideableProtocol && VM.isBooted()) {
             // Use the factory (if any). Volatile read makes
             // URLStreamHandlerFactory appear fully initialized to current thread.
             fac = factory;
@@ -1665,7 +1666,9 @@
     }
 
     boolean isBuiltinStreamHandler(URLStreamHandler handler) {
-       return isBuiltinStreamHandler(handler.getClass().getName());
+       Class<?> handlerClass = handler.getClass();
+       return isBuiltinStreamHandler(handlerClass.getName())
+                 || VM.isSystemDomainLoader(handlerClass.getClassLoader());
     }
 
     private boolean isBuiltinStreamHandler(String handlerClassName) {