From 7e21c701cd50ded94a29936c07ee6e9a170725da Mon Sep 17 00:00:00 2001 From: Dominic Burger Date: Wed, 20 Dec 2023 15:49:37 +0100 Subject: [PATCH] Check that all objects have an id for PolylinesOverlap cache --- .../extensions/functions/PolylinesOverlapIoxPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/geowerkstatt/ilivalidator/extensions/functions/PolylinesOverlapIoxPlugin.java b/src/main/java/ch/geowerkstatt/ilivalidator/extensions/functions/PolylinesOverlapIoxPlugin.java index f94a6c4..9d7f2e0 100644 --- a/src/main/java/ch/geowerkstatt/ilivalidator/extensions/functions/PolylinesOverlapIoxPlugin.java +++ b/src/main/java/ch/geowerkstatt/ilivalidator/extensions/functions/PolylinesOverlapIoxPlugin.java @@ -54,13 +54,13 @@ protected Value evaluateInternal(String validationKind, String usageScope, IomOb } Collection inputObjects = argObjects.getComplexObjects(); - boolean hasObjectIds = inputObjects.stream().anyMatch(o -> o.getobjectoid() != null); + List objectIds = inputObjects.stream().map(IomObject::getobjectoid).collect(Collectors.toList()); + boolean hasObjectIds = objectIds.stream().allMatch(Objects::nonNull); if (!hasObjectIds) { List lines = convertToJTSLines(polylineObjects); return new Value(hasEqualLinePart(lines)); } - List objectIds = inputObjects.stream().map(IomObject::getobjectoid).collect(Collectors.toList()); HasEqualLinePartKey key = new HasEqualLinePartKey(objectIds, argPath.isUndefined() ? null : argPath.getValue()); boolean hasOverlap = HAS_EQUAL_LINE_PART_CACHE.computeIfAbsent(key, k -> {