/**
   * Sets the properties to values of other indexed property pattern. If the properties change fires
   * PropertyChange event.
   *
   * @param src Source IdxPropertyPattern it's properties will be copied.
   */
  void copyProperties(IdxPropertyPattern src) {

    boolean changed =
        !src.getIndexedType().equals(getIndexedType())
            || !(src.getType() == null ? getType() == null : src.getType().equals(getType()))
            || !src.getName().equals(getName())
            || !(src.getMode() == getMode())
            || !(src.getEstimatedField() == null
                ? estimatedField == null
                : src.getEstimatedField().equals(estimatedField));

    if (src.getIndexedGetterMethod() != indexedGetterMethod)
      indexedGetterMethod = src.getIndexedGetterMethod();
    if (src.getIndexedSetterMethod() != indexedSetterMethod)
      indexedSetterMethod = src.getIndexedSetterMethod();

    if (src.getGetterMethod() != getterMethod) {
      changed = true;
      getterMethod = src.getGetterMethod();
    }
    if (src.getSetterMethod() != setterMethod) {
      changed = true;
      setterMethod = src.getSetterMethod();
    }
    if (src.getEstimatedField() != estimatedField) estimatedField = src.getEstimatedField();

    if (changed) {
      try {
        type = findPropertyType();
        findIndexedPropertyType();
      } catch (java.beans.IntrospectionException e) {
        // User's error
      }
      name = findIndexedPropertyName();

      firePropertyChange(new java.beans.PropertyChangeEvent(this, null, null, null));
    }
  }