< prev index next >

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

Print this page
8198810: URLClassLoader does not specify behavior when URL array contains null
Reviewed-by: alanb, darcy, dholmes

*** 103,113 **** * @param urls the URLs from which to load classes and resources * @param parent the parent class loader for delegation * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. ! * @exception NullPointerException if {@code urls} is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls, ClassLoader parent) { super(parent); // this is to make the stack depth consistent with 1.1 --- 103,114 ---- * @param urls the URLs from which to load classes and resources * @param parent the parent class loader for delegation * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. ! * @exception NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls, ClassLoader parent) { super(parent); // this is to make the stack depth consistent with 1.1
*** 147,157 **** * @param urls the URLs from which to load classes and resources * * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. ! * @exception NullPointerException if {@code urls} is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls) { super(); // this is to make the stack depth consistent with 1.1 --- 148,159 ---- * @param urls the URLs from which to load classes and resources * * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. ! * @exception NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls) { super(); // this is to make the stack depth consistent with 1.1
*** 190,200 **** * @param factory the URLStreamHandlerFactory to use when creating URLs * * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. ! * @exception NullPointerException if {@code urls} is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) { super(parent); --- 192,203 ---- * @param factory the URLStreamHandlerFactory to use when creating URLs * * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. ! * @exception NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) { super(parent);
*** 219,229 **** * @param name class loader name; or {@code null} if not named * @param urls the URLs from which to load classes and resources * @param parent the parent class loader for delegation * * @throws IllegalArgumentException if the given name is empty. ! * @throws NullPointerException if {@code urls} is {@code null}. * * @throws SecurityException if a security manager exists and its * {@link SecurityManager#checkCreateClassLoader()} method doesn't * allow creation of a class loader. * --- 222,233 ---- * @param name class loader name; or {@code null} if not named * @param urls the URLs from which to load classes and resources * @param parent the parent class loader for delegation * * @throws IllegalArgumentException if the given name is empty. ! * @throws NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * * @throws SecurityException if a security manager exists and its * {@link SecurityManager#checkCreateClassLoader()} method doesn't * allow creation of a class loader. *
*** 254,264 **** * @param urls the URLs from which to load classes and resources * @param parent the parent class loader for delegation * @param factory the URLStreamHandlerFactory to use when creating URLs * * @throws IllegalArgumentException if the given name is empty. ! * @throws NullPointerException if {@code urls} is {@code null}. * * @throws SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. * --- 258,269 ---- * @param urls the URLs from which to load classes and resources * @param parent the parent class loader for delegation * @param factory the URLStreamHandlerFactory to use when creating URLs * * @throws IllegalArgumentException if the given name is empty. ! * @throws NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * * @throws SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. *
*** 803,813 **** * {@code SecurityManager.checkPackageAccess} method before * loading the class. * * @param urls the URLs to search for classes and resources * @param parent the parent class loader for delegation ! * @exception NullPointerException if {@code urls} is {@code null}. * @return the resulting class loader */ public static URLClassLoader newInstance(final URL[] urls, final ClassLoader parent) { // Save the caller's context --- 808,819 ---- * {@code SecurityManager.checkPackageAccess} method before * loading the class. * * @param urls the URLs to search for classes and resources * @param parent the parent class loader for delegation ! * @exception NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * @return the resulting class loader */ public static URLClassLoader newInstance(final URL[] urls, final ClassLoader parent) { // Save the caller's context
*** 829,839 **** * returned by this method will invoke the * {@code SecurityManager.checkPackageAccess} before * loading the class. * * @param urls the URLs to search for classes and resources ! * @exception NullPointerException if {@code urls} is {@code null}. * @return the resulting class loader */ public static URLClassLoader newInstance(final URL[] urls) { // Save the caller's context final AccessControlContext acc = AccessController.getContext(); --- 835,846 ---- * returned by this method will invoke the * {@code SecurityManager.checkPackageAccess} before * loading the class. * * @param urls the URLs to search for classes and resources ! * @exception NullPointerException if {@code urls} or any of its ! * elements is {@code null}. * @return the resulting class loader */ public static URLClassLoader newInstance(final URL[] urls) { // Save the caller's context final AccessControlContext acc = AccessController.getContext();
< prev index next >