event's dominant boat class is not determined by the dominant boat class of the event (if there

are only two, none is dominant) but by the event's competitors' dominant boat class
This commit is contained in:
Axel Uhl committed 2011-06-24 18:42:11 +02:00
1 parent 07bded4764
commit a00ed444ad
1 file changed
+4 -1
@@ -310,7 +310,10 @@ public class DomainFactoryImpl implements DomainFactory {
// This means that currently it is permissible to assume that we'll get at most one
// boat class per TracTrac event. Generally, however, we have to assume that
// one TracTrac event may map to multiple domain Event objects with one BoatClass each
Collection<CompetitorClass> competitorClassList = event.getCompetitorClassList();
Collection<CompetitorClass> competitorClassList = new ArrayList<CompetitorClass>();
for (com.tractrac.clientmodule.Competitor c : event.getCompetitorList()) {
competitorClassList.add(c.getCompetitorClass());
}
BoatClass boatClass = getDominantBoatClass(competitorClassList);
Pair<String, String> key = new Pair<String, String>(event.getName(), boatClass==null?null:boatClass.getName());
Event result = eventCache.get(key);