From 433b08238ff91abc22c7500a3def4820ac2904ae Mon Sep 17 00:00:00 2001 From: vraskulin Date: Thu, 9 Feb 2017 17:42:05 +0300 Subject: [PATCH] We're gonna use standart parameterised constructor, instead of addAll method. --- Mage.Server/src/main/java/mage/server/ChatManager.java | 3 +-- Mage.Server/src/main/java/mage/server/TableManager.java | 3 +-- Mage.Server/src/main/java/mage/server/UserManager.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/ChatManager.java b/Mage.Server/src/main/java/mage/server/ChatManager.java index 4619ad07c1..9a2052d989 100644 --- a/Mage.Server/src/main/java/mage/server/ChatManager.java +++ b/Mage.Server/src/main/java/mage/server/ChatManager.java @@ -272,8 +272,7 @@ public class ChatManager { } public ArrayList getChatSessions() { - ArrayList chatSessionList = new ArrayList<>(); - chatSessionList.addAll(chatSessions.values()); + ArrayList chatSessionList = new ArrayList<>(chatSessions.values()); return chatSessionList; } diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index e7ff34a203..cadf63e4a0 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -388,8 +388,7 @@ public class TableManager { debugServerState(); } logger.debug("TABLE HEALTH CHECK"); - ArrayList tableCopy = new ArrayList<>(); - tableCopy.addAll(tables.values()); + ArrayList
tableCopy = new ArrayList<>(tables.values()); for (Table table : tableCopy) { try { if (table.getState() != TableState.FINISHED) { diff --git a/Mage.Server/src/main/java/mage/server/UserManager.java b/Mage.Server/src/main/java/mage/server/UserManager.java index acd963a62d..a1c45d113f 100644 --- a/Mage.Server/src/main/java/mage/server/UserManager.java +++ b/Mage.Server/src/main/java/mage/server/UserManager.java @@ -168,8 +168,7 @@ public class UserManager { private void checkExpired() { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MINUTE, -3); - List usersToCheck = new ArrayList<>(); - usersToCheck.addAll(users.values()); + List usersToCheck = new ArrayList<>(users.values()); for (User user : usersToCheck) { if (!user.getUserState().equals(UserState.Expired) && user.isExpired(calendar.getTime())) { removeUser(user.getId(), DisconnectReason.SessionExpired);