[e-cvs] cvs commit: e/src/jsrc/net/vattp/data DataPath.java StartUpProtocol.java VatTPMgr.java

markm@eros.cs.jhu.edu markm@eros.cs.jhu.edu
Mon, 1 Oct 2001 21:49:35 -0400


markm       01/10/01 21:49:35

  Modified:    src/jsrc/net/vattp/data DataPath.java StartUpProtocol.java
                        VatTPMgr.java
  Log:
  Bill agrees these try-catches are unnecessary

Revision  Changes    Path
1.7       +9 -35     e/src/jsrc/net/vattp/data/DataPath.java

Index: DataPath.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/DataPath.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DataPath.java	2001/10/02 01:29:18	1.6
+++ DataPath.java	2001/10/02 01:49:35	1.7
@@ -465,11 +465,7 @@
     /*package*/void connectToSelf() {
         Assertion.test(null == myDataConnection,
                 "Remote end should not be identitifed");
-//        try {
-            shutDownPath();
-//        } catch(IOException e) {
-//            Trace.comm.errorm("Error shuting down path", e);
-//        }
+        shutDownPath();
         myConnMgr.connectToSelf(this);
     }
 
@@ -669,11 +665,7 @@
      * @param e The exception which describes the problem
      */
     /*package*/ void noticeProblem(Throwable problem) {
-//        try {
-            shutDownPath();
-//        } catch(IOException e) {
-//            Trace.comm.errorm("Exception shutting down connection", e);
-//        }
+        shutDownPath();
         if (null != myDataConnection) {
             myDataConnection.noticeProblem(problem);
         } else if (null != myConnMgr) {
@@ -691,24 +683,15 @@
         long now = System.currentTimeMillis();
         if ( (now - lastNetActivity) > Msg.PING_SENDTIME) {
             if (0 == timePingSent && null != myWriter) {
-//No IOException?
-//                try {
-                    enqueue(thePingMsg);    //Send a ping
-                    if (Trace.comm.event && Trace.ON) {
-                        Trace.comm.eventm("Ping " + this);
-                    }
-//                } catch(IOException e) {
-//                    Trace.comm.errorm("Exception sending ping", e);
-//                }
+                enqueue(thePingMsg);    //Send a ping
+                if (Trace.comm.event && Trace.ON) {
+                    Trace.comm.eventm("Ping " + this);
+                }
                 timePingSent = System.currentTimeMillis();
             } else {
                 if ( (now - timePingSent) > Msg.PING_TIMEOUT) {
                     if (null != myWriter) {
-//                        try {
-                            shutDownPath();
-//                        } catch(IOException e) {
-//                            Trace.comm.errorm("Error on timeout shutdown", e);
-//                        }
+                        shutDownPath();
                         if (Trace.comm.usage && Trace.ON) {
                             Trace.comm.usagem("Connection timeout " + this);
                         }
@@ -747,12 +730,7 @@
      */
     public void processMessage(byte[] message, VatTPConnection connection) {
         if (Msg.PING == message[0]) {   // got a ping, send pong
-//No IOException?
-//            try {
-                enqueue(thePongMsg);
-//            } catch(IOException e) {
-//                Trace.comm.errorm("Error enqueuing pong msg", e);
-//            }
+            enqueue(thePongMsg);
         }
         //Do nothing with a PONG message.  The time received will have already
         //been updated, and that is all we need for keep alive.
@@ -987,11 +965,7 @@
      *          try.
      */
     /*package*/ void tryNext(String reason) {
-//        try {
-            shutDownPath();
-//        } catch(IOException e) {
-//            Trace.comm.errorm("Error shuting down path", e);
-//        }
+        shutDownPath();
         String msg = myRemoteAddr + ": " + reason;
         if (null == myDataConnection) {
             myConnMgr.unidentifiedConnectionDied(this, msg, null);



1.6       +2 -10     e/src/jsrc/net/vattp/data/StartUpProtocol.java

Index: StartUpProtocol.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/StartUpProtocol.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- StartUpProtocol.java	2001/10/02 01:29:18	1.5
+++ StartUpProtocol.java	2001/10/02 01:49:35	1.6
@@ -311,11 +311,7 @@
             }
         } catch(IOException e) {
             Trace.comm.errorm("IOException starting up", e);
-//            try {
-                myDataPath.shutDownPath();
-//            } catch(IOException e2) {
-//                Trace.comm.errorm("IOException shuting down connection", e2);
-//            }
+            myDataPath.shutDownPath();
         }
     }
 // Protocol methods.  These methods are presented more or less in the order
@@ -1115,11 +1111,7 @@
             if (!myStop) {
                 myDataPath.tryNext(e.toString() + "\n" + ThrowableSugar.javaStack(e));
             } else {
-//                try {
-                    myDataPath.shutDownPath();
-//                } catch(IOException ex) {
-//                    Trace.comm.errorm("Exception shuting down", ex);
-//                }
+                myDataPath.shutDownPath();
             }
         }
     }



1.2       +2 -6      e/src/jsrc/net/vattp/data/VatTPMgr.java

Index: VatTPMgr.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/vattp/data/VatTPMgr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VatTPMgr.java	2001/10/02 01:29:18	1.1
+++ VatTPMgr.java	2001/10/02 01:49:35	1.2
@@ -774,12 +774,8 @@
                                     remoteVatID, connection);
         if (null != oldconn) {
             Trace.comm.errorm("Overlaying " + oldconn + " with " + connection);
-//            try {
-                oldconn.shutDownConnection(new ConnectionShutDownException(
-                        "Replacing old connection with newly started one"));
-//            } catch(IOException e) {
-//                Trace.comm.errorm("Error shutting down connection", e);
-//            }
+            oldconn.shutDownConnection(new ConnectionShutDownException(
+              "Replacing old connection with newly started one"));
         }
         if (null != myReactor && !isResuming) {
             if (Trace.comm.event && Trace.ON) {