Add more warnings source to 1.6) and fix warnings
[nikiroo-utils.git] / src / be / nikiroo / utils / serial / Server.java
index 50b8f46116ab2c4f7b4d2d81530ccbae1932ada3..bc4e637a7d65d0e8bbdc154c6b45c32b0197a80f 100644 (file)
@@ -16,7 +16,6 @@ import be.nikiroo.utils.Version;
 abstract public class Server implements Runnable {
        static private final String[] ANON_CIPHERS = getAnonCiphers();
 
-       private Version serverVersion = new Version();
        private int port;
        private boolean ssl;
        private ServerSocket ss;
@@ -26,8 +25,13 @@ abstract public class Server implements Runnable {
        private Object lock = new Object();
        private Object counterLock = new Object();
 
-       public Server(Version version, int port, boolean ssl) throws IOException {
-               this.serverVersion = version;
+       @Deprecated
+       public Server(@SuppressWarnings("unused") Version notUsed, int port,
+                       boolean ssl) throws IOException {
+               this(port, ssl);
+       }
+
+       public Server(int port, boolean ssl) throws IOException {
                this.port = port;
                this.ssl = ssl;
                this.ss = createSocketServer(port, ssl);
@@ -53,6 +57,7 @@ abstract public class Server implements Runnable {
                        stop(timeout);
                } else {
                        new Thread(new Runnable() {
+                               @Override
                                public void run() {
                                        stop(timeout);
                                }
@@ -97,6 +102,7 @@ abstract public class Server implements Runnable {
                }
        }
 
+       @Override
        public void run() {
                try {
                        while (started && !exiting) {
@@ -129,12 +135,12 @@ abstract public class Server implements Runnable {
                                                } finally {
                                                        count(-1);
                                                }
-                                       };
+                                       }
 
                                        @Override
                                        protected void onClientVersionReceived(Version clientVersion) {
                                                this.clientVersion = clientVersion;
-                                       };
+                                       }
                                }.connectAsync();
                        }