]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaws
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Mon, 25 Sep 2017 14:43:51 +0000 (16:43 +0200)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Sat, 7 Oct 2017 07:06:25 +0000 (09:06 +0200)
server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/qualitygate/ConditionEvaluator.java

index 4139e899f2ae2df682d6fc7367b55df4ee99ed05..c4995587465c4464b1b037c008bbcf5eed7b190e 100644 (file)
@@ -42,8 +42,8 @@ public final class ConditionEvaluator {
     }
 
     return evaluateCondition(condition, measureComparable, Measure.Level.ERROR)
-      .orElse(evaluateCondition(condition, measureComparable, Measure.Level.WARN)
-        .orElse(new EvaluationResult(Measure.Level.OK, measureComparable)));
+      .orElseGet(() -> evaluateCondition(condition, measureComparable, Measure.Level.WARN)
+        .orElseGet(() -> new EvaluationResult(Measure.Level.OK, measureComparable)));
   }
 
   private static Optional<EvaluationResult> evaluateCondition(Condition condition, Comparable<?> measureComparable, Measure.Level alertLevel) {