Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 894C378CA for ; Thu, 3 Nov 2011 09:28:35 +0000 (UTC) Received: (qmail 38732 invoked by uid 500); 3 Nov 2011 09:28:35 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 38677 invoked by uid 500); 3 Nov 2011 09:28:35 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 38668 invoked by uid 99); 3 Nov 2011 09:28:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Nov 2011 09:28:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Nov 2011 09:28:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0CC802388978 for ; Thu, 3 Nov 2011 09:28:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1197018 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ObjectIndexedPropertyDescriptor.java Date: Thu, 03 Nov 2011 09:28:13 -0000 To: commits@commons.apache.org From: mcucchiara@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111103092814.0CC802388978@eris.apache.org> Author: mcucchiara Date: Thu Nov 3 09:28:13 2011 New Revision: 1197018 URL: http://svn.apache.org/viewvc?rev=1197018&view=rev Log: OGNL-37 - Provide equals() and hashcode() implementation to override PropertyDescriptor. Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ObjectIndexedPropertyDescriptor.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ObjectIndexedPropertyDescriptor.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ObjectIndexedPropertyDescriptor.java?rev=1197018&r1=1197017&r2=1197018&view=diff ============================================================================== --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ObjectIndexedPropertyDescriptor.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ObjectIndexedPropertyDescriptor.java Thu Nov 3 09:28:13 2011 @@ -118,4 +118,50 @@ public class ObjectIndexedPropertyDescri { return propertyType; } + + @Override + public boolean equals(Object o) { + if (this == o) + { + return true; + } + + if (!(o instanceof ObjectIndexedPropertyDescriptor)) + { + return false; + } + + if (!super.equals(o)) + { + return false; + } + + ObjectIndexedPropertyDescriptor that = (ObjectIndexedPropertyDescriptor) o; + + if (indexedReadMethod != null ? !indexedReadMethod.equals(that.indexedReadMethod) : that.indexedReadMethod != null) + { + return false; + } + + if (indexedWriteMethod != null ? !indexedWriteMethod.equals(that.indexedWriteMethod) : that.indexedWriteMethod != null) + { + return false; + } + + if (propertyType != null ? !propertyType.equals(that.propertyType) : that.propertyType != null) + { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + (indexedReadMethod != null ? indexedReadMethod.hashCode() : 0); + result = 31 * result + (indexedWriteMethod != null ? indexedWriteMethod.hashCode() : 0); + result = 31 * result + (propertyType != null ? propertyType.hashCode() : 0); + return result; + } }