aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-core
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2023-07-07 08:49:05 +0200
committersonartech <sonartech@sonarsource.com>2023-07-17 20:03:45 +0000
commitc62e96c1586baff4fcb6ffb71c2166686c6dbb68 (patch)
tree80c2e1c3e754d179833ebaad2db2c1cefb94db5c /server/sonar-db-core
parent470a55b6ae21f203d5f0fa27e4b7d114d3922902 (diff)
downloadsonarqube-c62e96c1586baff4fcb6ffb71c2166686c6dbb68.tar.gz
sonarqube-c62e96c1586baff4fcb6ffb71c2166686c6dbb68.zip
NO-JIRA replace Collectors.toList to Stream.toList
Diffstat (limited to 'server/sonar-db-core')
-rw-r--r--server/sonar-db-core/src/it/java/org/sonar/db/DatabaseUtilsIT.java7
-rw-r--r--server/sonar-db-core/src/testFixtures/java/org/sonar/db/AbstractDbTester.java3
2 files changed, 4 insertions, 6 deletions
diff --git a/server/sonar-db-core/src/it/java/org/sonar/db/DatabaseUtilsIT.java b/server/sonar-db-core/src/it/java/org/sonar/db/DatabaseUtilsIT.java
index 8b73d12b75d..31b9a58b4ea 100644
--- a/server/sonar-db-core/src/it/java/org/sonar/db/DatabaseUtilsIT.java
+++ b/server/sonar-db-core/src/it/java/org/sonar/db/DatabaseUtilsIT.java
@@ -33,13 +33,12 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
-import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
+import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import org.sonar.api.testfixtures.log.LogTester;
-import org.slf4j.LoggerFactory;
import org.sonar.db.dialect.Oracle;
import static org.assertj.core.api.Assertions.assertThat;
@@ -59,10 +58,10 @@ import static org.mockito.Mockito.when;
import static org.sonar.db.DatabaseUtils.ORACLE_DRIVER_NAME;
import static org.sonar.db.DatabaseUtils.checkThatNotTooManyConditions;
import static org.sonar.db.DatabaseUtils.closeQuietly;
+import static org.sonar.db.DatabaseUtils.getColumnMetadata;
import static org.sonar.db.DatabaseUtils.getDriver;
import static org.sonar.db.DatabaseUtils.log;
import static org.sonar.db.DatabaseUtils.tableColumnExists;
-import static org.sonar.db.DatabaseUtils.getColumnMetadata;
import static org.sonar.db.DatabaseUtils.tableExists;
import static org.sonar.db.DatabaseUtils.toUniqueAndSortedList;
@@ -354,7 +353,7 @@ public class DatabaseUtilsIT {
List<String> outputs = DatabaseUtils.executeLargeInputs(inputs, input -> {
// Check that each partition is only done on 1000 elements max
assertThat(input).hasSizeLessThanOrEqualTo(1000);
- return input.stream().map(String::valueOf).collect(Collectors.toList());
+ return input.stream().map(String::valueOf).toList();
});
assertThat(outputs).isEqualTo(expectedOutputs);
diff --git a/server/sonar-db-core/src/testFixtures/java/org/sonar/db/AbstractDbTester.java b/server/sonar-db-core/src/testFixtures/java/org/sonar/db/AbstractDbTester.java
index 6cd5c0f0808..0bd97c25111 100644
--- a/server/sonar-db-core/src/testFixtures/java/org/sonar/db/AbstractDbTester.java
+++ b/server/sonar-db-core/src/testFixtures/java/org/sonar/db/AbstractDbTester.java
@@ -44,7 +44,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.dbutils.QueryRunner;
@@ -391,7 +390,7 @@ public class AbstractDbTester<T extends TestDb> extends ExternalResource {
columnNames.stream()
.sorted(PkColumn.ORDERING_BY_INDEX)
.map(PkColumn::getName)
- .collect(Collectors.toList()));
+ .toList());
}
}