aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-api
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2023-07-10 16:59:50 +0200
committersonartech <sonartech@sonarsource.com>2023-07-17 20:03:45 +0000
commitce0e4ddf7ec619dde2c6cf02ae0ec08012f47335 (patch)
tree2f32948edd74d54872a7ec53c07fb1289e88a34a /server/sonar-webserver-api
parent46ac0043ee3aedee6b2304969533847781d985ef (diff)
downloadsonarqube-ce0e4ddf7ec619dde2c6cf02ae0ec08012f47335.tar.gz
sonarqube-ce0e4ddf7ec619dde2c6cf02ae0ec08012f47335.zip
NO-JIRA replace guava copy uniqueIndex to Collectors.toMap and simplify lambdas
Diffstat (limited to 'server/sonar-webserver-api')
-rw-r--r--server/sonar-webserver-api/src/main/java/org/sonar/server/rule/CachingRuleFinder.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/server/sonar-webserver-api/src/main/java/org/sonar/server/rule/CachingRuleFinder.java b/server/sonar-webserver-api/src/main/java/org/sonar/server/rule/CachingRuleFinder.java
index f024c733ed9..23f9ecec869 100644
--- a/server/sonar-webserver-api/src/main/java/org/sonar/server/rule/CachingRuleFinder.java
+++ b/server/sonar-webserver-api/src/main/java/org/sonar/server/rule/CachingRuleFinder.java
@@ -44,7 +44,6 @@ import org.sonar.db.rule.RuleParamDto;
import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableMap;
-import static org.sonar.core.util.stream.MoreCollectors.uniqueIndex;
/**
* A {@link RuleFinder} implementation that retrieves all rule definitions and their parameter when instantiated, cache
@@ -68,7 +67,7 @@ public class CachingRuleFinder implements ServerRuleFinder {
this.ruleDtosByUuid = dtos.stream().collect(Collectors.toMap(RuleDto::getUuid, d -> d));
this.ruleByRuleDto = buildRulesByRuleDefinitionDto(dbClient, dbSession, dtos);
this.rulesByKey = this.ruleByRuleDto.entrySet().stream()
- .collect(uniqueIndex(entry -> entry.getKey().getKey(), Map.Entry::getValue));
+ .collect(Collectors.toMap(entry -> entry.getKey().getKey(), Map.Entry::getValue));
}
}