From f0889feb3c2f795bcc182d13a56933de15b09e6f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 29 Sep 2005 22:35:36 +0000 Subject: PR classpath/23381: * java/beans/PropertyDescriptor.java (hashCode): New method. --- java/beans/PropertyDescriptor.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'java/beans/PropertyDescriptor.java') diff --git a/java/beans/PropertyDescriptor.java b/java/beans/PropertyDescriptor.java index 416d46857..a22d6252e 100644 --- a/java/beans/PropertyDescriptor.java +++ b/java/beans/PropertyDescriptor.java @@ -61,7 +61,6 @@ import java.lang.reflect.Method; ** @since 1.1 ** @status updated to 1.4 **/ - public class PropertyDescriptor extends FeatureDescriptor { Class propertyType; @@ -521,6 +520,22 @@ public class PropertyDescriptor extends FeatureDescriptor return newPropertyType; } + /** + * Return a hash code for this object, conforming to the contract described + * in {@link 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 PropertyDescriptor against the * given object. * Two PropertyDescriptors are equals if -- cgit v1.2.1