diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-29 21:47:03 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-29 21:47:03 +0000 |
| commit | 0b4f89526f1baa557ba3c36d81fde3d824dbcb03 (patch) | |
| tree | 2abee51b1df7b032736542aa6b0c8f6705c0fe41 /libjava/gnu | |
| parent | 1746a7627411f6bea920386ec6f295056c16f18a (diff) | |
| download | ppe42-gcc-0b4f89526f1baa557ba3c36d81fde3d824dbcb03.tar.gz ppe42-gcc-0b4f89526f1baa557ba3c36d81fde3d824dbcb03.zip | |
libjava:
* java/lang/natRuntime.cc (insertSystemProperties): Set
gnu.gcj.runtime.endorsed.dirs.
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Added
HelperClassLoader.java.
(AM_CXXFLAGS): Define GCJ_ENDORSED_DIRS.
* gnu/gcj/runtime/VMClassLoader.java (VMClassLoader): Extends
HelperClassLoader.
(init): Use addDirectoriesFromProperty.
* gnu/gcj/runtime/BootClassLoader.java (BootClassLoader): Extends
HelperClassLoader. Use addDirectoriesFromProperty. Handle
gnu.gcj.runtime.endorsed.dirs.
* gnu/gcj/runtime/HelperClassLoader.java: New file.
gcc/java:
* gcj.texi (libgcj Runtime Properties): Document
gnu.gcj.runtime.endorsed.dirs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97207 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
| -rw-r--r-- | libjava/gnu/gcj/runtime/BootClassLoader.java | 36 | ||||
| -rw-r--r-- | libjava/gnu/gcj/runtime/VMClassLoader.java | 47 |
2 files changed, 9 insertions, 74 deletions
diff --git a/libjava/gnu/gcj/runtime/BootClassLoader.java b/libjava/gnu/gcj/runtime/BootClassLoader.java index e25f21f8841..d2091720a4f 100644 --- a/libjava/gnu/gcj/runtime/BootClassLoader.java +++ b/libjava/gnu/gcj/runtime/BootClassLoader.java @@ -8,14 +8,9 @@ details. */ package gnu.gcj.runtime; -import java.io.File; -import java.io.FilenameFilter; import java.io.IOException; import java.net.URL; -import java.net.URLClassLoader; import java.util.Enumeration; -import java.util.HashSet; -import java.util.StringTokenizer; /** * This is a helper for the bootstrap class loader. It is a @@ -24,37 +19,18 @@ import java.util.StringTokenizer; * However, it is never called the way that an ordinary ClassLoader is * called. For instance, loadClass() is never used. */ -public final class BootClassLoader extends URLClassLoader +public final class BootClassLoader extends HelperClassLoader { BootClassLoader(String libdir) { - super(new URL[0]); + addDirectoriesFromProperty("java.endorsed.dirs"); + addDirectoriesFromProperty("gnu.gcj.runtime.endorsed.dirs"); - // Add the contents of the endorsed directories. - StringTokenizer st - = new StringTokenizer (System.getProperty ("java.endorsed.dirs", ""), - File.pathSeparator); try { - while (st.hasMoreElements ()) - { - String dirname = st.nextToken (); - File dir = new File (dirname); - if (dir.exists ()) - { - if (! dirname.endsWith (File.separator)) - dirname = dirname + File.separator; - String files[] = dir.list (new FilenameFilter () - { - public boolean accept (File dir, String name) - { - return name.endsWith (".jar") || name.endsWith (".zip"); - } - }); - for (int i = files.length - 1; i >= 0; i--) - addURL(new URL("file", "", -1, dirname + files[i])); - } - } + // Add core:/ to the end so any resources compiled into this + // executable may be found. + addURL(new URL("core", "", -1, "/")); } catch (java.net.MalformedURLException x) { diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java index 1ded892a06d..1ed0c026cf8 100644 --- a/libjava/gnu/gcj/runtime/VMClassLoader.java +++ b/libjava/gnu/gcj/runtime/VMClassLoader.java @@ -10,20 +10,16 @@ details. */ package gnu.gcj.runtime; -import java.io.*; -import java.util.StringTokenizer; -import java.util.HashSet; import java.net.URL; -import java.net.URLClassLoader; +import java.util.HashSet; // Despite its name, this class is really the extension loader for // libgcj. Class loader bootstrap is a bit tricky, see prims.cc and // SystemClassLoader for some details. -public final class VMClassLoader extends URLClassLoader +public final class VMClassLoader extends HelperClassLoader { private VMClassLoader () { - super (new URL[0]); String p = System.getProperty ("gnu.gcj.runtime.VMClassLoader.library_control", ""); @@ -39,44 +35,7 @@ public final class VMClassLoader extends URLClassLoader private void init() { - // Add the contents of the extensions directories. - StringTokenizer st - = new StringTokenizer (System.getProperty ("java.ext.dirs"), - File.pathSeparator); - - try - { - while (st.hasMoreElements ()) - { - String dirname = st.nextToken (); - File dir = new File (dirname); - if (dir.exists ()) - { - if (! dirname.endsWith (File.separator)) - dirname = dirname + File.separator; - String files[] - = dir.list (new FilenameFilter () - { - public boolean accept (File dir, String name) - { - return (name.endsWith (".jar") - || name.endsWith (".zip")); - } - }); - for (int i = files.length - 1; i >= 0; i--) - addURL(new URL("file", "", -1, dirname + files[i])); - } - } - - // Add core:/ to the end so any resources compiled into this - // executable may be found. - addURL(new URL("core", "", -1, "/")); - } - catch (java.net.MalformedURLException x) - { - // This should never happen. - throw new RuntimeException(x); - } + addDirectoriesFromProperty("java.ext.dirs"); } /** This is overridden to search the internal hash table, which |

