/**
   * Compares this <code>PropertyDescriptor</code> against the specified object. Returns true if the
   * objects are the same. Two <code>PropertyDescriptor</code>s are the same if the read, write,
   * property types, property editor and flags are equivalent.
   *
   * @since 1.4
   */
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj != null && obj instanceof PropertyDescriptor) {
      PropertyDescriptor other = (PropertyDescriptor) obj;
      Method otherReadMethod = other.getReadMethod();
      Method otherWriteMethod = other.getWriteMethod();

      if (!compareMethods(getReadMethod(), otherReadMethod)) {
        return false;
      }

      if (!compareMethods(getWriteMethod(), otherWriteMethod)) {
        return false;
      }

      if (getPropertyType() == other.getPropertyType()
          && getPropertyEditorClass() == other.getPropertyEditorClass()
          && bound == other.isBound()
          && constrained == other.isConstrained()
          && writeMethodName == other.writeMethodName
          && readMethodName == other.readMethodName) {
        return true;
      }
    }
    return false;
  }