Skip to content

Commit

Permalink
refactor(Entity.java): Updated zip sub directory file name check
Browse files Browse the repository at this point in the history
Replaced endsWith with equals to avoid unwanted matches e.g. stop_areas.txt being used instead of
areas.txt
  • Loading branch information
br648 committed Aug 19, 2024
1 parent 208ea3c commit 5f0c806
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/conveyal/gtfs/model/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public void loadTable(ZipFile zip) throws IOException {
// check if table is contained within sub-directory
while (entries.hasMoreElements()) {
ZipEntry e = entries.nextElement();
if (e.getName().endsWith(tableName + ".txt")) {
if (e.getName().equals(tableName + ".txt")) {
entry = e;
feed.errors.add(new TableInSubdirectoryError(tableName, entry.getName().replace(tableName + ".txt", "")));
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/conveyal/gtfs/GTFSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void canLoadAndExportFaresV2Feed() throws IOException {
}

/**
* Persistence expectations for use with the GTFS contained within the "MBTA_GTFS_Fares_v2.zip" feed.
* Persistence expectations for use with the GTFS contained within the "fake-agency-with-fares-v2" feed.
*/
private final PersistenceExpectation[] faresV2PersistenceExpectations = new PersistenceExpectation[]{
new PersistenceExpectation(
Expand Down

0 comments on commit 5f0c806

Please sign in to comment.