Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 78785 invoked from network); 1 Oct 2008 13:26:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2008 13:26:36 -0000 Received: (qmail 61964 invoked by uid 500); 1 Oct 2008 13:26:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 61896 invoked by uid 500); 1 Oct 2008 13:26:34 -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 61884 invoked by uid 99); 1 Oct 2008 13:26:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 06:26:34 -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, 01 Oct 2008 13:25:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7108E234C1FA for ; Wed, 1 Oct 2008 06:25:44 -0700 (PDT) Message-ID: <1649169147.1222867544461.JavaMail.jira@brutus> Date: Wed, 1 Oct 2008 06:25:44 -0700 (PDT) From: "Nicolas Mommaerts (JIRA)" To: issues@commons.apache.org Subject: [jira] Issue Comment Edited: (LANG-393) EqualsBuilder don't compare BigDecimals correctly In-Reply-To: <17055025.1199368054116.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-393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636021#action_12636021 ] dfuse edited comment on LANG-393 at 10/1/08 6:25 AM: ----------------------------------------------------------------- The following simple test case shows that the applied patch throws a ClassCastException: public static void main(String[] args) { class Test { public Object o; } BigDecimal d = new BigDecimal(1000); Long l = new Long(1000); Test t1 = new Test(); Test t2 = new Test(); t1.o = d; t2.o = l; System.out.println(EqualsBuilder.reflectionEquals(t1, t2)); } was (Author: dfuse): The following simple test case shows that the applied patch throws a ClassCastException: public static void main(String[] args) { class Test { public Object o; } BigDecimal d = new BigDecimal(1000); Long l = new Long(1000); Test t1 = new Test(); Test t2 = new Test(); t1.o = d; t2.o = l; System.out.println(t1.o); System.out.println(EqualsBuilder.reflectionEquals(t1, t2)); } > EqualsBuilder don't compare BigDecimals correctly > -------------------------------------------------- > > Key: LANG-393 > URL: https://issues.apache.org/jira/browse/LANG-393 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 2.3 > Reporter: Luis Henriques > Priority: Minor > Fix For: 2.4 > > Attachments: LANG-393.patch > > > When comparing a BigDecimal, the comparing is made using equals, not compareTo, which is more appropriate in the case of BigDecimal. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.