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]

FYI: Patch: javax.naming


Hi list,


I commited the attached patch to merge javax.naming with classpath again.


Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2306
diff -u -b -B -r1.2306 ChangeLog
--- ChangeLog	29 Oct 2003 10:53:18 -0000	1.2306
+++ ChangeLog	29 Oct 2003 14:52:08 -0000
@@ -1,3 +1,14 @@
+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
Index: javax/naming/InitialContext.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/naming/InitialContext.java,v
retrieving revision 1.9
diff -u -b -B -r1.9 InitialContext.java
--- javax/naming/InitialContext.java	18 Sep 2003 19:53:36 -0000	1.9
+++ javax/naming/InitialContext.java	29 Oct 2003 14:52:08 -0000
@@ -240,13 +240,29 @@
 
   public Object lookup (Name name) throws NamingException
   {
+    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
   {
+      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
   {
@@ -367,7 +383,8 @@
 
   public void close () throws NamingException
   {
-    throw new OperationNotSupportedException ();
+    myProps = null;
+    defaultInitCtx = null;
   }
 
   public String getNameInNamespace () throws NamingException
Index: javax/naming/spi/NamingManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/naming/spi/NamingManager.java,v
retrieving revision 1.7
diff -u -b -B -r1.7 NamingManager.java
--- javax/naming/spi/NamingManager.java	18 Sep 2003 19:51:39 -0000	1.7
+++ javax/naming/spi/NamingManager.java	29 Oct 2003 14:52:08 -0000
@@ -324,14 +324,19 @@
     // 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;
       }
     catch (Exception _)
       {
       }
+
+    // fix stack trace for re-thrown exception (message confusing otherwise)
+    cpe.fillInStackTrace();
 
     throw cpe;
   }

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