aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java
diff options
context:
space:
mode:
Diffstat (limited to 'node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java18
1 files changed, 5 insertions, 13 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java
index dd92af14609..0869b7f181c 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/NameAlreadyExistsTemplateException.java
@@ -1,22 +1,14 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.task.util.template;
-import com.yahoo.vespa.hosted.node.admin.task.util.text.Cursor;
-import com.yahoo.vespa.hosted.node.admin.task.util.text.CursorRange;
-
/**
* @author hakonhall
*/
public class NameAlreadyExistsTemplateException extends TemplateException {
- public NameAlreadyExistsTemplateException(String name, CursorRange range) {
- super("Name '" + name + "' already exists in the " + describeSection(range));
- }
-
- public NameAlreadyExistsTemplateException(String name, Cursor firstNameLocation,
- Cursor secondNameLocation) {
- super("Section named '" + name + "' at " +
- firstNameLocation.calculateLocation().lineAndColumnText() +
- " conflicts with earlier section with the same name at " +
- secondNameLocation.calculateLocation().lineAndColumnText());
+ public NameAlreadyExistsTemplateException(String name, Section first, Section second) {
+ super("The name '" + name + "' of the " + second.type() + " section at " +
+ second.range().start().calculateLocation().lineAndColumnText() +
+ " is in conflict with the identically named " + first.type() + " section at " +
+ first.range().start().calculateLocation().lineAndColumnText());
}
}