From cf818e127b54dbb9791e206874146c62b680a3f9 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 1 Sep 2014 13:48:59 +0200 Subject: [PATCH] Fix some quality flaws --- .../src/main/java/org/sonar/process/ProcessWrapper.java | 5 +---- .../src/main/java/org/sonar/search/SearchServer.java | 2 +- .../src/main/java/org/sonar/server/search/SearchClient.java | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java b/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java index 5251ca5bd0c..869867a6e34 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java @@ -73,6 +73,7 @@ public class ProcessWrapper extends Thread implements Terminable { private StreamGobbler errorGobbler; private StreamGobbler outputGobbler; private ProcessMXBean processMXBean; + private final Object terminationLock = new Object(); public ProcessWrapper(String processName) { super(processName); @@ -179,9 +180,6 @@ public class ProcessWrapper extends Thread implements Terminable { } catch (Exception e) { LOGGER.info("ProcessThread has been interrupted. Killing node."); LOGGER.trace("Process exception", e); - } finally { - ; - ; } } @@ -257,7 +255,6 @@ public class ProcessWrapper extends Thread implements Terminable { return null; } - private final Integer terminationLock = new Integer(1); @Override public void terminate() { synchronized (terminationLock) { diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java index 0fbb934c7c7..1abf733b66b 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java +++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java @@ -58,7 +58,7 @@ public class SearchServer extends MonitoredProcess { private final boolean isBlocking; private Node node; - private final Integer lock = new Integer(1); + private final Object lock = new Object(); @VisibleForTesting public SearchServer(final Props props, boolean monitored, boolean blocking) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java b/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java index 3ed0a7118ca..4c8b26f4bae 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java +++ b/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java @@ -119,11 +119,11 @@ public class SearchClient extends TransportClient implements Startable { @Override public void start() { - + // nothing to do } @Override public void stop() { - super.close(); + close(); } } -- 2.39.5