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 /container-core | |
parent | c956ac4cb73b329243072aabe35f0da508c02d0f (diff) |
Revert "Let list handling catch up with Java 17"
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/component/chain/Chain.java | 3 | ||||
-rw-r--r-- | container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/container-core/src/main/java/com/yahoo/component/chain/Chain.java b/container-core/src/main/java/com/yahoo/component/chain/Chain.java index 24c4a0a0e2e..e44eba35efe 100644 --- a/container-core/src/main/java/com/yahoo/component/chain/Chain.java +++ b/container-core/src/main/java/com/yahoo/component/chain/Chain.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.component.chain; +import com.google.common.collect.ImmutableList; import com.yahoo.component.ComponentId; import com.yahoo.component.chain.dependencies.ordering.ChainBuilder; @@ -27,7 +28,7 @@ public class Chain<COMPONENT extends ChainedComponent> { /** Create a chain directly. This will NOT order the chain by the ordering constraints. */ public Chain(ComponentId id, List<COMPONENT> componentList) { this.id = id; - this.componentList = List.copyOf(componentList); + this.componentList = ImmutableList.copyOf(componentList); } /** Create a chain directly. This will NOT order the chain by the ordering constraints. */ diff --git a/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java b/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java index 959caa215be..28645b4bde0 100644 --- a/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java +++ b/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.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.processing.handler; +import com.google.common.collect.ImmutableList; import com.yahoo.container.jdisc.AsyncHttpResponse; import com.yahoo.container.jdisc.VespaHeaders; import com.yahoo.jdisc.handler.CompletionHandler; @@ -109,13 +110,13 @@ public class ProcessingResponse extends AsyncHttpResponse { private List<ErrorMessage> flattenErrors(Response processingResponse) { Set<ErrorMessage> errors = flattenErrors(null, processingResponse.data()); - if (errors == null) return List.of(); - return List.copyOf(errors); + if (errors == null) return Collections.emptyList(); + return ImmutableList.copyOf(errors); } @SuppressWarnings("unchecked") private Set<ErrorMessage> flattenErrors(Set<ErrorMessage> errors, Data data) { - if (data.request() == null) return Set.of(); // Not allowed, but handle anyway + if (data.request() == null) return Collections.EMPTY_SET; // Not allowed, but handle anyway errors = addTo(errors, data.request().errors()); if (data instanceof DataList) { |