diff options
Diffstat (limited to 'java/lang/System.java')
| -rw-r--r-- | java/lang/System.java | 14 |
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()); } /** |
