diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/visualization/service/AnnotationHighlightService.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/visualization/service/AnnotationHighlightService.java index 9797d0aa..8669fffd 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/visualization/service/AnnotationHighlightService.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/visualization/service/AnnotationHighlightService.java @@ -46,7 +46,8 @@ public class AnnotationHighlightService { private final DictionaryService dictionaryService; - public void highlight(PDDocument document, Document classifiedDoc, boolean flatRedaction, ManualRedactions manualRedactions) throws IOException { + public void highlight(PDDocument document, Document classifiedDoc, boolean flatRedaction, + ManualRedactions manualRedactions) throws IOException { Set manualRedactionPages = getManualRedactionPages(manualRedactions); @@ -84,7 +85,8 @@ public class AnnotationHighlightService { } - private void addAnnotations(PDPage pdPage, Document classifiedDoc, boolean flatRedaction, ManualRedactions manualRedactions, int page) throws IOException { + private void addAnnotations(PDPage pdPage, Document classifiedDoc, boolean flatRedaction, + ManualRedactions manualRedactions, int page) throws IOException { List annotations = pdPage.getAnnotations(); @@ -118,15 +120,14 @@ public class AnnotationHighlightService { annotations.add(createAnnotation(rectanglesPerline, entityPositionSequence.getId(), createAnnotationContent(entity), getColor(entity), !flatRedaction && !isHint(entity))); } - redactionLogEntry.setId(entityPositionSequence.getId()); + redactionLogEntry.setId(entityPositionSequence.getId()); + } + classifiedDoc.getRedactionLogEntities().add(redactionLogEntry); } - classifiedDoc.getRedactionLogEntities().add(redactionLogEntry); + } -} - - private List getRectanglesPerLine(List textPositions, int page) { List rectangles = new ArrayList<>(); @@ -152,7 +153,8 @@ public class AnnotationHighlightService { } - private void addManualAnnotations(PDPage pdPage, Document classifiedDoc, ManualRedactions manualRedactions, int page) throws IOException { + private void addManualAnnotations(PDPage pdPage, Document classifiedDoc, ManualRedactions manualRedactions, + int page) throws IOException { if (manualRedactions == null) { return; @@ -220,7 +222,8 @@ public class AnnotationHighlightService { } - private PDAnnotationTextMarkup createAnnotation(List rectangles, String id, String content, float[] color, boolean popup) { + private PDAnnotationTextMarkup createAnnotation(List rectangles, String id, String content, + float[] color, boolean popup) { PDAnnotationTextMarkup annotation = new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_HIGHLIGHT); annotation.constructAppearances(); @@ -262,7 +265,6 @@ public class AnnotationHighlightService { private float[] toQuadPoints(List rectangles) { - float[] quadPoints = new float[rectangles.size() * 8]; int i = 0; @@ -325,7 +327,8 @@ public class AnnotationHighlightService { } - private void drawSectionFrames(PDDocument document, Document classifiedDoc, boolean flatRedaction, PDPage pdPage, int page) throws IOException { + private void drawSectionFrames(PDDocument document, Document classifiedDoc, boolean flatRedaction, PDPage pdPage, + int page) throws IOException { if (flatRedaction) { return;