commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Behar (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LANG-419) WordUtils.abbreviate bug when lower is greater than str.length
Date Thu, 27 Mar 2008 09:05:24 GMT

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

Vincent Behar updated LANG-419:
-------------------------------

    Attachment: WordUtils_abbreviate_lowerLimit_bug_fixed.patch

ok my mistake, I should have done something wrong yesterday while playing with it.
I've done a clean checkout and fixed the patch : the new one (...fixed.patch) is good, I checked
it with "mvn test".

> 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
>             Fix For: 3.0
>
>         Attachments: WordUtils_abbreviate_lowerLimit_bug.patch, WordUtils_abbreviate_lowerLimit_bug_fixed.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.


Mime
View raw message