From a5f72d6b3bb0d2263c4b20ebf2ef35ef0a20ee9c Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Thu, 27 Oct 2011 22:55:59 +0200 Subject: [PATCH] Implement Config.Entry.toString() to help debugging Change-Id: I86f6359d955d39ab033848b87ed39d20378d3c1f Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/lib/Config.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java index 77ab150c6..835999720 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java @@ -1414,6 +1414,7 @@ private static class State { * The configuration file entry */ private static class Entry { + /** * The text content before entry */ @@ -1482,6 +1483,20 @@ private static boolean eqSameCase(final String a, final String b) { return false; return a.equals(b); } + + @Override + public String toString() { + if (section == null) + return ""; + StringBuilder b = new StringBuilder(section); + if (subsection != null) + b.append(".").append(subsection); + if (name != null) + b.append(".").append(name); + if (value != null) + b.append("=").append(value); + return b.toString(); + } } private static class StringReader {