aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core/src
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2023-01-10 15:16:50 +0100
committersonartech <sonartech@sonarsource.com>2023-01-10 20:03:01 +0000
commit54b60b1adac5b703398163ee5edf5a621efc0d24 (patch)
tree2c4595fea6ddefca2b5f33cc9c26000ffb5750ce /server/sonar-webserver-core/src
parent295a87208f8c9898fbdc733a438587dc03a16877 (diff)
downloadsonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.tar.gz
sonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.zip
[NO-JIRA] Remove reported code smells about usages of toList
Diffstat (limited to 'server/sonar-webserver-core/src')
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/issue/index/AsyncIssueIndexingImpl.java2
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/cluster/GlobalInfoLoader.java5
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java3
3 files changed, 4 insertions, 6 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/issue/index/AsyncIssueIndexingImpl.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/issue/index/AsyncIssueIndexingImpl.java
index a71cd49349e..a0a4b8f0206 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/issue/index/AsyncIssueIndexingImpl.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/issue/index/AsyncIssueIndexingImpl.java
@@ -154,7 +154,7 @@ public class AsyncIssueIndexingImpl implements AsyncIssueIndexing {
List<String> uuids = ceQueueDtos.stream()
.filter(p -> p.getTaskType().equals(BRANCH_ISSUE_SYNC))
.map(CeQueueDto::getUuid)
- .collect(Collectors.toList());
+ .toList();
LOG.info(String.format("%s pending indexation task found to be deleted...", uuids.size()));
for (String uuid : uuids) {
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/cluster/GlobalInfoLoader.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/cluster/GlobalInfoLoader.java
index c26c2a19a08..a7cdf8713af 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/cluster/GlobalInfoLoader.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/cluster/GlobalInfoLoader.java
@@ -21,7 +21,6 @@ package org.sonar.server.platform.monitoring.cluster;
import java.util.Arrays;
import java.util.List;
-import java.util.stream.Collectors;
import org.sonar.api.server.ServerSide;
import org.sonar.process.systeminfo.Global;
import org.sonar.process.systeminfo.SystemInfoSection;
@@ -34,12 +33,12 @@ public class GlobalInfoLoader {
public GlobalInfoLoader(SystemInfoSection[] sections) {
this.globalSections = Arrays.stream(sections)
.filter(section -> section instanceof Global)
- .collect(Collectors.toList());
+ .toList();
}
public List<ProtobufSystemInfo.Section> load() {
return globalSections.stream()
.map(SystemInfoSection::toProtobuf)
- .collect(Collectors.toList());
+ .toList();
}
}
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java
index b874879c658..f2807079b77 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/CommonRuleDefinitionsImpl.java
@@ -22,7 +22,6 @@ package org.sonar.server.rule;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
-import java.util.stream.Collectors;
import org.sonar.api.resources.Language;
import org.sonar.api.resources.Languages;
import org.sonar.api.rule.Severity;
@@ -67,7 +66,7 @@ public class CommonRuleDefinitionsImpl implements CommonRuleDefinitions {
private static List<Language> getActiveLanguages(Language[] allLanguages) {
return Arrays.stream(allLanguages)
.filter(Predicate.not(language -> LANGUAGES_TO_SKIP.contains(language.getKey())))
- .collect(Collectors.toList());
+ .toList();
}
private static void defineBranchCoverageRule(RulesDefinition.NewRepository repo) {