summaryrefslogtreecommitdiff
path: root/java/beans
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-09-29 22:35:36 +0000
committerTom Tromey <tromey@redhat.com>2005-09-29 22:35:36 +0000
commitf0889feb3c2f795bcc182d13a56933de15b09e6f (patch)
treeb9f4d35c2e479082812bbcc61e92dfd68c0bc566 /java/beans
parent3b6c2ed2121f0d0504b20436916a35e2ddeaf642 (diff)
downloadclasspath-f0889feb3c2f795bcc182d13a56933de15b09e6f.tar.gz
PR classpath/23381:
* java/beans/PropertyDescriptor.java (hashCode): New method.
Diffstat (limited to 'java/beans')
-rw-r--r--java/beans/PropertyDescriptor.java17
1 files changed, 16 insertions, 1 deletions
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 <code>PropertyDescriptor</code> against the
* given object.
* Two PropertyDescriptors are equals if