solving bug 785 by cloning the WindSources collection

This commit is contained in:
Axel Uhl committed 2012-06-18 09:49:41 +02:00
1 parent f7aef32b74
commit fc41de7a51
2 files changed
+4 -2

No files matched your search

@@ -214,7 +214,7 @@ public interface TrackedRace extends Serializable {
Iterable<WindSource> getWindSources(WindSourceType type);
/**
* Retrieves all wind sources used by this race.
* Retrieves all wind sources used by this race. Callers can freely iterate because a copied collection is returned.
*/
Iterable<WindSource> getWindSources();
@@ -1659,7 +1659,9 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
@Override
public Iterable<WindSource> getWindSources() {
return windTracks.keySet();
synchronized (windTracks) {
return new ArrayList<WindSource>(windTracks.keySet());
}
}
@Override