]> source.dussan.org Git - sonarqube.git/commitdiff
Fix Indentation violations
authorDavid Gageot <david@gageot.net>
Tue, 17 Jul 2012 19:34:41 +0000 (21:34 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 17 Jul 2012 19:34:41 +0000 (21:34 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AlertUtils.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/libraries/client/Library.java
sonar-colorizer/src/main/java/org/sonar/colorizer/GroovyKeywords.java
sonar-colorizer/src/main/java/org/sonar/colorizer/JavaKeywords.java
sonar-server/src/main/java/org/sonar/server/charts/deprecated/CustomBarRenderer.java

index bd1fee2b1e7b258bc98ee6dab3909d9ccb35c510..9fe246f5fdf53787b6d12b1e34da5b9e08d6b06f 100644 (file)
@@ -63,25 +63,23 @@ public final class AlertUtils {
 
     int comparison = metricValue.compareTo(criteriaValue);
     return !(// NOSONAR complexity of this boolean expression is under control
-        (alert.isNotEqualsOperator() && comparison == 0) ||
-        (alert.isGreaterOperator() && comparison != 1) ||
-        (alert.isSmallerOperator() && comparison != -1) ||
-        (alert.isEqualsOperator() && comparison != 0)
-    );
+    (alert.isNotEqualsOperator() && comparison == 0)
+      || (alert.isGreaterOperator() && comparison != 1)
+      || (alert.isSmallerOperator() && comparison != -1)
+      || (alert.isEqualsOperator() && comparison != 0));
   }
 
-
   private static Comparable<?> getValueForComparison(Metric metric, String value) {
     if (metric.getType() == Metric.ValueType.FLOAT ||
-        metric.getType() == Metric.ValueType.PERCENT) {
+      metric.getType() == Metric.ValueType.PERCENT) {
       return Double.parseDouble(value);
     }
     if (metric.getType() == Metric.ValueType.INT ||
-        metric.getType() == Metric.ValueType.MILLISEC) {
+      metric.getType() == Metric.ValueType.MILLISEC) {
       return value.contains(".") ? Integer.parseInt(value.substring(0, value.indexOf('.'))) : Integer.parseInt(value);
     }
     if (metric.getType() == Metric.ValueType.STRING ||
-        metric.getType() == Metric.ValueType.LEVEL) {
+      metric.getType() == Metric.ValueType.LEVEL) {
       return value;
     }
     if (metric.getType() == Metric.ValueType.BOOL) {
@@ -95,15 +93,15 @@ public final class AlertUtils {
 
   private static Comparable<?> getMeasureValue(Metric metric, Measure measure) {
     if (metric.getType() == Metric.ValueType.FLOAT ||
-        metric.getType() == Metric.ValueType.PERCENT) {
+      metric.getType() == Metric.ValueType.PERCENT) {
       return measure.getValue();
     }
     if (metric.getType() == Metric.ValueType.INT ||
-        metric.getType() == Metric.ValueType.MILLISEC) {
+      metric.getType() == Metric.ValueType.MILLISEC) {
       return measure.getValue().intValue();
     }
     if (metric.getType() == Metric.ValueType.STRING ||
-        metric.getType() == Metric.ValueType.LEVEL) {
+      metric.getType() == Metric.ValueType.LEVEL) {
       return measure.getData();
     }
     if (metric.getType() == Metric.ValueType.BOOL) {
index c81ae7d2c610dd2f604c16f59bc5e43b2383233c..e8cbb3746eb0dc9c3e9da05b9cead8ec2df9bffa 100644 (file)
@@ -47,7 +47,6 @@ public class Library extends TreeItem {
     return text.toUpperCase();
   }
 
-
   /**
    * @param keyword upper-case keyword
    */
@@ -74,7 +73,6 @@ public class Library extends TreeItem {
     return html;
   }
 
-
   public boolean filter(String keyword, boolean testFiltered) {
     if (testFiltered && "test".equals(usage)) {
       setVisible(false);
@@ -88,7 +86,7 @@ public class Library extends TreeItem {
 
     boolean hasVisibleChild = false;
     for (int index = 0; index < getChildCount(); index++) {
-        hasVisibleChild |= !((Library) getChild(index)).filter(keyword, testFiltered);
+      hasVisibleChild |= !((Library) getChild(index)).filter(keyword, testFiltered);
     }
 
     boolean visible = !filtered || hasVisibleChild;
index d22f0c06a22bb5a75ee8871fbafe6ffdd8000094..e12f8558dfde1cee9324be370c656c914d5adb23 100644 (file)
@@ -27,9 +27,10 @@ public final class GroovyKeywords {
 
   private static final Set<String> KEYWORDS = new HashSet<String>();
 
-  private static final String[] GROOVY_KEYWORDS = new String[]{"as", "assert", "break", "case", "catch", "class", "continue", "def",
-      "default", "do", "else", "extends", "finally", "for", "if", "in", "implements", "import", "instanceof", "interface", "new", "package",
-      "property", "return", "switch", "throw", "throws", "try", "while"};
+  private static final String[] GROOVY_KEYWORDS = {
+    "as", "assert", "break", "case", "catch", "class", "continue", "def",
+    "default", "do", "else", "extends", "finally", "for", "if", "in", "implements", "import", "instanceof", "interface", "new", "package",
+    "property", "return", "switch", "throw", "throws", "try", "while"};
 
   static {
     Collections.addAll(KEYWORDS, GROOVY_KEYWORDS);
index a9f00b5f1cd556594db9b915598b779cbb5a7ddb..3057db57679273a4ccb2e12e0767fd8c0b9a038d 100644 (file)
@@ -27,13 +27,14 @@ public final class JavaKeywords {
 
   private static final Set<String> KEYWORDS = new HashSet<String>();
 
-  private static final String[] JAVA_KEYWORDS = new String[]{"abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
-      "class", "const", "continue", "default",
-      "do", "double", "else", "enum", "extends", "false", "final", "finally", "float", "for",
-      "goto", "if", "implements", "import", "instanceof",
-      "int", "interface", "long", "native", "new", "null", "package", "private",
-      "protected", "public", "return", "short", "static", "strictfp",
-      "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while"};
+  private static final String[] JAVA_KEYWORDS = {
+    "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
+    "class", "const", "continue", "default",
+    "do", "double", "else", "enum", "extends", "false", "final", "finally", "float", "for",
+    "goto", "if", "implements", "import", "instanceof",
+    "int", "interface", "long", "native", "new", "null", "package", "private",
+    "protected", "public", "return", "short", "static", "strictfp",
+    "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "void", "volatile", "while"};
 
   static {
     Collections.addAll(KEYWORDS, JAVA_KEYWORDS);
index a421a05ef3f7d71efee306589919401feefa9abd..4241b3432381e9889247c2de7b7a1020a446fc79 100644 (file)
@@ -25,9 +25,10 @@ import java.awt.*;
 
 public class CustomBarRenderer extends BarRenderer {
 
-  public static final Paint[] COLORS = new Paint[]{Color.red, Color.blue, Color.green,
-      Color.yellow, Color.orange, Color.cyan,
-      Color.magenta, Color.blue};
+  public static final Paint[] COLORS = {
+    Color.red, Color.blue, Color.green,
+    Color.yellow, Color.orange, Color.cyan,
+    Color.magenta, Color.blue};
 
   /**
    * The colors.