This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
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 13:29:52 -0600
- Subject: Patch: FYI: VMSecurityManager fixlet
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk.
VMClassLoader.getSystemClassLoader() is intended for use at
initialization time only. Calling it more than once will yield
strange results.
VMSecurityManager should be calling Class.getSystemClassLoader instead;
that is what this patch does.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/VMSecurityManager.java (currentClassLoader): Don't
call VMClassLoader.getSystemClassLoader.
Index: java/lang/VMSecurityManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/VMSecurityManager.java,v
retrieving revision 1.4
diff -u -r1.4 VMSecurityManager.java
--- java/lang/VMSecurityManager.java 21 Mar 2005 14:50:14 -0000 1.4
+++ java/lang/VMSecurityManager.java 3 May 2005 19:29:59 -0000
@@ -1,6 +1,6 @@
/*
* java.lang.SecurityManager: part of the Java Class Libraries project.
- * Copyright (C) 1998, 2001, 2002 Free Software Foundation
+ * Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -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 = VMClassLoader.getSystemClassLoader();
+ ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
Class[] classStack = getClassContext (caller);
for (int i = 0; i < classStack.length; i++)
{