#2641 - toString() - addCollection() firstElement change

This commit is contained in:
Rob Bygrave committed 2022-04-08 22:30:00 +12:00
1 parent 183b601be8
commit be2466003d
2 files changed
+32 -2

No files matched your search

@@ -125,10 +125,12 @@ public final class ToStringBuilder {
sb.append("[]");
return;
}
int collectionPos = 0;
boolean firstElement = true;
sb.append("[");
for (Object o : c) {
if (collectionPos++ > 0) {
if (firstElement) {
firstElement = false;
} else {
sb.append(", ");
}
value(o);