diff --git a/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/KlausurenServer.java b/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/KlausurenServer.java index 802872b..b60f0b9 100644 --- a/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/KlausurenServer.java +++ b/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/KlausurenServer.java @@ -8,11 +8,16 @@ import java.util.concurrent.*; public class KlausurenServer { private ConcurrentMap> data = new ConcurrentHashMap<>(); - private static ExecutorService executorService = Executors.newCachedThreadPool(); - private static ServerSocket serverSocket; + private ExecutorService executorService = Executors.newCachedThreadPool(); + private ServerSocket serverSocket; private static Map commands = new HashMap<>(); + + static Map getCommands() { + return commands; + } + private boolean running; public KlausurenServer(int port) { @@ -50,9 +55,8 @@ public class KlausurenServer { set.forEach((key, value) -> set.forEach((s, integers) -> { if(!value.equals(integers)) { - if (integers.containsAll(value)) { + if (integers.containsAll(value)) set.remove(key); - } } })); @@ -159,10 +163,6 @@ public class KlausurenServer { } } - static Map getCommands() { - return commands; - } - public static void main(String[] args) { new KlausurenServer(Integer.parseInt(args[0])); }