[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Patch: FYI: PR 23381
From: |
Tom Tromey |
Subject: |
[cp-patches] Patch: FYI: PR 23381 |
Date: |
29 Sep 2005 16:22:41 -0600 |
I'm checking this in.
This fixes PR 23381, a missing hashCode() method.
Interestingly, according to Sun, this was only added in 1.5... oops!
Tom
2005-09-29 Tom Tromey <address@hidden>
PR classpath/23381:
* java/beans/PropertyDescriptor.java (hashCode): New method.
Index: java/beans/PropertyDescriptor.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/beans/PropertyDescriptor.java,v
retrieving revision 1.15
diff -u -r1.15 PropertyDescriptor.java
--- java/beans/PropertyDescriptor.java 2 Jul 2005 20:32:37 -0000 1.15
+++ java/beans/PropertyDescriptor.java 29 Sep 2005 22:27:42 -0000
@@ -61,7 +61,6 @@
** @since 1.1
** @status updated to 1.4
**/
-
public class PropertyDescriptor extends FeatureDescriptor
{
Class propertyType;
@@ -519,6 +518,22 @@
}
return newPropertyType;
+ }
+
+ /**
+ * Return a hash code for this object, conforming to the contract described
+ * in address@hidden Object#hashCode()}.
+ * @return the hash code
+ * @since 1.5
+ */
+ public int hashCode()
+ {
+ return ((propertyType == null ? 0 : propertyType.hashCode())
+ | (propertyEditorClass == null ? 0 :
propertyEditorClass.hashCode())
+ | (bound ? Boolean.TRUE : Boolean.FALSE).hashCode()
+ | (constrained ? Boolean.TRUE : Boolean.FALSE).hashCode()
+ | (getMethod == null ? 0 : getMethod.hashCode())
+ | (setMethod == null ? 0 : setMethod.hashCode()));
}
/** Compares this <code>PropertyDescriptor</code> against the
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] Patch: FYI: PR 23381,
Tom Tromey <=