From ec5d30ee4a81111698840edf1f3ee2dc492e6eac Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 26 Aug 2014 13:55:50 +0200 Subject: [PATCH] Fix some quality flaws --- .../src/main/java/org/sonar/process/AesCipher.java | 4 ++-- .../src/main/java/org/sonar/process/Monitor.java | 2 +- .../src/main/java/org/sonar/process/MonitoredProcess.java | 2 +- .../src/main/java/org/sonar/process/ProcessLogging.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/AesCipher.java b/server/process/sonar-process/src/main/java/org/sonar/process/AesCipher.java index 11d69a805c1..204ae1a6b6b 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/AesCipher.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/AesCipher.java @@ -62,7 +62,7 @@ final class AesCipher implements Cipher { } catch (RuntimeException e) { throw e; } catch (Exception e) { - throw new RuntimeException(e); + throw new IllegalStateException(e); } } @@ -76,7 +76,7 @@ final class AesCipher implements Cipher { } catch (RuntimeException e) { throw e; } catch (Exception e) { - throw new RuntimeException(e); + throw new IllegalStateException(e); } } diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/Monitor.java b/server/process/sonar-process/src/main/java/org/sonar/process/Monitor.java index f1891535b37..663fb3cbcfc 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/Monitor.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/Monitor.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; public class Monitor extends Thread implements Terminable { - private final static Logger LOGGER = LoggerFactory.getLogger(Monitor.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Monitor.class); private static final long PING_DELAY_MS = 3000L; diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java b/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java index 0724ef42258..d9187c3e6d4 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/MonitoredProcess.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; public abstract class MonitoredProcess implements ProcessMXBean { - private final static Logger LOGGER = LoggerFactory.getLogger(MonitoredProcess.class); + private static final Logger LOGGER = LoggerFactory.getLogger(MonitoredProcess.class); private static final long AUTOKILL_TIMEOUT_MS = 30000L; private static final long AUTOKILL_CHECK_DELAY_MS = 2000L; diff --git a/server/process/sonar-process/src/main/java/org/sonar/process/ProcessLogging.java b/server/process/sonar-process/src/main/java/org/sonar/process/ProcessLogging.java index 40b336bbc0b..6b2e49e55fd 100644 --- a/server/process/sonar-process/src/main/java/org/sonar/process/ProcessLogging.java +++ b/server/process/sonar-process/src/main/java/org/sonar/process/ProcessLogging.java @@ -37,7 +37,7 @@ public class ProcessLogging { context.reset(); context.putProperty(PATH_LOGS_PROPERTY, props.of(PATH_LOGS_PROPERTY)); doConfigure(configurator, logbackXmlResource); - } catch (JoranException je) { + } catch (JoranException ignored) { // StatusPrinter will handle this } StatusPrinter.printInCaseOfErrorsOrWarnings(context); -- 2.39.5