summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
index e3ab49f0e32..b58bd64209b 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
@@ -1,7 +1,6 @@
// 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.yahoo.component.ComponentId;
import com.yahoo.component.provider.FreezableSimpleComponent;
import com.yahoo.processing.IllegalInputException;
@@ -420,7 +419,7 @@ public class QueryProfile extends FreezableSimpleComponent implements Cloneable
content.freeze();
- inherited= inherited==null ? ImmutableList.of() : ImmutableList.copyOf(inherited);
+ inherited= inherited==null ? List.of() : List.copyOf(inherited);
super.freeze();
}
@@ -616,8 +615,7 @@ public class QueryProfile extends FreezableSimpleComponent implements Cloneable
* be added (usually because the new value was added to the existing).
*/
static Object combineValues(Object newValue, Object existingValue) {
- if (newValue instanceof QueryProfile) {
- QueryProfile newProfile = (QueryProfile)newValue;
+ if (newValue instanceof QueryProfile newProfile) {
if ( ! (existingValue instanceof QueryProfile)) {
if ( ! isModifiable(newProfile)) {
// Make the query profile reference overridable
@@ -631,8 +629,7 @@ public class QueryProfile extends FreezableSimpleComponent implements Cloneable
return combineProfiles(newProfile, (QueryProfile)existingValue);
}
else {
- if (existingValue instanceof QueryProfile) { // we need to set a non-leaf value on a query profile
- QueryProfile existingProfile = (QueryProfile)existingValue;
+ if (existingValue instanceof QueryProfile existingProfile) { // we need to set a non-leaf value on a query profile
if (isModifiable(existingProfile)) {
existingProfile.setValue(newValue);
return null;