Adjusted TracTracEventManagementPanelPO.startTrackingForRaces to throw

an exception if not all given races were selected
This commit is contained in:
Steffen Schaefer committed 2017-04-04 15:56:24 +02:00
1 parent cdfa2140dc
commit 700e6f8728
1 file changed
+5 -1
@@ -244,9 +244,13 @@ public class TracTracEventManagementPanelPO extends PageArea {
}
public void startTrackingForRaces(List<TrackableRaceDescriptor> races) {
List<TrackableRaceDescriptor> racesToProcess = new ArrayList<>(races);
CellTablePO<DataEntryPO> table = getTrackableRacesTable();
table.selectEntries(e -> races.contains(new TrackableRaceDescriptor(e.getColumnContent("Event"),
table.selectEntries(e -> racesToProcess.remove(new TrackableRaceDescriptor(e.getColumnContent("Event"),
e.getColumnContent("Race"), e.getColumnContent("Boat Class"))));
if(!racesToProcess.isEmpty()) {
throw new IllegalStateException("Not all given races where selected");
}
startTrackingAndWaitForAjaxRequests();
}