Class.h (_Jv_CopyClassesToSystemLoader): Updated.

* java/lang/Class.h (_Jv_CopyClassesToSystemLoader): Updated.
	* java/lang/natClassLoader.cc (_Jv_CopyClassesToSystemLoader):
	Changed argument type.  Use SystemClassLoader.addClass.
	* gnu/gcj/runtime/SystemClassLoader.java (addClass): New method.

From-SVN: r109340
This commit is contained in:
Tom Tromey
2006-01-04 17:59:40 +00:00
committed by Tom Tromey
parent a8c253d020
commit 2fb1388876
4 changed files with 49 additions and 7 deletions
+20 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2005 Free Software Foundation
/* Copyright (C) 2005, 2006 Free Software Foundation
This file is part of libgcj.
@@ -21,6 +21,25 @@ public final class SystemClassLoader extends URLClassLoader
super(new URL[0], parent);
}
// This is called to register a native class which was linked into
// the application but which is registered with the system class
// loader after the VM is initialized.
void addClass(Class klass)
{
String packageName = null;
String className = klass.getName();
int lastDot = className.lastIndexOf('.');
if (lastDot != -1)
packageName = className.substring(0, lastDot);
if (packageName != null && getPackage(packageName) == null)
{
// Should have some way to store this information in a
// precompiled manifest.
definePackage(packageName, null, null, null, null, null, null, null);
}
loadedClasses.put(className, klass);
}
// We add the URLs to the system class loader late. The reason for
// this is that during bootstrap we don't want to parse URLs or
// create URL connections, since that will result in circularities