Commit f915364f authored by Christoph Thelen's avatar Christoph Thelen

Fixed checkstyle errors

parent 34e15def
......@@ -21,7 +21,6 @@ package de.thm.arsnova.services;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
......@@ -56,7 +55,7 @@ public class SessionService implements ISessionService {
@Autowired
private ARSnovaSocketIOServer socketIoServer;
@Autowired(required=false)
@Autowired(required = false)
private ConnectorClient connectorClient;
public void setDatabaseDao(final IDatabaseDao newDatabaseDao) {
......@@ -117,26 +116,22 @@ public class SessionService implements ISessionService {
if (connectorClient == null) {
return mySessions;
}
List<Session> courseSessions = databaseDao.getCourseSessions(
connectorClient.getCourses(user.getUsername()).getCourse()
);
Map<String, Session> allAvailableSessions = new HashMap<String, Session>();
for (Session session : mySessions) {
allAvailableSessions.put(session.get_id(), session);
}
for (Session session : courseSessions) {
allAvailableSessions.put(session.get_id(), session);
}
List<Session> result = new ArrayList<Session>(allAvailableSessions.values());
return result;
return new ArrayList<Session>(allAvailableSessions.values());
}
@Override
public final List<Session> getMyVisitedSessions(final User user) {
return databaseDao.getMyVisitedSessions(user);
......@@ -152,7 +147,6 @@ public class SessionService implements ISessionService {
throw new ForbiddenException();
}
}
return databaseDao.saveSession(session);
}
......@@ -196,7 +190,7 @@ public class SessionService implements ISessionService {
Session session = databaseDao.getSessionFromKeyword(sessionkey);
return databaseDao.countActiveUsers(session, since);
}
public static class SessionNameComperator implements Comparator<Session>, Serializable {
private static final long serialVersionUID = 1L;
......@@ -205,8 +199,8 @@ public class SessionService implements ISessionService {
return session1.getName().compareToIgnoreCase(session2.getName());
}
}
public static class SessionShortNameComperator implements Comparator<Session>, Serializable{
public static class SessionShortNameComperator implements Comparator<Session>, Serializable {
private static final long serialVersionUID = 1L;
@Override
......
Markdown is supported
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