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: javax.naming patch


I'm checking this in on the trunk.

This is a javax.naming fix from Classpath.

Tom

Index: ChangeLog
from  Dalibor Topic <robilad@kaffe.org>,
	Helmer Kraemer <hkraemer@freenet.de>

	* javax/naming/spi/NamingManager.java (getURLContext,
	getObjectInstance, getStateToBind): Always use current thread's
	context class loader when calling Class.forName.

Index: javax/naming/spi/NamingManager.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/naming/spi/NamingManager.java,v
retrieving revision 1.3
diff -u -r1.3 NamingManager.java
--- javax/naming/spi/NamingManager.java 13 Jul 2003 23:34:19 -0000 1.3
+++ javax/naming/spi/NamingManager.java 18 Sep 2003 19:47:27 -0000
@@ -129,7 +129,9 @@
 	String aTry = tokens.nextToken ();
 	try
 	  {
-	    Class factoryClass = Class.forName (aTry + "." + scheme);
+	    Class factoryClass = Class.forName (aTry + "." + scheme,
+						true,
+						Thread.currentThread().getContextClassLoader());
 	    ObjectFactory factory =
 	      (ObjectFactory) factoryClass.newInstance ();
 	    Object obj = factory.getObjectInstance (refInfo, name,
@@ -231,7 +233,9 @@
 	    if (fClass != null)
 	      {
 		// Exceptions here are passed to the caller.
-		Class k = Class.forName (fClass);
+		Class k = Class.forName (fClass,
+					 true,
+					 Thread.currentThread().getContextClassLoader());
 		factory = (ObjectFactory) k.newInstance ();
 	      }
 	    else
@@ -275,7 +279,9 @@
 	    while (tokens.hasMoreTokens ())
 	      {
 		String klassName = tokens.nextToken ();
-		Class k = Class.forName (klassName);
+		Class k = Class.forName (klassName,
+					 true,
+					 Thread.currentThread().getContextClassLoader());
 		factory = (ObjectFactory) k.newInstance ();
 		Object obj = factory.getObjectInstance (refInfo, name,
 							nameCtx, environment);
@@ -341,7 +347,9 @@
 	String klassName = tokens.nextToken ();
 	try
 	  {
-	    Class k = Class.forName (klassName);
+	    Class k = Class.forName (klassName,
+				     true,
+				     Thread.currentThread().getContextClassLoader());
 	    StateFactory factory = (StateFactory) k.newInstance ();
 	    Object o = factory.getStateToBind (obj, name, nameCtx,
 					       environment);


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