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

[jira] [Updated] (LANG-1302) java.lang.StringIndexOutOfBoundsException resulting in WordUtils.wrap

     [ https://issues.apache.org/jira/browse/LANG-1302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vadiraj Purohit updated LANG-1302:
----------------------------------
    Description: 
Commons-lang3:3.5

Issue code:
String appName = "Google Play Store";
appName = WordUtils.wrap(appName, appName.length()/2);
System.out.println(appName);

Resulting exception:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
	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 removedups.Main2.main(Main2.java:32)

This exception does not occur in commons-lang3:3.4 though

  was:
Commons-lang3:3.5

Issue code:
String appName = "Google Play Store";
appName = WordUtils.wrap(appName, appName.length()/2);
System.out.println(appName);

Resulting exception:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
	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 removedups.Main2.main(Main2.java:32)

This exception does not occur in commons-lang3:3.4


> java.lang.StringIndexOutOfBoundsException resulting in WordUtils.wrap
> ---------------------------------------------------------------------
>
>                 Key: LANG-1302
>                 URL: https://issues.apache.org/jira/browse/LANG-1302
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 3.5
>         Environment: Mac, Android, Linux
>            Reporter: Vadiraj Purohit
>
> Commons-lang3:3.5
> Issue code:
> String appName = "Google Play Store";
> appName = WordUtils.wrap(appName, appName.length()/2);
> System.out.println(appName);
> Resulting exception:
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
> 	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 removedups.Main2.main(Main2.java:32)
> This exception does not occur in commons-lang3:3.4 though



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