RED-6009: Document Tree Structure
* pmd fixes
This commit is contained in:
parent
8b7365c947
commit
57799c5f46
@ -121,8 +121,7 @@ public class SectionNodeFactory {
|
|||||||
private static void movePrecedingHeadlineToTableList(List<List<AbstractPageBlock>> splitList) {
|
private static void movePrecedingHeadlineToTableList(List<List<AbstractPageBlock>> splitList) {
|
||||||
|
|
||||||
for (int i = 0; i < splitList.size(); i++) {
|
for (int i = 0; i < splitList.size(); i++) {
|
||||||
if (listIsTableOnly(splitList.get(i))) {
|
if (listIsTableOnly(splitList.get(i)) && i > 0) {
|
||||||
if (i > 0) {
|
|
||||||
List<AbstractPageBlock> previousList = splitList.get(i - 1);
|
List<AbstractPageBlock> previousList = splitList.get(i - 1);
|
||||||
AbstractPageBlock lastPageBlockInPreviousList = previousList.get(previousList.size() - 1);
|
AbstractPageBlock lastPageBlockInPreviousList = previousList.get(previousList.size() - 1);
|
||||||
if (pageBlockIsHeadline(lastPageBlockInPreviousList)) {
|
if (pageBlockIsHeadline(lastPageBlockInPreviousList)) {
|
||||||
@ -132,7 +131,6 @@ public class SectionNodeFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static boolean listIsTableOnly(List<AbstractPageBlock> abstractPageBlocks) {
|
private static boolean listIsTableOnly(List<AbstractPageBlock> abstractPageBlocks) {
|
||||||
|
|||||||
@ -61,6 +61,7 @@ public class TableNodeFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("PMD.UnusedPrivateMethod") // PMD actually flags this wrong
|
||||||
private void addTableCell(Cell cell, int rowIndex, int colIndex, SemanticNode parentNode, int pageNumber, DocumentGraphFactory.Context context) {
|
private void addTableCell(Cell cell, int rowIndex, int colIndex, SemanticNode parentNode, int pageNumber, DocumentGraphFactory.Context context) {
|
||||||
|
|
||||||
PageNode page = context.getPage(pageNumber);
|
PageNode page = context.getPage(pageNumber);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.en
|
|||||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.entity.RedactionPosition;
|
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.entity.RedactionPosition;
|
||||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.nodes.DocumentGraph;
|
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.nodes.DocumentGraph;
|
||||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.nodes.ImageNode;
|
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.nodes.ImageNode;
|
||||||
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.utils.RectangleTransformations;
|
|
||||||
import com.iqser.red.service.redaction.v1.server.redaction.model.EntityType;
|
import com.iqser.red.service.redaction.v1.server.redaction.model.EntityType;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -126,7 +125,7 @@ public class RedactionLogCreatorService {
|
|||||||
.isHint(dictionaryService.isHint(image.getImageType().toString(), dossierTemplateId))
|
.isHint(dictionaryService.isHint(image.getImageType().toString(), dossierTemplateId))
|
||||||
.isDictionaryEntry(false)
|
.isDictionaryEntry(false)
|
||||||
.isRecommendation(false)
|
.isRecommendation(false)
|
||||||
.positions(List.of(RectangleTransformations.toRectangle(image.getPosition(), image.getPage().getNumber())))
|
.positions(List.of(toRectangle(image.getPosition(), image.getPage().getNumber())))
|
||||||
.sectionNumber(image.getTocId().get(0))
|
.sectionNumber(image.getTocId().get(0))
|
||||||
.section(image.getParent().buildTextBlock().getSearchText())
|
.section(image.getParent().buildTextBlock().getSearchText())
|
||||||
.imageHasTransparency(image.isTransparent())
|
.imageHasTransparency(image.isTransparent())
|
||||||
|
|||||||
@ -3,9 +3,9 @@ package com.iqser.red.service.redaction.v1.server.redaction.utils;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drools fucked up and introduced a bug with newer versions of java, this is needed or else:
|
* Drools fucked up and introduced a bug with newer versions of java, use this class instead of java.util.List.of(e1, e2) or else.
|
||||||
* java.lang.IncompatibleClassChangeError: Method 'java.util.List java.util.List.of(java.lang.Object, java.lang.Object)' must be InterfaceMethodref constant
|
* java.lang.IncompatibleClassChangeError: Method 'java.util.List java.util.List.of(java.lang.Object, java.lang.Object)' must be InterfaceMethodref constant
|
||||||
* Will be thrown on LHS of rules
|
* Will be thrown on LHS of rules, but only sometimes, I was not able to recreate this bug in a different project.
|
||||||
*/
|
*/
|
||||||
public class Liszt {
|
public class Liszt {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user