From efc3b511cbb097b9e8ce05a9ff44e1d8b7435528 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sat, 14 Aug 1999 12:49:06 -0700 Subject: [PATCH] resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0. 1999-08-14 Per Bothner * resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0. * java/lang/natClass.cc (initializeClass): Likewise. * java/lang/ClassLoader.java (resolveClass0): New static method. (resolveClass): Call resolveClass0. (findSystemClass): No longer static. From-SVN: r28711 --- libjava/ChangeLog | 8 ++++++++ libjava/configure.in | 2 +- libjava/java/lang/ClassLoader.java | 19 ++++++++----------- libjava/java/lang/natClass.cc | 2 +- libjava/resolve.cc | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index bcaa5c41bb0..2422a71c91c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +1999-08-14 Per Bothner + + * resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0. + * java/lang/natClass.cc (initializeClass): Likewise. + * java/lang/ClassLoader.java (resolveClass0): New static method. + (resolveClass): Call resolveClass0. + (findSystemClass): No longer static. + 1999-08-12 Alexandre Oliva * include/javaprims.h (TRUE, FALSE): Redefine as themselves. diff --git a/libjava/configure.in b/libjava/configure.in index caff68164b0..355e8f7b890 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -50,7 +50,7 @@ AC_ARG_ENABLE(interpreter, AC_DEFINE(INTERPRETER) fi) -dnl This becomes -lffi if the interpreter is enables +dnl This becomes -lffi if the interpreter is enabled. INTERPSPEC= AC_SUBST(INTERPSPEC) diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java index f0b533f6041..3135740a88e 100644 --- a/libjava/java/lang/ClassLoader.java +++ b/libjava/java/lang/ClassLoader.java @@ -23,10 +23,6 @@ import java.util.Stack; * @author Kresten Krab Thorup */ -/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * Status: Just a stub; not useful at all. - */ - public abstract class ClassLoader { static private ClassLoader system; @@ -225,16 +221,17 @@ public abstract class ClassLoader { * For historical reasons, this method has a name which is easily * misunderstood. Java classes are never ``resolved''. Classes are * linked; whereas method and field references are resolved. - *

- * FIXME: The JDK documentation declares this method - * final, we declare it static -- any - * objections? This allows us to call it directly from native code - * with less hassle. * * @param clazz the class to link. * @exception java.lang.LinkageError */ - protected static void resolveClass(Class clazz) + protected final void resolveClass(Class clazz) + throws java.lang.LinkageError + { + resolveClass0(clazz); + } + + static void resolveClass0(Class clazz) throws java.lang.LinkageError { synchronized (clazz) @@ -273,7 +270,7 @@ public abstract class ClassLoader { * @exception java.lang.LinkageError * @exception java.lang.ClassNotFoundException */ - protected native static Class findSystemClass(String name) + protected native Class findSystemClass(String name) throws java.lang.ClassNotFoundException, java.lang.LinkageError; /* diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 367f14abb0f..01058dc0e6b 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -398,7 +398,7 @@ java::lang::Class::initializeClass (void) #ifdef INTERPRETER if (_Jv_IsInterpretedClass (this)) { - java::lang::ClassLoader::resolveClass (this); + java::lang::ClassLoader::resolveClass0 (this); // Step 1. _Jv_MonitorEnter (this); diff --git a/libjava/resolve.cc b/libjava/resolve.cc index 9a48b6092b0..d5ab739833a 100644 --- a/libjava/resolve.cc +++ b/libjava/resolve.cc @@ -486,7 +486,7 @@ _Jv_PrepareClass(jclass klass) // the super class, so we use the Java method resolveClass, which will // unlock it properly, should an exception happen. - java::lang::ClassLoader::resolveClass (klass->superclass); + java::lang::ClassLoader::resolveClass0 (klass->superclass); _Jv_InterpClass *clz = (_Jv_InterpClass*)klass;