Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6445180

URLClassLoader does not describe the behavior of several methods with respect to null arguments

    XMLWordPrintable

Details

    • b115
    • generic
    • generic
    • Verified

    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.

      Attachments

        Issue Links

          Activity

            People

              bpb Brian Burkhalter
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: