dlr         01/08/24 14:26:10

  Modified:    util/src/java/org/apache/commons/util StringUtils.java
  Log:
  Originally, join() used characters as the separator, but since we've moved
  to Strings, csv is no longer an accurate variable name.
  
  Revision  Changes    Path
  1.6       +12 -12    
jakarta-commons-sandbox/util/src/java/org/apache/commons/util/StringUtils.java
  
  Index: StringUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/util/src/java/org/apache/commons/util/StringUtils.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -u -r1.5 -r1.6
  --- StringUtils.java  2001/08/24 21:24:52     1.5
  +++ StringUtils.java  2001/08/24 21:26:10     1.6
  @@ -76,7 +76,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jon S. Stevens</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Greg Coladonato</a>
  - * @version $Id: StringUtils.java,v 1.5 2001/08/24 21:24:52 dlr Exp $
  + * @version $Id: StringUtils.java,v 1.6 2001/08/24 21:26:10 dlr Exp $
    */
   public class StringUtils
   {
  @@ -262,9 +262,9 @@
       }
   
       /**
  -     * Joins the elements of the provided array into a single CSV
  -     * string containing the provided list of elements.  No delimiter
  -     * is added before or after the list.
  +     * Joins the elements of the provided array into a single string
  +     * containing the provided list of elements.  No delimiter is
  +     * added before or after the list.
        *
        * @param list      The list of values to join together.
        * @param separator The separator character.
  @@ -275,17 +275,17 @@
           int listSize = list.length;
           int bufSize = (listSize == 0 ? 0 :(list[0].toString().length() +
                                              separator.length()) * listSize);
  -        StringBuffer csv = new StringBuffer(bufSize);
  +        StringBuffer buf = new StringBuffer(bufSize);
               
           for (int i = 0; i < listSize; i++)
           {
               if (i > 0)
               {
  -                csv.append(separator);
  +                buf.append(separator);
               }
  -            csv.append(list[i]);
  +            buf.append(list[i]);
           }
  -        return csv.toString();
  +        return buf.toString();
       }
   
       /**
  @@ -300,16 +300,16 @@
        */
       public static String join(Iterator iterator, String separator)
       {
  -        StringBuffer csv = new StringBuffer();
  +        StringBuffer buf = new StringBuffer();
           while (iterator.hasNext())
           {
  -            csv.append(iterator.next());
  +            buf.append(iterator.next());
               if (iterator.hasNext())
               {
  -                csv.append(separator);
  +                buf.append(separator);
               }
           }
  -        return csv.toString();
  +        return buf.toString();
       }
   
       /**
  
  
  

Reply via email to