jdk/src/java.base/share/classes/java/net/URLClassLoader.java
changeset 37311 9ceaae6762fd
parent 36674 7ab530dd6f10
child 39638 c228d5b513eb
equal deleted inserted replaced
37310:eb1dccfaaa3c 37311:9ceaae6762fd
   463             return defineClass(name, b, 0, b.length, cs);
   463             return defineClass(name, b, 0, b.length, cs);
   464         }
   464         }
   465     }
   465     }
   466 
   466 
   467     /**
   467     /**
   468      * Defines a new package by name in this ClassLoader. The attributes
   468      * Defines a new package by name in this {@code URLClassLoader}.
   469      * contained in the specified Manifest will be used to obtain package
   469      * The attributes contained in the specified {@code Manifest}
   470      * version and sealing information. For sealed packages, the additional
   470      * will be used to obtain package version and sealing information.
   471      * URL specifies the code source URL from which the package was loaded.
   471      * For sealed packages, the additional URL specifies the code source URL
       
   472      * from which the package was loaded.
   472      *
   473      *
   473      * @param name  the package name
   474      * @param name  the package name
   474      * @param man   the Manifest containing package version and sealing
   475      * @param man   the {@code Manifest} containing package version and sealing
   475      *              information
   476      *              information
   476      * @param url   the code source url for the package, or null if none
   477      * @param url   the code source url for the package, or null if none
   477      * @exception   IllegalArgumentException if the package name duplicates
   478      * @throws      IllegalArgumentException if the package name is
   478      *              an existing package either in this class loader or one
   479      *              already defined by this class loader
   479      *              of its ancestors
   480      * @return      the newly defined {@code Package} object
   480      * @return the newly defined Package object
   481      */
   481      */
   482     protected Package definePackage(String name, Manifest man, URL url) {
   482     protected Package definePackage(String name, Manifest man, URL url)
       
   483         throws IllegalArgumentException
       
   484     {
       
   485         String path = name.replace('.', '/').concat("/");
   483         String path = name.replace('.', '/').concat("/");
   486         String specTitle = null, specVersion = null, specVendor = null;
   484         String specTitle = null, specVersion = null, specVendor = null;
   487         String implTitle = null, implVersion = null, implVendor = null;
   485         String implTitle = null, implVersion = null, implVendor = null;
   488         String sealed = null;
   486         String sealed = null;
   489         URL sealBase = null;
   487         URL sealBase = null;