From 7fb84c42e0daf22a2ad81537a46c23ba50da9420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kilian=20Sch=C3=BCttler?= Date: Mon, 17 Jun 2024 17:50:22 +0200 Subject: [PATCH] hotfix: fix mapping query error --- .../redaction/v1/server/model/component/ComponentMapping.java | 2 +- .../server/service/drools/ComponentDroolsExecutionService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/model/component/ComponentMapping.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/model/component/ComponentMapping.java index 5103f924..e467f548 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/model/component/ComponentMapping.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/model/component/ComponentMapping.java @@ -76,7 +76,7 @@ public class ComponentMapping implements Queryable { // find all elements which fulfill query List result = new LinkedList<>(); - while (data.get(idx)[0].equals(queryParameters.query())) { + while (idx < data.size() && data.get(idx)[0].equals(queryParameters.query())) { result.add(data.get(idx)); idx++; } diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/service/drools/ComponentDroolsExecutionService.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/service/drools/ComponentDroolsExecutionService.java index 62f85c66..9e785961 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/service/drools/ComponentDroolsExecutionService.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/service/drools/ComponentDroolsExecutionService.java @@ -124,7 +124,7 @@ public class ComponentDroolsExecutionService { private static void addOrUpdate(Set fileAttributes, List resultingFileAttributes) { for (FileAttribute resultingFileAttribute : resultingFileAttributes) { - fileAttributes.remove(resultingFileAttribute); + fileAttributes.removeIf(fa -> fa.getLabel().equals(resultingFileAttribute.getLabel())); fileAttributes.add(resultingFileAttribute); } }