commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r219083 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/StrBuilder.java test/org/apache/commons/lang/text/StrBuilderTest.java
Date Thu, 14 Jul 2005 19:52:34 GMT
Author: ggregory
Date: Thu Jul 14 12:52:31 2005
New Revision: 219083

URL: http://svn.apache.org/viewcvs?rev=219083&view=rev
Log:
[34715][lang] unit test for org.apache.commons.lang.text.StrBuilder.
Patch applied, thanks.

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java?rev=219083&r1=219082&r2=219083&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
Thu Jul 14 12:52:31 2005
@@ -589,10 +589,11 @@
         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 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;

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java?rev=219083&r1=219082&r2=219083&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java
Thu Jul 14 12:52:31 2005
@@ -567,7 +567,7 @@
 
         sb.clear();
         sb.setNullText("null");
-        sb.appendFixedWidthPadRight(null, 5, '-');
+        sb.appendFixedWidthPadLeft(null, 5, '-');
         assertEquals("-null", sb.toString());
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message