mirror of
https://github.com/correl/mage.git
synced 2024-12-01 03:00:09 +00:00
We're gonna use standart parameterised constructor, instead of addAll method.
This commit is contained in:
parent
192110cd68
commit
433b08238f
3 changed files with 3 additions and 6 deletions
|
@ -272,8 +272,7 @@ public class ChatManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<ChatSession> getChatSessions() {
|
public ArrayList<ChatSession> getChatSessions() {
|
||||||
ArrayList<ChatSession> chatSessionList = new ArrayList<>();
|
ArrayList<ChatSession> chatSessionList = new ArrayList<>(chatSessions.values());
|
||||||
chatSessionList.addAll(chatSessions.values());
|
|
||||||
return chatSessionList;
|
return chatSessionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -388,8 +388,7 @@ public class TableManager {
|
||||||
debugServerState();
|
debugServerState();
|
||||||
}
|
}
|
||||||
logger.debug("TABLE HEALTH CHECK");
|
logger.debug("TABLE HEALTH CHECK");
|
||||||
ArrayList<Table> tableCopy = new ArrayList<>();
|
ArrayList<Table> tableCopy = new ArrayList<>(tables.values());
|
||||||
tableCopy.addAll(tables.values());
|
|
||||||
for (Table table : tableCopy) {
|
for (Table table : tableCopy) {
|
||||||
try {
|
try {
|
||||||
if (table.getState() != TableState.FINISHED) {
|
if (table.getState() != TableState.FINISHED) {
|
||||||
|
|
|
@ -168,8 +168,7 @@ public class UserManager {
|
||||||
private void checkExpired() {
|
private void checkExpired() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.add(Calendar.MINUTE, -3);
|
calendar.add(Calendar.MINUTE, -3);
|
||||||
List<User> usersToCheck = new ArrayList<>();
|
List<User> usersToCheck = new ArrayList<>(users.values());
|
||||||
usersToCheck.addAll(users.values());
|
|
||||||
for (User user : usersToCheck) {
|
for (User user : usersToCheck) {
|
||||||
if (!user.getUserState().equals(UserState.Expired) && user.isExpired(calendar.getTime())) {
|
if (!user.getUserState().equals(UserState.Expired) && user.isExpired(calendar.getTime())) {
|
||||||
removeUser(user.getId(), DisconnectReason.SessionExpired);
|
removeUser(user.getId(), DisconnectReason.SessionExpired);
|
||||||
|
|
Loading…
Reference in a new issue