This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: gnu.java.lang.reflect.TypeSignature


Hi list,


I commited the attach patch from Guilhem Lavaux (which was already commited to 
classpath some time ago) to add a method that allows to use a non-standard 
classloader.


Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2439
diff -u -b -B -r1.2439 ChangeLog
--- ChangeLog	11 Dec 2003 16:12:46 -0000	1.2439
+++ ChangeLog	16 Dec 2003 11:18:03 -0000
@@ -1,3 +1,9 @@
+2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
+           Helmer Kraemer <hkraemer@freenet.de>
+ 
+	* gnu/java/lang/reflect/TypeSignature.java (getClassForEncoding):
+	Splitted the method so we can specify an explicit boot loader.
+
 2003-12-11  Michael Koch  <konqueror@gmx.de>
 
 	* java/text/Format.java (serialVersionUID): Fixed value.
Index: gnu/java/lang/reflect/TypeSignature.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/lang/reflect/TypeSignature.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 TypeSignature.java
--- gnu/java/lang/reflect/TypeSignature.java	30 Sep 2002 05:19:08 -0000	1.3
+++ gnu/java/lang/reflect/TypeSignature.java	16 Dec 2003 11:18:03 -0000
@@ -1,5 +1,5 @@
 /* TypeSignature.java -- Class used to compute type signatures
-   Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -148,6 +148,29 @@
    * @see #getEncodingOfClass(Class, boolean)
    */
   public static Class getClassForEncoding(String type_code, boolean descriptor)
+    throws ClassNotFoundException
+  {
+    return getClassForEncoding(type_code, descriptor, null);
+  }
+
+  /**
+   * 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
+   * 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.
+   *
+   * @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
+   * @see #getEncodingOfClass(Class, boolean)
+   * @see #getClassForEncoding(String, boolean)
+   */
+  public static Class getClassForEncoding(String type_code, boolean descriptor,
+					  ClassLoader loader)
     throws ClassNotFoundException
   {
     if (descriptor)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]