summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java
index 02a4199d32e..3da2ad53f9a 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java
@@ -1,12 +1,9 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.profile.types;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.yahoo.component.ComponentId;
import com.yahoo.component.provider.FreezableSimpleComponent;
import com.yahoo.processing.request.CompoundName;
-import com.yahoo.search.query.profile.OverridableQueryProfile;
import com.yahoo.search.query.profile.QueryProfile;
import java.util.ArrayList;
@@ -83,8 +80,7 @@ public class QueryProfileType extends FreezableSimpleComponent {
Map<String, FieldDescription> unfrozenFields = new LinkedHashMap<>();
for (Map.Entry<String, FieldDescription> field : fields.entrySet()) {
FieldDescription unfrozenFieldValue = field.getValue();
- if (field.getValue().getType() instanceof QueryProfileFieldType) {
- QueryProfileFieldType queryProfileFieldType = (QueryProfileFieldType)field.getValue().getType();
+ if (field.getValue().getType() instanceof QueryProfileFieldType queryProfileFieldType) {
if (queryProfileFieldType.getQueryProfileType() != null) {
QueryProfileFieldType unfrozenType =
new QueryProfileFieldType(queryProfileFieldType.getQueryProfileType().unfrozen());
@@ -185,8 +181,8 @@ public class QueryProfileType extends FreezableSimpleComponent {
fields.put(field.getName(), field);
}
}
- fields = ImmutableMap.copyOf(fields);
- inherited = ImmutableList.copyOf(inherited);
+ fields = Collections.unmodifiableMap(fields);
+ inherited = List.copyOf(inherited);
strict = isStrict();
matchAsPath = getMatchAsPath();
super.freeze();
@@ -382,7 +378,7 @@ public class QueryProfileType extends FreezableSimpleComponent {
*/
public Map<String, String> aliases() {
if (isFrozen()) return aliases;
- if (aliases == null) return Collections.emptyMap();
+ if (aliases == null) return Map.of();
return Collections.unmodifiableMap(aliases);
}