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 28875B575 for ; Wed, 4 Jan 2012 16:14:27 +0000 (UTC) Received: (qmail 58597 invoked by uid 500); 4 Jan 2012 16:14:24 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 58479 invoked by uid 500); 4 Jan 2012 16:14:24 -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 58149 invoked by uid 99); 4 Jan 2012 16:14:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2012 16:14:24 +0000 X-ASF-Spam-Status: No, hits=-2001.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2012 16:14:23 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 6245D13819D for ; Wed, 4 Jan 2012 16:13:39 +0000 (UTC) Date: Wed, 4 Jan 2012 16:13:39 +0000 (UTC) From: "Gary D. Gregory (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <128537719.5018.1325693619403.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1321078574.3545.1325656479289.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LANG-784) Strange behavior on StringUtils.difference MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13179594#comment-13179594 ] Gary D. Gregory commented on LANG-784: -------------------------------------- The Javadoc is clear IMO: {quote} Compares two Strings, and returns the portion where they differ. (More precisely, return the remainder of the second String, starting from where it's different from the first. {quote} A piece of the 2nd String is always returned, in this case a piece of "". Also note this example: StringUtils.difference("", "abc") = "abc" > Strange behavior on StringUtils.difference > ------------------------------------------ > > Key: LANG-784 > URL: https://issues.apache.org/jira/browse/LANG-784 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* > Affects Versions: 3.0.1 > Reporter: Arnaud BRUNET > Priority: Minor > > Hi, > The behavior of the method StringUtils.difference () behaves in a non-intuitive (explain in the javadoc). > StringUtils.difference ("abc", "") returns "" as intuitively expected to be "abc". > Is it possible to change this behavior ? > Regards, > Arnaud -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira