[34715][lang] unit test for org.apache.commons.lang.text.StrBuilder.
Patch applied, thanks. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@219083 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
421ba4c94c
commit
44334fdc98
|
@ -589,10 +589,11 @@ public class StrBuilder implements Cloneable {
|
|||
if (coll != null && coll.size() > 0) {
|
||||
separator = (separator == null ? "" : separator);
|
||||
Iterator it = coll.iterator();
|
||||
append(it.next());
|
||||
while (it.hasNext()) {
|
||||
append(separator);
|
||||
append(it.next());
|
||||
if (it.hasNext()) {
|
||||
append(separator);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
|
@ -611,10 +612,11 @@ public class StrBuilder implements Cloneable {
|
|||
public StrBuilder appendWithSeparators(Iterator it, String separator) {
|
||||
if (it != null) {
|
||||
separator = (separator == null ? "" : separator);
|
||||
append(it.next());
|
||||
while (it.hasNext()) {
|
||||
append(separator);
|
||||
append(it.next());
|
||||
if (it.hasNext()) {
|
||||
append(separator);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
|
|
|
@ -567,7 +567,7 @@ public class StrBuilderTest extends TestCase {
|
|||
|
||||
sb.clear();
|
||||
sb.setNullText("null");
|
||||
sb.appendFixedWidthPadRight(null, 5, '-');
|
||||
sb.appendFixedWidthPadLeft(null, 5, '-');
|
||||
assertEquals("-null", sb.toString());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue