From 6fb77ab2682e5ee2657188b70ebe2573e7c44aff Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Fri, 01 Jul 2016 12:53:43 +0000
Subject: [PATCH] OPENDJ-2956 Issue warnings during schema validation of an attribute type if it references obsolete elements

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java |   25 -------------------------
 1 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
index 07d1692..0131773 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -995,22 +995,6 @@
       }
     }
 
-    // Make sure that the new attribute type doesn't reference an
-    // OBSOLETE superior attribute type.
-    AttributeType superiorType = attributeType.getSuperiorType();
-    if (superiorType != null && superiorType.isObsolete())
-    {
-      LocalizableMessage message = ERR_SCHEMA_MODIFY_OBSOLETE_SUPERIOR_ATTRIBUTE_TYPE.get(
-          attributeType.getNameOrOID(), superiorType.getNameOrOID());
-      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
-    }
-
-    // Make sure that none of the associated matching rules are marked OBSOLETE.
-    throwIfObsoleteMatchingRule(attributeType, attributeType.getEqualityMatchingRule());
-    throwIfObsoleteMatchingRule(attributeType, attributeType.getOrderingMatchingRule());
-    throwIfObsoleteMatchingRule(attributeType, attributeType.getSubstringMatchingRule());
-    throwIfObsoleteMatchingRule(attributeType, attributeType.getApproximateMatchingRule());
-
     // If there is no existing type, then we're adding a new attribute.
     // Otherwise, we're replacing an existing one.
     if (existingType.isPlaceHolder())
@@ -1025,15 +1009,6 @@
     }
   }
 
-  private void throwIfObsoleteMatchingRule(AttributeType attributeType, MatchingRule mr) throws DirectoryException
-  {
-    if (mr != null && mr.isObsolete())
-    {
-      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
-          ERR_SCHEMA_MODIFY_ATTRTYPE_OBSOLETE_MR.get(attributeType.getNameOrOID(), mr.getNameOrOID()));
-    }
-  }
-
   /**
    * Update list of modified files and return the schema file to use for the
    * added element (may be null).

--
Gitblit v1.10.0