jdk/src/java.base/share/classes/java/net/URL.java
changeset 43800 1dc22b50717a
parent 43199 e7fc78485b36
child 46096 62c77b334012
equal deleted inserted replaced
43799:0e642fbacb25 43800:1dc22b50717a
     1 /*
     1 /*
     2  * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    39 import java.util.Locale;
    39 import java.util.Locale;
    40 import java.util.NoSuchElementException;
    40 import java.util.NoSuchElementException;
    41 import java.util.ServiceConfigurationError;
    41 import java.util.ServiceConfigurationError;
    42 import java.util.ServiceLoader;
    42 import java.util.ServiceLoader;
    43 
    43 
       
    44 import jdk.internal.misc.JavaNetURLAccess;
       
    45 import jdk.internal.misc.SharedSecrets;
    44 import sun.security.util.SecurityConstants;
    46 import sun.security.util.SecurityConstants;
    45 import sun.security.action.GetPropertyAction;
    47 import sun.security.action.GetPropertyAction;
    46 
    48 
    47 /**
    49 /**
    48  * Class {@code URL} represents a Uniform Resource
    50  * Class {@code URL} represents a Uniform Resource
  1612     }
  1614     }
  1613 
  1615 
  1614     private void setSerializedHashCode(int hc) {
  1616     private void setSerializedHashCode(int hc) {
  1615         this.hashCode = hc;
  1617         this.hashCode = hc;
  1616     }
  1618     }
       
  1619 
       
  1620     static {
       
  1621         SharedSecrets.setJavaNetURLAccess(
       
  1622                 new JavaNetURLAccess() {
       
  1623                     @Override
       
  1624                     public URLStreamHandler getHandler(URL u) {
       
  1625                         return u.handler;
       
  1626                     }
       
  1627                 }
       
  1628         );
       
  1629     }
  1617 }
  1630 }
  1618 
  1631 
  1619 final class UrlDeserializedState {
  1632 final class UrlDeserializedState {
  1620     private final String protocol;
  1633     private final String protocol;
  1621     private final String host;
  1634     private final String host;