found a fix for bug 4025 that also fixes the failing test case;

compute old results by using an extension to the results finder that can
exclude a particular result event; then remove score corrections
matching old results that are not overwritten by new results

Change-Id: I953f85a5dd04bffc5a82941406492aa7d8a5641d
This commit is contained in:
Axel Uhl committed 2017-01-11 18:10:01 +01:00
1 parent a803fe2e64
commit 0fe25e1842
5 files changed
+93 -22

No files matched your search

@@ -13,12 +13,30 @@ public class ConfirmedFinishPositioningListFinder extends RaceLogAnalyzer<Compet
@Override
protected CompetitorResults performAnalysis() {
return performAnalysis(/* eventToIgnore */ null);
}
private CompetitorResults performAnalysis(RaceLogFinishPositioningConfirmedEvent eventToIgnore) {
for (RaceLogEvent event : getPassEventsDescending()) {
if (event instanceof RaceLogFinishPositioningConfirmedEvent) {
if (event != eventToIgnore && event instanceof RaceLogFinishPositioningConfirmedEvent) {
RaceLogFinishPositioningConfirmedEvent finishPositioningEvent = (RaceLogFinishPositioningConfirmedEvent) event;
return finishPositioningEvent.getPositionedCompetitorsIDsNamesMaxPointsReasons();
}
}
return null;
}
/**
* Same as {@link #analyze()}, only that if {@code event} is found in the log then it is ignored for this
* analysis. This way, the method returns a result as it would have been without {@code event} in the
* {@link RaceLog}. This can be useful, e.g., to determine the result prior to the last update.
*/
public CompetitorResults analyzeIgnoring(RaceLogFinishPositioningConfirmedEvent event) {
log.lockForRead();
try {
return performAnalysis(event);
} finally {
log.unlockAfterRead();
}
}
}
@@ -1,6 +1,5 @@
package com.sap.sailing.domain.abstractlog.race.state;
public interface RaceStateChangedListener {
void onRacingProcedureChanged(ReadonlyRaceState state);