From debb5c4828a05a05812bac2bdc430ed15f28b52d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 23 Feb 2015 07:47:40 +0100 Subject: [PATCH] Fix quality flaws --- .../test/java/org/sonar/process/monitor/MonitorTest.java | 5 ----- .../java/org/sonar/api/utils/log/LogInterceptors.java | 2 +- .../java/org/sonar/api/utils/log/LogInterceptorsTest.java | 8 ++++++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java index e88b8d49379..e417b5fd268 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java @@ -221,11 +221,6 @@ public class MonitorTest { } } - @Test - public void force_stop_if_too_long() throws Exception { - // TODO - } - @Test public void fail_to_start_if_bad_class_name() throws Exception { monitor = newDefaultMonitor(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/LogInterceptors.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/LogInterceptors.java index a17ab972167..2e13f97b8e9 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/LogInterceptors.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/LogInterceptors.java @@ -23,7 +23,7 @@ import com.google.common.base.Preconditions; class LogInterceptors { - private static LogInterceptor instance = NullInterceptor.NULL_INSTANCE; + private static volatile LogInterceptor instance = NullInterceptor.NULL_INSTANCE; private LogInterceptors() { } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LogInterceptorsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LogInterceptorsTest.java index 7a5adbe5ca9..d05a4395353 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LogInterceptorsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LogInterceptorsTest.java @@ -20,6 +20,7 @@ package org.sonar.api.utils.log; import org.junit.Test; +import org.sonar.test.TestUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -35,4 +36,11 @@ public class LogInterceptorsTest { public void instance_cant_be_null() throws Exception { LogInterceptors.set(null); } + + @Test + public void private_constructor() throws Exception { + assertThat(TestUtils.hasOnlyPrivateConstructors(LogInterceptors.class)); + } } + + -- 2.39.5