diff options
author | Bjørn Christian Seime <bjorn.christian@seime.no> | 2022-12-02 14:52:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 14:52:26 +0100 |
commit | 81b884ac555806ae2f0a75773accfd8fe27ecbe1 (patch) | |
tree | 0f92b9ef73a90854cacc96796562d3f21ff1cff6 /controller-api | |
parent | c956ac4cb73b329243072aabe35f0da508c02d0f (diff) |
Revert "Let list handling catch up with Java 17"
Diffstat (limited to 'controller-api')
5 files changed, 13 insertions, 8 deletions
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 f0f0078be5a..f0ed73c2dc9 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,6 +1,7 @@ // 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; @@ -27,7 +28,7 @@ public class ServiceConvergence { this.zone = zone; this.converged = converged; this.wantedGeneration = wantedGeneration; - this.services = List.copyOf(services); + this.services = ImmutableList.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 ae71c5893e8..a33ef135adf 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,6 +1,7 @@ // 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; @@ -18,8 +19,8 @@ public class MemoryEntityService implements EntityService { @Override public Map<PropertyId, Property> listProperties() { - return Map.of(new PropertyId("1234"), new Property("foo"), - new PropertyId("4321"), new Property("bar")); + return ImmutableMap.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 7e566e07c7f..a1f27f85500 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,6 +1,8 @@ // 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; @@ -24,7 +26,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 = List.copyOf(Objects.requireNonNull(persons, "persons must be non-null")); + this.persons = ImmutableList.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 7db85da1dbb..55f65d71165 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,6 +1,8 @@ // 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; @@ -28,7 +30,7 @@ public class Issue { this.summary = summary; this.description = description; - this.labels = List.copyOf(labels); + this.labels = ImmutableList.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 e84578790ab..36b6e251fbc 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,10 +1,9 @@ // 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.yahoo.prelude.IndexFacts; +import com.google.common.collect.ImmutableList; import java.util.Collection; -import java.util.List; import java.util.Objects; import java.util.Optional; @@ -32,7 +31,7 @@ public class Mail { if (recipients.isEmpty()) throw new IllegalArgumentException("Empty recipient list is not allowed."); recipients.forEach(Objects::requireNonNull); - this.recipients = List.copyOf(recipients); + this.recipients = ImmutableList.copyOf(recipients); this.subject = Objects.requireNonNull(subject); this.message = Objects.requireNonNull(message); this.htmlMessage = Objects.requireNonNull(htmlMessage); |