]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2004-01-11 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Sun, 11 Jan 2004 14:07:36 +0000 (14:07 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Sun, 11 Jan 2004 14:07:36 +0000 (14:07 +0000)
* gnu/java/lang/reflect/TypeSignature.java
(getEncodingOfClass): Documentation fixed.
(getClassForEncoding): Give class loader to Class.forName().
Documentation fixed.

From-SVN: r75675

libjava/ChangeLog
libjava/gnu/java/lang/reflect/TypeSignature.java

index c1d1f9f2e248ac2606f0a26f526ebe0aa7c2a345..c5c273ac9eedad9f2e91f02ced237bfe11ab7acd 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-11  Michael Koch  <konqueror@gmx.de>
+
+       * gnu/java/lang/reflect/TypeSignature.java
+       (getEncodingOfClass): Documentation fixed.
+       (getClassForEncoding): Give class loader to Class.forName().
+       Documentation fixed.
+
 2004-01-11  Sascha Brawer  <brawer@dandelis.ch>
 
        * javax/swing/undo/CompoundEdit.java (serialVersionUID): Added.
index 1cf55a698e929b066a9cbd5a89c07ffd3d35a7a5..714160c18713eef75248c0260799411b95c205a2 100644 (file)
@@ -1,5 +1,5 @@
 /* TypeSignature.java -- Class used to compute type signatures
-   Copyright (C) 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -139,7 +139,10 @@ public class TypeSignature
    * accepts both object and descriptor formats, but must know which style
    * of string is being passed in (usually, descriptor should be true). In
    * descriptor format, "I" is treated as int.class, in object format, it
-   * is treated as a class named I in the unnamed package.
+   * is treated as a class named I in the unnamed package. This method is
+   * strictly equivalent to {@link #getClassForEncoding(java.lang.String, boolean, java.lang.ClassLoader)}
+   * with a class loader equal to <code>null</code>. In that case, it
+   * uses the default class loader on the calling stack.
    *
    * @param type_code the class name to decode
    * @param descriptor if the string is in descriptor format
@@ -156,21 +159,22 @@ public class TypeSignature
   /**
    * This function is the inverse of <code>getEncodingOfClass</code>. This
    * accepts both object and descriptor formats, but must know which style
-   * of string is being passed in (usually, descriptor should be true).In
+   * of string is being passed in (usually, descriptor should be true). In
    * descriptor format, "I" is treated as int.class, in object format, it
-   * is treated as a class named I in the unnamed package. It also
-  * accepts a <code>ClassLoader</code>, which is used to load the class.
+   * is treated as a class named I in the unnamed package.
    *
-   * @param type_code the class name to decode
-   * @param descriptor if the string is in descriptor format
-   * @param loader the class loader used to load the class
-   * @return the corresponding Class object
-   * @throws ClassNotFoundException if the class cannot be located
+   * @param type_code The class name to decode.
+   * @param descriptor If the string is in descriptor format.
+   * @param loader The class loader when resolving generic object name. If
+   * <code>loader</code> is null then it uses the default class loader on the
+   * calling stack.
+   * @return the corresponding Class object.
+   * @throws ClassNotFoundException if the class cannot be located.
    * @see #getEncodingOfClass(Class, boolean)
    * @see #getClassForEncoding(String, boolean)
    */
   public static Class getClassForEncoding(String type_code, boolean descriptor,
-                                         ClassLoader loader)
+                                         ClassLoader loader)
     throws ClassNotFoundException
   {
     if (descriptor)
@@ -204,7 +208,7 @@ public class TypeSignature
           case '[':
           }
       }
-    return Class.forName(type_code.replace('/', '.'));
+    return Class.forName(type_code.replace('/', '.'), true, loader);
   }
 
   /**