diff options
author | Archie Cobbs <archie@dellroad.org> | 2005-11-13 22:29:45 +0000 |
---|---|---|
committer | Archie Cobbs <archie@dellroad.org> | 2005-11-13 22:29:45 +0000 |
commit | a9803e6ab1ddd09af08d1ac31e9b17580a06ecd2 (patch) | |
tree | 1e1169d6aad17820ac367bda311f07c8b4f5451d /vm | |
parent | c021a6305fabb7861712842ddca5534eb9a8ba89 (diff) | |
download | classpath-a9803e6ab1ddd09af08d1ac31e9b17580a06ecd2.tar.gz |
* vm/reference/gnu/classpath/VMStackWalker.java (getClassLoader()):
added to fix an infinite loop bug.
* NEWS: note VM interface change.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/reference/gnu/classpath/VMStackWalker.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/vm/reference/gnu/classpath/VMStackWalker.java b/vm/reference/gnu/classpath/VMStackWalker.java index 28e4ce364..e995c4634 100644 --- a/vm/reference/gnu/classpath/VMStackWalker.java +++ b/vm/reference/gnu/classpath/VMStackWalker.java @@ -88,9 +88,9 @@ public final class VMStackWalker /** * Get the class loader associated with the Class returned by - * <code>getCallingClass()</code>, or <code>null</code> if no - * such class exists or it is the boot loader. This method is an optimization - * for the expression <code>getClassContext()[1].getClassLoader()</code> + * <code>getCallingClass()</code>, or <code>null</code> if no such class + * exists or it is the boot loader. This method is an optimization for the + * expression <code>VMStackWalker.getClassLoader(getClassContext()[1])</code> * and should return the same result. * * <p> @@ -102,7 +102,15 @@ public final class VMStackWalker Class[] ctx = getClassContext(); if (ctx.length < 3) return null; - return ctx[2].getClassLoader(); + return getClassLoader(ctx[2]); } + + /** + * Retrieve the class's ClassLoader, or <code>null</code> if loaded + * by the bootstrap loader. I.e., this should return the same thing + * as {@link java.lang.VMClass#getClassLoader}. This duplicate version + * is here to work around access permissions. + */ + public static native ClassLoader getClassLoader(Class cl); } |