diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-04-06 10:23:06 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-04-06 10:23:06 +0200 |
commit | 9e8e346e71b304fcf7aeb4e4f4c9a3c7107e1a53 (patch) | |
tree | 9be0ec5f72b5b6eb95871c50fab3b8f180de0b59 /server/sonar-server/src/main | |
parent | a5db81075b825ee87df9c64e3f1f2a32cdb4d72b (diff) | |
download | sonarqube-9e8e346e71b304fcf7aeb4e4f4c9a3c7107e1a53.tar.gz sonarqube-9e8e346e71b304fcf7aeb4e4f4c9a3c7107e1a53.zip |
Fix quality flaws
Diffstat (limited to 'server/sonar-server/src/main')
4 files changed, 12 insertions, 11 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java index ee608e26128..b974679fd12 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java @@ -31,6 +31,7 @@ import java.util.Collection; import java.util.Date; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import javax.annotation.CheckForNull; @@ -160,7 +161,8 @@ public class IssueQueryService { Date actualCreatedAfter = createdAfter; if (createdInLast != null) { - actualCreatedAfter = new DateTime(system.now()).minus(ISOPeriodFormat.standard().parsePeriod("P" + createdInLast.toUpperCase())).toDate(); + actualCreatedAfter = new DateTime(system.now()).minus( + ISOPeriodFormat.standard().parsePeriod("P" + createdInLast.toUpperCase(Locale.ENGLISH))).toDate(); } return actualCreatedAfter; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java index 5ad564e61b0..a769c0dc358 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java @@ -28,12 +28,13 @@ import com.google.common.collect.Sets; import java.util.Calendar; import java.util.Collection; import java.util.Date; +import java.util.Locale; import java.util.Set; import javax.annotation.Nullable; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.time.DateUtils; -import org.sonar.api.rules.RuleType; import org.sonar.api.ce.ComputeEngineSide; +import org.sonar.api.rules.RuleType; import org.sonar.api.server.ServerSide; import org.sonar.api.server.rule.RuleTagFormat; import org.sonar.api.user.User; @@ -318,7 +319,7 @@ public class IssueUpdater { }), new Function<String, String>() { @Override public String apply(String tag) { - String lowerCaseTag = tag.toLowerCase(); + String lowerCaseTag = tag.toLowerCase(Locale.ENGLISH); RuleTagFormat.validate(lowerCaseTag); return lowerCaseTag; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/AppAction.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/AppAction.java index 4a78923cef9..539699d9196 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/AppAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/AppAction.java @@ -125,7 +125,7 @@ public class AppAction implements RulesWsAction { json.name("statuses").beginObject(); for (RuleStatus status : RuleStatus.values()) { if (status != RuleStatus.REMOVED) { - json.prop(status.toString(), i18n.message(Locale.getDefault(), "rules.status." + status.toString().toLowerCase(), status.toString())); + json.prop(status.toString(), i18n.message(Locale.getDefault(), "rules.status." + status.toString().toLowerCase(Locale.ENGLISH), status.toString())); } } json.endObject(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServicesWs.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServicesWs.java index 1eaaad67b08..d9715fc9806 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServicesWs.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServicesWs.java @@ -21,18 +21,16 @@ package org.sonar.server.ws; import com.google.common.base.Function; import com.google.common.collect.Ordering; +import java.io.IOException; +import java.util.List; +import java.util.Set; +import javax.annotation.Nullable; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.RequestHandler; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.text.JsonWriter; -import javax.annotation.Nullable; - -import java.io.IOException; -import java.util.List; -import java.util.Set; - /** * This web service lists all the existing web services, including itself, * for documentation usage. @@ -139,7 +137,7 @@ public class WebServicesWs implements WebService { writer.close(); } - private void writeController(JsonWriter writer, Controller controller, boolean includeInternals) { + private static void writeController(JsonWriter writer, Controller controller, boolean includeInternals) { if (includeInternals || !controller.isInternal()) { writer.beginObject(); writer.prop("path", controller.path()); |