Skip to content

Commit

Permalink
task: Fix Sonar issues [DHIS2-18477]
Browse files Browse the repository at this point in the history
  • Loading branch information
muilpp committed Nov 29, 2024
1 parent 8d5fd03 commit dd014fb
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -506,13 +505,10 @@ public RootNode getTrackedEntityAudit(
// Helpers
// -----------------------------------------------------------------------------------------------------------------

private List<DataElement> getDataElementsByDataSet(List<String> uids) throws WebMessageException {
private List<DataElement> getDataElementsByDataSet(List<String> uids) {
List<DataSet> 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<Period> getPeriods(List<String> isoPeriods) throws WebMessageException {
Expand Down

0 comments on commit dd014fb

Please sign in to comment.