aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/VMClassLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang/VMClassLoader.java')
-rw-r--r--libjava/java/lang/VMClassLoader.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/libjava/java/lang/VMClassLoader.java b/libjava/java/lang/VMClassLoader.java
index c0739ba..dfbfba4 100644
--- a/libjava/java/lang/VMClassLoader.java
+++ b/libjava/java/lang/VMClassLoader.java
@@ -53,6 +53,7 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
+import gnu.gcj.runtime.BootClassLoader;
/**
* java.lang.VMClassLoader is a package-private helper for VMs to implement
@@ -82,6 +83,10 @@ final class VMClassLoader
static final HashMap definedPackages = new HashMap();
+ // This is a helper for handling java.endorsed.dirs. It is null
+ // until we've initialized the system, at which point it is created.
+ static BootClassLoader bootLoader;
+
/**
* Helper to define a class using a string of bytes. This assumes that
* the security checks have already been performed, if necessary.
@@ -153,6 +158,8 @@ final class VMClassLoader
*/
static URL getResource(String name)
{
+ if (bootLoader != null)
+ return bootLoader.bootGetResource(name);
return null;
}
@@ -168,6 +175,8 @@ final class VMClassLoader
*/
static Enumeration getResources(String name) throws IOException
{
+ if (bootLoader != null)
+ return bootLoader.bootGetResources(name);
return EmptyEnumeration.getInstance();
}
@@ -287,6 +296,8 @@ final class VMClassLoader
static native ClassLoader getSystemClassLoaderInternal();
+ static native void initBootLoader(String libdir);
+
static ClassLoader getSystemClassLoader()
{
// This method is called as the initialization of systemClassLoader,
@@ -310,6 +321,7 @@ final class VMClassLoader
+ loader, ex);
}
}
+
return default_sys;
}
}