From 2277fee73acb77c98a638c4aadff71df8eb973c4 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 14 Apr 2022 22:12:35 +0200 Subject: [PATCH] merging --- .../ch/zhaw/pm2/multichat/protocol/ConnectionHandler.java | 6 +----- .../zhaw/pm2/multichat/server/ServerConnectionHandler.java | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/protocol/src/main/java/ch/zhaw/pm2/multichat/protocol/ConnectionHandler.java b/protocol/src/main/java/ch/zhaw/pm2/multichat/protocol/ConnectionHandler.java index a0ddd57..f7acd4a 100644 --- a/protocol/src/main/java/ch/zhaw/pm2/multichat/protocol/ConnectionHandler.java +++ b/protocol/src/main/java/ch/zhaw/pm2/multichat/protocol/ConnectionHandler.java @@ -17,10 +17,6 @@ public abstract class ConnectionHandler { NEW, CONFIRM_CONNECT, CONNECTED, CONFIRM_DISCONNECT, DISCONNECTED; } - public ConnectionHandler(NetworkHandler.NetworkConnection connection) { - this.connection = connection; - } - public static String getDataTypeConnect() { return DATA_TYPE_CONNECT; } @@ -45,7 +41,7 @@ public abstract class ConnectionHandler { return connection; } - protected void setConnection() { + protected void setConnection(NetworkHandler.NetworkConnection connection) { this.connection = connection; } } diff --git a/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java b/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java index 4e3db14..d3bd33f 100644 --- a/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java +++ b/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java @@ -40,7 +40,8 @@ public class ServerConnectionHandler extends ConnectionHandler implements Runnab public ServerConnectionHandler(NetworkHandler.NetworkConnection connection, Map registry, ReentrantLock mutex, Condition nameComplete) { - super(connection); + super(); + setConnection(connection); Objects.requireNonNull(connection, "Connection must not be null"); Objects.requireNonNull(registry, "Registry must not be null"); this.connectionRegistry = registry;