Skip to content
Snippets Groups Projects
Commit ac1e34dd authored by Christoph Thelen's avatar Christoph Thelen
Browse files

Removed warnings

parent 6a7b0b5c
No related merge requests found
...@@ -22,12 +22,10 @@ package de.thm.arsnova.dao; ...@@ -22,12 +22,10 @@ package de.thm.arsnova.dao;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.AbstractMap; import java.util.AbstractMap;
import java.util.AbstractMap.SimpleEntry; import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.List; import java.util.List;
import net.sf.ezmorph.Morpher; import net.sf.ezmorph.Morpher;
...@@ -364,10 +362,8 @@ public class CouchDBDao implements IDatabaseDao { ...@@ -364,10 +362,8 @@ public class CouchDBDao implements IDatabaseDao {
); );
final JSONArray possibleAnswers = results.getJSONArray("rows").optJSONObject(0).optJSONObject("value") final JSONArray possibleAnswers = results.getJSONArray("rows").optJSONObject(0).optJSONObject("value")
.getJSONArray("possibleAnswers"); .getJSONArray("possibleAnswers");
final Collection<PossibleAnswer> answers = JSONArray.toCollection( @SuppressWarnings("unchecked")
possibleAnswers, final Collection<PossibleAnswer> answers = JSONArray.toCollection(possibleAnswers, PossibleAnswer.class);
PossibleAnswer.class
);
q.setPossibleAnswers(new ArrayList<PossibleAnswer>(answers)); q.setPossibleAnswers(new ArrayList<PossibleAnswer>(answers));
q.setSessionKeyword(getSessionKeyword(q.getSessionId())); q.setSessionKeyword(getSessionKeyword(q.getSessionId()));
return q; return q;
...@@ -390,6 +386,7 @@ public class CouchDBDao implements IDatabaseDao { ...@@ -390,6 +386,7 @@ public class CouchDBDao implements IDatabaseDao {
loggedIn = (LoggedIn) JSONObject.toBean(json, LoggedIn.class); loggedIn = (LoggedIn) JSONObject.toBean(json, LoggedIn.class);
final JSONArray vs = json.optJSONArray("visitedSessions"); final JSONArray vs = json.optJSONArray("visitedSessions");
if (vs != null) { if (vs != null) {
@SuppressWarnings("unchecked")
final Collection<VisitedSession> visitedSessions = JSONArray.toCollection(vs, VisitedSession.class); final Collection<VisitedSession> visitedSessions = JSONArray.toCollection(vs, VisitedSession.class);
loggedIn.setVisitedSessions(new ArrayList<VisitedSession>(visitedSessions)); loggedIn.setVisitedSessions(new ArrayList<VisitedSession>(visitedSessions));
} }
...@@ -421,6 +418,7 @@ public class CouchDBDao implements IDatabaseDao { ...@@ -421,6 +418,7 @@ public class CouchDBDao implements IDatabaseDao {
final LoggedIn l = (LoggedIn) JSONObject.toBean(doc.getJSONObject(), LoggedIn.class); final LoggedIn l = (LoggedIn) JSONObject.toBean(doc.getJSONObject(), LoggedIn.class);
final JSONArray vs = doc.getJSONObject().optJSONArray("visitedSessions"); final JSONArray vs = doc.getJSONObject().optJSONArray("visitedSessions");
if (vs != null) { if (vs != null) {
@SuppressWarnings("unchecked")
final Collection<VisitedSession> visitedSessions = JSONArray.toCollection(vs, VisitedSession.class); final Collection<VisitedSession> visitedSessions = JSONArray.toCollection(vs, VisitedSession.class);
l.setVisitedSessions(new ArrayList<VisitedSession>(visitedSessions)); l.setVisitedSessions(new ArrayList<VisitedSession>(visitedSessions));
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment