RED-7256 - Overlapping annotation color from imported redaction and resized redaction

- use Strings from guave for empty or null and set empty value in case of null value
This commit is contained in:
Corina Olariu 2023-12-19 12:50:21 +02:00
parent 36755e5958
commit 85737653f7
2 changed files with 3 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import com.iqser.red.service.persistence.management.v1.processor.configuration.MessagingConfiguration;
import com.iqser.red.service.persistence.management.v1.processor.entity.configuration.TypeEntity;
@ -210,7 +211,7 @@ public class EntityLogMergeService {
.requestedDate(manualResizeRedaction.getRequestDate())
.processedDate(null)
.userId(manualResizeRedaction.getUser());
if (!StringUtils.isEmpty(manualResizeRedaction.getValue())) {
if (Strings.isNullOrEmpty(manualResizeRedaction.getValue())) {
manualChange.propertyChanges(Map.of("value", manualResizeRedaction.getValue()));
}
entityLogEntry.getManualChanges().add(manualChange.build());

View File

@ -174,7 +174,7 @@ public class ManualRedactionMapper {
.user(KeycloakSecurity.getUserId())
.status(AnnotationStatus.APPROVED)
.positions(resizeRedactionRequest.getPositions())
.value(StringUtils.isEmpty(resizeRedactionRequest.getValue()) ? resizeRedactionRequest.getValue() : StringCleaningUtility.cleanString(resizeRedactionRequest.getValue()))
.value(resizeRedactionRequest.getValue() == null ? "" : StringCleaningUtility.cleanString(resizeRedactionRequest.getValue()))
.comment(resizeRedactionRequest.getComment())
.updateDictionary(resizeRedactionRequest.getUpdateDictionary())
.addToAllDossiers(resizeRedactionRequest.isAddToAllDossiers())