read Integer (or any Number) score corrections from MongoDB as Double

This commit is contained in:
Axel Uhl committed 2012-07-19 23:07:37 +02:00
1 parent 5fbfce5374
commit 5dc814925b
1 file changed
+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);
}
}
}