diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-09-02 13:46:24 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-09-02 13:46:24 +0200 |
commit | 259fa0a5f2076aad072ea5f83980948553089fa8 (patch) | |
tree | dc3e985f2d59feb3f8d7f979b464889a2abe706c | |
parent | 60fc38d183e03e7f50253b5c28ad1261da3d3b4b (diff) | |
download | sonarqube-259fa0a5f2076aad072ea5f83980948553089fa8.tar.gz sonarqube-259fa0a5f2076aad072ea5f83980948553089fa8.zip |
Fix quality flaws
5 files changed, 10 insertions, 12 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/Check.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/Check.java index 40911b81ee6..0c7ca51ce5d 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/Check.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/Check.java @@ -25,7 +25,7 @@ import org.sonar.api.rule.RuleKey; public interface Check { - public Class<Check>[] ALL = new Class[] {TemplateRuleCheck.class}; + Class<Check>[] ALL = new Class[] {TemplateRuleCheck.class}; void execute(SensorContext context, InputFile file, RuleKey ruleKey); diff --git a/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/BaseChart.java b/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/BaseChart.java index b7bbc7e0477..9aa879656b4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/BaseChart.java +++ b/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/BaseChart.java @@ -36,10 +36,8 @@ import org.jfree.ui.RectangleEdge; public abstract class BaseChart { public static final Color BASE_COLOR = new Color(51, 51, 51); - public static final Color BASE_COLOR_LIGHT = new Color(204, 204, 204); - public static final Color SERIE_BORDER_COLOR = new Color(67, 119, 166); - public static final Color[] COLORS = { + protected static final Color[] COLORS = { new Color(5, 141, 199), new Color(80, 180, 50), new Color(237, 86, 27), diff --git a/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/CustomBarRenderer.java b/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/CustomBarRenderer.java index c5cab5c4305..df148eb229b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/CustomBarRenderer.java +++ b/server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/CustomBarRenderer.java @@ -25,7 +25,7 @@ import org.jfree.chart.renderer.category.BarRenderer; public class CustomBarRenderer extends BarRenderer { - public static final Paint[] COLORS = { + protected static final Paint[] COLORS = { Color.red, Color.blue, Color.green, Color.yellow, Color.orange, Color.cyan, Color.magenta, Color.blue}; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java index dd91ba9f6ea..4f5dd500c98 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java @@ -39,7 +39,7 @@ public enum SearchAdditionalField { USERS("users"); public static final String ALL_ALIAS = "_all"; - public static final EnumSet<SearchAdditionalField> ALL_ADDITIONAL_FIELDS = EnumSet.allOf(SearchAdditionalField.class); + static final EnumSet<SearchAdditionalField> ALL_ADDITIONAL_FIELDS = EnumSet.allOf(SearchAdditionalField.class); private final String label; diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java index e3f1306d8ab..3208faf78d6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java +++ b/server/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java @@ -45,15 +45,15 @@ public class StaticResourcesServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String pluginKey = getPluginKey(request); String resource = getResourcePath(request); - - PluginRepository pluginRepository = Platform.getInstance().getContainer().getComponentByType(PluginRepository.class); - if (!pluginRepository.hasPlugin(pluginKey)) { - response.sendError(HttpServletResponse.SC_NOT_FOUND); - return; - } InputStream in = null; OutputStream out = null; try { + PluginRepository pluginRepository = Platform.getInstance().getContainer().getComponentByType(PluginRepository.class); + if (!pluginRepository.hasPlugin(pluginKey)) { + response.sendError(HttpServletResponse.SC_NOT_FOUND); + return; + } + in = pluginRepository.getPluginInstance(pluginKey).getClass().getClassLoader().getResourceAsStream(resource); if (in != null) { // mime type must be set before writing response body |