This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: FYI: VMSecurityManager fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 03 May 2005 16:07:08 -0600
- Subject: Re: Patch: FYI: VMSecurityManager fixlet
- References: <m33bt4cdlb.fsf@localhost.localdomain>
- Reply-to: tromey at redhat dot com
Tom> VMSecurityManager should be calling Class.getSystemClassLoader instead;
Tom> that is what this patch does.
Mark pointed out that this involves a security check, which is bad.
This patch updates the change to use the field from ClassLoader
instead, which has the same effect but avoids the check.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/VMSecurityManager.java (currentClassLoader): Use
'systemClasssLoader' directly.
Index: java/lang/VMSecurityManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/VMSecurityManager.java,v
retrieving revision 1.5
diff -u -r1.5 VMSecurityManager.java
--- java/lang/VMSecurityManager.java 3 May 2005 19:33:13 -0000 1.5
+++ java/lang/VMSecurityManager.java 3 May 2005 22:07:09 -0000
@@ -54,7 +54,7 @@
// The docs above are wrong. See the online docs.
// FIXME this implementation is a bit wrong too -- the docs say we
// must also consider ancestors of the system class loader.
- ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
+ ClassLoader systemClassLoader = ClassLoader.systemClassLoader;
Class[] classStack = getClassContext (caller);
for (int i = 0; i < classStack.length; i++)
{