summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-10-19 16:09:54 +0200
committerGitHub <noreply@github.com>2022-10-19 16:09:54 +0200
commitdfb918506e63fee9c7c41949bc5fa10b7d98bc93 (patch)
treef23bdaea5364767503a527982b366b2b0a6e47e5 /config-model/src/main/java/com/yahoo
parent71922a7b3329fc90cd0f1a51568680758c7dc72a (diff)
parent8aada7b3ce5f66204d36f1fb88f1d8873d0f292d (diff)
Merge pull request #24506 from vespa-engine/bratseth/inputs
More input tests and better error message
Diffstat (limited to 'config-model/src/main/java/com/yahoo')
-rw-r--r--config-model/src/main/java/com/yahoo/schema/RankProfile.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/RankProfile.java b/config-model/src/main/java/com/yahoo/schema/RankProfile.java
index 31c68d2f2c8..cc1c87e6f47 100644
--- a/config-model/src/main/java/com/yahoo/schema/RankProfile.java
+++ b/config-model/src/main/java/com/yahoo/schema/RankProfile.java
@@ -783,12 +783,13 @@ public class RankProfile implements Cloneable {
// Combine
Map<Reference, Input> allInputs = new LinkedHashMap<>();
+
for (var inheritedProfile : inherited()) {
for (var input : inheritedProfile.inputs().entrySet()) {
Input existing = allInputs.get(input.getKey());
if (existing != null && ! existing.equals(input.getValue()))
throw new IllegalArgumentException(this + " inherits " + inheritedProfile + " which contains " +
- input.getValue() + ", but this input is already defined as " +
+ input.getValue() + ", but this is already defined as " +
existing + " in another profile this inherits");
allInputs.put(input.getKey(), input.getValue());
}
@@ -1403,8 +1404,7 @@ public class RankProfile implements Cloneable {
@Override
public boolean equals(Object o) {
if (o == this) return true;
- if ( ! (o instanceof Input)) return false;
- Input other = (Input)o;
+ if ( ! (o instanceof Input other)) return false;
if ( ! other.name().equals(this.name())) return false;
if ( ! other.type().equals(this.type())) return false;
if ( ! other.defaultValue().equals(this.defaultValue())) return false;
@@ -1418,8 +1418,8 @@ public class RankProfile implements Cloneable {
@Override
public String toString() {
- return "input '" + name + "' " + type +
- (defaultValue().isPresent() ? ":" + defaultValue.get().toAbbreviatedString() : "");
+ return "input " + name + " " + type +
+ (defaultValue().isPresent() ? ":" + defaultValue.get().toAbbreviatedString(false, true) : "");
}
}