(getSystemClassLoader): Get gnu.gcj.runtime.VMClassLoader.instance
directly instead of using it to set the system field.
(loadClass): Use VMClassLoader.instance instead of system field.
(findSystemClass): Similar.
* prims.cc (_Jv_RunMain): Clear VMClassLoader::instance rather
than ClassLoader::system which no longer exists.
* java/lang/natClassLoader.java (_Jv_FindClass): Simplify.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45343
138bc75d-0d04-0410-961f-
82ee72b054a4
+2001-08-31 Per Bothner <per@bothner.com>
+
+ * java/lang/ClassLoader.java (system): Remove static field.
+ (getSystemClassLoader): Get gnu.gcj.runtime.VMClassLoader.instance
+ directly instead of using it to set the system field.
+ (loadClass): Use VMClassLoader.instance instead of system field.
+ (findSystemClass): Similar.
+ * prims.cc (_Jv_RunMain): Clear VMClassLoader::instance rather
+ than ClassLoader::system which no longer exists.
+ * java/lang/natClassLoader.java (_Jv_FindClass): Simplify.
+
2001-08-31 Tom Tromey <tromey@redhat.com>
* java/io/BufferedReader.java, java/io/ObjectInput.java,
public abstract class ClassLoader
{
- static private ClassLoader system;
private ClassLoader parent;
private HashMap definedPackages = new HashMap();
public static ClassLoader getSystemClassLoader ()
{
- if (system == null)
- system = gnu.gcj.runtime.VMClassLoader.instance;
- return system;
+ return gnu.gcj.runtime.VMClassLoader.instance;
}
/**
if (parent != null)
return parent.loadClass (name, link);
else
- c = system.findClass (name);
+ c = gnu.gcj.runtime.VMClassLoader.instance.findClass (name);
} catch (ClassNotFoundException ex) {
/* ignore, we'll try findClass */;
}
protected final Class findSystemClass(String name)
throws java.lang.ClassNotFoundException
{
- return getSystemClassLoader ().loadClass (name);
+ return gnu.gcj.runtime.VMClassLoader.instance.loadClass (name);
}
/*
}
else
{
- java::lang::ClassLoader *sys = java::lang::ClassLoader::system;
- if (sys == NULL)
- {
- _Jv_InitClass (&ClassLoaderClass);
- sys = java::lang::ClassLoader::getSystemClassLoader ();
- }
+ java::lang::ClassLoader *sys
+ = java::lang::ClassLoader::getSystemClassLoader ();
// Load using the bootstrap loader jvmspec 5.3.1.
klass = sys->loadClass (sname, false);
#include <java/lang/reflect/Modifier.h>
#include <java/io/PrintStream.h>
#include <java/lang/UnsatisfiedLinkError.h>
+#include <gnu/gcj/runtime/VMClassLoader.h>
#ifdef USE_LTDL
#include <ltdl.h>
// jar file only. The easiest way to do this is to lose our
// reference to the previous classloader.
_Jv_Jar_Class_Path = strdup (name);
- java::lang::ClassLoader::system = NULL;
+ gnu::gcj::runtime::VMClassLoader::instance = NULL;
}
}
catch (java::lang::Throwable *t)