mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-21 11:40:01 +00:00
read Integer (or any Number) score corrections from MongoDB as Double
This commit is contained in:
1 parent
5fbfce5374
commit
5dc814925b
1 file changed
+4
-3
+4
-3
@@ -266,7 +266,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
DBObject carriedPoints = (DBObject) dbLeaderboard.get(FieldNames.LEADERBOARD_CARRIED_POINTS.name());
|
||||
if (carriedPoints != null) {
|
||||
for (String competitorName : carriedPoints.keySet()) {
|
||||
Double carriedPointsForCompetitor = (Double) carriedPoints.get(competitorName);
|
||||
Double carriedPointsForCompetitor = ((Number) carriedPoints.get(competitorName)).doubleValue();
|
||||
if (carriedPointsForCompetitor != null) {
|
||||
correctionsToUpdate.setCarriedPoints(MongoUtils.unescapeDollarAndDot(competitorName), carriedPointsForCompetitor);
|
||||
}
|
||||
@@ -284,8 +284,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
.get(FieldNames.LEADERBOARD_SCORE_CORRECTION_MAX_POINTS_REASON.name())));
|
||||
}
|
||||
if (dbScoreCorrectionForCompetitorInRace.containsField(FieldNames.LEADERBOARD_CORRECTED_SCORE.name())) {
|
||||
correctionsToUpdate.correctScore(MongoUtils.unescapeDollarAndDot(competitorName), raceColumn, (Double) dbScoreCorrectionForCompetitorInRace
|
||||
.get(FieldNames.LEADERBOARD_CORRECTED_SCORE.name()));
|
||||
final Double leaderboardCorrectedScore = ((Number) dbScoreCorrectionForCompetitorInRace
|
||||
.get(FieldNames.LEADERBOARD_CORRECTED_SCORE.name())).doubleValue();
|
||||
correctionsToUpdate.correctScore(MongoUtils.unescapeDollarAndDot(competitorName), raceColumn, (Double) leaderboardCorrectedScore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user