From 299de1c1b2242ebb445f16942cbef15fb966c812 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Wed, 12 Jul 2017 15:54:36 +0200 Subject: [PATCH] Fix quality flaws --- .../src/main/java/org/sonar/server/es/IndexingResult.java | 2 +- .../main/java/org/sonar/server/rule/index/RuleIndexer.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/IndexingResult.java b/server/sonar-server/src/main/java/org/sonar/server/es/IndexingResult.java index 5571f509989..e66d842ed4b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/IndexingResult.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/IndexingResult.java @@ -66,7 +66,7 @@ public class IndexingResult { * @see {@link RecoveryIndexer#recover()} */ public double getFailureRatio() { - return total.get() == 0 ? 1 : (1.0d * getFailures()) / total.get(); + return total.get() == 0 ? 1 : ((1.0d * getFailures()) / total.get()); } public boolean isSuccess() { diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexer.java b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexer.java index eaf63b2f452..8a9f9d6f290 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexer.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexer.java @@ -83,9 +83,9 @@ public class RuleIndexer implements StartupIndexer, ResilientIndexer { // index all organization extensions if (uninitializedIndexTypes.contains(INDEX_TYPE_RULE_EXTENSION)) { - dbClient.ruleDao().scrollIndexingRuleExtensions(dbSession, dto -> { - bulk.add(newRuleExtensionDocIndexRequest(dto)); - }); + dbClient.ruleDao().scrollIndexingRuleExtensions(dbSession, dto -> + bulk.add(newRuleExtensionDocIndexRequest(dto)) + ); } bulk.stop(); -- 2.39.5