From c1527d134cfa758f6be915a96914c717f9ceca34 Mon Sep 17 00:00:00 2001 From: mkoch Date: Tue, 16 Dec 2003 11:35:40 +0000 Subject: 2003-12-16 Guilhem Lavaux Helmer Kraemer * gnu/java/lang/reflect/TypeSignature.java (getClassForEncoding): Splitted the method so we can specify an explicit boot loader. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74687 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/java/lang/reflect/TypeSignature.java | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'libjava/gnu/java') diff --git a/libjava/gnu/java/lang/reflect/TypeSignature.java b/libjava/gnu/java/lang/reflect/TypeSignature.java index e9c8861c611..1cf55a698e9 100644 --- a/libjava/gnu/java/lang/reflect/TypeSignature.java +++ b/libjava/gnu/java/lang/reflect/TypeSignature.java @@ -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. @@ -149,6 +149,29 @@ public class TypeSignature */ public static Class getClassForEncoding(String type_code, boolean descriptor) throws ClassNotFoundException + { + return getClassForEncoding(type_code, descriptor, null); + } + + /** + * This function is the inverse of getEncodingOfClass. 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 ClassLoader, 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) { -- cgit v1.2.3