commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Schumacher (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LANG-1292) WordUtils.wrap throws StringIndexOutOfBoundsException
Date Tue, 29 Nov 2016 22:26:58 GMT

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

Pascal Schumacher edited comment on LANG-1292 at 11/29/16 10:26 PM:
--------------------------------------------------------------------

caused by this commit: https://github.com/apache/commons-lang/commit/0fe9685c8a78ba2d780a3ec1e1a323990dc6d218


was (Author: pascalschumacher):
probably caused by this commit: https://github.com/apache/commons-lang/commit/0fe9685c8a78ba2d780a3ec1e1a323990dc6d218

> 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
>            Priority: Critical
>             Fix For: Patch Needed
>
>
> 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)

Mime
View raw message