aboutsummaryrefslogtreecommitdiffstats
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.java8
1 files changed, 3 insertions, 5 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 3da2ad53f9a..9cbfe5b7112 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
@@ -52,7 +52,7 @@ public class QueryProfileType extends FreezableSimpleComponent {
private QueryProfileType(ComponentId id, Map<String, FieldDescription> fields, List<QueryProfileType> inherited) {
super(id);
QueryProfile.validateName(id.getName());
- componentIdAsCompoundName = new CompoundName(getId().getName());
+ componentIdAsCompoundName = CompoundName.from(getId().getName());
this.fields = fields;
this.inherited = inherited;
}
@@ -318,10 +318,9 @@ public class QueryProfileType extends FreezableSimpleComponent {
QueryProfileType type = null;
FieldDescription fieldDescription = getField(name);
if (fieldDescription != null) {
- if ( ! (fieldDescription.getType() instanceof QueryProfileFieldType))
+ if ( ! (fieldDescription.getType() instanceof QueryProfileFieldType fieldType))
throw new IllegalArgumentException("Cannot use name '" + name + "' as a prefix because it is " +
"already a " + fieldDescription.getType());
- QueryProfileFieldType fieldType = (QueryProfileFieldType) fieldDescription.getType();
type = fieldType.getQueryProfileType();
}
@@ -399,8 +398,7 @@ public class QueryProfileType extends FreezableSimpleComponent {
@Override
public boolean equals(Object o) {
if (o == this) return true;
- if ( ! (o instanceof QueryProfileType)) return false;
- QueryProfileType other = (QueryProfileType)o;
+ if ( ! (o instanceof QueryProfileType other)) return false;
return other.getId().equals(this.getId());
}