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

Matthew Swift
25.01.2011 2acc9b3468534251048f561600f42d24d0e07bbf
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
@@ -3141,7 +3141,8 @@
        // content rule.
        if (checkDITContentRule)
        {
          if (objectClass.getObjectClassType() == ObjectClassType.AUXILIARY)
          if (objectClass.getObjectClassType() == ObjectClassType.AUXILIARY
              && !ditContentRule.getAuxiliaryClasses().contains(objectClass))
          {
            if (errorMessages != null)
            {
@@ -3161,11 +3162,11 @@
        // present.
        if (checkObjectClasses)
        {
          for (final AttributeType t : objectClass.getRequiredAttributes())
          for (final AttributeType t : objectClass.getDeclaredRequiredAttributes())
          {
            final Attribute a = Attributes.emptyAttribute(AttributeDescription
                .create(t));
            if (entry.containsAttribute(a, null))
            if (!entry.containsAttribute(a, null))
            {
              if (errorMessages != null)
              {
@@ -3191,7 +3192,7 @@
        {
          final Attribute a = Attributes.emptyAttribute(AttributeDescription
              .create(t));
          if (entry.containsAttribute(a, null))
          if (!entry.containsAttribute(a, null))
          {
            if (errorMessages != null)
            {
@@ -3284,37 +3285,37 @@
              }
            }
          }
        }
          // Check attributes contain an appropriate number of values.
          if (checkAttributeValues)
        // Check all attributes contain an appropriate number of values.
        if (checkAttributeValues)
        {
          final int sz = attribute.size();
          if (sz == 0)
          {
            final int sz = attribute.size();
            if (sz == 0)
            if (errorMessages != null)
            {
              if (errorMessages != null)
              {
                final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_EMPTY_ATTRIBUTE
                    .get(entry.getName().toString(), t.getNameOrOID());
                errorMessages.add(message);
              }
              if (policy.checkAttributeValues().isReject())
              {
                return false;
              }
              final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_EMPTY_ATTRIBUTE
              .get(entry.getName().toString(), t.getNameOrOID());
              errorMessages.add(message);
            }
            else if (sz > 1 && t.isSingleValue())
            if (policy.checkAttributeValues().isReject())
            {
              if (errorMessages != null)
              {
                final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_SINGLE_VALUED_ATTRIBUTE
                    .get(entry.getName().toString(), t.getNameOrOID());
                errorMessages.add(message);
              }
              if (policy.checkAttributeValues().isReject())
              {
                return false;
              }
              return false;
            }
          }
          else if (sz > 1 && t.isSingleValue())
          {
            if (errorMessages != null)
            {
              final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_SINGLE_VALUED_ATTRIBUTE
              .get(entry.getName().toString(), t.getNameOrOID());
              errorMessages.add(message);
            }
            if (policy.checkAttributeValues().isReject())
            {
              return false;
            }
          }
        }
@@ -3388,7 +3389,7 @@
      for (final AVA ava : rdn)
      {
        final AttributeType t = ava.getAttributeType();
        if (nameForm.isRequiredOrOptional(t))
        if (!nameForm.isRequiredOrOptional(t))
        {
          if (nameFormWarnings != null)
          {