|
@@ -40,17 +40,16 @@ public class ComputeResultController {
|
40
|
40
|
|
41
|
41
|
for (Vote v: allVotes) {
|
42
|
42
|
Long optionID = (v.getOption().getId());
|
43
|
|
- OptionCount temp;
|
44
|
43
|
if (!optionCountsMap.keySet().contains(optionID)) {
|
45
|
|
- temp = new OptionCount();
|
46
|
|
- temp.setCount(1);
|
47
|
|
- optionCountsMap.put(optionID,temp);
|
|
44
|
+ optionCountsMap.put(optionID, new OptionCount());
|
|
45
|
+// optionCountsMap.get(optionID).setCount(1);
|
48
|
46
|
} else {
|
49
|
|
- temp = optionCountsMap.get(optionID);
|
|
47
|
+ OptionCount temp = optionCountsMap.get(optionID);
|
50
|
48
|
temp.setCount(temp.getCount()+1);
|
51
|
49
|
optionCountsMap.replace(optionID, temp);
|
52
|
50
|
}
|
53
|
51
|
}
|
|
52
|
+
|
54
|
53
|
voteResult.setTotalVotes((int)voteCount);
|
55
|
54
|
voteResult.setResults(optionCountsMap.values());
|
56
|
55
|
|