summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/everge/ReplError.java
diff options
context:
space:
mode:
authorBen Culkin <scorpress@gmail.com>2020-04-13 18:45:06 -0400
committerBen Culkin <scorpress@gmail.com>2020-04-13 18:45:06 -0400
commit7bbc3b4c159eb50f6286ccbcc8da6af9f5a8fb06 (patch)
tree24c628a479fc5ae790b2dbd292581bed6e149ed1 /src/main/java/bjc/everge/ReplError.java
parent10b6688ef898285924026e695240a1de2f332bcb (diff)
Cleanup pass
Pass to do some cleanup
Diffstat (limited to 'src/main/java/bjc/everge/ReplError.java')
-rw-r--r--src/main/java/bjc/everge/ReplError.java46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/main/java/bjc/everge/ReplError.java b/src/main/java/bjc/everge/ReplError.java
index 2e1334c..27324ca 100644
--- a/src/main/java/bjc/everge/ReplError.java
+++ b/src/main/java/bjc/everge/ReplError.java
@@ -28,13 +28,13 @@ public class ReplError {
* Create a new ReplPair parse error.
*
* @param lne
- * The line the error occured on.
+ * The line the error occured on.
* @param nPairs
- * The number of pairs processed up to this point.
+ * The number of pairs processed up to this point.
* @param msg
- * The message detailing the error.
+ * The message detailing the error.
* @param txt
- * The text that caused the error.
+ * The text that caused the error.
*/
public ReplError(IntHolder lne, IntHolder nPairs, String msg, String txt) {
this(lne.get(), nPairs.get(), msg, txt);
@@ -44,13 +44,13 @@ public class ReplError {
* Create a new ReplPair parse error.
*
* @param lne
- * The line the error occured on.
+ * The line the error occured on.
* @param nPairs
- * The number of pairs processed up to this point.
+ * The number of pairs processed up to this point.
* @param msg
- * The message detailing the error.
+ * The message detailing the error.
* @param txt
- * The text that caused the error.
+ * The text that caused the error.
*/
public ReplError(int lne, int nPairs, String msg, String txt) {
line = lne;
@@ -63,16 +63,19 @@ public class ReplError {
@Override
public String toString() {
String errString;
- if (txt == null) errString = "No associated line";
- else if (txt.equals("")) errString = "Text of line was empty";
- else errString = "Text of line was: " + txt;
+ if (txt == null)
+ errString = "No associated line";
+ else if (txt.equals(""))
+ errString = "Text of line was empty";
+ else
+ errString = "Text of line was: " + txt;
return String.format("line %d, pair %d:%s\n\t%s", line, numPairs, msg, errString);
}
/**
* Convert the error to a printable string.
- *
+ *
* @return The error as a printable string.
*/
public String toPrintString() {
@@ -81,19 +84,22 @@ public class ReplError {
/**
* Convert the error to a printable string, with a custom header.
- *
+ *
* @param hdr
- * The text to include in the header.
- *
+ * The text to include in the header.
+ *
* @return The error as a printable string.
*/
public String toPrintString(String hdr) {
String errString;
- if (txt == null) errString = "No associated line";
- else if (txt.equals("")) errString = "Text of line was empty";
- else errString = "Text of line was: " + txt;
+ if (txt == null)
+ errString = "No associated line";
+ else if (txt.equals(""))
+ errString = "Text of line was empty";
+ else
+ errString = "Text of line was: " + txt;
- return String.format("[ERROR] line %d, pair %d: %s\n%s\tContext: %s",
- line, numPairs, msg, hdr, errString);
+ return String.format("[ERROR] line %d, pair %d: %s\n%s\tContext: %s", line,
+ numPairs, msg, hdr, errString);
}
}