final List<QuestionAnswer> answerList = getQuestionDao().getAnswersByQuestionId(poll.getQuestion().getQid());
for (QuestionAnswer questionAnswer : answerList) {
final List<Object[]> myPoll = getPollDao().retrieveResultPollsbyAnswer(poll.getPollId(), questionAnswer.getQuestionAnswerId());
log.debug(" Resultpolls by answer ---> " + myPoll.size() + "\n");
if (myPoll.size() == 0) {
final PollBeanResult result = ConvertDomainBean.convertPollResultToBean(questionAnswer.getQuestionAnswerId(),
questionAnswer.getAnswer(), questionAnswer.getColor(), 0L, poll.getQuestion());
results.add(result);
} else {
for (Object[] objects2 : myPoll) {
final Long answerId = objects2[0] == null ? null : Long.valueOf(objects2[0].toString());
final String answerString = objects2[1] == null ? null : objects2[1].toString();
final String color = objects2[2] == null ? null : objects2[2].toString();
final Long votes = objects2[3] == null ? null : Long.valueOf(objects2[3].toString());
if (answerId != null) {
final PollBeanResult result = ConvertDomainBean.convertPollResultToBean(answerId, answerString, color, votes, poll.getQuestion());
results.add(result);
} else {
throw new IllegalArgumentException("answer id is empty");
}
}