From f0d7a1e8b170d718494f1cb906142733a92adfd7 Mon Sep 17 00:00:00 2001 From: Juno Date: Wed, 27 Dec 2023 18:03:34 -0500 Subject: [PATCH] remove unused end argument --- src/main/java/org/lavajuno/mirrorlog/yaml/YamlElement.java | 7 +++---- src/main/java/org/lavajuno/mirrorlog/yaml/YamlList.java | 5 ++--- src/main/java/org/lavajuno/mirrorlog/yaml/YamlMap.java | 7 +++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/lavajuno/mirrorlog/yaml/YamlElement.java b/src/main/java/org/lavajuno/mirrorlog/yaml/YamlElement.java index 05e2397..eaa940e 100644 --- a/src/main/java/org/lavajuno/mirrorlog/yaml/YamlElement.java +++ b/src/main/java/org/lavajuno/mirrorlog/yaml/YamlElement.java @@ -43,12 +43,11 @@ protected enum LINE_MATCHES { * @param key Key for the new element * @param lines Lines we are parsing * @param begin Where to begin parsing - * @param end This will be set to where we stop parsing * @param indent Indent of the new element's elements * @return A new YamlElement. (Either a YamlList or a YamlMap) * @throws InvalidPropertiesFormatException If an error is encountered while parsing */ - protected static YamlElement parseElement(String key, List lines, int begin, Integer end, int indent) + protected static YamlElement parseElement(String key, List lines, int begin, int indent) throws InvalidPropertiesFormatException { int i = begin + 1; for(; i < lines.size(); i++) { @@ -58,8 +57,8 @@ protected static YamlElement parseElement(String key, List lines, int be throw new InvalidPropertiesFormatException("Reached end of input."); } return switch (matchLine(lines.get(i))) { - case LIST_ELEMENT, LIST_PAIR, LIST_VALUE -> new YamlList(key, lines, i, end, indent); - case ELEMENT, PAIR -> new YamlMap(key, lines, i, end, indent); + case LIST_ELEMENT, LIST_PAIR, LIST_VALUE -> new YamlList(key, lines, i, indent); + case ELEMENT, PAIR -> new YamlMap(key, lines, i, indent); default -> { printParseError(lines.get(i), i, "Unexpected line."); throw new InvalidPropertiesFormatException("Parse error on line " + i + "."); diff --git a/src/main/java/org/lavajuno/mirrorlog/yaml/YamlList.java b/src/main/java/org/lavajuno/mirrorlog/yaml/YamlList.java index ab84b59..8a0fe1a 100644 --- a/src/main/java/org/lavajuno/mirrorlog/yaml/YamlList.java +++ b/src/main/java/org/lavajuno/mirrorlog/yaml/YamlList.java @@ -15,11 +15,10 @@ public class YamlList extends YamlElement { * @param key This YamlMap's key * @param lines Input we are parsing * @param begin Where to begin parsing - * @param end This will be set to where we stop parsing * @param indent Indent of this YamlMap's elements * @throws InvalidPropertiesFormatException If an error is encountered while parsing */ - protected YamlList(String key, List lines, int begin, Integer end, int indent) throws InvalidPropertiesFormatException { + protected YamlList(String key, List lines, int begin, int indent) throws InvalidPropertiesFormatException { this.KEY = key; this.ELEMENTS = new Vector<>(); @@ -32,7 +31,7 @@ protected YamlList(String key, List lines, int begin, Integer end, int i switch(line_match) { case LIST_ELEMENT: String curr_key = parseKey(line.split("-", 2)[1]); - ELEMENTS.add(parseElement(curr_key, lines, i, end, indent + 2)); + ELEMENTS.add(parseElement(curr_key, lines, i, indent + 2)); break; case LIST_PAIR: ELEMENTS.add(new YamlPair(line.split("-", 2)[1].stripLeading())); diff --git a/src/main/java/org/lavajuno/mirrorlog/yaml/YamlMap.java b/src/main/java/org/lavajuno/mirrorlog/yaml/YamlMap.java index 6e86731..afcc34f 100644 --- a/src/main/java/org/lavajuno/mirrorlog/yaml/YamlMap.java +++ b/src/main/java/org/lavajuno/mirrorlog/yaml/YamlMap.java @@ -15,7 +15,7 @@ public class YamlMap extends YamlElement { * @throws InvalidPropertiesFormatException If an error is encountered while parsing */ public YamlMap(List lines) throws InvalidPropertiesFormatException { - this("root", lines, 0, 0, 0); + this("root", lines, 0, 0); } /** @@ -23,11 +23,10 @@ public YamlMap(List lines) throws InvalidPropertiesFormatException { * @param key This YamlMap's key * @param lines Input we are parsing * @param begin Where to begin parsing - * @param end This will be set to where we stop parsing * @param indent Indent of this YamlMap's elements * @throws InvalidPropertiesFormatException If an error is encountered while parsing */ - protected YamlMap(String key, List lines, int begin, Integer end, int indent) throws InvalidPropertiesFormatException { + protected YamlMap(String key, List lines, int begin, int indent) throws InvalidPropertiesFormatException { this.KEY = key; this.ELEMENTS = new TreeMap<>(); for(int i = begin; i < lines.size(); i++) { @@ -40,7 +39,7 @@ protected YamlMap(String key, List lines, int begin, Integer end, int in switch(line_match) { case ELEMENT: curr_key = parseKey(line); - ELEMENTS.put(curr_key, parseElement(curr_key, lines, i, end, indent + 2)); + ELEMENTS.put(curr_key, parseElement(curr_key, lines, i, indent + 2)); break; case PAIR: curr_key = parseKey(line);