This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: fix Security provider class loader


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)
 	      {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]