Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java =================================================================== diff -u -r5b5c0b11229d23a7dd68e772f20cb4a3a9829a76 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (.../VoteContentDAO.java) (revision 5b5c0b11229d23a7dd68e772f20cb4a3a9829a76) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (.../VoteContentDAO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -23,7 +23,6 @@ package org.lamsfoundation.lams.tool.vote.dao.hibernate; import java.util.List; -import java.util.Set; import org.hibernate.FlushMode; import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; @@ -64,11 +63,11 @@ @Override public VoteContent getVoteContentByContentId(Long voteContentId) { String query = "from VoteContent as vote where vote.voteContentId = ?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteContentId.longValue()) - .list(); + List list = getSessionFactory().getCurrentSession().createQuery(query) + .setLong(0, voteContentId.longValue()).list(); if (list != null && list.size() > 0) { - VoteContent vote = (VoteContent) list.get(0); + VoteContent vote = list.get(0); return vote; } return null; @@ -96,11 +95,11 @@ @Override public void removeVoteById(Long voteContentId) { if (voteContentId != null) { - List list = getSessionFactory().getCurrentSession().createQuery(VoteContentDAO.FIND_VOTE_CONTENT) - .setLong(0, voteContentId.longValue()).list(); + List list = getSessionFactory().getCurrentSession() + .createQuery(VoteContentDAO.FIND_VOTE_CONTENT).setLong(0, voteContentId.longValue()).list(); if (list != null && list.size() > 0) { - VoteContent vote = (VoteContent) list.get(0); + VoteContent vote = list.get(0); getSessionFactory().getCurrentSession().setFlushMode(FlushMode.AUTO); getSession().delete(vote); getSession().flush(); @@ -126,7 +125,7 @@ @Override public void removeQuestionsFromCache(VoteContent voteContent) { if (voteContent != null) { - for (VoteQueContent question : (Set) voteContent.getVoteQueContents()) { + for (VoteQueContent question : voteContent.getVoteQueContents()) { getSession().evict(question); } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java =================================================================== diff -u -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -38,7 +38,7 @@ @Repository public class VoteQueContentDAO extends LAMSBaseDAO implements IVoteQueContentDAO { - // private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; + // private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; @@ -55,11 +55,11 @@ @Override public VoteQueContent getDefaultVoteContentFirstQuestion() { final long voteContentId = 1; - List list = getSessionFactory().getCurrentSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) - .setLong("voteContentId", voteContentId).list(); + List list = getSessionFactory().getCurrentSession() + .createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID).setLong("voteContentId", voteContentId).list(); if (list != null && list.size() > 0) { - VoteQueContent voteq = (VoteQueContent) list.get(0); + VoteQueContent voteq = list.get(0); return voteq; } return null; @@ -68,12 +68,12 @@ @SuppressWarnings("unchecked") @Override public VoteQueContent getQuestionByDisplayOrder(final Long displayOrder, final Long voteContentUid) { - List list = getSessionFactory().getCurrentSession().createQuery(LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER) - .setLong("displayOrder", displayOrder.longValue()).setLong("voteContentUid", voteContentUid.longValue()) - .list(); + List list = getSessionFactory().getCurrentSession() + .createQuery(LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER).setLong("displayOrder", displayOrder.longValue()) + .setLong("voteContentUid", voteContentUid.longValue()).list(); if (list != null && list.size() > 0) { - VoteQueContent voteq = (VoteQueContent) list.get(0); + VoteQueContent voteq = list.get(0); return voteq; } return null; @@ -82,8 +82,8 @@ @SuppressWarnings("unchecked") @Override public List getAllQuestionsSorted(final long voteContentId) { - List list = getSessionFactory().getCurrentSession().createQuery(SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER) - .setLong("voteContentId", voteContentId).list(); + List list = getSessionFactory().getCurrentSession() + .createQuery(SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER).setLong("voteContentId", voteContentId).list(); return list; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java =================================================================== diff -u -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -61,11 +61,11 @@ public VoteSession getSessionBySessionId(Long voteSessionId) { String query = "from VoteSession votes where votes.voteSessionId=?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteSessionId.longValue()) - .list(); + List list = getSessionFactory().getCurrentSession().createQuery(query) + .setLong(0, voteSessionId.longValue()).list(); if (list != null && list.size() > 0) { - VoteSession vote = (VoteSession) list.get(0); + VoteSession vote = list.get(0); return vote; } return null; @@ -108,7 +108,7 @@ .setLong(0, voteSessionId.longValue()).list(); if (list != null && list.size() > 0) { - VoteSession vote = (VoteSession) list.get(0); + VoteSession vote = list.get(0); getSessionFactory().getCurrentSession().setFlushMode(FlushMode.AUTO); getSession().delete(vote); getSession().flush(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java =================================================================== diff -u -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -49,10 +49,11 @@ public VoteQueUsr getUserByUserId(Long userId) { String query = "from VoteQueUsr user where user.queUsrId=?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, userId.longValue()).list(); + List list = getSessionFactory().getCurrentSession().createQuery(query) + .setLong(0, userId.longValue()).list(); if (list != null && list.size() > 0) { - VoteQueUsr voteu = (VoteQueUsr) list.get(0); + VoteQueUsr voteu = list.get(0); return voteu; } return null; @@ -68,7 +69,7 @@ if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { - VoteQueUsr user = (VoteQueUsr) listIterator.next(); + VoteQueUsr user = listIterator.next(); if (user.getVoteSession().getSessionStatus().equals("COMPLETED")) { ++completedSessionUserCount; } @@ -87,7 +88,7 @@ .setLong("queUsrId", queUsrId.longValue()).setLong("voteSessionId", voteSessionId.longValue()).list(); if (list != null && list.size() > 0) { - VoteQueUsr usr = (VoteQueUsr) list.get(0); + VoteQueUsr usr = list.get(0); return usr; } return null; @@ -98,10 +99,11 @@ public VoteQueUsr getVoteQueUsrById(long voteQueUsrId) { String query = "from VoteQueUsr user where user.queUsrId=?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteQueUsrId).list(); + List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteQueUsrId) + .list(); if (list != null && list.size() > 0) { - VoteQueUsr qu = (VoteQueUsr) list.get(0); + VoteQueUsr qu = list.get(0); return qu; } return null; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -100,8 +100,8 @@ @SuppressWarnings("unchecked") @Override public List getAttemptsForUser(final Long queUsrId) { - List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER) - .setLong("queUsrId", queUsrId.longValue()).list(); + List list = getSessionFactory().getCurrentSession() + .createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER).setLong("queUsrId", queUsrId.longValue()).list(); return list; } @@ -111,7 +111,7 @@ List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRIES) .setLong("voteContentUid", voteContentUid).list(); - Set userEntries = new HashSet(); + Set userEntries = new HashSet<>(); if ((list != null) && (list.size() > 0)) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { @@ -222,7 +222,7 @@ .createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION) .setLong("queUsrId", queUsrId.longValue()).setLong("sessionUid", sessionUid.longValue()).list(); - Set userEntries = new HashSet(); + Set userEntries = new HashSet<>(); if ((list != null) && (list.size() > 0)) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { @@ -249,8 +249,9 @@ @SuppressWarnings("unchecked") @Override public int getSessionEntriesCount(final Long voteSessionUid) { - List result = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID) - .setLong("voteSessionUid", voteSessionUid).list(); + List result = getSessionFactory().getCurrentSession() + .createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID).setLong("voteSessionUid", voteSessionUid) + .list(); Long resultLong = result.get(0) != null ? (Long) result.get(0) : new Long(0); return resultLong.intValue(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralAuthoringDTO.java =================================================================== diff -u -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralAuthoringDTO.java (.../VoteGeneralAuthoringDTO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralAuthoringDTO.java (.../VoteGeneralAuthoringDTO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -52,8 +52,8 @@ protected String contentFolderID; protected String editableQuestionText; - // protected List attachmentList; - // protected List deletedAttachmentList; + // protected List attachmentList; + // protected List deletedAttachmentList; protected String reflect; protected String reflectionSubject; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralLearnerFlowDTO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r56531c4382aa9cf2b2811f85401afc4539659f14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralLearnerFlowDTO.java (.../VoteGeneralLearnerFlowDTO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralLearnerFlowDTO.java (.../VoteGeneralLearnerFlowDTO.java) (revision 56531c4382aa9cf2b2811f85401afc4539659f14) @@ -35,7 +35,7 @@ * * @author Ozgur Demirtas */ -public class VoteGeneralLearnerFlowDTO implements Comparable { +public class VoteGeneralLearnerFlowDTO implements Comparable { protected String activityTitle; protected String activityInstructions; @@ -92,7 +92,7 @@ protected Date submissionDeadline; - protected Map mapGeneralCheckedOptionsContent; + protected Map mapGeneralCheckedOptionsContent; protected Map mapStandardNominationsContent; @@ -108,6 +108,7 @@ // protected List listMonitoredAnswersContainerDto; + @SuppressWarnings("rawtypes") protected List listUserEntries; /** @@ -383,6 +384,7 @@ /** * @return Returns the listUserEntries. */ + @SuppressWarnings("rawtypes") public List getListUserEntries() { return listUserEntries; } @@ -391,6 +393,7 @@ * @param listUserEntries * The listUserEntries to set. */ + @SuppressWarnings("rawtypes") public void setListUserEntries(List listUserEntries) { this.listUserEntries = listUserEntries; } @@ -567,15 +570,15 @@ /** * @return Returns the mapGeneralCheckedOptionsContent. */ - public Map getMapGeneralCheckedOptionsContent() { + public Map getMapGeneralCheckedOptionsContent() { return mapGeneralCheckedOptionsContent; } /** * @param mapGeneralCheckedOptionsContent * The mapGeneralCheckedOptionsContent to set. */ - public void setMapGeneralCheckedOptionsContent(Map mapGeneralCheckedOptionsContent) { + public void setMapGeneralCheckedOptionsContent(Map mapGeneralCheckedOptionsContent) { this.mapGeneralCheckedOptionsContent = mapGeneralCheckedOptionsContent; }