PR Improvements

This commit is contained in:
deiflaender 2020-08-13 16:10:22 +02:00
parent 5d18a46ec3
commit 5d286f58e9
2 changed files with 4 additions and 3 deletions

View File

@ -219,7 +219,7 @@ public class EntityRedactionService {
private void addSectionToManualRedactions(List<TextBlock> textBlocks, ManualRedactions manualRedactions, String section, int sectionNumber) {
if (manualRedactions == null) {
if (manualRedactions == null || manualRedactions.getEntriesToAdd().isEmpty()) {
return;
}

View File

@ -1,5 +1,6 @@
package com.iqser.red.service.redaction.v1.server.redaction.utils;
import java.nio.charset.StandardCharsets;
import java.util.List;
import com.google.common.hash.HashFunction;
@ -21,11 +22,11 @@ public class IdBuilder {
sb.append(textPosition.getTextMatrix());
}));
return hashFunction.hashBytes(sb.toString().getBytes()).toString();
return hashFunction.hashString(sb.toString(), StandardCharsets.UTF_8).toString();
}
public String buildId(ManualRedactionEntry manualRedactionEntry) {
return hashFunction.hashBytes(manualRedactionEntry.toString().getBytes()).toString();
return hashFunction.hashString(manualRedactionEntry.toString(), StandardCharsets.UTF_8).toString();
}
}