bug5076: stop tracking and remove tracked race when "un-denoting"

This commit is contained in:
Axel Uhl
2024-09-10 18:27:58 +02:00
parent f85bc10e34
commit fcd8c6fdcc
6 changed files with 36 additions and 23 deletions
@@ -3,9 +3,12 @@ package com.sap.sailing.domain.abstractlog.impl;
import com.sap.sailing.domain.abstractlog.AbstractLog;
import com.sap.sailing.domain.abstractlog.AbstractLogEvent;
import com.sap.sailing.domain.abstractlog.BaseLogAnalyzer;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
/**
* Finds the most recent event in the log which is an {@code instanceof} {@link #ofType}.
* Finds the most recent {@link RaceLog#getUnrevokedEventsDescending() valid unrevoked event} in the log which is an
* {@code instanceof} {@link #ofType}.
*
* @author Fredrik Teschke
*
*/
@@ -22,13 +25,12 @@ VisitorT> extends BaseLogAnalyzer<LogT, EventT, VisitorT, EventT> {
@Override
protected EventT performAnalysis() {
Iterable<EventT> set = onlyUnrevoked ? getLog().getUnrevokedEventsDescending() : getAllEventsDescending();
for (EventT event : set) {
final Iterable<EventT> set = onlyUnrevoked ? getLog().getUnrevokedEventsDescending() : getAllEventsDescending();
for (final EventT event : set) {
if (ofType.isAssignableFrom(event.getClass())) {
return event;
}
}
return null;
}
}