From 99f73d795e1c877513ca0e7c6fb8399e11bd600e Mon Sep 17 00:00:00 2001 From: miles-grant-ibi Date: Wed, 31 Jan 2024 14:14:45 -0500 Subject: [PATCH 1/2] shared stops validator: only consider stops from feed being checked --- .../jobs/validation/SharedStopsValidator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java b/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java index a99e686f2..6da6bcefa 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java @@ -127,17 +127,19 @@ public void validate() { // Check for SS_01 (stop id appearing in multiple stop groups). // Make sure this error is only returned if we are inside the feed that is being checked. - if (seenStopIds.contains(stopId)) { - if (feedId.equals(sharedStopFeedId)) { + Stop syntheticStop = new Stop(); + syntheticStop.stop_id = stopId; + if (feedId.equals(sharedStopFeedId)) { + if (seenStopIds.contains(stopId)) { registerError(stops .stream() .filter(stop -> stop.stop_id.equals(stopId)) .findFirst() - .orElse(new Stop()), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS + .orElse(syntheticStop), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS ); + }else { + seenStopIds.add(stopId); } - } else { - seenStopIds.add(stopId); } // Check for SS_02 (multiple primary stops per stop group). From eed8d91b70bebf501c401a3fddb440a76b1cfa83 Mon Sep 17 00:00:00 2001 From: miles-grant-ibi Date: Wed, 31 Jan 2024 14:16:08 -0500 Subject: [PATCH 2/2] lint --- .../datatools/manager/jobs/validation/SharedStopsValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java b/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java index 6da6bcefa..ed8d1a58e 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java @@ -137,7 +137,7 @@ public void validate() { .findFirst() .orElse(syntheticStop), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS ); - }else { + } else { seenStopIds.add(stopId); } }