]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] Fix reported code smells 9.3.0.51899
authorKlaudio Sinani <klaudio.sinani@sonarsource.com>
Thu, 27 Jan 2022 17:28:45 +0000 (18:28 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 28 Jan 2022 09:11:21 +0000 (09:11 +0000)
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/period/NewCodePeriodResolver.java
server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskCharacteristicDto.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/monitoring/package-info.java [new file with mode: 0644]
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java

index 257c3fd02f2cdc9eefa5efe63874a77cd7b89c19..4e83d5e6310d0c70d82e72acf366385f62174540 100644 (file)
@@ -84,7 +84,7 @@ public class NewCodePeriodResolver {
     }
   }
 
-  private Period resolveByReferenceBranch(String value) {
+  private static Period resolveByReferenceBranch(String value) {
     return newPeriod(NewCodePeriodType.REFERENCE_BRANCH, value, null);
   }
 
index 75928668ec804faa4c541273f805b8a5135191dd..c67ddfa69b57d38a81040c55eae0637f07f36a4f 100644 (file)
  */
 package org.sonar.db.ce;
 
-import java.util.HashSet;
 import java.util.Set;
 
-import static java.util.Arrays.asList;
-import static java.util.Collections.unmodifiableSet;
-
 public class CeTaskCharacteristicDto {
 
   public static final String BRANCH_KEY = "branch";
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/monitoring/package-info.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/monitoring/package-info.java
new file mode 100644 (file)
index 0000000..88f058e
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.server.monitoring;
+
+import javax.annotation.ParametersAreNonnullByDefault;
index 81f0cf0605996f5817d84a3b83c16c7311825d50..b2daf362d9f79eb90b7386ad92adb344b1d7d88f 100644 (file)
@@ -30,7 +30,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
-import java.util.stream.Stream;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.sonar.api.SonarQubeSide;
index e2cb11a71949d6250331091649082401a737e304..d46634f87ce59b22aa475b2dd11bdb91785e25db 100644 (file)
@@ -75,8 +75,6 @@ import org.sonar.scanner.repository.ContextPropertiesCache;
 import org.sonar.scanner.scan.branch.BranchConfiguration;
 
 import static java.lang.Math.max;
-import static java.util.Arrays.asList;
-import static java.util.Collections.unmodifiableSet;
 import static java.util.stream.Collectors.toList;
 import static org.sonar.api.measures.CoreMetrics.COMMENT_LINES_DATA_KEY;
 import static org.sonar.api.measures.CoreMetrics.LINES_KEY;