code: protected boolean setConfiguredPropertyIfChanged(final ConfiguredPropertyDescriptor configuredProperty,
              final Object value) {
          if (configuredProperty == null) {
              throw new IllegalArgumentException("configuredProperty cannot be null");
          }
  
          final Object currentValue = configuredProperty.getValue(_configurableBean);
          if (EqualsBuilder.equals(currentValue, value)) {
              // no change
              return false;
          }
  
          if (value != null) {
              boolean correctType = true;
              if (configuredProperty.isArray()) {
                  if (value.getClass().isArray()) {
                      int length = Array.getLength(value);
                      for (int i = 0; i < length; i++) {
                          Object valuePart = Array.get(value, i);
                          if (valuePart == null) {
                              logger.warn("Element no. {} in array (size {}) is null! Value passed to {}", new Object[] {
                                      i, length, configuredProperty });
                          } else {
                              if (!ReflectionUtils.is(valuePart.getClass(), configuredProperty.getBaseType())) {
                                  correctType = false;
                              }
                          }
                      }
                  } else {
                      if (!ReflectionUtils.is(value.getClass(), configuredProperty.getBaseType())) {
                          correctType = false;
                      }
                  }
              } else {
                  if (!ReflectionUtils.is(value.getClass(), configuredProperty.getBaseType())) {
                      correctType = false;
                  }
              }
              if (!correctType) {
                  throw new IllegalArgumentException("Invalid value type: " + value.getClass().getName() + ", expected: "
                          + configuredProperty.getBaseType().getName());
              }
          }
  
          configuredProperty.setValue(_configurableBean, value);
          return true;
      }
docs: Sets a configured property if it has changed.
  
  Note that this method is for internal use. It does not invoke
  {@link #onConfigurationChanged()} even if changes happen. The reason for
  this is to allow code reuse and avoid chatty use of the notification
  method.
  
  @param configuredProperty
  @param value
  @return true if the value was changed or false if it was not