From cc25a94b7e3d45d01c35fc464d8bb67165b1480e Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 2 Dec 2022 12:38:30 +0100 Subject: Let list handling catch up with Java 17 --- .../controller/api/integration/configserver/ServiceConvergence.java | 3 +-- .../controller/api/integration/entity/MemoryEntityService.java | 5 ++--- .../hosted/controller/api/integration/organization/Contact.java | 4 +--- .../vespa/hosted/controller/api/integration/organization/Issue.java | 4 +--- .../vespa/hosted/controller/api/integration/organization/Mail.java | 5 +++-- 5 files changed, 8 insertions(+), 13 deletions(-) (limited to 'controller-api/src/main/java/com') diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java index f0ed73c2dc9..f0f0078be5a 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.configserver; -import com.google.common.collect.ImmutableList; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.HostName; import com.yahoo.config.provision.zone.ZoneId; @@ -28,7 +27,7 @@ public class ServiceConvergence { this.zone = zone; this.converged = converged; this.wantedGeneration = wantedGeneration; - this.services = ImmutableList.copyOf(services); + this.services = List.copyOf(services); } public ApplicationId application() { return application; } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/entity/MemoryEntityService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/entity/MemoryEntityService.java index a33ef135adf..ae71c5893e8 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/entity/MemoryEntityService.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/entity/MemoryEntityService.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.entity; -import com.google.common.collect.ImmutableMap; import com.yahoo.vespa.hosted.controller.api.identifiers.Property; import com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId; @@ -19,8 +18,8 @@ public class MemoryEntityService implements EntityService { @Override public Map listProperties() { - return ImmutableMap.of(new PropertyId("1234"), new Property("foo"), - new PropertyId("4321"), new Property("bar")); + return Map.of(new PropertyId("1234"), new Property("foo"), + new PropertyId("4321"), new Property("bar")); } @Override diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Contact.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Contact.java index a1f27f85500..7e566e07c7f 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Contact.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Contact.java @@ -1,8 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.organization; -import com.google.common.collect.ImmutableList; - import java.net.URI; import java.util.List; import java.util.Objects; @@ -26,7 +24,7 @@ public class Contact { this.propertyUrl = Objects.requireNonNull(propertyUrl, "propertyUrl must be non-null"); this.url = Objects.requireNonNull(url, "url must be non-null"); this.issueTrackerUrl = Objects.requireNonNull(issueTrackerUrl, "issueTrackerUrl must be non-null"); - this.persons = ImmutableList.copyOf(Objects.requireNonNull(persons, "persons must be non-null")); + this.persons = List.copyOf(Objects.requireNonNull(persons, "persons must be non-null")); this.queue = queue; this.component = component; } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java index 55f65d71165..7db85da1dbb 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java @@ -1,8 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.organization; -import com.google.common.collect.ImmutableList; - import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -30,7 +28,7 @@ public class Issue { this.summary = summary; this.description = description; - this.labels = ImmutableList.copyOf(labels); + this.labels = List.copyOf(labels); this.assignee = assignee; this.type = type; this.queue = queue; diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java index 36b6e251fbc..e84578790ab 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java @@ -1,9 +1,10 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.organization; -import com.google.common.collect.ImmutableList; +import com.yahoo.prelude.IndexFacts; import java.util.Collection; +import java.util.List; import java.util.Objects; import java.util.Optional; @@ -31,7 +32,7 @@ public class Mail { if (recipients.isEmpty()) throw new IllegalArgumentException("Empty recipient list is not allowed."); recipients.forEach(Objects::requireNonNull); - this.recipients = ImmutableList.copyOf(recipients); + this.recipients = List.copyOf(recipients); this.subject = Objects.requireNonNull(subject); this.message = Objects.requireNonNull(message); this.htmlMessage = Objects.requireNonNull(htmlMessage); -- cgit v1.2.3