You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Duncan Jones (JIRA)" <ji...@apache.org> on 2016/12/01 19:31:58 UTC

[jira] [Commented] (LANG-1292) WordUtils.wrap throws StringIndexOutOfBoundsException

    [ https://issues.apache.org/jira/browse/LANG-1292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15712850#comment-15712850 ] 

Duncan Jones commented on LANG-1292:
------------------------------------

Thanks for reporting this. Now fixed:

{quote}
Repository: commons-lang
Updated Branches:
 refs/heads/master 8c1a0d2ee -> a08ec31db


Fixes LANG-1292: WordUtils.wrap throws StringIndexOutOfBoundsException

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

> WordUtils.wrap throws StringIndexOutOfBoundsException
> -----------------------------------------------------
>
>                 Key: LANG-1292
>                 URL: https://issues.apache.org/jira/browse/LANG-1292
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 3.5
>            Reporter: Mirek Hankus
>            Assignee: Duncan Jones
>            Priority: Critical
>             Fix For: 3.6
>
>
> Running following line of code results in StringIndexOutOfBoundsException (in 3.5 release)
> {code}
> WordUtils.wrap("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",70);
> {code}
> {code}
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> 	at java.lang.String.substring(String.java:1967)
> 	at org.apache.commons.lang3.text.WordUtils.wrap(WordUtils.java:328)
> 	at org.apache.commons.lang3.text.WordUtils.wrap(WordUtils.java:176)
> 	at org.apache.commons.lang3.text.WordUtils.wrap(WordUtils.java:100)
> 	at pl.netpr.commons.string.TextToolsTest.testWrap(TextToolsTest.java:245)
> 	
> {code}
> It worked fine with 3.4 releae. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)