Don't add a newline at the front of a ParsedResult.

git-svn-id: https://zxing.googlecode.com/svn/trunk@498 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2008-07-03 16:35:00 +00:00
parent a4568587a0
commit 0ddf4bcf96

View file

@ -50,7 +50,10 @@ public abstract class ParsedResult {
protected static void maybeAppend(String value, StringBuffer result) {
if (value != null) {
result.append('\n');
// Don't add a newline before the first value
if (result.length() > 0) {
result.append('\n');
}
result.append(value);
}
}
@ -58,7 +61,9 @@ public abstract class ParsedResult {
protected static void maybeAppend(String[] value, StringBuffer result) {
if (value != null) {
for (int i = 0; i < value.length; i++) {
result.append('\n');
if (result.length() > 0) {
result.append('\n');
}
result.append(value[i]);
}
}