aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-12-02 22:44:23 +0100
committerGitHub <noreply@github.com>2022-12-02 22:44:23 +0100
commitc0a2a4c5b8c595b3f523026a9684d505cabedf05 (patch)
tree94fedd0f85998659dd956b5256e60ca8e4950817 /container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariants.java
parent7f870bf3cb8dd0a3d015a448608ba7291a783932 (diff)
Revert "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, 10 insertions, 7 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 845c2cfd384..1b0472c5b17 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,12 +1,15 @@
// 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.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* This class represent a set of query profiles virtually - rather
@@ -54,7 +57,7 @@ public class QueryProfileVariants implements Freezable, Cloneable {
* on lookup time to influence the value returned.
*/
public QueryProfileVariants(String[] dimensions, QueryProfile owner) {
- this(Arrays.asList(dimensions), owner);
+ this(List.of(dimensions), owner);
}
/**
@@ -77,13 +80,13 @@ public class QueryProfileVariants implements Freezable, Cloneable {
if (frozen) return;
for (FieldValues fieldValues : fieldValuesByName.values())
fieldValues.freeze();
- fieldValuesByName = ImmutableMap.copyOf(fieldValuesByName);
+ fieldValuesByName = Map.copyOf(fieldValuesByName);
inheritedProfiles.freeze();
Collections.sort(variants);
for (QueryProfileVariant variant : variants)
variant.freeze();
- variants = ImmutableList.copyOf(variants);
+ variants = List.copyOf(variants);
frozen=true;
}
@@ -331,7 +334,7 @@ public class QueryProfileVariants implements Freezable, Cloneable {
if (frozen) return;
sort();
if (resolutionList != null)
- resolutionList = ImmutableList.copyOf(resolutionList);
+ resolutionList = List.copyOf(resolutionList);
frozen = true;
}