From: jsimomaa Date: Tue, 20 Nov 2018 08:34:56 +0000 (+0200) Subject: AsyncUtils.pmap() to use Collectors.toList() X-Git-Tag: v1.43.0~136^2~262 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=64e7dc1d68d688634860d65e475a0f8a35a004d0;p=simantics%2Fplatform.git AsyncUtils.pmap() to use Collectors.toList() gitlab #207 Change-Id: I17ceafa27e6d27c7159c1698910d14b341476e1e --- diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java index fcab99c20..d771a821e 100644 --- a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java @@ -2,7 +2,6 @@ package org.simantics.scl.runtime.utils; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.concurrent.Callable; @@ -55,7 +54,7 @@ public class AsyncUtils { @SuppressWarnings({ "rawtypes", "unchecked" }) public static List pmap(Function f, List l) { - return Arrays.asList(l.parallelStream().map(a -> f.apply(a)).toArray()); + return l.parallelStream().map(f::apply).collect(Collectors.toList()); } @SuppressWarnings({ "rawtypes", "unchecked" })