]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 3 Feb 2017 12:55:48 +0000 (13:55 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 3 Feb 2017 13:00:51 +0000 (14:00 +0100)
server/sonar-server/src/main/java/org/sonar/server/test/index/CoveredFileDoc.java
server/sonar-server/src/main/java/org/sonar/server/user/ws/UserPropertiesWs.java
server/sonar-server/src/main/java/org/sonar/server/util/MetricKeyValidator.java
sonar-core/src/main/java/org/sonar/core/util/stream/Collectors.java

index c23d5645f6088a298533951755b44016c59f3c85..6bd2656e0a5c46b4cb0f89d7b911c530d5c10c9b 100644 (file)
@@ -33,6 +33,11 @@ public class CoveredFileDoc extends BaseDoc {
     super(fields);
   }
 
+  @VisibleForTesting
+  public CoveredFileDoc() {
+    super(Maps.newHashMapWithExpectedSize(2));
+  }
+
   @Override
   public String getId() {
     throw new UnsupportedOperationException();
@@ -48,11 +53,6 @@ public class CoveredFileDoc extends BaseDoc {
     throw new UnsupportedOperationException();
   }
 
-  @VisibleForTesting
-  public CoveredFileDoc() {
-    super(Maps.<String, Object>newHashMapWithExpectedSize(2));
-  }
-
   public String fileUuid() {
     return getField(FIELD_COVERED_FILE_UUID);
   }
index 42590c9b49b986141936da30bbfc0a38764a4332..05e78e1acd8aba247a07923e46e8bbb29ef160d3 100644 (file)
@@ -33,7 +33,7 @@ public class UserPropertiesWs implements WebService {
     controller.done();
   }
 
-  private void defineIndexAction(NewController controller) {
+  private static void defineIndexAction(NewController controller) {
     controller.createAction("index")
       .setDescription("This web service is removed")
       .setSince("2.6")
index 0e90fdc6be632440840f7e04fcdd33474159d45d..170a8bffb3968ac07805864e9549e514b6bf8070 100644 (file)
@@ -21,15 +21,15 @@ package org.sonar.server.util;
 
 public class MetricKeyValidator {
 
-  private MetricKeyValidator() {
-    // static stuff only
-  }
-
   /*
    * Allowed characters are alphanumeric, '-', '_', with at least one non-digit
    */
   private static final String VALID_METRIC_KEY_REGEXP = "[\\p{Alnum}\\-_]*[\\p{Alpha}\\-_]+[\\p{Alnum}\\-_]*";
 
+  private MetricKeyValidator() {
+    // static stuff only
+  }
+
   /**
    * <p>Test if given parameter is valid for a project/module. Valid format is:</p>
    * <ul>
index 40990df301815d95bedf2d7b94d34df365777a28..1e5d3650e3605ee52153c02c36796d302ab14cf9 100644 (file)
@@ -262,6 +262,7 @@ public final class Collectors {
 
   /**
    * For stream of one expected element, return the element
+   *
    * @throws IllegalArgumentException if stream has no element or more than 1 element
    */
   public static <T> Collector<T, ?, T> toOneElement() {