mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
29.59.2007 9ba239d1a7f3caf0be1a02f01b00762ec3f01397
opends/src/server/org/opends/server/admin/client/ldap/LDAPManagedObject.java
@@ -424,7 +424,8 @@
    for (PropertyDefinition<?> pd : definition.getAllPropertyDefinitions()) {
      Property<?> p = properties.getProperty(pd);
      if (pd.hasOption(PropertyOption.MANDATORY) && p.isEmpty()) {
      if (pd.hasOption(PropertyOption.MANDATORY)
          && p.getEffectiveValues().isEmpty()) {
        exceptions.add(new PropertyIsMandatoryException(pd));
      }
    }
@@ -941,8 +942,17 @@
  private <T> void encodeProperty(Attribute attribute,
      PropertyDefinition<T> pd, PropertySet properties) {
    Property<T> p = properties.getProperty(pd);
    for (T value : p.getPendingValues()) {
      attribute.add(pd.encodeValue(value));
    if (pd.hasOption(PropertyOption.MANDATORY)) {
      // For mandatory properties we fall-back to the default values
      // if defined which can sometimes be the case e.g when a
      // mandatory property is overridden.
      for (T value : p.getEffectiveValues()) {
        attribute.add(pd.encodeValue(value));
      }
    } else {
      for (T value : p.getPendingValues()) {
        attribute.add(pd.encodeValue(value));
      }
    }
  }