From 2e4dd3a01f19df7e964bb527d25dde5ed01f8007 Mon Sep 17 00:00:00 2001 From: Landon Reed Date: Fri, 29 Mar 2019 17:11:42 -0400 Subject: [PATCH] refactor(editor): remove service id filter param from normalize stop times --- .../com/conveyal/gtfs/loader/JdbcTableWriter.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/conveyal/gtfs/loader/JdbcTableWriter.java b/src/main/java/com/conveyal/gtfs/loader/JdbcTableWriter.java index 6d9e2adf8..b542baffd 100644 --- a/src/main/java/com/conveyal/gtfs/loader/JdbcTableWriter.java +++ b/src/main/java/com/conveyal/gtfs/loader/JdbcTableWriter.java @@ -271,7 +271,7 @@ public int normalizeStopTimesForPattern (int id, int beginWithSequence) throws S patternStopsToNormalize.add(patternStop); } } - int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize, null); + int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize); connection.commit(); return stopTimesUpdated; } catch (Exception e) { @@ -707,10 +707,11 @@ private int updateStopTimesForPatternStop(ObjectNode patternStop, int previousTr * departure times for existing trips after a pattern stop has been added or inserted into a pattern or if a * pattern stop's default travel or dwell time were updated and the stop times need to reflect this update. * @param patternStops list of pattern stops for which to update stop times (ordered by increasing stop_sequence) - * @param serviceIdFilters service_id values to filter trips on * @throws SQLException + * + * TODO? add param Set serviceIdFilters service_id values to filter trips on */ - private int updateStopTimesForPatternStops(List patternStops, Set serviceIdFilters) throws SQLException { + private int updateStopTimesForPatternStops(List patternStops) throws SQLException { PatternStop firstPatternStop = patternStops.iterator().next(); int firstStopSequence = firstPatternStop.stop_sequence; // Prepare SQL query to determine the time that should form the basis for adding the travel time values. @@ -724,12 +725,6 @@ private int updateStopTimesForPatternStops(List patternStops, Set 0) { - getFirstTravelTimeSql += String.format( - " and t.service_id in (%s)", - Collections.nCopies(serviceIdFilters.size(), "?") - ); - } PreparedStatement statement = connection.prepareStatement(getFirstTravelTimeSql); statement.setInt(1, previousStopSequence); statement.setString(2, firstPatternStop.pattern_id);