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

incomplete doc for RMIClassLoader.loadClass(String)

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.6



      Name: sdR10048 Date: 12/04/2000


      Javadoc for method
      java.rmi.server.RMIClassLoader.loadClass(String name)
      says:

      public static Class loadClass(String name)
                             throws MalformedURLException,
                                    ClassNotFoundException

           Deprecated. replaced by loadClass(String,String) method

           Loads a class from the codebase URL path specified by the
           java.rmi.server.codebase property.
           Parameters:
               name - the name of the class to load
           Returns:
               the Class object representing the loaded class
           Throws:
               MalformedURLException - if the system property
                   java.rmi.server.codebase contains an invalid URL
               ClassNotFoundException - if a definition for the class could
                   not be found at the codebase location
           Since:
               JDK1.1
           See Also:
               loadClass(String,String)

      but it does not specify method behaviour if java.rmi.server.codebase
      property is unset (null). Yep, this is the doc incompleteness in
      deprecated method, but docs for other methods: loadClass(String,
      String), loadClass(URL, String), getClassLoader(String) have
      references into it and relay on it.
      See bellow:

      public static Class loadClass(URL codebase,
                                    String name)
                             throws MalformedURLException,
                                    ClassNotFoundException

           Loads a class from a codebase URL. If the given codebase is null,
           then the Class object returned is equivalent to the Class object
           returned by RMIClassLoader.loadClass(name).
                                      ^^^^^^^^^^^^^^^
           Parameters:
               codebase - the URL to load the class from
               name - the name of the class to load
           Returns:
               the Class object representing the loaded class
           Throws:
               MalformedURLException - if the codebase paramater contains an
                        invalid non-null URL
               ClassNotFoundException - if a definition for the class could
                        not be found at the specified URL
           Since:
               JDK1.1

      public static ClassLoader getClassLoader(String codebase)
                                        throws MalformedURLException,
                                               SecurityException

           Returns a class loader that loads classes from the given codebase
           URL path. The class loader returned is the class loader that the
           #loadClass(String,String) method would use to load classes from
           the given codebase. If a class loader with the same codebase URL
           path already exists for RMI runtime, it will be returned;
           otherwise, a new class loader will be created. If the given
           codebase is null, it returns the class loader used to load
           classes via the #loadClass(String) method.
                           ^^^^^^^^^^^^^^^^^^
           Parameters:
               codebase - the list of space-separated URLs which the the
                       class loader will load classes from
           Returns:
               a class loader that loads classes from the given codebase URL
                       path
           Throws:
               MalformedURLException - if the codebase paramater contains an
                       invalid non-null URL
               SecurityException - if the caller does not have permission to
                       connect to all of the URLs in codebase
               URL path
           Since:
               1.3

      Thus javadoc for this method should be completed or otherwise all
      related methods should be updated accordingly since loadClass(String)
      is deprecated.

      ======================================================================

            peterjones Peter Jones (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: