[JGIT PATCH 03/12] Add a simple toString to FormatError to facilitate debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 .../src/org/spearce/jgit/patch/FormatError.java    |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/patch/FormatError.java b/org.spearce.jgit/src/org/spearce/jgit/patch/FormatError.java
index e6f0a03..ab75c63 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/patch/FormatError.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/patch/FormatError.java
@@ -92,4 +92,18 @@ public String getLineText() {
 		final int eol = RawParseUtils.nextLF(buf, offset);
 		return RawParseUtils.decode(Constants.CHARSET, buf, offset, eol);
 	}
+
+	@Override
+	public String toString() {
+		final StringBuilder r = new StringBuilder();
+		r.append(getSeverity().name().toLowerCase());
+		r.append(": at offset ");
+		r.append(getOffset());
+		r.append(": ");
+		r.append(getMessage());
+		r.append("\n");
+		r.append("  in ");
+		r.append(getLineText());
+		return r.toString();
+	}
 }
-- 
1.6.1.rc2.306.ge5d5e

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux