harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r478936 - /harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
Date Fri, 24 Nov 2006 18:17:20 GMT
Author: ayza
Date: Fri Nov 24 10:17:18 2006
New Revision: 478936

URL: http://svn.apache.org/viewvc?view=rev&rev=478936
Log:
Fix for equals() method, corrects two failures in IndexedPropertyDescriptorTest

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java?view=diff&rev=478936&r1=478935&r2=478936
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
Fri Nov 24 10:17:18 2006
@@ -138,12 +138,25 @@
     @Override
     public boolean equals(Object obj) {
         boolean result = super.equals(obj);
+        
         if (result) {
             IndexedPropertyDescriptor pd = (IndexedPropertyDescriptor) obj;
-            result = (this.indexedGetter.equals(pd.getIndexedReadMethod()))
-                    && (this.indexedSetter.equals(pd.getIndexedWriteMethod()));
-            return result;
+    
+            if (indexedGetter != null) {
+                result = indexedGetter.equals(pd.getIndexedReadMethod());
+            } else if (result && indexedGetter == null) {
+                result = pd.getIndexedReadMethod() == null;
+            }
+                
+            if (result) {
+                if (indexedSetter != null) {
+                    result = indexedSetter.equals(pd.getIndexedWriteMethod());
+                } else if (indexedSetter == null) {
+                    result = pd.getIndexedWriteMethod() == null;
+                }
+            }
         }
+            
         return result;
     }
 



Mime
View raw message