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

Nicolas Capponi
28.40.2016 1a9cf8eb5d85975f405a129743de69e56a91334e
opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -1405,36 +1405,6 @@
                           Set<String> modifiedSchemaFiles)
          throws DirectoryException
  {
    // Make sure that the new name form doesn't reference an objectclass
    // or attributes that are marked OBSOLETE.
    ObjectClass structuralClass = nameForm.getStructuralClass();
    if (structuralClass.isObsolete())
    {
      LocalizableMessage message = ERR_SCHEMA_MODIFY_NF_OC_OBSOLETE.get(
          nameForm.getNameOrOID(), structuralClass.getNameOrOID());
      throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message);
    }
    for (AttributeType at : nameForm.getRequiredAttributes())
    {
      if (at.isObsolete())
      {
        LocalizableMessage message = ERR_SCHEMA_MODIFY_NF_OBSOLETE_REQUIRED_ATTR.get(
            nameForm.getNameOrOID(), at.getNameOrOID());
        throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
      }
    }
    for (AttributeType at : nameForm.getOptionalAttributes())
    {
      if (at.isObsolete())
      {
        LocalizableMessage message = ERR_SCHEMA_MODIFY_NF_OBSOLETE_OPTIONAL_ATTR.get(
            nameForm.getNameOrOID(), at.getNameOrOID());
        throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
      }
    }
    // If there is no existing class, then we're adding a new name form.
    // Otherwise, we're replacing an existing one.
    if (!schema.hasNameForm(nameForm.getNameOrOID()))