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 2017/08/31 01:32:25 UTC

[13/22] james-project git commit: JAMES-2127 MPT: Stream instead of FluentIterable.from

JAMES-2127 MPT: Stream instead of FluentIterable.from


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

Branch: refs/heads/master
Commit: 9c3bd034caf8a7582d2ee636e7fc506b7d1a247c
Parents: a93201e
Author: quynhn <qn...@linagora.com>
Authored: Fri Aug 25 16:17:14 2017 +0700
Committer: benwa <bt...@linagora.com>
Committed: Thu Aug 31 08:24:02 2017 +0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/james/mpt/api/ImapFeatures.java    | 5 ++---
 .../james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java       | 4 ++--
 .../external/james/host/ExternalJamesHostSystem.java            | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/9c3bd034/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java
----------------------------------------------------------------------
diff --git a/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java b/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java
index 4e4fec9..11b12bf 100644
--- a/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java
+++ b/mpt/core/src/main/java/org/apache/james/mpt/api/ImapFeatures.java
@@ -21,8 +21,6 @@ package org.apache.james.mpt.api;
 import java.util.Set;
 
 import com.google.common.base.Preconditions;
-import com.google.common.base.Predicates;
-import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableSet;
 
 public class ImapFeatures {
@@ -52,7 +50,8 @@ public class ImapFeatures {
     public boolean supports(Feature... features) {
         Preconditions.checkNotNull(features);
         ImmutableSet<Feature> requestedFeatures = ImmutableSet.copyOf(features);
-        return FluentIterable.from(requestedFeatures).allMatch(Predicates.in(supportedFeatures));
+        return requestedFeatures.stream()
+            .allMatch(feature -> supportedFeatures.contains(feature));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/9c3bd034/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java b/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java
index 2af65be..2c09ac8 100644
--- a/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java
+++ b/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/CyrusHostSystem.java
@@ -19,8 +19,8 @@
 package org.apache.james.mpt.imapmailbox.cyrus.host;
 
 import java.net.InetSocketAddress;
+import java.util.function.Supplier;
 
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mpt.api.ImapFeatures;
@@ -30,10 +30,10 @@ import org.apache.james.mpt.api.UserAdder;
 import org.apache.james.mpt.host.ExternalHostSystem;
 import org.apache.james.mpt.monitor.NullMonitor;
 import org.apache.james.mpt.protocol.ProtocolSession;
+import org.apache.commons.lang.NotImplementedException;
 
 import com.google.common.base.Joiner;
 import com.google.common.base.Strings;
-import com.google.common.base.Supplier;
 import com.google.common.base.Throwables;
 import com.google.inject.Inject;
 import com.google.inject.Provider;

http://git-wip-us.apache.org/repos/asf/james-project/blob/9c3bd034/mpt/impl/imap-mailbox/external-james/src/test/java/org/apache/james/mpt/imapmailbox/external/james/host/ExternalJamesHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/external-james/src/test/java/org/apache/james/mpt/imapmailbox/external/james/host/ExternalJamesHostSystem.java b/mpt/impl/imap-mailbox/external-james/src/test/java/org/apache/james/mpt/imapmailbox/external/james/host/ExternalJamesHostSystem.java
index 1f82887..65853eb 100644
--- a/mpt/impl/imap-mailbox/external-james/src/test/java/org/apache/james/mpt/imapmailbox/external/james/host/ExternalJamesHostSystem.java
+++ b/mpt/impl/imap-mailbox/external-james/src/test/java/org/apache/james/mpt/imapmailbox/external/james/host/ExternalJamesHostSystem.java
@@ -19,16 +19,16 @@
 package org.apache.james.mpt.imapmailbox.external.james.host;
 
 import java.net.InetSocketAddress;
+import java.util.function.Supplier;
 
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mpt.api.ImapFeatures;
 import org.apache.james.mpt.api.ImapFeatures.Feature;
 import org.apache.james.mpt.host.ExternalHostSystem;
 import org.apache.james.mpt.monitor.NullMonitor;
+import org.apache.commons.lang.NotImplementedException;
 
 import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 


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