You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2016/09/25 17:20:27 UTC

[1/6] [lang] LANG-1023 WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

Repository: commons-lang
Updated Branches:
  refs/heads/master cac7a60ab -> 8f362e7ea


LANG-1023
WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

changed wrap method to use regex pattern to find breakable characters rather than only spaces. added a few basic tests for "regex wrap"


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/0fe9685c
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/0fe9685c
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/0fe9685c

Branch: refs/heads/master
Commit: 0fe9685c8a78ba2d780a3ec1e1a323990dc6d218
Parents: bd9adbb
Author: marko-bekhta <ma...@prykladna.lviv.ua>
Authored: Wed Jul 27 06:21:32 2016 +0200
Committer: marko-bekhta <ma...@prykladna.lviv.ua>
Committed: Wed Jul 27 06:21:32 2016 +0200

----------------------------------------------------------------------
 .../apache/commons/lang3/text/WordUtils.java    | 111 +++++++++++++++++--
 .../commons/lang3/text/WordUtilsTest.java       |  28 ++++-
 2 files changed, 131 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/0fe9685c/src/main/java/org/apache/commons/lang3/text/WordUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/text/WordUtils.java b/src/main/java/org/apache/commons/lang3/text/WordUtils.java
index da92856..9e04962 100644
--- a/src/main/java/org/apache/commons/lang3/text/WordUtils.java
+++ b/src/main/java/org/apache/commons/lang3/text/WordUtils.java
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.lang3.text;
 
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.commons.lang3.ArrayUtils;
@@ -172,6 +173,84 @@ public class WordUtils {
      * @return a line with newlines inserted, <code>null</code> if null input
      */
     public static String wrap(final String str, int wrapLength, String newLineStr, final boolean wrapLongWords) {
+        return wrap(str, wrapLength, newLineStr, wrapLongWords, " ");
+    }
+
+    /**
+     * <p>Wraps a single line of text, identifying words by <code>' '</code>.</p>
+     *
+     * <p>Leading spaces on a new line are stripped.
+     * Trailing spaces are not stripped.</p>
+     *
+     * <table border="1" summary="Wrap Results">
+     *  <tr>
+     *   <th>input</th>
+     *   <th>wrapLenght</th>
+     *   <th>newLineString</th>
+     *   <th>wrapLongWords</th>
+     *   <th>result</th>
+     *  </tr>
+     *  <tr>
+     *   <td>null</td>
+     *   <td>*</td>
+     *   <td>*</td>
+     *   <td>true/false</td>
+     *   <td>null</td>
+     *  </tr>
+     *  <tr>
+     *   <td>""</td>
+     *   <td>*</td>
+     *   <td>*</td>
+     *   <td>true/false</td>
+     *   <td>""</td>
+     *  </tr>
+     *  <tr>
+     *   <td>"Here is one line of text that is going to be wrapped after 20 columns."</td>
+     *   <td>20</td>
+     *   <td>"\n"</td>
+     *   <td>true/false</td>
+     *   <td>"Here is one line of\ntext that is going\nto be wrapped after\n20 columns."</td>
+     *  </tr>
+     *  <tr>
+     *   <td>"Here is one line of text that is going to be wrapped after 20 columns."</td>
+     *   <td>20</td>
+     *   <td>"&lt;br /&gt;"</td>
+     *   <td>true/false</td>
+     *   <td>"Here is one line of&lt;br /&gt;text that is going&lt;br /&gt;to be wrapped after&lt;br /&gt;20 columns."</td>
+     *  </tr>
+     *  <tr>
+     *   <td>"Here is one line of text that is going to be wrapped after 20 columns."</td>
+     *   <td>20</td>
+     *   <td>null</td>
+     *   <td>true/false</td>
+     *   <td>"Here is one line of" + systemNewLine + "text that is going" + systemNewLine + "to be wrapped after" + systemNewLine + "20 columns."</td>
+     *  </tr>
+     *  <tr>
+     *   <td>"Click here to jump to the commons website - http://commons.apache.org"</td>
+     *   <td>20</td>
+     *   <td>"\n"</td>
+     *   <td>false</td>
+     *   <td>"Click here to jump\nto the commons\nwebsite -\nhttp://commons.apache.org"</td>
+     *  </tr>
+     *  <tr>
+     *   <td>"Click here to jump to the commons website - http://commons.apache.org"</td>
+     *   <td>20</td>
+     *   <td>"\n"</td>
+     *   <td>true</td>
+     *   <td>"Click here to jump\nto the commons\nwebsite -\nhttp://commons.apach\ne.org"</td>
+     *  </tr>
+     * </table>
+     *
+     * @param str  the String to be word wrapped, may be null
+     * @param wrapLength  the column to wrap the words at, less than 1 is treated as 1
+     * @param newLineStr  the string to insert for a new line,
+     *  <code>null</code> uses the system property line separator
+     * @param wrapLongWords  true if long words (such as URLs) should be wrapped
+     * @param wrapOn regex expression to be used as a breakable characters,
+     *               if blank string is provided a space character will be used
+     * @return a line with newlines inserted, <code>null</code> if null input
+     */
+    public static String wrap(final String str, int wrapLength, String newLineStr, final boolean wrapLongWords, String wrapOn) {
         if (str == null) {
             return null;
         }
@@ -181,27 +260,41 @@ public class WordUtils {
         if (wrapLength < 1) {
             wrapLength = 1;
         }
+        if (StringUtils.isBlank(wrapOn)) {
+            wrapOn = " ";
+        }
+        Pattern patternToWrapOn = Pattern.compile(wrapOn);
         final int inputLineLength = str.length();
         int offset = 0;
         final StringBuilder wrappedLine = new StringBuilder(inputLineLength + 32);
-        
+
         while (offset < inputLineLength) {
-            if (str.charAt(offset) == ' ') {
-                offset++;
-                continue;
+            int spaceToWrapAt = -1;
+            Matcher matcher = patternToWrapOn.matcher(str.substring(offset, Math.min(offset + wrapLength + 1, inputLineLength)));
+            if (matcher.find()) {
+                if (matcher.start() == 0) {
+                    offset += matcher.end();
+                    continue;
+                }else {
+                    spaceToWrapAt = matcher.start();
+                }
             }
+
             // only last line without leading spaces is left
             if(inputLineLength - offset <= wrapLength) {
                 break;
             }
-            int spaceToWrapAt = str.lastIndexOf(' ', wrapLength + offset);
+
+            while(matcher.find()){
+                spaceToWrapAt = matcher.start() + offset;
+            }
 
             if (spaceToWrapAt >= offset) {
                 // normal case
                 wrappedLine.append(str.substring(offset, spaceToWrapAt));
                 wrappedLine.append(newLineStr);
                 offset = spaceToWrapAt + 1;
-                
+
             } else {
                 // really long word or URL
                 if (wrapLongWords) {
@@ -211,7 +304,11 @@ public class WordUtils {
                     offset += wrapLength;
                 } else {
                     // do not wrap really long word, just extend beyond limit
-                    spaceToWrapAt = str.indexOf(' ', wrapLength + offset);
+                    matcher = patternToWrapOn.matcher(str.substring(offset + wrapLength));
+                    if (matcher.find()) {
+                        spaceToWrapAt = matcher.start() + offset + wrapLength;
+                    }
+
                     if (spaceToWrapAt >= 0) {
                         wrappedLine.append(str.substring(offset, spaceToWrapAt));
                         wrappedLine.append(newLineStr);

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/0fe9685c/src/test/java/org/apache/commons/lang3/text/WordUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/text/WordUtilsTest.java b/src/test/java/org/apache/commons/lang3/text/WordUtilsTest.java
index 0da57dd..8275768 100644
--- a/src/test/java/org/apache/commons/lang3/text/WordUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/WordUtilsTest.java
@@ -154,7 +154,33 @@ public class WordUtilsTest {
         expected = "Click here,\nhttp://commons.apach\ne.org, to jump to\nthe commons website";
         assertEquals(expected, WordUtils.wrap(input, 20, "\n", true));
     }
-    
+
+    @Test
+    public void testWrap_StringIntStringBooleanString() {
+
+        //no changes test
+        String input = "flammable/inflammable";
+        String expected = "flammable/inflammable";
+        assertEquals(expected, WordUtils.wrap(input, 30, "\n", false, "/"));
+
+        // wrap on / and small width
+        expected = "flammable\ninflammable";
+        assertEquals(expected, WordUtils.wrap(input, 2, "\n", false, "/"));
+
+        // wrap long words on / 1
+        expected = "flammable\ninflammab\nle";
+        assertEquals(expected, WordUtils.wrap(input, 9, "\n", true, "/"));
+
+        // wrap long words on / 2
+        expected = "flammable\ninflammable";
+        assertEquals(expected, WordUtils.wrap(input, 15, "\n", true, "/"));
+
+        // wrap long words on / 3
+        input = "flammableinflammable";
+        expected = "flammableinflam\nmable";
+        assertEquals(expected, WordUtils.wrap(input, 15, "\n", true, "/"));
+    }
+
     //-----------------------------------------------------------------------
     @Test
     public void testCapitalize_String() {


[6/6] [lang] Add LANG-1248 to changes.xml

Posted by br...@apache.org.
Add LANG-1248 to changes.xml


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/8f362e7e
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/8f362e7e
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/8f362e7e

Branch: refs/heads/master
Commit: 8f362e7eab0c628b7628ece09f2132aab69d35b4
Parents: a3b74d9
Author: Benedikt Ritter <br...@apache.org>
Authored: Sun Sep 25 19:20:14 2016 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Sun Sep 25 19:20:14 2016 +0200

----------------------------------------------------------------------
 src/changes/changes.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/8f362e7e/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b7be59e..dde81f6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -62,6 +62,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action issue="LANG-1226" type="fix" dev="pschumacher" due-to="pschumacher">StringUtils#normalizeSpace does not trim the string anymore</action>
     <action issue="LANG-1251" type="fix" dev="pschumacher" due-to="Takuya Ueshin">SerializationUtils.ClassLoaderAwareObjectInputStream should use static initializer to initialize primitiveTypes map</action>
     <action issue="LANG-1253" type="add" dev="ggregory" due-to="adilek">[GitHub issue #170] Add RandomUtils#nextBoolean() method</action>
+    <action issue="LANG-1248" type="fix" dev="chas" due-to="Benoit Wiart">FastDatePrinter Memory allocation regression</action>
     <action issue="LANG-1247" type="update" dev="chas" due-to="Benoit Wiart">FastDatePrinter generates extra Date objects</action>
     <action issue="LANG-1018" type="fix" dev="pschumacher" due-to="Nick Manley">Fix precision loss on NumberUtils.createNumber(String)</action>
     <action issue="LANG-1229" type="update" dev="pschumacher" due-to="Ruslan Cheremin">HashCodeBuilder.append(Object,Object) is too big to be inlined, which prevents whole builder to be scalarized</action>


[5/6] [lang] Merge branch 'LANG-1023'

Posted by br...@apache.org.
Merge branch 'LANG-1023'


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/a3b74d9c
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/a3b74d9c
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/a3b74d9c

Branch: refs/heads/master
Commit: a3b74d9c230a85df8ebeef3169fc1cd0439c9a87
Parents: cac7a60 2b36e25
Author: Benedikt Ritter <br...@apache.org>
Authored: Sun Sep 25 19:19:08 2016 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Sun Sep 25 19:19:08 2016 +0200

----------------------------------------------------------------------
 src/changes/changes.xml                         |   1 +
 .../apache/commons/lang3/text/WordUtils.java    | 126 +++++++++++++++++--
 .../commons/lang3/text/WordUtilsTest.java       |  28 ++++-
 3 files changed, 147 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/a3b74d9c/src/changes/changes.xml
----------------------------------------------------------------------
diff --cc src/changes/changes.xml
index a9b58e2,3a89fae..b7be59e
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@@ -45,23 -45,10 +45,24 @@@ The <action> type attribute can be add,
    </properties>
    <body>
  
 -  <release version="3.5" date="tba" description="tba">
 +  <release version="3.5" date="tba" description="New features including Java 9 detection">
+     <action issue="LANG-1023" type="add" dev="britter" due-to="Marko Bekhta">Add WordUtils.wrap overload with customizable breakable character</action>
 -    <action issue="LANG-1248" type="fix" dev="chas" due-to="Benoit Wiart">FastDatePrinter Memory allocation regression</action>
 -    <action issue="LANG-1247" type="fix" dev="chas" due-to="Benoit Wiart">FastDatePrinter generates extra Date objects</action>
 +    <action issue="LANG-787" type="add" dev="pschumacher" due-to="Gokul Nanthakumar C">Add method removeIgnoreCase(String, String) to StringUtils</action>
 +    <action issue="LANG-1261" type="fix" dev="pschumacher" >ArrayUtils.contains returns false for instances of subtypes</action>
 +    <action issue="LANG-1197" type="update" dev="pschumacher" >Prepare Java 9 detection</action>
 +    <action issue="LANG-1252" type="fix" dev="chtompki" due-to="Rob Tompkins">Rename NumberUtils.isNumber, isCreatable to better reflect createNumber. Also, accommodated for "+" symbol as prefix in isCreatable and isNumber.</action>
 +    <action issue="LANG-1262" type="update" dev="pschumacher" due-to="Ruslan Cheremin">CompareToBuilder.append(Object, Object, Comparator) method is too big to be inlined</action>
 +    <action issue="LANG-1230" type="fix" dev="pschumacher" due-to="Philippe Marschall">Remove unnecessary synchronization from registry lookup in EqualsBuilder and HashCodeBuilder</action>
 +    <action issue="LANG-1224" type="add" dev="pschumacher" due-to="Caleb Cushing">Extend RandomStringUtils with methods that generate strings between a min and max length</action>
 +    <action issue="LANG-1214" type="fix" dev="pschumacher" due-to="Henry Tung">Handle "void" in ClassUtils.getClass()</action>
 +    <action issue="LANG-1250" type="fix" dev="pschumacher" due-to="Glease Wang">SerializationUtils#deserialize has unnecessary code and a comment for that</action>
 +    <action issue="LANG-1259" type="update" dev="britter" due-to="Dominik Stadler">JavaDoc for ArrayUtils.isNotEmpty() is slightly misleading</action>
 +    <action issue="LANG-1257" type="add" dev="ggregory" due-to="Gary Gregory">Add APIs StringUtils.wrapIfMissing(String, char|String)</action>
 +    <action issue="LANG-1190" type="fix" dev="pschumacher" due-to="pschumacher">TypeUtils.isAssignable throws NullPointerException when fromType has type variables and toType generic superclass specifies type variable</action>
 +    <action issue="LANG-1226" type="fix" dev="pschumacher" due-to="pschumacher">StringUtils#normalizeSpace does not trim the string anymore</action>
 +    <action issue="LANG-1251" type="fix" dev="pschumacher" due-to="Takuya Ueshin">SerializationUtils.ClassLoaderAwareObjectInputStream should use static initializer to initialize primitiveTypes map</action>
 +    <action issue="LANG-1253" type="add" dev="ggregory" due-to="adilek">[GitHub issue #170] Add RandomUtils#nextBoolean() method</action>
 +    <action issue="LANG-1247" type="update" dev="chas" due-to="Benoit Wiart">FastDatePrinter generates extra Date objects</action>
      <action issue="LANG-1018" type="fix" dev="pschumacher" due-to="Nick Manley">Fix precision loss on NumberUtils.createNumber(String)</action>
      <action issue="LANG-1229" type="update" dev="pschumacher" due-to="Ruslan Cheremin">HashCodeBuilder.append(Object,Object) is too big to be inlined, which prevents whole builder to be scalarized</action>
      <action issue="LANG-1085" type="add" dev="oheger" due-to="oheger / kinow">Add a circuit breaker implementation</action>

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/a3b74d9c/src/main/java/org/apache/commons/lang3/text/WordUtils.java
----------------------------------------------------------------------


[4/6] [lang] Add LANG-1023 to changes.xml

Posted by br...@apache.org.
Add LANG-1023 to changes.xml


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/2b36e25f
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/2b36e25f
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/2b36e25f

Branch: refs/heads/master
Commit: 2b36e25f6699d3bcf5fd2762c824aefb40c424c5
Parents: 8c99b82
Author: Benedikt Ritter <br...@apache.org>
Authored: Sun Sep 25 19:11:21 2016 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Sun Sep 25 19:11:21 2016 +0200

----------------------------------------------------------------------
 src/changes/changes.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/2b36e25f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 96487a2..3a89fae 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -46,6 +46,7 @@ The <action> type attribute can be add,update,fix,remove.
   <body>
 
   <release version="3.5" date="tba" description="tba">
+    <action issue="LANG-1023" type="add" dev="britter" due-to="Marko Bekhta">Add WordUtils.wrap overload with customizable breakable character</action>
     <action issue="LANG-1248" type="fix" dev="chas" due-to="Benoit Wiart">FastDatePrinter Memory allocation regression</action>
     <action issue="LANG-1247" type="fix" dev="chas" due-to="Benoit Wiart">FastDatePrinter generates extra Date objects</action>
     <action issue="LANG-1018" type="fix" dev="pschumacher" due-to="Nick Manley">Fix precision loss on NumberUtils.createNumber(String)</action>


[3/6] [lang] LANG-1023 WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

Posted by br...@apache.org.
LANG-1023
WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

updated JavaDoc


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/8c99b829
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/8c99b829
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/8c99b829

Branch: refs/heads/master
Commit: 8c99b8299df8f5af5136e4ad53ea5111f953db92
Parents: 78c373d
Author: marko-bekhta <ma...@prykladna.lviv.ua>
Authored: Tue Sep 20 19:47:20 2016 +0200
Committer: marko-bekhta <ma...@prykladna.lviv.ua>
Committed: Tue Sep 20 19:47:20 2016 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/lang3/text/WordUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/8c99b829/src/main/java/org/apache/commons/lang3/text/WordUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/text/WordUtils.java b/src/main/java/org/apache/commons/lang3/text/WordUtils.java
index a85f28f..7221ab0 100644
--- a/src/main/java/org/apache/commons/lang3/text/WordUtils.java
+++ b/src/main/java/org/apache/commons/lang3/text/WordUtils.java
@@ -253,7 +253,7 @@ public class WordUtils {
      *   <td>"\n"</td>
      *   <td>true</td>
      *   <td>"/"</td>
-     *   <td>"flammable/inflammable"</td>
+     *   <td>"flammable\ninflammable"</td>
      *  </tr>
      * </table>
      * @param str  the String to be word wrapped, may be null


[2/6] [lang] LANG-1023 WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

Posted by br...@apache.org.
LANG-1023
WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

updated JavaDoc


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/78c373d7
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/78c373d7
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/78c373d7

Branch: refs/heads/master
Commit: 78c373d7bc23e81c82cac6feb66a9f6b9472f8ab
Parents: 0fe9685
Author: marko-bekhta <ma...@prykladna.lviv.ua>
Authored: Tue Sep 20 19:46:50 2016 +0200
Committer: marko-bekhta <ma...@prykladna.lviv.ua>
Committed: Tue Sep 20 19:46:50 2016 +0200

----------------------------------------------------------------------
 .../org/apache/commons/lang3/text/WordUtils.java | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/78c373d7/src/main/java/org/apache/commons/lang3/text/WordUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/text/WordUtils.java b/src/main/java/org/apache/commons/lang3/text/WordUtils.java
index 9e04962..a85f28f 100644
--- a/src/main/java/org/apache/commons/lang3/text/WordUtils.java
+++ b/src/main/java/org/apache/commons/lang3/text/WordUtils.java
@@ -177,7 +177,7 @@ public class WordUtils {
     }
 
     /**
-     * <p>Wraps a single line of text, identifying words by <code>' '</code>.</p>
+     * <p>Wraps a single line of text, identifying words by <code>wrapOn</code>.</p>
      *
      * <p>Leading spaces on a new line are stripped.
      * Trailing spaces are not stripped.</p>
@@ -188,6 +188,7 @@ public class WordUtils {
      *   <th>wrapLenght</th>
      *   <th>newLineString</th>
      *   <th>wrapLongWords</th>
+     *   <th>wrapOn</th>
      *   <th>result</th>
      *  </tr>
      *  <tr>
@@ -195,6 +196,7 @@ public class WordUtils {
      *   <td>*</td>
      *   <td>*</td>
      *   <td>true/false</td>
+     *   <td>*</td>
      *   <td>null</td>
      *  </tr>
      *  <tr>
@@ -202,6 +204,7 @@ public class WordUtils {
      *   <td>*</td>
      *   <td>*</td>
      *   <td>true/false</td>
+     *   <td>*</td>
      *   <td>""</td>
      *  </tr>
      *  <tr>
@@ -209,6 +212,7 @@ public class WordUtils {
      *   <td>20</td>
      *   <td>"\n"</td>
      *   <td>true/false</td>
+     *   <td>" "</td>
      *   <td>"Here is one line of\ntext that is going\nto be wrapped after\n20 columns."</td>
      *  </tr>
      *  <tr>
@@ -216,6 +220,7 @@ public class WordUtils {
      *   <td>20</td>
      *   <td>"&lt;br /&gt;"</td>
      *   <td>true/false</td>
+     *   <td>" "</td>
      *   <td>"Here is one line of&lt;br /&gt;text that is going&lt;br /&gt;to be wrapped after&lt;br /&gt;20 columns."</td>
      *  </tr>
      *  <tr>
@@ -223,6 +228,7 @@ public class WordUtils {
      *   <td>20</td>
      *   <td>null</td>
      *   <td>true/false</td>
+     *   <td>" "</td>
      *   <td>"Here is one line of" + systemNewLine + "text that is going" + systemNewLine + "to be wrapped after" + systemNewLine + "20 columns."</td>
      *  </tr>
      *  <tr>
@@ -230,6 +236,7 @@ public class WordUtils {
      *   <td>20</td>
      *   <td>"\n"</td>
      *   <td>false</td>
+     *   <td>" "</td>
      *   <td>"Click here to jump\nto the commons\nwebsite -\nhttp://commons.apache.org"</td>
      *  </tr>
      *  <tr>
@@ -237,10 +244,18 @@ public class WordUtils {
      *   <td>20</td>
      *   <td>"\n"</td>
      *   <td>true</td>
+     *   <td>" "</td>
      *   <td>"Click here to jump\nto the commons\nwebsite -\nhttp://commons.apach\ne.org"</td>
      *  </tr>
+     *  <tr>
+     *   <td>"flammable/inflammable"</td>
+     *   <td>20</td>
+     *   <td>"\n"</td>
+     *   <td>true</td>
+     *   <td>"/"</td>
+     *   <td>"flammable/inflammable"</td>
+     *  </tr>
      * </table>
-     *
      * @param str  the String to be word wrapped, may be null
      * @param wrapLength  the column to wrap the words at, less than 1 is treated as 1
      * @param newLineStr  the string to insert for a new line,