james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1726769 - in /james/project/trunk/protocols: imap/src/main/java/org/apache/james/imap/api/message/MessageFlags.java pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
Date Tue, 26 Jan 2016 10:46:36 GMT
Author: matthieu
Date: Tue Jan 26 10:46:35 2016
New Revision: 1726769

URL: http://svn.apache.org/viewvc?rev=1726769&view=rev
Log:
JAMES-1669 don't copy manually arrays into collections

Modified:
    james/project/trunk/protocols/imap/src/main/java/org/apache/james/imap/api/message/MessageFlags.java
    james/project/trunk/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java

Modified: james/project/trunk/protocols/imap/src/main/java/org/apache/james/imap/api/message/MessageFlags.java
URL: http://svn.apache.org/viewvc/james/project/trunk/protocols/imap/src/main/java/org/apache/james/imap/api/message/MessageFlags.java?rev=1726769&r1=1726768&r2=1726769&view=diff
==============================================================================
--- james/project/trunk/protocols/imap/src/main/java/org/apache/james/imap/api/message/MessageFlags.java
(original)
+++ james/project/trunk/protocols/imap/src/main/java/org/apache/james/imap/api/message/MessageFlags.java
Tue Jan 26 10:46:35 2016
@@ -21,6 +21,7 @@ package org.apache.james.imap.api.messag
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 
 import javax.mail.Flags;
 
@@ -100,9 +101,8 @@ public class MessageFlags {
         
         // Add user flags
         String[] userFlags = flags.getUserFlags();
-        for (int i = 0; i < userFlags.length; i++) {
-            results.add(userFlags[i]);
-        }
+        Collections.addAll(results, userFlags);
+
         if (flags.contains(Flags.Flag.USER)) {
             results.add(USER_OUTPUT_CAPITALISED);
         }

Modified: james/project/trunk/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
URL: http://svn.apache.org/viewvc/james/project/trunk/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java?rev=1726769&r1=1726768&r2=1726769&view=diff
==============================================================================
--- james/project/trunk/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
(original)
+++ james/project/trunk/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
Tue Jan 26 10:46:35 2016
@@ -20,6 +20,7 @@
 package org.apache.james.protocols.pop3;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.james.protocols.api.handler.CommandDispatcher;
@@ -71,9 +72,7 @@ public class POP3ProtocolHandlerChain ex
     protected List<ProtocolHandler> initDefaultHandlers(AbstractPassCmdHandler... authHandlers)
{
         List<ProtocolHandler> handlers = new ArrayList<ProtocolHandler>();
         // add all pass handlers
-        for (AbstractPassCmdHandler handler: authHandlers) {
-            handlers.add(handler);
-        }
+        Collections.addAll(handlers, authHandlers);
         
         handlers.add(new CapaCmdHandler());
         handlers.add(new UserCmdHandler());



---------------------------------------------------------------------
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