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;
SCLContext.push(context);
try {
f.apply(Tuple0.INSTANCE);
- } catch (Exception e) {
- LOGGER.error("Could not execute async", e);
- printError(e);
+ } catch (Throwable t) {
+ LOGGER.error("Could not execute async", t);
+ printError(t);
} finally {
SCLContext.pop();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public static List<Object> pmap(Function f, List<Object> l) {
- return Arrays.asList(l.parallelStream().map(a -> f.apply(a)).toArray());
+ return l.parallelStream().map(f::apply).collect(Collectors.toList());
}
@SuppressWarnings({ "rawtypes", "unchecked" })