Author: jbq
Date: Fri Feb 23 12:50:36 2007
New Revision: 511101

URL: http://svn.apache.org/viewvc?view=rev&rev=511101
Log:
Fix typos, reformat and keep in sync

Modified:
    
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/util/diff/DiffUtil.java
    incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/AddDelta.java
    incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/Chunk.java
    incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/DiffUtil.java
    incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/ToString.java

Modified: 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/util/diff/DiffUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/util/diff/DiffUtil.java?view=diff&rev=511101&r1=511100&r2=511101
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/util/diff/DiffUtil.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/util/diff/DiffUtil.java
 Fri Feb 23 12:50:36 2007
@@ -53,9 +53,9 @@
         * @param document
         *            Current output
         * @param file
-        *            Expected ouput
+        *            Expected output
         * @param clazz
-        *            Used to load the file (relativ to clazz package)
+        *            Used to load the file (relative to clazz package)
         * @param wicketTestCase
         * @param failWithAssert
         * @return true, if equal

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/AddDelta.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/AddDelta.java?view=diff&rev=511101&r1=511100&r2=511101
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/AddDelta.java 
(original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/AddDelta.java 
Fri Feb 23 12:50:36 2007
@@ -73,74 +73,76 @@
        /**
         * Construct.
         */
-    AddDelta()
-    {
-    }
-
-    /**
-     * Construct.
-     * @param origpos
-     * @param rev
-     */
-    public AddDelta(int origpos, Chunk rev)
-    {
-        init(new Chunk(origpos, 0), rev);
-    }
-
-    /**
-     * @see wicket.util.diff.Delta#verify(java.util.List)
-     */
-    @Override
+       AddDelta()
+       {
+       }
+
+       /**
+        * Construct.
+        * 
+        * @param origpos
+        * @param rev
+        */
+       public AddDelta(int origpos, Chunk rev)
+       {
+               init(new Chunk(origpos, 0), rev);
+       }
+
+       /**
+        * @see wicket.util.diff.Delta#verify(java.util.List)
+        */
+       @Override
        public void verify(List<Object> target) throws PatchFailedException
-    {
-        if (original.first() > target.size())
-        {
-            throw new PatchFailedException("original.first() > target.size()");
-        }
-    }
-
-    /**
-     * @see wicket.util.diff.Delta#applyTo(java.util.List)
-     */
-    @Override
+       {
+               if (original.first() > target.size())
+               {
+                       throw new PatchFailedException("original.first() > 
target.size()");
+               }
+       }
+
+       /**
+        * @see wicket.util.diff.Delta#applyTo(java.util.List)
+        */
+       @Override
        public void applyTo(List<Object> target)
-    {
-        revised.applyAdd(original.first(), target);
-    }
-
-    /**
-     * @see wicket.util.diff.Delta#toString(java.lang.StringBuffer)
-     */
-    @Override
+       {
+               revised.applyAdd(original.first(), target);
+       }
+
+       /**
+        * @see wicket.util.diff.Delta#toString(java.lang.StringBuffer)
+        */
+       @Override
        public void toString(StringBuffer s)
-    {
-        s.append(original.anchor());
-        s.append("a");
-        s.append(revised.rangeString());
-        s.append(Diff.NL);
-        revised.toString(s, "> ", Diff.NL);
-    }
-
-    /**
-     * @see wicket.util.diff.Delta#toRCSString(java.lang.StringBuffer, 
java.lang.String)
-     */
-    @Override
+       {
+               s.append(original.anchor());
+               s.append("a");
+               s.append(revised.rangeString());
+               s.append(Diff.NL);
+               revised.toString(s, "> ", Diff.NL);
+       }
+
+       /**
+        * @see wicket.util.diff.Delta#toRCSString(java.lang.StringBuffer,
+        *      java.lang.String)
+        */
+       @Override
        public void toRCSString(StringBuffer s, String EOL)
-    {
-        s.append("a");
-        s.append(original.anchor());
-        s.append(" ");
-        s.append(revised.size());
-        s.append(EOL);
-        revised.toString(s, "", EOL);
-    }
-
-    /**
-     * @see wicket.util.diff.Delta#accept(wicket.util.diff.RevisionVisitor)
-     */
-    @Override
+       {
+               s.append("a");
+               s.append(original.anchor());
+               s.append(" ");
+               s.append(revised.size());
+               s.append(EOL);
+               revised.toString(s, "", EOL);
+       }
+
+       /**
+        * @see wicket.util.diff.Delta#accept(wicket.util.diff.RevisionVisitor)
+        */
+       @Override
        public void accept(RevisionVisitor visitor)
-    {
-        visitor.visit(this);
-    }
+       {
+               visitor.visit(this);
+       }
 }

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/Chunk.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/Chunk.java?view=diff&rev=511101&r1=511100&r2=511101
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/Chunk.java 
(original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/Chunk.java Fri 
Feb 23 12:50:36 2007
@@ -74,337 +74,344 @@
 public class Chunk extends ToString
 {
 
-    protected int anchor;
+       protected int anchor;
 
-    protected int count;
+       protected int count;
 
-    protected List chunk;
+       protected List chunk;
 
-    /**
-     * Creates a chunk that doesn't copy the original text.
-     * 
-     * @param pos
-     *            the start position in the text.
-     * @param count
-     *            the size of the chunk.
-     */
-    public Chunk(int pos, int count)
-    {
-        this.anchor = pos;
-        this.count = (count >= 0 ? count : 0);
-    }
-
-    /**
-     * Creates a chunk and saves a copy the original chunk's text.
-     * 
-     * @param iseq
-     *            the original text.
-     * @param pos
-     *            the start position in the text.
-     * @param count
-     *            the size of the chunk.
-     */
-    public Chunk(Object[] iseq, int pos, int count)
-    {
-        this(pos, count);
-        chunk = slice(iseq, pos, count);
-    }
-
-    /**
-     * Creates a chunk that will be displaced in the resulting text, and saves 
a
-     * copy the original chunk's text.
-     * 
-     * @param iseq
-     *            the original text.
-     * @param pos
-     *            the start position in the text.
-     * @param count
-     *            the size of the chunk.
-     * @param offset
-     *            the position the chunk should have in the resulting text.
-     */
-    public Chunk(Object[] iseq, int pos, int count, int offset)
-    {
-        this(offset, count);
-        chunk = slice(iseq, pos, count);
-    }
-
-    /**
-     * Creates a chunk and saves a copy the original chunk's text.
-     * 
-     * @param iseq
-     *            the original text.
-     * @param pos
-     *            the start position in the text.
-     * @param count
-     *            the size of the chunk.
-     */
-    public Chunk(List<Object> iseq, int pos, int count)
-    {
-        this(pos, count);
-        chunk = slice(iseq, pos, count);
-    }
-
-    /**
-     * Creates a chunk that will be displaced in the resulting text, and saves 
a
-     * copy the original chunk's text.
-     * 
-     * @param iseq
-     *            the original text.
-     * @param pos
-     *            the start position in the text.
-     * @param count
-     *            the size of the chunk.
-     * @param offset
-     *            the position the chunk should have in the resulting text.
-     */
-    public Chunk(List<Object> iseq, int pos, int count, int offset)
-    {
-        this(offset, count);
-        chunk = slice(iseq, pos, count);
-    }
-
-    /**
-     * Returns the anchor position of the chunk.
-     * 
-     * @return the anchor position.
-     */
-    public int anchor()
-    {
-        return anchor;
-    }
-
-    /**
-     * Returns the size of the chunk.
-     * 
-     * @return the size.
-     */
-    public int size()
-    {
-        return count;
-    }
-
-    /**
-     * Returns the index of the first line of the chunk.
-     * @return int 
-     */
-    public int first()
-    {
-        return anchor();
-    }
-
-    /**
-     * Returns the index of the last line of the chunk.
-     * @return int
-     */
-    public int last()
-    {
-        return anchor() + size() - 1;
-    }
-
-    /**
-     * Returns the <i>from</i> index of the chunk in RCS terms.
-     * @return int
-     */
-    public int rcsfrom()
-    {
-        return anchor + 1;
-    }
-
-    /**
-     * Returns the <i>to</i> index of the chunk in RCS terms.
-     * @return int 
-     */
-    public int rcsto()
-    {
-        return anchor + count;
-    }
-
-    /**
-     * Returns the text saved for this chunk.
-     * 
-     * @return the text.
-     */
-    public List chunk()
-    {
-        return chunk;
-    }
-
-    /**
-     * Verifies that this chunk's saved text matches the corresponding text in
-     * the given sequence.
-     * 
-     * @param target
-     *            the sequence to verify against.
-     * @return true if the texts match.
-     */
-    public boolean verify(List target)
-    {
-        if (chunk == null)
-        {
-            return true;
-        }
-        if (last() > target.size())
-        {
-            return false;
-        }
-        for (int i = 0; i < count; i++)
-        {
-            if (!target.get(anchor + i).equals(chunk.get(i)))
-            {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Delete this chunk from he given text.
-     * 
-     * @param target
-     *            the text to delete from.
-     */
-    public void applyDelete(List target)
-    {
-        for (int i = last(); i >= first(); i--)
-        {
-            target.remove(i);
-        }
-    }
-
-    /**
-     * Add the text of this chunk to the target at the given position.
-     * 
-     * @param start
-     *            where to add the text.
-     * @param target
-     *            the text to add to.
-     */
-    public void applyAdd(int start, List<Object> target)
-    {
-        Iterator i = chunk.iterator();
-        while (i.hasNext())
-        {
-            target.add(start++, i.next());
-        }
-    }
-
-    /**
-     * Provide a string image of the chunk using the an empty prefix and
-     * postfix.
-     */
-    @Override
+       /**
+        * Creates a chunk that doesn't copy the original text.
+        * 
+        * @param pos
+        *            the start position in the text.
+        * @param count
+        *            the size of the chunk.
+        */
+       public Chunk(int pos, int count)
+       {
+               this.anchor = pos;
+               this.count = (count >= 0 ? count : 0);
+       }
+
+       /**
+        * Creates a chunk and saves a copy the original chunk's text.
+        * 
+        * @param iseq
+        *            the original text.
+        * @param pos
+        *            the start position in the text.
+        * @param count
+        *            the size of the chunk.
+        */
+       public Chunk(Object[] iseq, int pos, int count)
+       {
+               this(pos, count);
+               chunk = slice(iseq, pos, count);
+       }
+
+       /**
+        * Creates a chunk that will be displaced in the resulting text, and 
saves a
+        * copy the original chunk's text.
+        * 
+        * @param iseq
+        *            the original text.
+        * @param pos
+        *            the start position in the text.
+        * @param count
+        *            the size of the chunk.
+        * @param offset
+        *            the position the chunk should have in the resulting text.
+        */
+       public Chunk(Object[] iseq, int pos, int count, int offset)
+       {
+               this(offset, count);
+               chunk = slice(iseq, pos, count);
+       }
+
+       /**
+        * Creates a chunk and saves a copy the original chunk's text.
+        * 
+        * @param iseq
+        *            the original text.
+        * @param pos
+        *            the start position in the text.
+        * @param count
+        *            the size of the chunk.
+        */
+       public Chunk(List<Object> iseq, int pos, int count)
+       {
+               this(pos, count);
+               chunk = slice(iseq, pos, count);
+       }
+
+       /**
+        * Creates a chunk that will be displaced in the resulting text, and 
saves a
+        * copy the original chunk's text.
+        * 
+        * @param iseq
+        *            the original text.
+        * @param pos
+        *            the start position in the text.
+        * @param count
+        *            the size of the chunk.
+        * @param offset
+        *            the position the chunk should have in the resulting text.
+        */
+       public Chunk(List<Object> iseq, int pos, int count, int offset)
+       {
+               this(offset, count);
+               chunk = slice(iseq, pos, count);
+       }
+
+       /**
+        * Returns the anchor position of the chunk.
+        * 
+        * @return the anchor position.
+        */
+       public int anchor()
+       {
+               return anchor;
+       }
+
+       /**
+        * Returns the size of the chunk.
+        * 
+        * @return the size.
+        */
+       public int size()
+       {
+               return count;
+       }
+
+       /**
+        * Returns the index of the first line of the chunk.
+        * 
+        * @return int
+        */
+       public int first()
+       {
+               return anchor();
+       }
+
+       /**
+        * Returns the index of the last line of the chunk.
+        * 
+        * @return int
+        */
+       public int last()
+       {
+               return anchor() + size() - 1;
+       }
+
+       /**
+        * Returns the <i>from</i> index of the chunk in RCS terms.
+        * 
+        * @return int
+        */
+       public int rcsfrom()
+       {
+               return anchor + 1;
+       }
+
+       /**
+        * Returns the <i>to</i> index of the chunk in RCS terms.
+        * 
+        * @return int
+        */
+       public int rcsto()
+       {
+               return anchor + count;
+       }
+
+       /**
+        * Returns the text saved for this chunk.
+        * 
+        * @return the text.
+        */
+       public List chunk()
+       {
+               return chunk;
+       }
+
+       /**
+        * Verifies that this chunk's saved text matches the corresponding text 
in
+        * the given sequence.
+        * 
+        * @param target
+        *            the sequence to verify against.
+        * @return true if the texts match.
+        */
+       public boolean verify(List target)
+       {
+               if (chunk == null)
+               {
+                       return true;
+               }
+               if (last() > target.size())
+               {
+                       return false;
+               }
+               for (int i = 0; i < count; i++)
+               {
+                       if (!target.get(anchor + i).equals(chunk.get(i)))
+                       {
+                               return false;
+                       }
+               }
+               return true;
+       }
+
+       /**
+        * Delete this chunk from he given text.
+        * 
+        * @param target
+        *            the text to delete from.
+        */
+       public void applyDelete(List target)
+       {
+               for (int i = last(); i >= first(); i--)
+               {
+                       target.remove(i);
+               }
+       }
+
+       /**
+        * Add the text of this chunk to the target at the given position.
+        * 
+        * @param start
+        *            where to add the text.
+        * @param target
+        *            the text to add to.
+        */
+       public void applyAdd(int start, List<Object> target)
+       {
+               Iterator i = chunk.iterator();
+               while (i.hasNext())
+               {
+                       target.add(start++, i.next());
+               }
+       }
+
+       /**
+        * Provide a string image of the chunk using the an empty prefix and
+        * postfix.
+        * 
+        * @param s
+        */
+       @Override
        public void toString(StringBuffer s)
-    {
-        toString(s, "", "");
-    }
-
-    /**
-     * Provide a string image of the chunk using the given prefix and postfix.
-     * 
-     * @param s
-     *            where the string image should be appended.
-     * @param prefix
-     *            the text thatshould prefix each line.
-     * @param postfix
-     *            the text that should end each line.
-     * @return StringBuffer
-     */
-    public StringBuffer toString(StringBuffer s, String prefix, String postfix)
-    {
-        if (chunk != null)
-        {
-            Iterator i = chunk.iterator();
-            while (i.hasNext())
-            {
-                s.append(prefix);
-                s.append(i.next());
-                s.append(postfix);
-            }
-        }
-        return s;
-    }
-
-    /**
-     * Retreives the specified part from a [EMAIL PROTECTED] List List}.
-     * 
-     * @param seq
-     *            the list to retreive a slice from.
-     * @param pos
-     *            the start position.
-     * @param count
-     *            the number of items in the slice.
-     * @return a [EMAIL PROTECTED] List List} containing the specified items.
-     */
-    public static List slice(List<Object> seq, int pos, int count)
-    {
-        if (count <= 0)
-        {
-            return new ArrayList<Object>(seq.subList(pos, pos));
-        }
-        else
-        {
-            return new ArrayList<Object>(seq.subList(pos, pos + count));
-        }
-    }
-
-    /**
-     * Retrieves a slice from an [EMAIL PROTECTED] Object Object} array.
-     * 
-     * @param seq
-     *            the list to retreive a slice from.
-     * @param pos
-     *            the start position.
-     * @param count
-     *            the number of items in the slice.
-     * @return a [EMAIL PROTECTED] List List} containing the specified items.
-     */
-    public static List slice(Object[] seq, int pos, int count)
-    {
-        return slice(Arrays.asList(seq), pos, count);
-    }
-
-    /**
-     * Provide a string representation of the numeric range of this chunk.
-     * @return String
-     */
-    public String rangeString()
-    {
-        StringBuffer result = new StringBuffer();
-        rangeString(result);
-        return result.toString();
-    }
-
-    /**
-     * Provide a string representation of the numeric range of this chunk.
-     * 
-     * @param s
-     *            where the string representation should be appended.
-     */
-    public void rangeString(StringBuffer s)
-    {
-        rangeString(s, ",");
-    }
-
-    /**
-     * Provide a string representation of the numeric range of this chunk.
-     * 
-     * @param s
-     *            where the string representation should be appended.
-     * @param separ
-     *            what to use as line separator.
-     */
-    public void rangeString(StringBuffer s, String separ)
-    {
-        if (size() <= 1)
-        {
-            s.append(Integer.toString(rcsfrom()));
-        }
-        else
-        {
-            s.append(Integer.toString(rcsfrom()));
-            s.append(separ);
-            s.append(Integer.toString(rcsto()));
-        }
-    }
-}
\ No newline at end of file
+       {
+               toString(s, "", "");
+       }
+
+       /**
+        * Provide a string image of the chunk using the given prefix and 
postfix.
+        * 
+        * @param s
+        *            where the string image should be appended.
+        * @param prefix
+        *            the text thatshould prefix each line.
+        * @param postfix
+        *            the text that should end each line.
+        * @return StringBuffer
+        */
+       public StringBuffer toString(StringBuffer s, String prefix, String 
postfix)
+       {
+               if (chunk != null)
+               {
+                       Iterator i = chunk.iterator();
+                       while (i.hasNext())
+                       {
+                               s.append(prefix);
+                               s.append(i.next());
+                               s.append(postfix);
+                       }
+               }
+               return s;
+       }
+
+       /**
+        * Retreives the specified part from a [EMAIL PROTECTED] List List}.
+        * 
+        * @param seq
+        *            the list to retreive a slice from.
+        * @param pos
+        *            the start position.
+        * @param count
+        *            the number of items in the slice.
+        * @return a [EMAIL PROTECTED] List List} containing the specified 
items.
+        */
+       public static List slice(List<Object> seq, int pos, int count)
+       {
+               if (count <= 0)
+               {
+                       return new ArrayList<Object>(seq.subList(pos, pos));
+               }
+               else
+               {
+                       return new ArrayList<Object>(seq.subList(pos, pos + 
count));
+               }
+       }
+
+       /**
+        * Retrieves a slice from an [EMAIL PROTECTED] Object Object} array.
+        * 
+        * @param seq
+        *            the list to retreive a slice from.
+        * @param pos
+        *            the start position.
+        * @param count
+        *            the number of items in the slice.
+        * @return a [EMAIL PROTECTED] List List} containing the specified 
items.
+        */
+       public static List slice(Object[] seq, int pos, int count)
+       {
+               return slice(Arrays.asList(seq), pos, count);
+       }
+
+       /**
+        * Provide a string representation of the numeric range of this chunk.
+        * 
+        * @return String
+        */
+       public String rangeString()
+       {
+               StringBuffer result = new StringBuffer();
+               rangeString(result);
+               return result.toString();
+       }
+
+       /**
+        * Provide a string representation of the numeric range of this chunk.
+        * 
+        * @param s
+        *            where the string representation should be appended.
+        */
+       public void rangeString(StringBuffer s)
+       {
+               rangeString(s, ",");
+       }
+
+       /**
+        * Provide a string representation of the numeric range of this chunk.
+        * 
+        * @param s
+        *            where the string representation should be appended.
+        * @param separ
+        *            what to use as line separator.
+        */
+       public void rangeString(StringBuffer s, String separ)
+       {
+               if (size() <= 1)
+               {
+                       s.append(Integer.toString(rcsfrom()));
+               }
+               else
+               {
+                       s.append(Integer.toString(rcsfrom()));
+                       s.append(separ);
+                       s.append(Integer.toString(rcsto()));
+               }
+       }
+}

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/DiffUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/DiffUtil.java?view=diff&rev=511101&r1=511100&r2=511101
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/DiffUtil.java 
(original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/DiffUtil.java 
Fri Feb 23 12:50:36 2007
@@ -53,9 +53,9 @@
         * @param document
         *            Current output
         * @param file
-        *            Expected ouput
+        *            Expected output
         * @param clazz
-        *            Used to load the file (relativ to clazz package)
+        *            Used to load the file (relative to clazz package)
         * @param wicketTestCase
         * @param failWithAssert
         * @return true, if equal
@@ -163,4 +163,4 @@
                out.close();
        }
 
-}
\ No newline at end of file
+}

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/ToString.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/ToString.java?view=diff&rev=511101&r1=511100&r2=511101
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/ToString.java 
(original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/util/diff/ToString.java 
Fri Feb 23 12:50:36 2007
@@ -70,95 +70,95 @@
  */
 public class ToString
 {
-    /**
-     * Construct.
-     */
-    public ToString()
-    {
-    }
+       /**
+        * Construct.
+        */
+       public ToString()
+       {
+       }
 
-    /**
-     * Default implementation of the
-     * [EMAIL PROTECTED] java.lang.Object#toString toString() } method that 
delegates work
-     * to a [EMAIL PROTECTED] java.lang.StringBuffer StringBuffer} base 
version.
-     */
-    @Override
+       /**
+        * Default implementation of the
+        * [EMAIL PROTECTED] java.lang.Object#toString toString() } method that 
delegates work
+        * to a [EMAIL PROTECTED] java.lang.StringBuffer StringBuffer} base 
version.
+        */
+       @Override
        public String toString()
-    {
-        StringBuffer s = new StringBuffer();
-        toString(s);
-        return s.toString();
-    }
+       {
+               StringBuffer s = new StringBuffer();
+               toString(s);
+               return s.toString();
+       }
 
-    /**
-     * Place a string image of the object in a StringBuffer.
-     * 
-     * @param s
-     *            the string buffer.
-     */
-    public void toString(StringBuffer s)
-    {
-        s.append(super.toString());
-    }
+       /**
+        * Place a string image of the object in a StringBuffer.
+        * 
+        * @param s
+        *            the string buffer.
+        */
+       public void toString(StringBuffer s)
+       {
+               s.append(super.toString());
+       }
 
-    /**
-     * Breaks a string into an array of strings. Use the value of the
-     * <code>line.separator</code> system property as the linebreak character.
-     * 
-     * @param value
-     *            the string to convert.
-     * @return String[]
-     */
-    public static String[] stringToArray(String value)
-    {
-        BufferedReader reader = new BufferedReader(new StringReader(value));
-        List<String> l = new LinkedList<String>();
-        String s;
-        try
-        {
-            while ((s = reader.readLine()) != null)
-            {
-                l.add(s);
-            }
-        }
-        catch (java.io.IOException e)
-        {
-        }
-        return l.toArray(new String[l.size()]);
-    }
+       /**
+        * Breaks a string into an array of strings. Use the value of the
+        * <code>line.separator</code> system property as the linebreak 
character.
+        * 
+        * @param value
+        *            the string to convert.
+        * @return String[]
+        */
+       public static String[] stringToArray(String value)
+       {
+               BufferedReader reader = new BufferedReader(new 
StringReader(value));
+               List<String> l = new LinkedList<String>();
+               String s;
+               try
+               {
+                       while ((s = reader.readLine()) != null)
+                       {
+                               l.add(s);
+                       }
+               }
+               catch (java.io.IOException e)
+               {
+               }
+               return l.toArray(new String[l.size()]);
+       }
 
-    /**
-     * Converts an array of [EMAIL PROTECTED] Object Object} to a string Use 
the value of
-     * the <code>line.separator</code> system property the line separator.
-     * 
-     * @param o
-     *            the array of objects.
-     * @return String
-     */
-    public static String arrayToString(Object[] o)
-    {
-        return arrayToString(o, System.getProperty("line.separator"));
-    }
+       /**
+        * Converts an array of [EMAIL PROTECTED] Object Object} to a string 
Use the value of
+        * the <code>line.separator</code> system property the line separator.
+        * 
+        * @param o
+        *            the array of objects.
+        * @return String
+        */
+       public static String arrayToString(Object[] o)
+       {
+               return arrayToString(o, System.getProperty("line.separator"));
+       }
 
-    /**
-     * Converts an array of [EMAIL PROTECTED] Object Object} to a string using 
the given
-     * line separator.
-     * 
-     * @param o
-     *            the array of objects.
-     * @param EOL
-     *            the string to use as line separator.
-     * @return String
-     */
-    public static String arrayToString(Object[] o, String EOL)
-    {
-        StringBuffer buf = new StringBuffer();
-        for (int i = 0; i < o.length - 1; i++)
-        {
-            buf.append(o[i]);
-            buf.append(EOL);
-        }
-        buf.append(o[o.length - 1]);
-        return buf.toString();
-    }
+       /**
+        * Converts an array of [EMAIL PROTECTED] Object Object} to a string 
using the given
+        * line separator.
+        * 
+        * @param o
+        *            the array of objects.
+        * @param EOL
+        *            the string to use as line separator.
+        * @return String
+        */
+       public static String arrayToString(Object[] o, String EOL)
+       {
+               StringBuffer buf = new StringBuffer();
+               for (int i = 0; i < o.length - 1; i++)
+               {
+                       buf.append(o[i]);
+                       buf.append(EOL);
+               }
+               buf.append(o[o.length - 1]);
+               return buf.toString();
+       }
 }


Reply via email to