From 9aa90e6e51ac2dc5feea05f09d8d26acc036c871 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Mon, 25 Sep 2017 16:43:51 +0200 Subject: [PATCH] fix quality flaws --- .../task/projectanalysis/qualitygate/ConditionEvaluator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/qualitygate/ConditionEvaluator.java b/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/qualitygate/ConditionEvaluator.java index 4139e899f2a..c4995587465 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/qualitygate/ConditionEvaluator.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/qualitygate/ConditionEvaluator.java @@ -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 evaluateCondition(Condition condition, Comparable measureComparable, Measure.Level alertLevel) { -- 2.39.5