diff --git a/project.xml b/project.xml index c748ebc11..eb0f803fd 100644 --- a/project.xml +++ b/project.xml @@ -301,6 +301,9 @@ limitations under the License. Sean Schofield + + Reuben Sivan + Ville Skytta diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java index 4ed9a1c3e..4a8f7e177 100644 --- a/src/java/org/apache/commons/lang/StringUtils.java +++ b/src/java/org/apache/commons/lang/StringUtils.java @@ -110,6 +110,7 @@ import java.util.List; * @author Phil Steitz * @author Al Chou * @author Michael Davey + * @author Reuben Sivan * @since 1.0 * @version $Id$ */ @@ -152,7 +153,7 @@ public class StringUtils { * *

Used for efficient space padding. The length of each String expands as needed.

*/ - private static final String[] PADDING = new String[Character.MAX_VALUE]; + private static final String[] PADDING = new String[Character.MAX_VALUE + 1]; static { // space padding is most common, start with 64 chars diff --git a/src/test/org/apache/commons/lang/StringUtilsTest.java b/src/test/org/apache/commons/lang/StringUtilsTest.java index 798363642..9d067d52d 100644 --- a/src/test/org/apache/commons/lang/StringUtilsTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsTest.java @@ -1126,6 +1126,7 @@ public class StringUtilsTest extends TestCase { assertEquals(" ", StringUtils.leftPad("", 5, ' ')); assertEquals(" abc", StringUtils.leftPad("abc", 5, ' ')); assertEquals("xxabc", StringUtils.leftPad("abc", 5, 'x')); + assertEquals("\uffff\uffffabc", StringUtils.leftPad("abc", 5, '\uffff')); assertEquals("abc", StringUtils.leftPad("abc", 2, ' ')); String str = StringUtils.leftPad("aaa", 10000, 'a'); // bigger than pad length assertEquals(10000, str.length());