Fixing bug 643 by returning a clones list for RegattaImpl.getAllRaces()

This commit is contained in:
Axel Uhl committed 2012-05-16 14:49:44 +02:00
1 parent f63a703caf
commit bd92f5ba8a
4 files changed
+15 -13

No files matched your search

@@ -26,9 +26,6 @@ public interface Regatta extends Named {
* For example, it may be the case that a {@link RaceDefinition} is returned by this method for which no
* {@link TrackedRace} exists in the corresponding {@link TrackedRegatta}. This could be the case, e.g., during
* the initialization of the tracker as well as during removing a race from the server.<p>
*
* Callers iterating over the result that anticipate concurrent modifications shall synchronize the iteration
* on the result.
*/
Iterable<RaceDefinition> getAllRaces();
@@ -64,7 +64,9 @@ public class RegattaImpl extends NamedImpl implements Regatta {
@Override
public Iterable<RaceDefinition> getAllRaces() {
return races;
synchronized (races) {
return new ArrayList<RaceDefinition>(races);
}
}
@Override
@@ -74,15 +76,12 @@ public class RegattaImpl extends NamedImpl implements Regatta {
@Override
public RaceDefinition getRaceByName(String raceName) {
Iterable<RaceDefinition> allRaces = getAllRaces();
synchronized (allRaces) {
for (RaceDefinition r : getAllRaces()) {
if (r.getName().equals(raceName)) {
return r;
}
for (RaceDefinition r : getAllRaces()) {
if (r.getName().equals(raceName)) {
return r;
}
return null;
}
return null;
}
@Override
@@ -234,7 +234,10 @@ abort=Abort
noLeaderboardGroupWithNameFound=No leaderboard group with the name {0} found
overview=Overview
welcomeToSailingAnalytics=Welcome to SAP Sailing Analytics
welcomeToSailingAnalyticsBody=Understanding what happens out on the race course isn't always easy. To help solve this challenge and bring the excitement of sailing to the fans, we have developed a leader board based on SAP analytics.\nThrough analyzing GPS data together with integrated wind measurements from sensors out on the race course, the leader board displays information such as in-race ranking, average speeds, distance travelled, ETA (estimated time of arrival at the next mark rounding), gaps to leader, gains and losses per leg.\n\nCheck out the results for yourself to see who triumphed - and how they did it.
welcomeToSailingAnalyticsBody=Understanding what happens out on the race course isn''t always easy. To help solve this challenge and bring the excitement of sailing to the fans, we have developed a leader board based on SAP analytics.\
Through analyzing GPS data together with integrated wind measurements from sensors out on the race course, the leader board displays information such as in-race ranking, average speeds, distance travelled, ETA (estimated time of arrival at the next mark rounding), gaps to leader, gains and losses per leg.\
\
Check out the results for yourself to see who triumphed - and how they did it.
home=Home
clickAndDragToZoomIn=Click and drag in the plot area to zoom in
windSpeed=Wind speed (kts)
@@ -235,7 +235,10 @@ abort=Abbrechen
noLeaderboardGroupWithNameFound=Keine Ranglisten-Gruppe mit dem Namen {0} gefunden
overview=Übersicht
welcomeToSailingAnalytics=Willkommen bei SAP Sailing Analytics
welcomeToSailingAnalyticsBody=Understanding what happens out on the race course isn't always easy. To help solve this challenge and bring the excitement of sailing to the fans, we have developed a leader board based on SAP analytics.\nThrough analyzing GPS data together with integrated wind measurements from sensors out on the race course, the leader board displays information such as in-race ranking, average speeds, distance travelled, ETA (estimated time of arrival at the next mark rounding), gaps to leader, gains and losses per leg.\n\nCheck out the results for yourself to see who triumphed - and how they did it.
welcomeToSailingAnalyticsBody=Understanding what happens out on the race course isn''t always easy. To help solve this challenge and bring the excitement of sailing to the fans, we have developed a leader board based on SAP analytics.\
Through analyzing GPS data together with integrated wind measurements from sensors out on the race course, the leader board displays information such as in-race ranking, average speeds, distance travelled, ETA (estimated time of arrival at the next mark rounding), gaps to leader, gains and losses per leg.\
\
Check out the results for yourself to see who triumphed - and how they did it.
home=Startseite
clickAndDragToZoomIn=Anklicken und ziehen zum Hineinzoomen
windSpeed=Wind speed (sm/h)