aboutsummaryrefslogtreecommitdiffstats
path: root/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java
diff options
context:
space:
mode:
Diffstat (limited to 'model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java')
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java
index 131af8de065..39702690bfa 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java
@@ -23,8 +23,7 @@ public class Switch extends IntermediateOperation {
}
Optional<OrderedTensorType> predicate = inputs.get(1).type();
if (predicate.get().type().rank() != 0) {
- throw new IllegalArgumentException("Switch in " + name + ": " +
- "predicate must be a scalar");
+ throw new IllegalArgumentException("Switch in " + name + ": predicate must be a scalar");
}
return inputs.get(0).type().orElse(null);
}
@@ -33,12 +32,10 @@ public class Switch extends IntermediateOperation {
protected TensorFunction lazyGetFunction() {
IntermediateOperation predicateOperation = inputs().get(1);
if (!predicateOperation.getConstantValue().isPresent()) {
- throw new IllegalArgumentException("Switch in " + name + ": " +
- "predicate must be a constant");
+ throw new IllegalArgumentException("Switch in " + name + ": predicate must be a constant");
}
if (port < 0 || port > 1) {
- throw new IllegalArgumentException("Switch in " + name + ": " +
- "choice should be boolean");
+ throw new IllegalArgumentException("Switch in " + name + ": choice should be boolean");
}
double predicate = predicateOperation.getConstantValue().get().asDouble();