diff --git a/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AuditController.java b/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AuditController.java index e5b12182cb5..ae4719551fc 100644 --- a/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AuditController.java +++ b/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AuditController.java @@ -41,7 +41,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.hisp.dhis.audit.Audit; import org.hisp.dhis.category.CategoryOptionCombo; @@ -506,13 +505,10 @@ public RootNode getTrackedEntityAudit( // Helpers // ----------------------------------------------------------------------------------------------------------------- - private List getDataElementsByDataSet(List uids) throws WebMessageException { + private List getDataElementsByDataSet(List uids) { List dataSets = manager.loadByUid(DataSet.class, uids); - return dataSets.stream() - .map(ds -> ds.getDataElements()) - .flatMap(Set::stream) - .collect(Collectors.toList()); + return dataSets.stream().map(DataSet::getDataElements).flatMap(Set::stream).toList(); } private List getPeriods(List isoPeriods) throws WebMessageException {