diff options
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/BackedOverridableQueryProfile.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/profile/BackedOverridableQueryProfile.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/BackedOverridableQueryProfile.java b/container-search/src/main/java/com/yahoo/search/query/profile/BackedOverridableQueryProfile.java index 0bb36d87f64..9eab6629a45 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/BackedOverridableQueryProfile.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/BackedOverridableQueryProfile.java @@ -31,7 +31,7 @@ public class BackedOverridableQueryProfile extends OverridableQueryProfile imple * @param backingProfile the backing profile, which is assumed read only, never null */ public BackedOverridableQueryProfile(QueryProfile backingProfile) { - Validator.ensureNotNull("An overridable query profile must be backed by a real query profile",backingProfile); + Validator.ensureNotNull("An overridable query profile must be backed by a real query profile", backingProfile); setType(backingProfile.getType()); this.backingProfile = backingProfile; } @@ -49,7 +49,7 @@ public class BackedOverridableQueryProfile extends OverridableQueryProfile imple protected Object localLookup(String localName, DimensionBinding dimensionBinding) { Object valueInThis = super.localLookup(localName, dimensionBinding); if (valueInThis != null) return valueInThis; - return backingProfile.localLookup(localName, dimensionBinding); + return backingProfile.localLookup(localName, dimensionBinding.createFor(backingProfile.getDimensions())); } protected Boolean isLocalInstanceOverridable(String localName) { @@ -88,17 +88,17 @@ public class BackedOverridableQueryProfile extends OverridableQueryProfile imple } @Override - protected void visitVariants(boolean allowContent,QueryProfileVisitor visitor,DimensionBinding dimensionBinding) { + protected void visitVariants(boolean allowContent, QueryProfileVisitor visitor, DimensionBinding dimensionBinding) { super.visitVariants(allowContent, visitor, dimensionBinding); if (visitor.isDone()) return; - backingProfile.visitVariants(allowContent, visitor, dimensionBinding); + backingProfile.visitVariants(allowContent, visitor, dimensionBinding.createFor(backingProfile.getDimensions())); } @Override protected void visitInherited(boolean allowContent, QueryProfileVisitor visitor, DimensionBinding dimensionBinding, QueryProfile owner) { super.visitInherited(allowContent, visitor, dimensionBinding, owner); if (visitor.isDone()) return; - backingProfile.visitInherited(allowContent, visitor, dimensionBinding,owner); + backingProfile.visitInherited(allowContent, visitor, dimensionBinding.createFor(backingProfile.getDimensions()), owner); } /** Returns a value from the content of this: The value in this, or the value from the backing if not set in this */ @@ -113,12 +113,12 @@ public class BackedOverridableQueryProfile extends OverridableQueryProfile imple * All the values in this, and all values in the backing where an overriding value is not set in this */ @Override - protected Map<String,Object> getContent() { - Map<String,Object> thisContent=super.getContent(); - Map<String,Object> backingContent=backingProfile.getContent(); + protected Map<String, Object> getContent() { + Map<String,Object> thisContent = super.getContent(); + Map<String,Object> backingContent = backingProfile.getContent(); if (thisContent.isEmpty()) return backingContent; // Shortcut if (backingContent.isEmpty()) return thisContent; // Shortcut - Map<String,Object> content=new HashMap<>(backingContent); + Map<String, Object> content = new HashMap<>(backingContent); content.putAll(thisContent); return content; } |