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 2011/01/18 03:50:43 UTC

[jira] Commented: (LANG-673) WordUtils.abbreviate() throws undocumented StringIndexOutOfBoundsException

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

Paul Benedict commented on LANG-673:
------------------------------------

The error happens in line 627: {code}result.append(str.substring(0, upper));{code}

> WordUtils.abbreviate() throws undocumented StringIndexOutOfBoundsException
> --------------------------------------------------------------------------
>
>                 Key: LANG-673
>                 URL: https://issues.apache.org/jira/browse/LANG-673
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.5
>            Reporter: Paul Benedict
>             Fix For: 3.0
>
>
> The javadoc does not indicate that the string must already be long enough to abbreviate; yet it really does or an Exception is thrown. For example, if you try to abbreviate a string of length 10 at 40 characters, this will fail. I believe this should be allowed... just without any abbreviation.

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