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 2019/11/15 02:41:13 UTC
[james-project] 04/30: JAMES-2704 RandomStoring should use james
Iterators util for stream conversion
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 463f11ab77ff8407d9a520ed011e5f22ceb018c9
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Nov 6 17:01:06 2019 +0700
JAMES-2704 RandomStoring should use james Iterators util for stream conversion
---
.../main/java/org/apache/james/transport/mailets/RandomStoring.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RandomStoring.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RandomStoring.java
index 2c56f6f..58e816c 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RandomStoring.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RandomStoring.java
@@ -38,6 +38,7 @@ import org.apache.james.mailbox.model.search.MailboxQuery;
import org.apache.james.transport.mailets.delivery.MailStore;
import org.apache.james.user.api.UsersRepository;
import org.apache.james.user.api.UsersRepositoryException;
+import org.apache.james.util.streams.Iterators;
import org.apache.mailet.Attribute;
import org.apache.mailet.Mail;
import org.apache.mailet.base.GenericMailet;
@@ -45,7 +46,6 @@ import org.apache.mailet.base.GenericMailet;
import com.github.fge.lambdas.Throwing;
import com.github.steveash.guavate.Guavate;
import com.google.common.base.MoreObjects;
-import com.google.common.collect.Streams;
import reactor.core.publisher.Mono;
@@ -107,7 +107,7 @@ public class RandomStoring extends GenericMailet {
}
private List<ReroutingInfos> retrieveReroutingInfos() throws UsersRepositoryException {
- return Streams.stream(usersRepository.list())
+ return Iterators.toStream(usersRepository.list())
.map(Username::of)
.flatMap(this::buildReRoutingInfos)
.collect(Guavate.toImmutableList());
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org