Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 20171 invoked from network); 26 Mar 2008 23:13:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Mar 2008 23:13:40 -0000 Received: (qmail 25543 invoked by uid 500); 26 Mar 2008 23:13:38 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 25476 invoked by uid 500); 26 Mar 2008 23:13:37 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 25467 invoked by uid 99); 26 Mar 2008 23:13:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2008 16:13:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2008 23:12:55 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0F32A234C0AB for ; Wed, 26 Mar 2008 16:11:27 -0700 (PDT) Message-ID: <450793276.1206573087061.JavaMail.jira@brutus> Date: Wed, 26 Mar 2008 16:11:27 -0700 (PDT) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (LANG-419) WordUtils.abbreviate bug when lower is greater than str.length In-Reply-To: <2072723487.1206551251695.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582474#action_12582474 ] Henri Yandell commented on LANG-419: ------------------------------------ When I apply the patch, the tests don't pass. ie) Looks like the fix doesn't fix it. > 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 > > > 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.