summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java3
-rw-r--r--clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/ReindexingMaintainer.java5
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java4
-rw-r--r--config-model/src/main/java/com/yahoo/schema/LargeRankingExpressions.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationCuratorDatabase.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java2
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogEntry.java2
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMock.java4
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java4
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/maven/Metadata.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzFacade.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java1
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/SupportAccessSerializer.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java6
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/user/UserFlagsSerializer.java8
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccess.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccessControl.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainerTest.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/BufferedLogStoreTest.java3
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java2
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java19
-rw-r--r--http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java3
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/application/BindingSet.java4
-rw-r--r--messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java5
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/ConfigServerInfo.java2
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/container/image/ContainerImagePruner.java2
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/container/ContainerEngineMock.java2
-rw-r--r--routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/RoutingTable.java2
-rw-r--r--vespaclient-core/src/main/java/com/yahoo/vespaclient/ClusterList.java2
32 files changed, 51 insertions, 60 deletions
diff --git a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
index 246092034de..92b5e56ac08 100644
--- a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
+++ b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
@@ -32,7 +32,6 @@ import static java.util.Objects.requireNonNull;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
-import static java.util.stream.Collectors.toUnmodifiableList;
/**
* Progresses reindexing efforts by creating visitor sessions against its own content cluster,
@@ -82,7 +81,7 @@ public class Reindexer {
this.cluster = cluster;
this.ready = ready.stream() // Iterate through document types in consistent order.
.sorted(comparingDouble(Trigger::speed).reversed().thenComparing(Trigger::readyAt).thenComparing(Trigger::type))
- .collect(toUnmodifiableList());
+ .toList();
this.database = database;
this.visitorSessions = visitorSessions;
this.metrics = new ReindexingMetrics(metric, cluster.name);
diff --git a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/ReindexingMaintainer.java b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/ReindexingMaintainer.java
index 42555e38326..0a1fdb32a84 100644
--- a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/ReindexingMaintainer.java
+++ b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/ReindexingMaintainer.java
@@ -32,7 +32,6 @@ import java.util.stream.Stream;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.WARNING;
import static java.util.stream.Collectors.toMap;
-import static java.util.stream.Collectors.toUnmodifiableList;
/**
* Runs in all cluster controller containers, and progresses reindexing efforts.
@@ -70,7 +69,7 @@ public class ReindexingMaintainer extends AbstractComponent {
access,
metric,
clock))
- .collect(toUnmodifiableList());
+ .toList();
this.executor = new ScheduledThreadPoolExecutor(reindexingConfig.clusters().size(), new DaemonThreadFactory("reindexer-"));
if (reindexingConfig.enabled())
scheduleStaggered((delayMillis, intervalMillis) -> executor.scheduleAtFixedRate(this::maintain, delayMillis, intervalMillis, TimeUnit.MILLISECONDS),
@@ -123,7 +122,7 @@ public class ReindexingMaintainer extends AbstractComponent {
.map(typeStatus -> new Trigger(manager.getDocumentType(typeStatus.getKey()),
Instant.ofEpochMilli(typeStatus.getValue().readyAtMillis()),
typeStatus.getValue().speed()))
- .collect(toUnmodifiableList());
+ .toList();
}
/** Schedules a task with the given interval (across all containers in this ZK cluster). */
diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java b/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java
index 8256237dc43..1b5c5ce5873 100644
--- a/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java
+++ b/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java
@@ -34,8 +34,8 @@ public class TimeWindow {
private final LocalDateRange dateRange;
private TimeWindow(List<DayOfWeek> days, List<Integer> hours, ZoneId zone, LocalDateRange dateRange) {
- this.days = Objects.requireNonNull(days).stream().distinct().sorted().collect(Collectors.toUnmodifiableList());
- this.hours = Objects.requireNonNull(hours).stream().distinct().sorted().collect(Collectors.toUnmodifiableList());
+ this.days = Objects.requireNonNull(days).stream().distinct().sorted().toList();
+ this.hours = Objects.requireNonNull(hours).stream().distinct().sorted().toList();
this.zone = Objects.requireNonNull(zone);
this.dateRange = Objects.requireNonNull(dateRange);
if (days.isEmpty()) throw new IllegalArgumentException("At least one day must be specified");
diff --git a/config-model/src/main/java/com/yahoo/schema/LargeRankingExpressions.java b/config-model/src/main/java/com/yahoo/schema/LargeRankingExpressions.java
index 2ae9041b1a2..319b1ac343a 100644
--- a/config-model/src/main/java/com/yahoo/schema/LargeRankingExpressions.java
+++ b/config-model/src/main/java/com/yahoo/schema/LargeRankingExpressions.java
@@ -40,7 +40,7 @@ public class LargeRankingExpressions {
/** Returns a read-only list of ranking constants ordered by name */
public Collection<RankingExpressionBody> expressions() {
- return expressions.values().stream().sorted().collect(Collectors.toUnmodifiableList());
+ return expressions.values().stream().sorted().toList();
}
// Note: Use by integration tests in internal repo
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationCuratorDatabase.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationCuratorDatabase.java
index 438ac7dc9a8..d757421c23a 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationCuratorDatabase.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/ApplicationCuratorDatabase.java
@@ -122,7 +122,7 @@ public class ApplicationCuratorDatabase {
.sorted()
.map(ApplicationId::fromSerializedForm)
.filter(id -> activeSessionOf(id).isPresent())
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
public Optional<ApplicationReindexing> readReindexingStatus(ApplicationId id) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java
index cbd66c0bb67..369f91ec876 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v1/RoutingStatusApiHandler.java
@@ -99,7 +99,7 @@ public class RoutingStatusApiHandler extends RestApiRequestHandler<RoutingStatus
List<String> inactiveDeployments = curator.getChildren(DEPLOYMENT_STATUS_ROOT).stream()
.filter(upstreamName -> deploymentStatus(upstreamName).status() == RoutingStatus.out)
.sorted()
- .collect(Collectors.toUnmodifiableList());
+ .toList();
Slime slime = new Slime();
Cursor rootArray = slime.setArray();
inactiveDeployments.forEach(rootArray::addString);
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogEntry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogEntry.java
index 73f83a9b6e5..96a0e5baa56 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogEntry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogEntry.java
@@ -71,7 +71,7 @@ public class LogEntry {
.replaceAll("\\\\t", "\t")))
.filter(entry -> entry.at().isAfter(from))
.limit(100_000)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
catch (IOException e) {
throw new UncheckedIOException(e);
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMock.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMock.java
index f7e7d69cd2f..7ae03d7ce6b 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMock.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMock.java
@@ -58,7 +58,7 @@ public class EndpointCertificateMock implements EndpointCertificateProvider {
"athenzDomain",
p.requestedDnsSans().stream()
.map(san -> new EndpointCertificateRequestMetadata.DnsNameStatus(san, "done"))
- .collect(Collectors.toUnmodifiableList()),
+ .toList(),
3600,
"ok",
"2021-09-28T00:14:31.946562037Z",
@@ -66,7 +66,7 @@ public class EndpointCertificateMock implements EndpointCertificateProvider {
p.issuer(),
"rsa_2048"
))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
@Override
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java
index 0a71e185717..0ca4ae66fb3 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java
@@ -81,7 +81,7 @@ public class MemoryNameService implements NameService {
public List<Record> findRecords(Record.Type type, RecordName name) {
return records.stream()
.filter(record -> record.type() == type && record.name().equals(name))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
@Override
@@ -103,7 +103,7 @@ public class MemoryNameService implements NameService {
}
return false;
})
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
@Override
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/maven/Metadata.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/maven/Metadata.java
index 6750c6d2eaf..dd80a2b3a9a 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/maven/Metadata.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/maven/Metadata.java
@@ -23,7 +23,7 @@ public class Metadata {
public Metadata(ArtifactId id, List<Version> versions) {
this.id = requireNonNull(id);
- this.versions = versions.stream().sorted().collect(Collectors.toUnmodifiableList());
+ this.versions = versions.stream().sorted().toList();
}
/** Creates a new Metadata object from the given XML document. */
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzFacade.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzFacade.java
index 3bc2aec95ff..6a493f3f5ed 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzFacade.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzFacade.java
@@ -235,7 +235,7 @@ public class AthenzFacade implements AccessControl {
return tenants.stream()
.filter(tenant -> tenant.type() == Tenant.Type.athenz
&& userDomains.apply(identity).contains(((AthenzTenant) tenant).domain()))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
public void addTenantAdmin(AthenzDomain tenantDomain, AthenzUser user) {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
index 3c2dbcb8633..a5cb839e9c9 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
@@ -152,7 +152,7 @@ public class DeploymentTrigger {
.collect(groupingBy(Job::applicationId))
.values().stream()
.flatMap(List::stream)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
// Map of test jobs, a list for each job type. Jobs in each list are sorted by priority.
Map<JobType, List<Job>> sortedTestJobsByType = testJobs.stream()
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
index 9c983eb5a0f..674d71001e3 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
@@ -94,7 +94,6 @@ import static java.util.Comparator.naturalOrder;
import static java.util.function.Predicate.not;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
-import static java.util.stream.Collectors.toUnmodifiableList;
/**
* A singleton owned by the controller, which contains the state and methods for controlling deployment jobs.
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java
index 71ff28c47e6..fd1e5592608 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java
@@ -307,7 +307,7 @@ public class Run {
.allMatch(step -> steps.get(step) == null
|| steps.get(step).status() == succeeded))
.map(Map.Entry::getKey)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
/** Returns the list of not-yet-run run-always steps whose run-always prerequisites have all run. */
@@ -320,7 +320,7 @@ public class Run {
.allMatch(step -> steps.get(step) == null
|| steps.get(step).status() != unfinished))
.map(Map.Entry::getKey)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
private void requireActive() {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/SupportAccessSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/SupportAccessSerializer.java
index a913e86dda9..af7c03f8657 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/SupportAccessSerializer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/SupportAccessSerializer.java
@@ -124,7 +124,7 @@ public class SupportAccessSerializer {
inspector.field(requestorFieldName).asString(),
X509CertificateUtils.fromPem(inspector.field(certificateFieldName).asString())
))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
List<SupportAccessChange> changeHistory = SlimeUtils.entriesStream(slime.get().field(historyFieldName))
.map(inspector ->
@@ -133,7 +133,7 @@ public class SupportAccessSerializer {
Instant.parse(inspector.field(atFieldName).asString()),
inspector.field(byFieldName).asString())
)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
return new SupportAccess(changeHistory, grantHistory);
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
index d4536da91fe..f6b28a2ee34 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/TenantSerializer.java
@@ -271,7 +271,7 @@ public class TenantSerializer {
inspector.field(nameField).asString(),
inspector.field(awsIdField).asString(),
inspector.field(roleField).asString()))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
private LastLoginInfo lastLoginInfoFromSlime(Inspector lastLoginInfoObject) {
@@ -337,7 +337,7 @@ public class TenantSerializer {
private TenantContacts tenantContactsFrom(Inspector object) {
List<TenantContacts.Contact> contacts = SlimeUtils.entriesStream(object)
.map(this::readContact)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
return new TenantContacts(contacts);
}
@@ -405,7 +405,7 @@ public class TenantSerializer {
.orElseThrow(() -> new RuntimeException("Unknown type: " + inspector.field("type").asString()));
var audiences = SlimeUtils.entriesStream(inspector.field("audiences"))
.map(audience -> TenantSerializer.fromAudience(audience.asString()))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
switch (type) {
case EMAIL:
var isVerified = asBoolOrTrue(inspector.field("data").field("emailVerified"));
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/user/UserFlagsSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/user/UserFlagsSerializer.java
index 44d537883f9..54a24360b5a 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/user/UserFlagsSerializer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/user/UserFlagsSerializer.java
@@ -36,7 +36,7 @@ public class UserFlagsSerializer {
.filter(fd -> fd.getDimensions().contains(FetchVector.Dimension.CONSOLE_USER_EMAIL))
.map(FlagDefinition::getUnboundFlag)
.map(flag -> filteredFlagData(flag, Optional.ofNullable(rawFlagData.get(flag.id())), authorizedForTenantNames, isOperator, resolveVector))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
byte[] bytes = FlagData.serializeListToUtf8Json(filteredFlagData);
SlimeUtils.copyObject(SlimeUtils.jsonToSlime(bytes).get(), cursor);
@@ -55,10 +55,10 @@ public class UserFlagsSerializer {
.map(rule -> new Rule(rule.getValueToApply().or(() -> defaultValue),
rule.conditions().stream()
.flatMap(condition -> filteredCondition(condition, authorizedForTenantNames, isOperator, resolveVector).stream())
- .collect(Collectors.toUnmodifiableList())))
+ .toList()))
// We can stop as soon as we hit the first rule that has no conditions
.takeWhile(rule -> !encounteredEmpty.getAndSet(rule.conditions().isEmpty()))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
return new FlagData(definition.id(), new FetchVector(), rules);
}
@@ -80,7 +80,7 @@ public class UserFlagsSerializer {
private static Optional<Condition> valueSubset(Condition condition, Predicate<String> predicate) {
Condition.CreateParams createParams = condition.toCreateParams();
return Optional.of(createParams
- .withValues(createParams.values().stream().filter(predicate).collect(Collectors.toUnmodifiableList()))
+ .withValues(createParams.values().stream().filter(predicate).toList())
.createAs(condition.type()));
}
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccess.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccess.java
index 27cf61564aa..e5304a05d02 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccess.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccess.java
@@ -71,7 +71,7 @@ public class SupportAccess {
private <T> List<T> prepend(T newEntry, List<T> existingEntries) {
return Stream.concat(Stream.of(newEntry), existingEntries.stream()) // latest change first
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
public static class CurrentStatus {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccessControl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccessControl.java
index 27b61a4fd17..1561a486fda 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccessControl.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccessControl.java
@@ -88,7 +88,7 @@ public class SupportAccessControl {
return supportAccess.grantHistory().stream()
.filter(grant -> now.isAfter(grant.certificate().getNotBefore().toInstant()))
.filter(grant -> now.isBefore(grant.certificate().getNotAfter().toInstant()))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
public boolean allowDataplaneMembership(AthenzUser identity, DeploymentId deploymentId) {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index 2c1d7315adc..93b804805c3 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -336,7 +336,7 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
public List<LoadBalancer> getLoadBalancers(ApplicationId application, ZoneId zone) {
return getLoadBalancers(zone).stream()
.filter(lb -> lb.application().equals(application))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
@Override
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainerTest.java
index 1f92c7f6e41..157abe17841 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainerTest.java
@@ -152,6 +152,6 @@ public class ResourceMeterMaintainerTest {
.clusterId("clusterA")
.clusterType(state == Node.State.active ? Node.ClusterType.admin : Node.ClusterType.container)
.build())
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/BufferedLogStoreTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/BufferedLogStoreTest.java
index eb5422f5cff..59433a6bb69 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/BufferedLogStoreTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/BufferedLogStoreTest.java
@@ -19,7 +19,6 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.IntStream;
-import static java.util.stream.Collectors.toUnmodifiableList;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -100,7 +99,7 @@ public class BufferedLogStoreTest {
// Logging a large entry enough times to reach the maximum size causes no further entries to be stored.
List<LogEntry> monsterLog = IntStream.range(0, 2 * maxChunks + 3)
.mapToObj(i -> new LogEntry(i, entry.at(), entry.type(), entry.message()))
- .collect(toUnmodifiableList());
+ .toList();
List<LogEntry> logged = new ArrayList<>(monsterLog);
logged.remove(logged.size() - 1);
logged.remove(logged.size() - 1);
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java
index cd8a9e72051..43ad01fc5c2 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java
@@ -209,7 +209,7 @@ public class RotationRepositoryTest {
}
private static List<RotationId> rotationIds(List<AssignedRotation> assignedRotations) {
- return assignedRotations.stream().map(AssignedRotation::rotationId).collect(Collectors.toUnmodifiableList());
+ return assignedRotations.stream().map(AssignedRotation::rotationId).toList();
}
}
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java b/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java
index ea35732a7d6..b930fe7d10a 100644
--- a/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java
+++ b/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java
@@ -8,7 +8,6 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.Comparator.comparing;
-import static java.util.stream.Collectors.toUnmodifiableList;
/**
* A list of {@link Entry} items from a deployment job.
@@ -23,7 +22,7 @@ public class DeploymentLog {
private final OptionalLong last;
public DeploymentLog(List<Entry> entries, boolean active, Status status, OptionalLong last) {
- this.entries = entries.stream().sorted(comparing(Entry::at)).collect(toUnmodifiableList());
+ this.entries = entries.stream().sorted(comparing(Entry::at)).toList();
this.active = active;
this.status = status;
this.last = last;
@@ -31,7 +30,7 @@ public class DeploymentLog {
/** Returns this log updated with the content of the other. */
public DeploymentLog updatedWith(DeploymentLog other) {
- return new DeploymentLog(Stream.concat(entries.stream(), other.entries.stream()).collect(toUnmodifiableList()),
+ return new DeploymentLog(Stream.concat(entries.stream(), other.entries.stream()).toList(),
other.active,
other.status,
other.last);
@@ -101,13 +100,13 @@ public class DeploymentLog {
debug;
public static Level of(String level) {
- switch (level) {
- case "error" : return error;
- case "warning" : return warning;
- case "info" : return info;
- case "debug" : return debug;
- default : return debug;
- }
+ return switch (level) {
+ case "error" -> error;
+ case "warning" -> warning;
+ case "info" -> info;
+ case "debug" -> debug;
+ default -> debug;
+ };
}
}
diff --git a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java
index 4da887f0cbb..10ef20980e6 100644
--- a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java
+++ b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java
@@ -30,7 +30,6 @@ import java.util.stream.IntStream;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;
-import static java.util.stream.Collectors.toUnmodifiableList;
/**
* @author jonmv
@@ -265,7 +264,7 @@ public interface HttpClient extends Closeable {
/** Attempts each request against the host the specified number of times. */
static HostStrategy repeating(URI host, int count) {
- return ordered(IntStream.range(0, count).mapToObj(__ -> host).collect(toUnmodifiableList()));
+ return ordered(IntStream.range(0, count).mapToObj(__ -> host).toList());
}
}
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/application/BindingSet.java b/jdisc_core/src/main/java/com/yahoo/jdisc/application/BindingSet.java
index 2f0a2806947..8a76f6f796d 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/application/BindingSet.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/application/BindingSet.java
@@ -6,8 +6,6 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
-import static java.util.stream.Collectors.toUnmodifiableList;
-
/**
* <p>This is an immutable set of ordered bindings from {@link UriPattern}s to some target type T. To create an instance
* of this class, you must 1) create a {@link BindingRepository}, 2) configure it using the {@link
@@ -69,7 +67,7 @@ public class BindingSet<T> implements Iterable<Map.Entry<UriPattern, T>> {
}
private static <T> Collection<Map.Entry<UriPattern, T>> sorted(Collection<Map.Entry<UriPattern, T>> unsorted) {
- return unsorted.stream().sorted(Map.Entry.comparingByKey()).collect(toUnmodifiableList());
+ return unsorted.stream().sorted(Map.Entry.comparingByKey()).toList();
}
}
diff --git a/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java b/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java
index 8380c9d00ef..ee5c39f641b 100644
--- a/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java
+++ b/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java
@@ -17,7 +17,6 @@ import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
-import static java.util.stream.Collectors.toUnmodifiableList;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
@@ -307,7 +306,7 @@ public class DynamicThrottlePolicyTest {
final int maximumTaskPerWorker;
final int workerParallelism;
final int[] currentTask;
- final List<Deque<Consumer<Boolean>>> outstandingTasks;
+ final List<ArrayDeque<Consumer<Boolean>>> outstandingTasks;
int pending = 0;
MockServer(int workPerSuccess, int numberOfWorkers, int maximumTaskPerWorker, int workerParallelism) {
@@ -318,7 +317,7 @@ public class DynamicThrottlePolicyTest {
this.currentTask = new int[numberOfWorkers];
this.outstandingTasks = IntStream.range(0, numberOfWorkers)
.mapToObj(__ -> new ArrayDeque<Consumer<Boolean>>())
- .collect(toUnmodifiableList());
+ .toList();
}
void tick() {
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/ConfigServerInfo.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/ConfigServerInfo.java
index 77c8b80ca91..a097db2adba 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/ConfigServerInfo.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/ConfigServerInfo.java
@@ -26,7 +26,7 @@ public class ConfigServerInfo {
this.configServerHostnameToUriMapper = hostname -> URI.create("https://" + hostname + ":4443");
this.configServerURIs = configServerHostNames.stream()
.map(configServerHostnameToUriMapper)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
public List<URI> getConfigServerUris() {
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/container/image/ContainerImagePruner.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/container/image/ContainerImagePruner.java
index 236a4d6718f..8fcd7893f64 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/container/image/ContainerImagePruner.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/container/image/ContainerImagePruner.java
@@ -158,7 +158,7 @@ public class ContainerImagePruner {
if ("<none>:<none>".equals(tag)) return image.id();
return tag;
})
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
}
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/container/ContainerEngineMock.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/container/ContainerEngineMock.java
index 2d3a4976fe5..09590be42f8 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/container/ContainerEngineMock.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/container/ContainerEngineMock.java
@@ -173,7 +173,7 @@ public class ContainerEngineMock implements ContainerEngine {
return images.values().stream()
.filter(ImageDownload::isComplete)
.map(ImageDownload::image)
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
private Container requireContainer(ContainerName name) {
diff --git a/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/RoutingTable.java b/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/RoutingTable.java
index de3207fda2e..7f9f04ed691 100644
--- a/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/RoutingTable.java
+++ b/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/RoutingTable.java
@@ -154,7 +154,7 @@ public class RoutingTable {
this.instance = Objects.requireNonNull(instance);
this.zone = Objects.requireNonNull(zone);
this.cluster = Objects.requireNonNull(cluster);
- this.reals = Objects.requireNonNull(reals).stream().sorted().collect(Collectors.toUnmodifiableList());
+ this.reals = Objects.requireNonNull(reals).stream().sorted().toList();
for (int i = 0; i < reals.size(); i++) {
for (int j = 0; j < i; j++) {
if (reals.get(i).equals(reals.get(j))) {
diff --git a/vespaclient-core/src/main/java/com/yahoo/vespaclient/ClusterList.java b/vespaclient-core/src/main/java/com/yahoo/vespaclient/ClusterList.java
index c42d48b4821..452ab175862 100644
--- a/vespaclient-core/src/main/java/com/yahoo/vespaclient/ClusterList.java
+++ b/vespaclient-core/src/main/java/com/yahoo/vespaclient/ClusterList.java
@@ -36,7 +36,7 @@ public class ClusterList {
private static List<ClusterDef> parse(ClusterListConfig config) {
return config.storage().stream()
.map(storage -> new ClusterDef(storage.name()))
- .collect(Collectors.toUnmodifiableList());
+ .toList();
}
}