* javax/naming/spi/NamingManager.java (getContinuationContext): Call
getObjectInstance() with Object, Name, Context and environment
Hashtable from exception. Call fillInStackTrace() on exception when
rethrown.
* javax/naming/InitialContext.java (lookup(Name)): When a
CannotProceedException is thrown use the ContinuationContext.
(lookup(String)): Likewise.
(close): Clear myProps and defaultInitCtx.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73041
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-10-29 Julian Dolby <dolby@us.ibm.com>
+
+ * javax/naming/spi/NamingManager.java (getContinuationContext): Call
+ getObjectInstance() with Object, Name, Context and environment
+ Hashtable from exception. Call fillInStackTrace() on exception when
+ rethrown.
+ * javax/naming/InitialContext.java (lookup(Name)): When a
+ CannotProceedException is thrown use the ContinuationContext.
+ (lookup(String)): Likewise.
+ (close): Clear myProps and defaultInitCtx.
+
2003-10-29 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java
public Object lookup (Name name) throws NamingException
{
- return getURLOrDefaultInitCtx (name).lookup (name);
+ try
+ {
+ return getURLOrDefaultInitCtx (name).lookup (name);
+ }
+ catch (CannotProceedException cpe)
+ {
+ Context ctx = NamingManager.getContinuationContext (cpe);
+ return ctx.lookup (cpe.getRemainingName());
+ }
}
public Object lookup (String name) throws NamingException
{
- return getURLOrDefaultInitCtx (name).lookup (name);
+ try
+ {
+ return getURLOrDefaultInitCtx (name).lookup (name);
+ }
+ catch (CannotProceedException cpe)
+ {
+ Context ctx = NamingManager.getContinuationContext (cpe);
+ return ctx.lookup (cpe.getRemainingName());
+ }
}
public void rebind (Name name, Object obj) throws NamingException
public void close () throws NamingException
{
- throw new OperationNotSupportedException ();
+ myProps = null;
+ defaultInitCtx = null;
}
public String getNameInNamespace () throws NamingException
// It is really unclear to me if this is right.
try
{
- Object obj = getObjectInstance (null, cpe.getAltName (),
- cpe.getAltNameCtx (), env);
+ Object obj = getObjectInstance (cpe.getResolvedObj(),
+ cpe.getAltName (),
+ cpe.getAltNameCtx (),
+ env);
if (obj != null)
return (Context) obj;
}
{
}
+ // fix stack trace for re-thrown exception (message confusing otherwise)
+ cpe.fillInStackTrace();
+
throw cpe;
}