classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI:Throwing different exception in gnu/java/rmi/server/Uni


From: Meskauskas Audrius
Subject: [cp-patches] FYI:Throwing different exception in gnu/java/rmi/server/UnicastRef.java
Date: Fri, 13 Jan 2006 05:31:51 +0100
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

The Sun's implementation throws java.rmi.ConnectException (subclass of RemoteException) in the case of failure to establish the connection. Our implementation throws the RemoteException itself. This crashes applications that specifically catch ConnectException. In Classpath, this exception is thrown from gnu/java/rmi/server/UnicastRef.java (newCall).

2006-01-13  Audrius Meskauskas  <address@hidden>

   * gnu/java/rmi/server/UnicastRef.java (newCall):
   Throw ConnectException after catching IOException.
Index: gnu/java/rmi/server/UnicastRef.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/rmi/server/UnicastRef.java,v
retrieving revision 1.8
diff -u -r1.8 UnicastRef.java
--- gnu/java/rmi/server/UnicastRef.java 2 Jul 2005 20:32:14 -0000       1.8
+++ gnu/java/rmi/server/UnicastRef.java 13 Jan 2006 04:12:32 -0000
@@ -47,6 +47,7 @@
 import java.io.ObjectOutputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.rmi.ConnectException;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
 import java.rmi.server.ObjID;
@@ -195,7 +196,7 @@
                conn = manager.getConnection();
        }
        catch (IOException e1) {
-               throw new RemoteException("connection failed to host: " + 
manager.serverName, e1);
+               throw new ConnectException("connection failed to host: " + 
manager.serverName, e1);
        }
 
     //obj: useless?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]