james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1228298 - /james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
Date Fri, 06 Jan 2012 17:41:23 GMT
Author: norman
Date: Fri Jan  6 17:41:22 2012
New Revision: 1228298

URL: http://svn.apache.org/viewvc?rev=1228298&view=rev
Log:
Fix writing back POP3Response with null argument to client

Modified:
    james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java

Modified: james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java?rev=1228298&r1=1228297&r2=1228298&view=diff
==============================================================================
--- james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
(original)
+++ james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
Fri Jan  6 17:41:22 2012
@@ -71,7 +71,7 @@ public class POP3Response extends Abstra
      * 
      */
     public POP3Response(String code) {
-        this(code, null);
+        setRetCode(code);
     }
     
     protected POP3Response() {
@@ -85,11 +85,15 @@ public class POP3Response extends Abstra
      */
     public List<CharSequence> getLines() {
         List<CharSequence> responseList = new ArrayList<CharSequence>();
-        for (int i = 0; i < lines.size(); i++) {
-            if (i == 0) {
-                responseList.add(getRetCode() + WS +lines.get(i));
-            } else {
-                responseList.add(lines.get(i));
+        if (lines.isEmpty()) {
+            responseList.add(getRetCode());
+        } else {
+            for (int i = 0; i < lines.size(); i++) {
+                if (i == 0) {
+                    responseList.add(getRetCode() + WS +lines.get(i));
+                } else {
+                    responseList.add(lines.get(i));
+                }
             }
         }
         return responseList;



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message