/*
   * (non-Javadoc)
   *
   * @see android.preference.Preference#setDefaultValue(java.lang.Object)
   */
  @Override
  public void setDefaultValue(Object defaultValue) {
    // BUG this method is never called if you use the 'android:defaultValue' attribute in your XML
    // preference file,
    // not sure why it isn't

    super.setDefaultValue(defaultValue);

    if (!(defaultValue instanceof String)) {
      return;
    }

    if (!((String) defaultValue).matches(VALIDATION_EXPRESSION)) {
      return;
    }

    this.defaultValue = (String) defaultValue;
  }