diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2022-01-10 09:28:00 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2022-01-10 09:28:00 +0100 |
commit | fc12aa59ef675bf9391300074e97b57233797b5a (patch) | |
tree | c86d4ce1753f5fb1b21766305d65a243a49c75c9 /node-admin | |
parent | 137a169f65a79773a3f5a09ca27234f0e2fcfe2c (diff) |
Remove unused methods
Diffstat (limited to 'node-admin')
4 files changed, 2 insertions, 67 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateNameNotSetException.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateNameNotSetException.java index 7a8693ca4ad..0c715df2efd 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateNameNotSetException.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateNameNotSetException.java @@ -7,7 +7,7 @@ import com.yahoo.vespa.hosted.node.admin.task.util.text.Cursor; * @author hakonhall */ public class TemplateNameNotSetException extends TemplateException { - public TemplateNameNotSetException(Section section, String name, Cursor nameOffset) { + public TemplateNameNotSetException(String name, Cursor nameOffset) { super(name + " at " + nameOffset.calculateLocation().lineAndColumnText() + " has not been set"); } } diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Token.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Token.java index 2fdb4fa9fbb..9d1cd129e06 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Token.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Token.java @@ -22,21 +22,6 @@ class Token { return Optional.of(new CursorRange(start, cursor).string()); } - static String verifyId(String id) { - if (id.isEmpty()) - throw new IllegalArgumentException("Token is empty"); - - if (!isIdStart(id.charAt(0))) - throw new IllegalArgumentException("Invalid identifier: '" + id + "'"); - - for (int i = 1; i < id.length(); ++i) { - if (!isIdPart(id.charAt(i))) - throw new IllegalArgumentException("Invalid identifier: '" + id + "'"); - } - - return id; - } - /** A delimiter either starts a directive (e.g. %{) or ends it (e.g. }). */ static String verifyDelimiter(String delimiter) { if (!isAsciiToken(delimiter)) { diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/VariableSection.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/VariableSection.java index 034ac632a50..b384a2deb5a 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/VariableSection.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/VariableSection.java @@ -25,7 +25,7 @@ class VariableSection extends Section { @Override void appendTo(StringBuilder buffer) { String value = form().getVariableValue(name) - .orElseThrow(() -> new TemplateNameNotSetException(this, name, nameOffset)); + .orElseThrow(() -> new TemplateNameNotSetException(name, nameOffset)); buffer.append(value); } } diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java index 14abebfa51c..277c16b9e71 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java @@ -91,17 +91,6 @@ public class Cursor { } } - public boolean skipBackwards(String substring) { - int newOffset = offset - substring.length(); - if (newOffset < 0) return false; - if (text.startsWith(substring, newOffset)) { - offset = newOffset; - return true; - } else { - return false; - } - } - /** If the current char is a whitespace, skip it and return true. */ public boolean skipWhitespace() { if (!eot() && Character.isWhitespace(getChar())) { @@ -130,13 +119,6 @@ public class Cursor { return true; } - /** Return false if bot(), otherwise retreat to the previous char and return true. */ - public boolean decrement() { - if (bot()) return false; - --offset; - return true; - } - /** * Advance {@code distance} chars until bot() or eot() is reached (distance may be negative), * and return true if this cursor moved the full distance. @@ -167,38 +149,6 @@ public class Cursor { } } - /** Advance pointer until start of needle is found (and return true), or EOT is reached (and return false). */ - public boolean advanceTo(char needle) { - int index = text.indexOf(needle, offset); - if (index == -1) { - offset = text.length(); - return false; // and eot() is true - } else { - offset = index; - return true; // and eot() is false - } - } - - /** Advance pointer past needle (and return true), or to EOT (and return false). */ - public boolean advancePast(String needle) { - if (advanceTo(needle)) { - offset += needle.length(); - return true; // and eot() may or may not be true - } else { - return false; // and eot() is true - } - } - - /** Advance pointer past needle (and return true), or to EOT (and return false). */ - public boolean advancePast(char needle) { - if (advanceTo(needle)) { - ++offset; - return true; // and eot() may or may not be true - } else { - return false; // and eot() is true - } - } - @Override public boolean equals(Object o) { if (this == o) return true; |