From 194ba7a4bdcf0e0164560a99612e98076180ab28 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Fri, 3 Feb 2017 13:55:48 +0100 Subject: [PATCH] Fix quality flaws --- .../org/sonar/server/test/index/CoveredFileDoc.java | 10 +++++----- .../org/sonar/server/user/ws/UserPropertiesWs.java | 2 +- .../java/org/sonar/server/util/MetricKeyValidator.java | 8 ++++---- .../java/org/sonar/core/util/stream/Collectors.java | 1 + 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/test/index/CoveredFileDoc.java b/server/sonar-server/src/main/java/org/sonar/server/test/index/CoveredFileDoc.java index c23d5645f60..6bd2656e0a5 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/test/index/CoveredFileDoc.java +++ b/server/sonar-server/src/main/java/org/sonar/server/test/index/CoveredFileDoc.java @@ -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.newHashMapWithExpectedSize(2)); - } - public String fileUuid() { return getField(FIELD_COVERED_FILE_UUID); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserPropertiesWs.java b/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserPropertiesWs.java index 42590c9b49b..05e78e1acd8 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserPropertiesWs.java +++ b/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserPropertiesWs.java @@ -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") diff --git a/server/sonar-server/src/main/java/org/sonar/server/util/MetricKeyValidator.java b/server/sonar-server/src/main/java/org/sonar/server/util/MetricKeyValidator.java index 0e90fdc6be6..170a8bffb39 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/util/MetricKeyValidator.java +++ b/server/sonar-server/src/main/java/org/sonar/server/util/MetricKeyValidator.java @@ -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 + } + /** *

Test if given parameter is valid for a project/module. Valid format is:

*