diff options
| author | Kresten Krab Thorup <krab@gnu.org> | 1999-08-18 14:16:42 +0000 |
|---|---|---|
| committer | Kresten Krab Thorup <krab@gcc.gnu.org> | 1999-08-18 14:16:42 +0000 |
| commit | eb4534a63677aa47ec9e5cc460617622b905d736 (patch) | |
| tree | 3bcaf8f2877d654d67d3e2cc982a85a71299ca35 /libjava/gnu/gcj/runtime/VMClassLoader.java | |
| parent | 312f625598f2eed11718c43a649027bc760ef30a (diff) | |
natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed from _Jv_InternClassStrings.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed
from _Jv_InternClassStrings.
* prims.cc (_Jv_RunMain): New function.
(JvRunMain): Remove gij-support.
* gij.cc (main): Use _Jv_RunMain.
* java/util/zip/ZipFile.java: Call readDirectory in constructor.
* interpret.cc (PUSHA, PUSHI, PUSHF, PUSHL, PUSHD): Don't store
argument in temp variable.
(continue1): For all op_x2y insns, use temp variable for
intermediate value. Also remove some comments.
* java/lang/natClass.cc (newInstance): Call _Jv_InitClass.
(forName): Don't call _Jv_InitClass.
* java/lang/Class.java (getResource,getResourceAsStream): Implement.
* java/util/zip/ZipEntry.java (ZipEntry(ZipEntry)): New construcor.
* java/util/jar/JarInputStream.java: New file.
* java/util/jar/JarEntry.java: New file.
* java/util/jar/JarFile.java: New file.
* java/net/URLClassLoader.java: New file.
* java/net/JarURLConnection.java: New file.
* gnu/gcj/protocol/jar/Handler.java: New file.
* gnu/gcj/protocol/jar/Connection.java: New file.
* java/security/SecureClassLoader.java: New file.
* java/lang/ClassLoader.java (parent): New variable.
(ClassLoader (ClassLoader)): new constructor.
(findClass): New method.
(loadClass): Add default 1.2 implementation.
(getSystemResourceAsBytes, getResourceAsBytes): Removed.
(readfully): Removed.
* gnu/gcj/runtime/VMClassLoader.java: Moved from java/lang.
(findSystemClass): New method.
(VMClassLoader): Constructor rewritten.
(init): New method.
All other methods removed.
* java/lang/natClassLoader.cc: Change use of java::lang::VMClassLoader
to gnu::gcj::runtime::VMClassLoader.
(_Jv_InternClassStrings): Use _Jv_ResolvePoolEntry. Also handle
class entries.
(VMClassLoader::findSystemClass): renamed from findBootClass.
* Makefile.am: Add new files.
(FirstThread.h, ThreadGroup.h): Add _Jv_Main friend.
* Makefile.in: Rebuilt.
From-SVN: r28748
Diffstat (limited to 'libjava/gnu/gcj/runtime/VMClassLoader.java')
| -rw-r--r-- | libjava/gnu/gcj/runtime/VMClassLoader.java | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java new file mode 100644 index 00000000000..bfdb3627073 --- /dev/null +++ b/libjava/gnu/gcj/runtime/VMClassLoader.java @@ -0,0 +1,62 @@ +/* Copyright (C) 1999 Cygnus Solutions + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +/* Author: Kresten Krab Thorup <krab@gnu.org> */ + +package gnu.gcj.runtime; + +import java.io.*; +import java.util.StringTokenizer; +import java.net.URL; + +final class VMClassLoader extends java.net.URLClassLoader +{ + private VMClassLoader () + { + super (init()); + } + + private static URL[] init() + { + StringTokenizer st + = new StringTokenizer (System.getProperty ("java.class.path", "."), + System.getProperty ("path.separator", ":")); + + java.util.Vector p = new java.util.Vector(); + while (st.hasMoreElements ()) + { + String e = st.nextToken (); + try + { + if (e.endsWith(".jar") || e.endsWith (".zip")) + p.addElement(new URL("jar", "", -1, "file:///"+e+"!/")); + else if (e.endsWith ("/")) + p.addElement (new URL("file", "", -1, e)); + else if (new File (e).isDirectory ()) + p.addElement (new URL("file", "", -1, e + "/")); + else + /* Ignore path element. */; + } + catch (java.net.MalformedURLException x) + { + /* Ignore this path element */ + } + } + + URL[] urls = new URL[p.size()]; + p.copyInto (urls); + return urls; + } + + /** This is overridden to search the internal hash table, which + * will only search existing linked-in classes. This will make + * the default implementation of loadClass (in ClassLoader) work right. + */ + protected final native Class findSystemClass(String name) + throws java.lang.ClassNotFoundException, java.lang.LinkageError; +} |
