aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2022-10-12 14:32:58 +0200
committersonartech <sonartech@sonarsource.com>2022-10-12 20:03:43 +0000
commit3399bd00eb9d03efbb5608acd628176908fd4e3e (patch)
tree0cf03ef927bd16441e4b7452028a20cf8700f319 /server/sonar-webserver-core
parente81c64aa19b554b54e9fb4735eab510c5942f508 (diff)
downloadsonarqube-3399bd00eb9d03efbb5608acd628176908fd4e3e.tar.gz
sonarqube-3399bd00eb9d03efbb5608acd628176908fd4e3e.zip
NO-JIRA fix code smells
Diffstat (limited to 'server/sonar-webserver-core')
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/AbstractSystemInfoWriter.java7
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/ClusterSystemInfoWriter.java5
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/StandaloneSystemInfoWriter.java5
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/platform/ClusterSystemInfoWriterTest.java4
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/platform/StandaloneSystemInfoWriterTest.java5
5 files changed, 4 insertions, 22 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/AbstractSystemInfoWriter.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/AbstractSystemInfoWriter.java
index d6a59d032ff..4bdc6e5a238 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/AbstractSystemInfoWriter.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/AbstractSystemInfoWriter.java
@@ -24,7 +24,6 @@ import org.sonar.api.utils.text.JsonWriter;
import org.sonar.process.systeminfo.SystemInfoUtils;
import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo;
import org.sonar.server.health.Health;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
public abstract class AbstractSystemInfoWriter implements SystemInfoWriter {
private static final String[] ORDERED_SECTION_NAMES = {
@@ -36,12 +35,6 @@ public abstract class AbstractSystemInfoWriter implements SystemInfoWriter {
"Compute Engine Tasks", "Compute Engine JVM State", "Compute Engine Database Connection", "Compute Engine Logging", "Compute Engine JVM Properties",
"Search State", "Search Indexes"};
- private final TelemetryDataJsonWriter dataJsonWriter;
-
- AbstractSystemInfoWriter(TelemetryDataJsonWriter dataJsonWriter) {
- this.dataJsonWriter = dataJsonWriter;
- }
-
protected void writeSections(Collection<ProtobufSystemInfo.Section> sections, JsonWriter json) {
SystemInfoUtils
.order(sections, ORDERED_SECTION_NAMES)
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/ClusterSystemInfoWriter.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/ClusterSystemInfoWriter.java
index 71f83793d51..4acc73f4890 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/ClusterSystemInfoWriter.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/ClusterSystemInfoWriter.java
@@ -27,8 +27,6 @@ import org.sonar.server.platform.monitoring.cluster.AppNodesInfoLoader;
import org.sonar.server.platform.monitoring.cluster.GlobalInfoLoader;
import org.sonar.server.platform.monitoring.cluster.NodeInfo;
import org.sonar.server.platform.monitoring.cluster.SearchNodesInfoLoader;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
-import org.sonar.server.telemetry.TelemetryDataLoader;
public class ClusterSystemInfoWriter extends AbstractSystemInfoWriter {
private final GlobalInfoLoader globalInfoLoader;
@@ -37,8 +35,7 @@ public class ClusterSystemInfoWriter extends AbstractSystemInfoWriter {
private final HealthChecker healthChecker;
public ClusterSystemInfoWriter(GlobalInfoLoader globalInfoLoader, AppNodesInfoLoader appNodesInfoLoader, SearchNodesInfoLoader searchNodesInfoLoader,
- HealthChecker healthChecker, TelemetryDataJsonWriter dataJsonWriter) {
- super(dataJsonWriter);
+ HealthChecker healthChecker) {
this.globalInfoLoader = globalInfoLoader;
this.appNodesInfoLoader = appNodesInfoLoader;
this.searchNodesInfoLoader = searchNodesInfoLoader;
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/StandaloneSystemInfoWriter.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/StandaloneSystemInfoWriter.java
index 3ae5be33d8a..db6fb7cdd7b 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/StandaloneSystemInfoWriter.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/StandaloneSystemInfoWriter.java
@@ -27,7 +27,6 @@ import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo;
import org.sonar.server.ce.http.CeHttpClient;
import org.sonar.server.health.Health;
import org.sonar.server.health.HealthChecker;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
import static java.util.Arrays.stream;
@@ -36,9 +35,7 @@ public class StandaloneSystemInfoWriter extends AbstractSystemInfoWriter {
private final HealthChecker healthChecker;
private final SystemInfoSection[] systemInfoSections;
- public StandaloneSystemInfoWriter(CeHttpClient ceHttpClient, HealthChecker healthChecker,
- TelemetryDataJsonWriter dataJsonWriter, SystemInfoSection... systemInfoSections) {
- super(dataJsonWriter);
+ public StandaloneSystemInfoWriter(CeHttpClient ceHttpClient, HealthChecker healthChecker, SystemInfoSection... systemInfoSections) {
this.ceHttpClient = ceHttpClient;
this.healthChecker = healthChecker;
this.systemInfoSections = systemInfoSections;
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/ClusterSystemInfoWriterTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/ClusterSystemInfoWriterTest.java
index 93b09849b45..f61689bbb79 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/ClusterSystemInfoWriterTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/ClusterSystemInfoWriterTest.java
@@ -33,7 +33,6 @@ import org.sonar.server.platform.monitoring.cluster.AppNodesInfoLoader;
import org.sonar.server.platform.monitoring.cluster.GlobalInfoLoader;
import org.sonar.server.platform.monitoring.cluster.NodeInfo;
import org.sonar.server.platform.monitoring.cluster.SearchNodesInfoLoader;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
@@ -44,9 +43,8 @@ public class ClusterSystemInfoWriterTest {
private final AppNodesInfoLoader appNodesInfoLoader = mock(AppNodesInfoLoader.class);
private final SearchNodesInfoLoader searchNodesInfoLoader = mock(SearchNodesInfoLoader.class);
private final HealthChecker healthChecker = mock(HealthChecker.class);
- private final TelemetryDataJsonWriter dataJsonWriter = new TelemetryDataJsonWriter();
private final ClusterSystemInfoWriter underTest = new ClusterSystemInfoWriter(globalInfoLoader, appNodesInfoLoader,
- searchNodesInfoLoader, healthChecker, dataJsonWriter);
+ searchNodesInfoLoader, healthChecker);
@Before
public void before() throws InterruptedException {
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/StandaloneSystemInfoWriterTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/StandaloneSystemInfoWriterTest.java
index f8b400e943b..91f384d3d18 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/StandaloneSystemInfoWriterTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/StandaloneSystemInfoWriterTest.java
@@ -30,8 +30,6 @@ import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo;
import org.sonar.server.ce.http.CeHttpClient;
import org.sonar.server.ce.http.CeHttpClientImpl;
import org.sonar.server.health.TestStandaloneHealthChecker;
-import org.sonar.server.telemetry.TelemetryDataJsonWriter;
-import org.sonar.server.telemetry.TelemetryDataLoader;
import org.sonar.server.tester.UserSessionRule;
import static org.assertj.core.api.Assertions.assertThat;
@@ -49,8 +47,7 @@ public class StandaloneSystemInfoWriterTest {
private final SystemInfoSection section2 = mock(SystemInfoSection.class);
private final CeHttpClient ceHttpClient = mock(CeHttpClientImpl.class, Mockito.RETURNS_MOCKS);
private final TestStandaloneHealthChecker healthChecker = new TestStandaloneHealthChecker();
- private final TelemetryDataJsonWriter dataJsonWriter = new TelemetryDataJsonWriter();
- private final StandaloneSystemInfoWriter underTest = new StandaloneSystemInfoWriter(ceHttpClient, healthChecker, dataJsonWriter, section1, section2);
+ private final StandaloneSystemInfoWriter underTest = new StandaloneSystemInfoWriter(ceHttpClient, healthChecker, section1, section2);
@Test
public void write_json() {