aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process
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-process
parent295a87208f8c9898fbdc733a438587dc03a16877 (diff)
downloadsonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.tar.gz
sonarqube-54b60b1adac5b703398163ee5edf5a621efc0d24.zip
[NO-JIRA] Remove reported code smells about usages of toList
Diffstat (limited to 'server/sonar-process')
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/cluster/hz/HazelcastMemberBuilder.java3
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java2
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/logging/LogLevelConfig.java3
3 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/cluster/hz/HazelcastMemberBuilder.java b/server/sonar-process/src/main/java/org/sonar/process/cluster/hz/HazelcastMemberBuilder.java
index 4333f157c11..2ccaffd6017 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/cluster/hz/HazelcastMemberBuilder.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/cluster/hz/HazelcastMemberBuilder.java
@@ -25,7 +25,6 @@ import com.hazelcast.config.MemberAttributeConfig;
import com.hazelcast.config.NetworkConfig;
import com.hazelcast.core.Hazelcast;
import java.util.List;
-import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.sonar.process.ProcessId;
import org.sonar.process.cluster.hz.HazelcastMember.Attribute;
@@ -110,7 +109,7 @@ public class HazelcastMemberBuilder {
.filter(host -> !host.isBlank())
.map(String::trim)
.map(HazelcastMemberBuilder::applyDefaultPortToHost)
- .collect(Collectors.toList());
+ .toList();
joinConfig.getTcpIpConfig().setEnabled(true);
joinConfig.getTcpIpConfig().setMembers(requireNonNull(addressesWithDefaultPorts, "Members are missing"));
}
diff --git a/server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java b/server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java
index bdae5ae72a8..93a841f61b6 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java
@@ -184,7 +184,7 @@ public class Log4JPropertiesBuilder extends AbstractLogHelper {
.filter(loggerName -> !ROOT_LOGGER_NAME.equals(loggerName))
.distinct()
.sorted()
- .collect(Collectors.toList());
+ .toList();
if (!loggerNames.isEmpty()) {
putProperty("loggers", loggerNames.stream().collect(Collectors.joining(",")));
}
diff --git a/server/sonar-process/src/main/java/org/sonar/process/logging/LogLevelConfig.java b/server/sonar-process/src/main/java/org/sonar/process/logging/LogLevelConfig.java
index 9afd9d286d3..a687897662b 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/logging/LogLevelConfig.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/logging/LogLevelConfig.java
@@ -27,7 +27,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.sonar.process.ProcessId;
@@ -107,7 +106,7 @@ public final class LogLevelConfig {
private void levelByProperty(String loggerName, String property, String... otherProperties) {
ensureUniqueConfiguration(loggerName);
- configuredByProperties.put(loggerName, Stream.concat(Stream.of(property), Arrays.stream(otherProperties)).collect(Collectors.toList()));
+ configuredByProperties.put(loggerName, Stream.concat(Stream.of(property), Arrays.stream(otherProperties)).toList());
}
/**