fix for bug 3037: use int[0] to encode no discards on regatta; make regatta leaderboard dialog robust for null discarding threshold array

This commit is contained in:
Axel Uhl committed 2015-06-27 10:16:29 +02:00
1 parent ffa6b1f6ca
commit dbdcdfebb0
3 files changed
+5 -3

No files matched your search

@@ -74,7 +74,9 @@ public abstract class RegattaLeaderboardDialog extends AbstractLeaderboardDialog
}
regattaDefinesDiscardsLabel.setVisible(true);
} else {
discardThresholdBoxes.getWidget().setVisible(true);
if (discardThresholdBoxes != null) {
discardThresholdBoxes.getWidget().setVisible(true);
}
regattaDefinesDiscardsLabel.setVisible(false);
}
}
@@ -23,7 +23,7 @@ public class RegattaLeaderboardEditDialog extends RegattaLeaderboardDialog {
regattaListBox = createSortedRegattaListBox(existingRegattas, leaderboardDescriptor.getRegattaName());
regattaListBox.setEnabled(false);
if (leaderboardDescriptor.getDiscardThresholds() != null) {
if (!getSelectedRegatta().definesSeriesDiscardThresholds()) {
discardThresholdBoxes = new DiscardThresholdBoxes(this, leaderboardDescriptor.getDiscardThresholds(), stringMessages);
} // else, the regatta leaderboard obtains its result discarding rule implicitly from the underlying regatta
adjustVisibilityOfResultDiscardingRuleComponent();
@@ -133,7 +133,7 @@ public class SeriesEditDialog extends DataEntryDialog<SeriesDescriptor> {
}
return new SeriesDescriptor(selectedSeries, seriesNameTextBox.getValue(), races, isMedalCheckbox.getValue(),
useSeriesResultDiscardingThresholdsCheckbox.getValue() ? discardThresholdBoxes.getDiscardThresholds()
: null, startWithZeroScoreCheckbox.getValue(),
: new int[0], startWithZeroScoreCheckbox.getValue(),
firstColumnIsNonDiscardableCarryForwardCheckbox.getValue(), hasSplitFleetContiguousScoringCheckbox.getValue());
}