sonar cleanup in Sessionhandler

This commit is contained in:
Ingmar Goudt 2019-03-10 22:04:27 +01:00
parent dab481ee17
commit 7a5920322d

View file

@ -14,6 +14,7 @@ import mage.remote.MageRemoteException;
import mage.remote.Session;
import mage.remote.SessionImpl;
import mage.view.*;
import org.apache.log4j.Logger;
import java.util.*;
@ -22,9 +23,15 @@ import java.util.*;
*/
public final class SessionHandler {
private static final Logger logger = Logger.getLogger(SessionHandler.class);
private static Session session;
private static String lastConnectError = "";
private SessionHandler(){
}
public static void startSession(MageFrame mageFrame) {
session = new SessionImpl(mageFrame);
@ -181,7 +188,7 @@ public final class SessionHandler {
try {
return session.getTournament(tournamentId);
} catch (MageRemoteException e) {
e.printStackTrace();
logger.info(e);
return null;
}
@ -275,7 +282,7 @@ public final class SessionHandler {
try {
return session.getRoomUsers(roomId);
} catch (MageRemoteException e) {
e.printStackTrace();
logger.info(e);
return Collections.emptyList();
}
}
@ -284,8 +291,8 @@ public final class SessionHandler {
try {
return session.getFinishedMatches(roomId);
} catch (MageRemoteException e) {
e.printStackTrace();
return new ArrayList<>();
logger.info(e);
return Collections.emptyList();
}
}
@ -301,8 +308,8 @@ public final class SessionHandler {
try {
return session.getTables(roomId);
} catch (MageRemoteException e) {
e.printStackTrace();
return new ArrayList<>();
logger.info(e);
return Collections.emptyList();
}
}