aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/Class.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang/Class.java')
-rw-r--r--libjava/java/lang/Class.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index 60ca457..66b85c7 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -111,6 +111,14 @@ public final class Class implements Serializable
public static native Class forName (String className)
throws ClassNotFoundException;
+ // A private internal method that is called by compiler-generated code.
+ private static Class forName (String className, Class caller)
+ throws ClassNotFoundException
+ {
+ return forName(className, true, caller.getClassLoader());
+ }
+
+
/**
* Use the specified classloader to load and link a class. If the loader
* is null, this uses the bootstrap class loader (provide the security
@@ -185,6 +193,9 @@ public final class Class implements Serializable
*/
public native ClassLoader getClassLoader ();
+ // A private internal method that is called by compiler-generated code.
+ private final native ClassLoader getClassLoader (Class caller);
+
/**
* If this is an array, get the Class representing the type of array.
* Examples: "[[Ljava.lang.String;" would return "[Ljava.lang.String;", and