Merge "Implement Config.Entry.toString() to help debugging"

This commit is contained in:
Shawn Pearce 2011-11-03 16:19:17 -04:00 committed by Code Review
commit 2efbcb7e44
1 changed files with 15 additions and 0 deletions

View File

@ -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 "<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 {