summaryrefslogtreecommitdiff
path: root/java/lang/System.java
diff options
context:
space:
mode:
authorArchie Cobbs <archie@dellroad.org>2005-01-07 15:08:21 +0000
committerArchie Cobbs <archie@dellroad.org>2005-01-07 15:08:21 +0000
commitec858596f78dd4ddc318edd3d3f4ec537780c854 (patch)
treeea7ebb6d209ae7bbc3a1c34e3bbbea043cfbc3ec /java/lang/System.java
parent53a43c88b4600340bd75f20120d26ed6afdc2065 (diff)
downloadclasspath-ec858596f78dd4ddc318edd3d3f4ec537780c854.tar.gz
Re-committing now that the 0.13 release has been tagged:
* NEWS: Document changes. * java/lang/Class.java (newInstance(), getClassLoader(), forName(String), forName(String, boolean, ClassLoader)): Use new VMStackWalker methods. * java/lang/ClassLoader.java (getParent(), getSystemClassLoader()): Likewise. * java/lang/Package.java (getPackages()): Likewise. * java/lang/SecurityManager.java (getClassContext()): Likewise. * java/util/ResourceBundle.java (getBundle()): Likewise. * java/lang/Runtime.java (load(), loadLibrary()): Load the native library using the calling class' class loader. * java/lang/System.java (load(), loadLibrary()): Likewise. (currentClassLoader()): implement via currentLoadedClass(). * vm/reference/gnu/classpath/VMStackWalker.java: New class. * vm/reference/java/lang/VMRuntime.java (nativeLoad()): Add a ClassLoader parameter. * vm/reference/java/lang/VMSecurityManager.java: Removed.
Diffstat (limited to 'java/lang/System.java')
-rw-r--r--java/lang/System.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/java/lang/System.java b/java/lang/System.java
index a639cac40..d0e32a3e5 100644
--- a/java/lang/System.java
+++ b/java/lang/System.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.lang;
+import gnu.classpath.VMStackWalker;
import gnu.classpath.SystemProperties;
import java.io.InputStream;
@@ -480,6 +481,10 @@ public final class System
* check may be performed, <code>checkLink</code>. This just calls
* <code>Runtime.getRuntime().load(filename)</code>.
*
+ * <p>
+ * The library is loaded using the class loader associated with the
+ * class associated with the invoking method.
+ *
* @param filename the code file to load
* @throws SecurityException if permission is denied
* @throws UnsatisfiedLinkError if the file cannot be loaded
@@ -487,7 +492,7 @@ public final class System
*/
public static void load(String filename)
{
- Runtime.getRuntime().load(filename);
+ Runtime.getRuntime().load(filename, VMStackWalker.getCallingClassLoader());
}
/**
@@ -495,6 +500,10 @@ public final class System
* check may be performed, <code>checkLink</code>. This just calls
* <code>Runtime.getRuntime().load(filename)</code>.
*
+ * <p>
+ * The library is loaded using the class loader associated with the
+ * class associated with the invoking method.
+ *
* @param libname the library file to load
* @throws SecurityException if permission is denied
* @throws UnsatisfiedLinkError if the file cannot be loaded
@@ -502,7 +511,8 @@ public final class System
*/
public static void loadLibrary(String libname)
{
- Runtime.getRuntime().loadLibrary(libname);
+ Runtime.getRuntime().loadLibrary(libname,
+ VMStackWalker.getCallingClassLoader());
}
/**