mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 11:53:53 +00:00
solving bug 785 by cloning the WindSources collection
This commit is contained in:
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();
|
||||
|
||||
|
||||
+3
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user