JDK-6445180 : URLClassLoader does not describe the behavior of several methods with respect to null arguments
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-29
  • Updated: 2014-01-10
  • Resolved: 2013-10-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b115Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
URLClassLoader is not describes behavior of several methods in case null arguments.

This methods are:

public URLClassLoader(URL[] urls)
URLClassLoader(URL[] urls, ClassLoader parent)
URLClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
protected void addURL(URL url)
protected Class<?> findClass(String name) throws ClassNotFoundException
protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException
public URL findResource(String name)
public Enumeration<URL> findResources(String name) throws IOException
protected PermissionCollection getPermissions(CodeSource codesource)
public static URLClassLoader newInstance(URL[] urls, ClassLoader parent)
public static URLClassLoader newInstance(URL[] urls)


From "Requirements for Writing Java API Specifications":
For each reference type argument, specify the behavior when null is passed in. If possible, document the general null argument behavior at the package or class level, such as causing a java.lang.NullPointerException to be thrown. Deviations from this behavior can then be documented at the method level.

See: http://java.sun.com/j2se/javadoc/writingapispecs/index.html#method

I'm searching for such documentations and found nothing. URLClassLoader itself, as well as methods documentation and package (java.net) documentation all hasn't such information.

So, we can assume that all methods will feel O.K. in case null argument(s). That most likely isn't true.

Comments
Verified in b122, attached regression test test/java/net/URLClassLoader/NullURLTest.java passed
10-01-2014