You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2020/04/21 02:56:48 UTC

[james-project] 12/19: [Refactoring] use a singleton for single element list

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 25b4644456a33c2e3a23920bdac3b952ebe868da
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Fri Apr 3 15:54:53 2020 +0200

    [Refactoring] use a singleton for single element list
---
 .../org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
index e08369c..fa32758 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
@@ -23,8 +23,8 @@ import java.nio.ByteBuffer;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Locale;
@@ -93,7 +93,6 @@ public class ReceivedDataLineFilter extends SeparatingDataLineFilter {
     /**
      * Returns the Received header for the message.
      */
-    @SuppressWarnings("unchecked")
     protected Collection<Header> headers(SMTPSession session) {
 
         StringBuilder headerLineBuffer = new StringBuilder();
@@ -134,7 +133,7 @@ public class ReceivedDataLineFilter extends SeparatingDataLineFilter {
 
         header.add(headerLineBuffer.toString());
         
-        return Arrays.asList(header);
+        return Collections.singletonList(header);
     
     }
 


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