[Webfunds-commits] java/webfunds/sox MailReply.java Reply.java

Ian Grigg iang@cypherpunks.ai
Sat, 10 Jun 2000 16:18:00 -0400 (AST)


iang        00/06/10 16:17:59

  Modified:    webfunds/sox MailReply.java Reply.java
  Log:
  errors are being carelessly copied into strings, need to be careful
  not to copy them by default, as the error number carries the error
  text already.  Error string is only for additional error information.

Revision  Changes    Path
1.13      +4 -1      java/webfunds/sox/MailReply.java

Index: MailReply.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/MailReply.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- MailReply.java	2000/03/27 05:04:57	1.12
+++ MailReply.java	2000/06/10 20:17:56	1.13
@@ -1,5 +1,5 @@
 /*
- * $Id: MailReply.java,v 1.12 2000/03/27 05:04:57 iang Exp $
+ * $Id: MailReply.java,v 1.13 2000/06/10 20:17:56 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -134,6 +134,9 @@
     public String toString()
     {
         String s;
+        if (errorNumber != 0)
+            return "MailReply in error: " + super.toString();
+
         int len = (mails == null) ? 0 : mails.length;
         s = "MailReply num = " + len + " mails";
         for (int i = 0; i < len; i++)



1.16      +6 -1      java/webfunds/sox/Reply.java

Index: Reply.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Reply.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Reply.java	2000/06/10 18:31:32	1.15
+++ Reply.java	2000/06/10 20:17:56	1.16
@@ -1,5 +1,5 @@
 /*
- * $Id: Reply.java,v 1.15 2000/06/10 18:31:32 iang Exp $
+ * $Id: Reply.java,v 1.16 2000/06/10 20:17:56 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -63,7 +63,12 @@
     /**
      *  Append a new error.  Only useful for the server.
      */
-    public void addErrorText(String s) { errorText += "; " + s; }
+    public void addErrorText(String s)
+    {
+        if ((s == null) || (s.length() == 0))
+           return ;
+        errorText += ((errorText.length() != 0) ? "; " : "") + s;
+    }
     
     /**
      *  Get the error code.