aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2022-12-02 14:52:26 +0100
committerGitHub <noreply@github.com>2022-12-02 14:52:26 +0100
commit81b884ac555806ae2f0a75773accfd8fe27ecbe1 (patch)
tree0f92b9ef73a90854cacc96796562d3f21ff1cff6 /container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
parentc956ac4cb73b329243072aabe35f0da508c02d0f (diff)
Revert "Let list handling catch up with Java 17"
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
index 1b0472c5b17..845c2cfd384 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
@@ -1,15 +1,12 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.profile;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
import com.yahoo.component.provider.Freezable;
import com.yahoo.search.query.profile.types.QueryProfileType;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
* This class represent a set of query profiles virtually - rather
@@ -57,7 +54,7 @@ public class QueryProfileVariants implements Freezable, Cloneable {
* on lookup time to influence the value returned.
*/
public QueryProfileVariants(String[] dimensions, QueryProfile owner) {
- this(List.of(dimensions), owner);
+ this(Arrays.asList(dimensions), owner);
}
/**
@@ -80,13 +77,13 @@ public class QueryProfileVariants implements Freezable, Cloneable {
if (frozen) return;
for (FieldValues fieldValues : fieldValuesByName.values())
fieldValues.freeze();
- fieldValuesByName = Map.copyOf(fieldValuesByName);
+ fieldValuesByName = ImmutableMap.copyOf(fieldValuesByName);
inheritedProfiles.freeze();
Collections.sort(variants);
for (QueryProfileVariant variant : variants)
variant.freeze();
- variants = List.copyOf(variants);
+ variants = ImmutableList.copyOf(variants);
frozen=true;
}
@@ -334,7 +331,7 @@ public class QueryProfileVariants implements Freezable, Cloneable {
if (frozen) return;
sort();
if (resolutionList != null)
- resolutionList = List.copyOf(resolutionList);
+ resolutionList = ImmutableList.copyOf(resolutionList);
frozen = true;
}