Skip to content

Commit

Permalink
Check that all objects have an id for PolylinesOverlap cache
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-b committed Dec 20, 2023
1 parent f5e7d6d commit 7e21c70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ protected Value evaluateInternal(String validationKind, String usageScope, IomOb
}

Collection<IomObject> inputObjects = argObjects.getComplexObjects();
boolean hasObjectIds = inputObjects.stream().anyMatch(o -> o.getobjectoid() != null);
List<String> objectIds = inputObjects.stream().map(IomObject::getobjectoid).collect(Collectors.toList());
boolean hasObjectIds = objectIds.stream().allMatch(Objects::nonNull);
if (!hasObjectIds) {
List<CompoundCurve> lines = convertToJTSLines(polylineObjects);
return new Value(hasEqualLinePart(lines));
}

List<String> 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 -> {
Expand Down

0 comments on commit 7e21c70

Please sign in to comment.