RED-7034 - Check for dossierDictionaryOnly flag when add to template dict is requested

- fix PMD violations
This commit is contained in:
Corina Olariu 2023-07-10 10:08:20 +03:00
parent db16cc0ab3
commit 6ee500c1c7

View File

@ -314,17 +314,13 @@ public class ManualRedactionService {
}
if (!removeRedactionRequest.isRemoveFromDictionary() && AnnotationStatus.APPROVED.equals(removeRedactionRequest.getStatus())) {
Optional<RedactionLogEntry> redactionLogEntryOptional = redactionLog.getRedactionLogEntry()
.stream()
.filter(entry -> entry.getId().equals(removeRedactionRequest.getAnnotationId()))
.findFirst();
RedactionLogEntry redactionLogEntry = null;
boolean requiresAnalysis = false;
try {
redactionLogEntry = getRedactionLogEntry(redactionLog, removeRedactionRequest.getAnnotationId());
requiresAnalysis = redactionLogEntry.isHint();
} catch (NotFoundException e) {
requiresAnalysis = false;
}
actionPerformed = actionPerformed || requiresAnalysis;
if (!requiresAnalysis && idRemoval.isApproved()) {