Closes #2521 - Fix code smells Stream.collect(Collectors.toList()) to Stream.toList()

This commit is contained in:
Maria Margaritis 2024-03-05 23:56:30 +01:00
parent 09d1870651
commit f9ee1664d1
1 changed files with 1 additions and 2 deletions

View File

@ -7,7 +7,6 @@ import java.lang.reflect.Field;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import org.json.JSONObject;
import pro.taskana.common.api.exceptions.SystemException;
@ -56,7 +55,7 @@ public class ObjectAttributeChangeDetector {
.map(wrap(field -> Triplet.of(field, field.get(oldObject), field.get(newObject))))
.filter(not(t -> Objects.equals(t.getMiddle(), t.getRight())))
.map(t -> generateChangedAttribute(t.getLeft(), t.getMiddle(), t.getRight()))
.collect(Collectors.toList());
.toList();
JSONObject changes = new JSONObject();
changes.put("changes", changedAttributes);