diff --git a/weasis-launcher/src/main/java/org/weasis/launcher/Singleton.java b/weasis-launcher/src/main/java/org/weasis/launcher/Singleton.java index e9c4a93a0..1e94588f3 100755 --- a/weasis-launcher/src/main/java/org/weasis/launcher/Singleton.java +++ b/weasis-launcher/src/main/java/org/weasis/launcher/Singleton.java @@ -349,9 +349,7 @@ private static String getStreamEncoding(InputStream is) throws IOException { } private Void runSingletonServer() { - ExecutorService executor = Executors.newFixedThreadPool(1); - - try { + try (ExecutorService executor = Executors.newFixedThreadPool(1)) { while (!Thread.currentThread().isInterrupted()) { try { Socket socket = ss.accept(); @@ -363,8 +361,6 @@ private Void runSingletonServer() { LOGGER.error("Error accepting connection", e); } } - } finally { - executor.shutdown(); } return null; } diff --git a/weasis-launcher/src/main/java/org/weasis/launcher/Utils.java b/weasis-launcher/src/main/java/org/weasis/launcher/Utils.java index 0af4c5bd3..56cd90324 100755 --- a/weasis-launcher/src/main/java/org/weasis/launcher/Utils.java +++ b/weasis-launcher/src/main/java/org/weasis/launcher/Utils.java @@ -68,10 +68,6 @@ public static boolean hasText(CharSequence str) { return false; } - public static boolean hasText(String str) { - return hasText((CharSequence) str); - } - public static String getWeasisProtocol(String... params) { Pattern pattern = Pattern.compile("^weasis(-.*)?://.*?"); for (String p : params) {