fixed PMD

This commit is contained in:
Timo 2021-07-19 11:59:53 +03:00
parent 0b89c55a1d
commit d4486ea6f4

View File

@ -666,17 +666,17 @@ public class RedactionLogCreatorService {
// Cannot undo Already Approved change because UI won't allow it for now // Cannot undo Already Approved change because UI won't allow it for now
if (Status.REQUESTED.equals(entry.getStatus())) { if (Status.REQUESTED.equals(entry.getStatus())) {
var recategorizeExists = manualRedactions.getImageRecategorizations().stream().anyMatch(entryToAdd -> entryToAdd.getId().equalsIgnoreCase(entry.getId())); if (entry.getManualRedactionType() == ManualRedactionType.RECATEGORIZE) {
if (!recategorizeExists) { var recategorizeExists = manualRedactions.getImageRecategorizations().stream().anyMatch(entryToAdd -> entryToAdd.getId().equalsIgnoreCase(entry.getId()));
if (entry.getManualRedactionType() == ManualRedactionType.RECATEGORIZE) { if (!recategorizeExists) {
entry.setManual(false); entry.setManual(false);
entry.setStatus(null); entry.setStatus(null);
entry.setRecategorizationType(null); entry.setRecategorizationType(null);
} }
} }
var legalBasisChangeExists = manualRedactions.getImageRecategorizations().stream().anyMatch(entryToAdd -> entryToAdd.getId().equalsIgnoreCase(entry.getId())); if (entry.getManualRedactionType() == ManualRedactionType.LEGAL_BASIS_CHANGE) {
if (!legalBasisChangeExists) { var legalBasisChangeExists = manualRedactions.getImageRecategorizations().stream().anyMatch(entryToAdd -> entryToAdd.getId().equalsIgnoreCase(entry.getId()));
if (entry.getManualRedactionType() == ManualRedactionType.LEGAL_BASIS_CHANGE) { if (!legalBasisChangeExists) {
entry.setManual(false); entry.setManual(false);
entry.setStatus(null); entry.setStatus(null);
entry.setLegalBasisChangeValue(null); entry.setLegalBasisChangeValue(null);