Skip to content

Commit

Permalink
use addError/hasErrors instead of List interface
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrd committed Jan 11, 2024
1 parent 6545e97 commit e294e80
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ public boolean resolve(TransportNetwork network) {
for (TripPattern tripPattern : network.transitLayer.tripPatterns) {
String feedId = feedIdForTripPattern(tripPattern);
if (isNullOrEmpty(feedId)) {
errors.add("Could not find feed ID prefix in route ID " + tripPattern.routeId);
addError("Could not find feed ID prefix in route ID " + tripPattern.routeId);
continue;
}
GTFSFeed feed = feedForUnscopedId.get(feedId);
if (feed == null) {
errors.add("Could not find feed for ID " + feedId);
addError("Could not find feed for ID " + feedId);
}
}
return errors.size() > 0;
return hasErrors();
}

@Override
Expand Down Expand Up @@ -133,7 +133,7 @@ public boolean apply(TransportNetwork network) {
// Store the resulting precomputed information in a SelectedLink instance on the TransportNetwork.
// This could also be on the TransitLayer, but we may eventually want to include street edges in SelectedLink.
network.selectedLink = new SelectedLink(network.transitLayer, hopsInTripPattern);
return errors.size() > 0;
return hasErrors();
}

// By returning false for both affects methods, we make a very shallow copy of the TransitNetwork for efficiency.
Expand Down

0 comments on commit e294e80

Please sign in to comment.