java.util.Arrayscom.google.common.collect.ImmutableList



Project SonarSource/sonarqube in file ....core.sensors.AllTestsBranchCoverageDecorator.java (2012-10-03)
@@ -19,20 +19,19 @@
  */
 package org.sonar.plugins.core.sensors;
 
+import com.google.common.collect.ImmutableList;
 import org.sonar.api.batch.DecoratorContext;
 import org.sonar.api.batch.DependsUpon;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.MeasureUtils;
 import org.sonar.api.measures.Metric;
 
-import java.util.Arrays;
 import java.util.List;
 
 public final class AllTestsBranchCoverageDecorator extends AbstractCoverageDecorator {
-
   @DependsUpon
   public List<Metric> dependsUponMetrics() {
-    return Arrays.asList(CoreMetrics.MERGED_UNCOVERED_CONDITIONS, CoreMetrics.MERGED_CONDITIONS_TO_COVER,
+    return ImmutableList.of(CoreMetrics.MERGED_UNCOVERED_CONDITIONS, CoreMetrics.MERGED_CONDITIONS_TO_COVER,
         CoreMetrics.NEW_MERGED_UNCOVERED_CONDITIONS, CoreMetrics.NEW_MERGED_CONDITIONS_TO_COVER);
   }
 
@@ -50,6 +49,7 @@ public final class AllTestsBranchCoverageDecorator extends AbstractCoverageDecor
   protected long countCoveredElements(DecoratorContext context) {
     long uncoveredConditions = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.MERGED_UNCOVERED_CONDITIONS), 0L);
     long conditions = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.MERGED_CONDITIONS_TO_COVER), 0L);
+
     return conditions - uncoveredConditions;
   }
 
@@ -67,6 +67,7 @@ public final class AllTestsBranchCoverageDecorator extends AbstractCoverageDecor
   protected long countCoveredElementsForNewCode(DecoratorContext context, int periodIndex) {
     long uncoveredConditions = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_MERGED_UNCOVERED_CONDITIONS), periodIndex, 0L);
     long conditions = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_MERGED_CONDITIONS_TO_COVER), periodIndex, 0L);
+
     return conditions - uncoveredConditions;
   }
 }
Project SonarSource/sonarqube in file ...ns.core.sensors.AllTestsLineCoverageDecorator.java (2012-10-03)
@@ -19,19 +19,19 @@
  */
 package org.sonar.plugins.core.sensors;
 
+import com.google.common.collect.ImmutableList;
 import org.sonar.api.batch.DecoratorContext;
 import org.sonar.api.batch.DependsUpon;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.MeasureUtils;
 import org.sonar.api.measures.Metric;
 
-import java.util.Arrays;
 import java.util.List;
 
 public final class AllTestsLineCoverageDecorator extends AbstractCoverageDecorator {
   @DependsUpon
   public List<Metric> dependsUponMetrics() {
-    return Arrays.asList(CoreMetrics.MERGED_UNCOVERED_LINES, CoreMetrics.MERGED_LINES_TO_COVER, CoreMetrics.NEW_MERGED_UNCOVERED_LINES,
+    return ImmutableList.of(CoreMetrics.MERGED_UNCOVERED_LINES, CoreMetrics.MERGED_LINES_TO_COVER, CoreMetrics.NEW_MERGED_UNCOVERED_LINES,
         CoreMetrics.NEW_MERGED_LINES_TO_COVER);
   }
 
@@ -49,10 +49,10 @@ public final class AllTestsLineCoverageDecorator extends AbstractCoverageDecorat
   protected long countCoveredElements(DecoratorContext context) {
     long uncoveredLines = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.MERGED_UNCOVERED_LINES), 0L);
     long lines = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.MERGED_LINES_TO_COVER), 0L);
+
     return lines - uncoveredLines;
   }
 
-
   @Override
   protected Metric getGeneratedMetricForNewCode() {
     return CoreMetrics.NEW_MERGED_LINE_COVERAGE;
@@ -67,6 +67,7 @@ public final class AllTestsLineCoverageDecorator extends AbstractCoverageDecorat
   protected long countCoveredElementsForNewCode(DecoratorContext context, int periodIndex) {
     long uncoveredLines = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_MERGED_UNCOVERED_LINES), periodIndex, 0L);
     long lines = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_MERGED_LINES_TO_COVER), periodIndex, 0L);
+
     return lines - uncoveredLines;
   }
 }
Project SonarSource/sonarqube in file ....plugins.core.sensors.BranchCoverageDecorator.java (2012-10-03)
@@ -19,20 +19,19 @@
  */
 package org.sonar.plugins.core.sensors;
 
+import com.google.common.collect.ImmutableList;
 import org.sonar.api.batch.DecoratorContext;
 import org.sonar.api.batch.DependsUpon;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.MeasureUtils;
 import org.sonar.api.measures.Metric;
 
-import java.util.Arrays;
 import java.util.List;
 
 public final class BranchCoverageDecorator extends AbstractCoverageDecorator {
-
   @DependsUpon
   public List<Metric> dependsUponMetrics() {
-    return Arrays.asList(CoreMetrics.UNCOVERED_CONDITIONS, CoreMetrics.CONDITIONS_TO_COVER,
+    return ImmutableList.of(CoreMetrics.UNCOVERED_CONDITIONS, CoreMetrics.CONDITIONS_TO_COVER,
         CoreMetrics.NEW_UNCOVERED_CONDITIONS, CoreMetrics.NEW_CONDITIONS_TO_COVER);
   }
 
@@ -50,6 +49,7 @@ public final class BranchCoverageDecorator extends AbstractCoverageDecorator {
   protected long countCoveredElements(DecoratorContext context) {
     long uncoveredConditions = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.UNCOVERED_CONDITIONS), 0L);
     long conditions = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.CONDITIONS_TO_COVER), 0L);
+
     return conditions - uncoveredConditions;
   }
 
@@ -67,6 +67,7 @@ public final class BranchCoverageDecorator extends AbstractCoverageDecorator {
   protected long countCoveredElementsForNewCode(DecoratorContext context, int periodIndex) {
     long uncoveredConditions = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_UNCOVERED_CONDITIONS), periodIndex, 0L);
     long conditions = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_CONDITIONS_TO_COVER), periodIndex, 0L);
+
     return conditions - uncoveredConditions;
   }
 }
Project SonarSource/sonarqube in file ...lugins.core.sensors.ItBranchCoverageDecorator.java (2012-10-03)
@@ -19,20 +19,20 @@
  */
 package org.sonar.plugins.core.sensors;
 
+import com.google.common.collect.ImmutableList;
 import org.sonar.api.batch.DecoratorContext;
 import org.sonar.api.batch.DependsUpon;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.MeasureUtils;
 import org.sonar.api.measures.Metric;
 
-import java.util.Arrays;
 import java.util.List;
 
 public final class ItBranchCoverageDecorator extends AbstractCoverageDecorator {
 
   @DependsUpon
   public List<Metric> dependsUponMetrics() {
-    return Arrays.asList(CoreMetrics.IT_UNCOVERED_CONDITIONS, CoreMetrics.IT_CONDITIONS_TO_COVER,
+    return ImmutableList.of(CoreMetrics.IT_UNCOVERED_CONDITIONS, CoreMetrics.IT_CONDITIONS_TO_COVER,
         CoreMetrics.NEW_IT_UNCOVERED_CONDITIONS, CoreMetrics.NEW_IT_CONDITIONS_TO_COVER);
   }
 
@@ -50,6 +50,7 @@ public final class ItBranchCoverageDecorator extends AbstractCoverageDecorator {
   protected long countCoveredElements(DecoratorContext context) {
     long uncoveredConditions = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.IT_UNCOVERED_CONDITIONS), 0L);
     long conditions = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.IT_CONDITIONS_TO_COVER), 0L);
+
     return conditions - uncoveredConditions;
   }
 
@@ -67,6 +68,7 @@ public final class ItBranchCoverageDecorator extends AbstractCoverageDecorator {
   protected long countCoveredElementsForNewCode(DecoratorContext context, int periodIndex) {
     long uncoveredConditions = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_IT_UNCOVERED_CONDITIONS), periodIndex, 0L);
     long conditions = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_IT_CONDITIONS_TO_COVER), periodIndex, 0L);
+
     return conditions - uncoveredConditions;
   }
 }
Project SonarSource/sonarqube in file ....plugins.core.sensors.ItLineCoverageDecorator.java (2012-10-03)
@@ -19,20 +19,19 @@
  */
 package org.sonar.plugins.core.sensors;
 
+import com.google.common.collect.ImmutableList;
 import org.sonar.api.batch.DecoratorContext;
 import org.sonar.api.batch.DependsUpon;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.MeasureUtils;
 import org.sonar.api.measures.Metric;
 
-import java.util.Arrays;
 import java.util.List;
 
 public final class ItLineCoverageDecorator extends AbstractCoverageDecorator {
-
   @DependsUpon
   public List<Metric> dependsUponMetrics() {
-    return Arrays.asList(CoreMetrics.IT_UNCOVERED_LINES, CoreMetrics.IT_LINES_TO_COVER, CoreMetrics.NEW_IT_UNCOVERED_LINES,
+    return ImmutableList.of(CoreMetrics.IT_UNCOVERED_LINES, CoreMetrics.IT_LINES_TO_COVER, CoreMetrics.NEW_IT_UNCOVERED_LINES,
         CoreMetrics.NEW_IT_LINES_TO_COVER);
   }
 
@@ -50,10 +49,10 @@ public final class ItLineCoverageDecorator extends AbstractCoverageDecorator {
   protected long countCoveredElements(DecoratorContext context) {
     long uncoveredLines = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.IT_UNCOVERED_LINES), 0L);
     long lines = MeasureUtils.getValueAsLong(context.getMeasure(CoreMetrics.IT_LINES_TO_COVER), 0L);
+
     return lines - uncoveredLines;
   }
 
-
   @Override
   protected Metric getGeneratedMetricForNewCode() {
     return CoreMetrics.NEW_IT_LINE_COVERAGE;
@@ -68,6 +67,7 @@ public final class ItLineCoverageDecorator extends AbstractCoverageDecorator {
   protected long countCoveredElementsForNewCode(DecoratorContext context, int periodIndex) {
     long uncoveredLines = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_IT_UNCOVERED_LINES), periodIndex, 0L);
     long lines = MeasureUtils.getVariationAsLong(context.getMeasure(CoreMetrics.NEW_IT_LINES_TO_COVER), periodIndex, 0L);
+
     return lines - uncoveredLines;
   }
 }