aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java
index 7fc8bfd40ab..57aa3516dfc 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java
@@ -1,11 +1,13 @@
// 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.search.query.profile.types.QueryProfileType;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* A variant of a query profile
@@ -40,7 +42,7 @@ public class QueryProfileVariant implements Cloneable, Comparable<QueryProfileVa
public Map<String, Object> values() {
if (values == null) {
if (frozen)
- return Collections.emptyMap();
+ return Map.of();
else
values = new HashMap<>();
}
@@ -54,7 +56,7 @@ public class QueryProfileVariant implements Cloneable, Comparable<QueryProfileVa
public List<QueryProfile> inherited() {
if (inherited == null) {
if (frozen)
- return Collections.emptyList();
+ return List.of();
else
inherited = new ArrayList<>();
}
@@ -140,9 +142,9 @@ public class QueryProfileVariant implements Cloneable, Comparable<QueryProfileVa
public void freeze() {
if (frozen) return;
if (inherited != null)
- inherited = ImmutableList.copyOf(inherited);
+ inherited = List.copyOf(inherited);
if (values != null)
- values = ImmutableMap.copyOf(values);
+ values = Map.copyOf(values);
frozen=true;
}