Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Esposito committed Aug 18, 2017
1 parent 9042324 commit 379e1cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Handler<Message<String>> pollCreatedEventListener() {
pollCreatedEvent.getOptions(),
new HashMap<>(),
new HashMap<>()
));
));
} catch (PollCreationException e) {
e.printStackTrace();
}
Expand All @@ -75,7 +75,7 @@ private Handler<Message<String>> answerSubmittedEventListener() {
Poll p = polls.get(answerSubmitted.getPollID());
// Todo stats

if (p!=null){
if (p != null) {
p.getAnswers().putAll(answerSubmitted.getAnswers());
polls.put(p.getPollID(), p);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;


/**
Expand Down Expand Up @@ -86,12 +85,12 @@ private Handler<Message<Object>> submitAnswer() {
SubmitAnswerCommand.class);

Poll p = polls.get(submitAnswerCommand.getPollID());
if (p != null){
if (p != null) {
submitAnswerCommand.getAnswers().forEach(a -> {
p.getAnswers().merge(a, 1, Integer::sum);
});

polls.put(p.getPollID(), p);
polls.put(p.getPollID(), p);

final AnswerSubmitted answerSubmitted = new AnswerSubmitted(p.getPollID(), p.getAnswers());
vertx.eventBus().send("answerSubmittedEvent", Json.encode(answerSubmitted));
Expand Down

0 comments on commit 379e1cb

Please sign in to comment.