]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 2 Sep 2015 11:46:24 +0000 (13:46 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 2 Sep 2015 11:46:24 +0000 (13:46 +0200)
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/Check.java
server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/BaseChart.java
server/sonar-server/src/main/java/org/sonar/server/charts/deprecated/CustomBarRenderer.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java
server/sonar-server/src/main/java/org/sonar/server/plugins/StaticResourcesServlet.java

index 40911b81ee6f1380abbe7f9234b9198e23f2df38..0c7ca51ce5dcd91c74028119caa842e8228ac12f 100644 (file)
@@ -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);
 
index b7bbc7e047794dd17da354fed6acb882fed39b3e..9aa879656b4d58efb9fc79377865fe9eaedee5cb 100644 (file)
@@ -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),
index c5cab5c4305edf8a9a6867351baa312fc84392b6..df148eb229b61396751d5e7da64533354297fb3f 100644 (file)
@@ -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};
index dd91ba9f6ea99fdf11572e4aca8e937b4c5099ee..4f5dd500c98675d57f287c57d66aae4eae9b3242 100644 (file)
@@ -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;
 
index e3f1306d8abfbcd3632fb69099c02174b00e3a01..3208faf78d699e3627a3a2651c235e907d5da2f3 100644 (file)
@@ -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