Skip to content

Commit

Permalink
Avoid ConcurrentModificationException when looping over agencies. #15.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed Aug 29, 2012
1 parent 5991a6d commit e5363ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/MetroArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ public void mergeAreas (MetroArea other) {
GeometryFactory factory;

for (NtdAgency agency : other.agencies) {
this.agencies.add(agency);
other.agencies.remove(agency);
this.agencies.add(agency);;
}

// erase all other's agencies
other.initializeAgencies();

// now, combine geometries

Expand Down

0 comments on commit e5363ea

Please sign in to comment.