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; } });