MAILET-124 Mail recipients should be copied by Not matcher

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/028dc503
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/028dc503
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/028dc503

Branch: refs/heads/master
Commit: 028dc503cecd0831867b5287b38d97102b8f9e59
Parents: d1b0b8d
Author: Benoit Tellier <btell...@linagora.com>
Authored: Thu Sep 8 15:02:30 2016 +0200
Committer: Benoit Tellier <btell...@linagora.com>
Committed: Thu Sep 15 12:07:40 2016 +0200

----------------------------------------------------------------------
 .../apache/james/mailetcontainer/impl/matchers/Not.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/028dc503/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
----------------------------------------------------------------------
diff --git 
a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
 
b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
index d061583..b8751f2 100644
--- 
a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
+++ 
b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers/Not.java
@@ -21,15 +21,15 @@ package org.apache.james.mailetcontainer.impl.matchers;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 
+import javax.mail.MessagingException;
+
+import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
 import org.apache.mailet.Matcher;
-import org.apache.mailet.Mail;
-
-import javax.mail.MessagingException;
 
 import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
 
 public class Not extends GenericCompositeMatcher {
 
@@ -43,7 +43,7 @@ public class Not extends GenericCompositeMatcher {
      *         Matcher(s).
      */
     public Collection<MailAddress> match(Mail mail) throws MessagingException {
-        Collection<MailAddress> finalResult = 
Optional.fromNullable(mail.getRecipients()).or(new ArrayList<MailAddress>());
+        Collection<MailAddress> finalResult = 
Optional.fromNullable(Lists.newArrayList(mail.getRecipients())).or(new 
ArrayList<MailAddress>());
         for (Matcher matcher : getMatchers()) {
             Collection<MailAddress> matcherResult = matcher.match(mail);
             if (matcherResult != null) {


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

Reply via email to