Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 17167200BF3 for ; Thu, 5 Jan 2017 15:31:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 15AB7160B27; Thu, 5 Jan 2017 14:31:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8535C160B26 for ; Thu, 5 Jan 2017 15:30:59 +0100 (CET) Received: (qmail 43730 invoked by uid 500); 5 Jan 2017 14:30:58 -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 43718 invoked by uid 99); 5 Jan 2017 14:30:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2017 14:30:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7538E2C1F5A for ; Thu, 5 Jan 2017 14:30:58 +0000 (UTC) Date: Thu, 5 Jan 2017 14:30:58 +0000 (UTC) From: "Andres Joy (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LANG-1309) Should EqualsBuilder.reflectionEquals return false if both values of a field is null? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 Jan 2017 14:31:00 -0000 [ https://issues.apache.org/jira/browse/LANG-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andres Joy updated LANG-1309: ----------------------------- Summary: Should EqualsBuilder.reflectionEquals return false if both values of a field is null? (was: Should EqualsBuilder.reflectionEquals return false if both values of a field is false?) > Should EqualsBuilder.reflectionEquals return false if both values of a field is null? > ------------------------------------------------------------------------------------- > > Key: LANG-1309 > URL: https://issues.apache.org/jira/browse/LANG-1309 > Project: Commons Lang > Issue Type: Improvement > Reporter: Andres Joy > Priority: Minor > > EqualsBuilder.reflectionEquals return false if both values of the two objects on a field is null. Is this behavior intended? > Consider the following example: > {code}class Person { > String name; > int age; > String phone = null; > ... > }{code} > And a main method: > {code}Person p1 = new Person(); > p1.name = "Mike"; > p1.age = 30; > Person p2 = new Person(); > p2.name = "Mike"; > p2.age = 30; > assertTrue(EqualsBuilder.reflectionEquals(p1, p2));{code} > This test won't pass because the assertion will fail. > Moreover, in this example, the objects we compare are actually equal(morally speaking) and the check should therefore return true. > What motivates the current behavior? -- This message was sent by Atlassian JIRA (v6.3.4#6332)