From a4de86b5df865dfc047277c4072fe02687fee6de Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 25 May 2022 10:21:54 +0200 Subject: [PATCH] fixed orientation duplicates check --- .../checks/OrientationTableDuplicatesCheck.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/OrientationTableDuplicatesCheck.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/OrientationTableDuplicatesCheck.java index ad1a226f..681fc7b9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/OrientationTableDuplicatesCheck.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/OrientationTableDuplicatesCheck.java @@ -70,18 +70,19 @@ public class OrientationTableDuplicatesCheck implements DBIntegrityCheck { return "OK"; } + final List checkedToDelete = toDelete + .stream() + .filter(this::doubleCheck) + .collect(Collectors.toList()); + if (tryFix) { - final List checkedToDelete = toDelete - .stream() - .filter(this::doubleCheck) - .collect(Collectors.toList()); checkedToDelete .stream() .forEach(this.orientationRecordMapper::deleteByPrimaryKey); - return "Fixed duplicates by deletion: " + checkedToDelete + " from findings:" + toDelete; + return "Fixed duplicates by deletion: " + checkedToDelete; } else { - return "Found duplicates: " + toDelete; + return "Found duplicates: " + checkedToDelete; } });