]> source.dussan.org Git - jgit.git/commitdiff
Implement Config.Entry.toString() to help debugging 01/4401/2
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 27 Oct 2011 20:55:59 +0000 (22:55 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 27 Oct 2011 20:55:59 +0000 (22:55 +0200)
Change-Id: I86f6359d955d39ab033848b87ed39d20378d3c1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java

index 77ab150c6d423c7878e1c8ce7ab194e09776a6d0..83599972024ab67f7d5dc027a68196fa351c1805 100644 (file)
@@ -1414,6 +1414,7 @@ public class Config {
         * The configuration file entry
         */
        private static class Entry {
+
                /**
                 * The text content before entry
                 */
@@ -1482,6 +1483,20 @@ public class Config {
                                return false;
                        return a.equals(b);
                }
+
+               @Override
+               public String toString() {
+                       if (section == null)
+                               return "<empty>";
+                       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 {