From 0516e849e4489ec0ba0d12790e0247dd5f164c99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?L=C3=A9o=20Geoffroy?= Date: Wed, 12 Jul 2023 15:41:26 +0200 Subject: [PATCH] SONAR-19850 Fix code smells --- .../java/org/sonar/server/projectdump/ws/StatusActionIT.java | 5 +++-- .../server/newcodeperiod/NewCodeDefinitionResolver.java | 1 - .../java/org/sonar/server/project/ws/BulkDeleteAction.java | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectdump/ws/StatusActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectdump/ws/StatusActionIT.java index ee7479374f8..f2294c20399 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectdump/ws/StatusActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectdump/ws/StatusActionIT.java @@ -39,7 +39,6 @@ import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; import org.sonar.db.component.ResourceTypesRule; -import org.sonar.db.component.SnapshotTesting; import org.sonar.db.project.ProjectDto; import org.sonar.server.component.ComponentFinder; import org.sonar.server.exceptions.BadRequestException; @@ -123,9 +122,11 @@ public class StatusActionIT { @Test public void fails_with_BRE_if_both_params_are_provided() { + String projectUuid = project.getUuid(); + String projectKey = project.getKey(); assertThatThrownBy(() -> { underTest.newRequest() - .setParam(ID_PARAM, project.getUuid()).setParam(KEY_PARAM, project.getKey()) + .setParam(ID_PARAM, projectUuid).setParam(KEY_PARAM, projectKey) .execute(); }) .isInstanceOf(BadRequestException.class) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java index 64085be3fd2..a91268891c2 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java @@ -31,7 +31,6 @@ import org.sonar.db.DbSession; import org.sonar.db.newcodeperiod.NewCodePeriodDto; import org.sonar.db.newcodeperiod.NewCodePeriodParser; import org.sonar.db.newcodeperiod.NewCodePeriodType; -import org.sonar.server.component.ComponentCreationData; import static org.sonar.db.newcodeperiod.NewCodePeriodType.NUMBER_OF_DAYS; import static org.sonar.db.newcodeperiod.NewCodePeriodType.PREVIOUS_VERSION; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java index 379c1774e81..9f1d77e6658 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java @@ -20,7 +20,6 @@ package org.sonar.server.project.ws; import com.google.common.base.Strings; -import com.google.common.collect.ImmutableSet; import java.util.Date; import java.util.HashSet; import java.util.List; -- 2.39.5