opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java
@@ -724,7 +724,11 @@ * <code>false</code> if not. */ public boolean isOptional(final AttributeType attributeType) { return optionalAttributes.contains(attributeType); // In theory, attribute types not defined in the schema (i.e place holder attributes) should // not be considered as optional. // However, in practice, some parts of the server have historically relied on non-defined // attributes to behave properly. return isExtensibleObject || optionalAttributes.contains(attributeType); } /** opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
@@ -958,7 +958,7 @@ } @Test public void testExtensibleObjectAcceptsAnyAttributeButNotPlaceholderAttribute() throws Exception { public void testExtensibleObjectAcceptsAnyAttributeIncludingPlaceholderAttribute() throws Exception { // @formatter:off final Entry e2 = newEntry( "dn: dc=example,dc=com", @@ -979,7 +979,7 @@ "o: example", "dummy: unknown attribute!!"); // @formatter:on assertDoesNotConformToSchema(e, defaultPolicy()); assertConformsToSchema(e, defaultPolicy()); } /** opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/ObjectClassTestCase.java
@@ -30,19 +30,19 @@ public class ObjectClassTestCase extends AbstractSchemaTestCase { @Test public void extensibleObjectShouldNotAcceptPlaceholderAttribute() { public void extensibleObjectShouldAcceptPlaceholderAttribute() { Schema schema = getCoreSchema(); ObjectClass extensibleObject = schema.getObjectClass(EXTENSIBLE_OBJECT_OBJECTCLASS_OID); AttributeType dummy = schema.getAttributeType("dummy"); assertThat(dummy.isPlaceHolder()).isTrue(); assertThat(extensibleObject.isRequired(dummy)).isFalse(); assertThat(extensibleObject.isOptional(dummy)).isFalse(); assertThat(extensibleObject.isRequiredOrOptional(dummy)).isFalse(); AttributeType attributeType = schema.getAttributeType("dummy"); assertThat(attributeType.isPlaceHolder()).isTrue(); assertThat(extensibleObject.isRequired(attributeType)).isFalse(); assertThat(extensibleObject.isOptional(attributeType)).isTrue(); assertThat(extensibleObject.isRequiredOrOptional(attributeType)).isTrue(); } @Test public void extensibleObjectShouldAcceptAnyAttributeInTheSchema() { public void extensibleObjectShouldAcceptAnyAttribute() { Schema schema = getCoreSchema(); ObjectClass extensibleObject = schema.getObjectClass(EXTENSIBLE_OBJECT_OBJECTCLASS_OID);