From 2d7aad2c25507ea427980b54848c26594c607ae2 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 20 Feb 2014 11:20:22 +0000
Subject: [PATCH] OPENDJ-1308 Migrate schema support

---
 opendj3-server-dev/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java b/opendj3-server-dev/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java
index 75a4d8e..5d635da 100644
--- a/opendj3-server-dev/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java
+++ b/opendj3-server-dev/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java
@@ -32,12 +32,12 @@
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.forgerock.opendj.ldap.ByteSequence;
 import org.forgerock.opendj.ldap.ByteString;
+import org.forgerock.opendj.ldap.DecodeException;
 import org.opends.server.api.EqualityMatchingRule;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.types.AcceptRejectWarn;
 import org.opends.server.types.DN;
 import org.opends.server.types.DirectoryException;
-import org.forgerock.opendj.ldap.ResultCode;
 
 import static org.opends.messages.SchemaMessages.*;
 import static org.opends.server.schema.SchemaConstants.*;
@@ -125,12 +125,12 @@
    *
    * @return  The normalized version of the provided value.
    *
-   * @throws  DirectoryException  If the provided value is invalid according to
+   * @throws  DecodeException  If the provided value is invalid according to
    *                              the associated attribute syntax.
    */
   @Override
   public ByteString normalizeAttributeValue(ByteSequence value)
-         throws DirectoryException
+         throws DecodeException
   {
     // Since the normalization for DNs is so complex, it will be handled
     // elsewhere.
@@ -147,7 +147,7 @@
       if (DirectoryServer.getSyntaxEnforcementPolicy() ==
           AcceptRejectWarn.REJECT)
       {
-        throw de;
+        throw DecodeException.error(de.getMessageObject(), de);
       }
 
       return bestEffortNormalize(toLowerCase(value.toString()));
@@ -159,8 +159,7 @@
       if (DirectoryServer.getSyntaxEnforcementPolicy() ==
           AcceptRejectWarn.REJECT)
       {
-        throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
-            ERR_ATTR_SYNTAX_DN_INVALID.get(value, e));
+        throw DecodeException.error(ERR_ATTR_SYNTAX_DN_INVALID.get(value, e));
       }
       else
       {

--
Gitblit v1.10.0