diff --git a/metasfresh-webui-api/src/main/java/de/metas/ui/web/view/IDocumentViewSelection.java b/metasfresh-webui-api/src/main/java/de/metas/ui/web/view/IDocumentViewSelection.java index 069667760..ce2b5bd58 100644 --- a/metasfresh-webui-api/src/main/java/de/metas/ui/web/view/IDocumentViewSelection.java +++ b/metasfresh-webui-api/src/main/java/de/metas/ui/web/view/IDocumentViewSelection.java @@ -5,11 +5,11 @@ import java.util.Set; import java.util.stream.Stream; -import org.adempiere.util.Check; -import org.adempiere.util.GuavaCollectors; import org.adempiere.util.lang.impl.TableRecordReference; import org.compiere.util.Evaluatee; +import com.google.common.collect.ImmutableList; + import de.metas.ui.web.exceptions.EntityNotFoundException; import de.metas.ui.web.process.descriptor.WebuiRelatedProcessDescriptor; import de.metas.ui.web.window.datatypes.DocumentId; @@ -70,20 +70,7 @@ default IDocumentView getById(final int documentIdInt) throws EntityNotFoundExce default List getByIds(final Set documentIds) { - Check.assumeNotEmpty(documentIds, "documentIds is not empty"); - return documentIds.stream() - .map(documentId -> { - try - { - return getById(documentId); - } - catch (final EntityNotFoundException e) - { - return null; - } - }) - .filter(document -> document != null) - .collect(GuavaCollectors.toImmutableList()); + return streamByIds(documentIds).collect(ImmutableList.toImmutableList()); } LookupValuesList getFilterParameterDropdown(String filterId, String filterParameterName, Evaluatee ctx);