Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 951AF18200 for ; Fri, 11 Dec 2015 13:47:11 +0000 (UTC) Received: (qmail 93066 invoked by uid 500); 11 Dec 2015 13:47:11 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 92930 invoked by uid 500); 11 Dec 2015 13:47:11 -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 92870 invoked by uid 99); 11 Dec 2015 13:47:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 13:47:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 21B052C1F5A for ; Fri, 11 Dec 2015 13:47:11 +0000 (UTC) Date: Fri, 11 Dec 2015 13:47:11 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1193) ordinalIndexOf("abc", "ab", 1) gives incorrect answer of -1 (correct answer should be 0) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-1193?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D15052= 771#comment-15052771 ]=20 Sebb commented on LANG-1193: ---------------------------- Thanks for the report. I agree that there is a bug here. Looks like the problem was introduced as a fix for LANG-1077 (which was inv= alid). > ordinalIndexOf("abc", "ab", 1) gives incorrect answer of -1 (correct answ= er should be 0) > -------------------------------------------------------------------------= --------------- > > Key: LANG-1193 > URL: https://issues.apache.org/jira/browse/LANG-1193 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 3.4 > Environment: OS X Yosemite 10.10.5. Maven project. > Reporter: Qin Li > Fix For: 2.6 > > > In Apache Commons Lang 3.4, StringUtils.ordinalIndexOf("abc", "ab", 1) gi= ves incorrect answer of -1 (correct answer should be 0)=E3=80=82but StringU= tils.ordinalIndexOf("abc", "a", 1) gives correct answer of 0. > Based on the above mentioned observation, the bug occurrs if the searchSt= r is of length > 1, and locates at the index 0 of the str. > In Apache Commons Lang 2.6, this bug is not observed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)