This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix Security provider class loader
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 01 Feb 2006 18:05:07 -0700
- Subject: Patch: FYI: fix Security provider class loader
- Reply-to: tromey at redhat dot com
I'm checking this in on the 4.1 branch.
I put this in Classpath a little while ago.
This changes Security to load providers via the system class loader.
This is correct according to the JCE spec. Also it lets us put
providers into the extensions directory and not the endorsed
directory, as we had been doing.
Tom
2006-02-01 Tom Tromey <tromey@redhat.com>
* java/security/Security.java (loadProviders): Use system class
loader.
Index: java/security/Security.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/security/Security.java,v
retrieving revision 1.41
diff -u -r1.41 Security.java
--- java/security/Security.java 19 Jan 2006 09:51:53 -0000 1.41
+++ java/security/Security.java 2 Feb 2006 01:05:19 -0000
@@ -133,7 +133,8 @@
Exception exception = null;
try
{
- providers.addElement(Class.forName(name).newInstance());
+ ClassLoader sys = ClassLoader.getSystemClassLoader();
+ providers.addElement(Class.forName(name, true, sys).newInstance());
}
catch (ClassNotFoundException x)
{