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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user