mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-11 05:23:55 +08:00
NamingManager.java (getURLContext, [...]): Always use current thread's context class loader when calling Class.forName.
2003-09-18 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. Co-Authored-By: Helmer Kraemer <hkraemer@freenet.de> From-SVN: r71534
This commit is contained in:
parent
8d8369f85b
commit
1eeae5c1cd
@ -1,3 +1,10 @@
|
||||
2003-09-18 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.
|
||||
|
||||
2003-09-18 Michael Koch <konqueror@gmx.de>
|
||||
|
||||
* java/util/Timer.java (finalize): Added "throws Throwable".
|
||||
|
@ -129,7 +129,9 @@ public class NamingManager
|
||||
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 @@ public class NamingManager
|
||||
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 @@ public class NamingManager
|
||||
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 @@ public class NamingManager
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user