You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Paul Benedict (JIRA)" <ji...@apache.org> on 2008/03/26 18:11:24 UTC

[jira] Commented: (LANG-419) WordUtils.abbreviate bug when lower is greater than str.length

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

Paul Benedict commented on LANG-419:
------------------------------------

Congrats on the logging the first 2.4 bug.

> WordUtils.abbreviate bug when lower is greater than str.length
> --------------------------------------------------------------
>
>                 Key: LANG-419
>                 URL: https://issues.apache.org/jira/browse/LANG-419
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.4
>            Reporter: Vincent Behar
>            Priority: Minor
>         Attachments: WordUtils_abbreviate_lowerLimit_bug.patch
>
>
> In WordUtils.abbreviate, upper is adjusted to the length of the string, then to lower.
> But lower is never adjusted to the length of the string, so if lower is greater than str.lengt(), upper will be too...
> Then, str.substring(0, upper) throw a StringIndexOutOfBoundsException
> The fix is to adjust lower to the length of the string

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.