From d8475ffa48cc7a7ecdca78295bf2ce42c6042e48 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 17 Jun 2011 15:55:07 +0000
Subject: [PATCH] Initial work for OPENDJ-155: Add support for OpenDJ extended matching rules and syntaxes

---
 opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java
index 2eb90ae..c1d4483 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java
@@ -81,9 +81,9 @@
   {
     // We'll use the decodeNameForm method to determine if the value is
     // acceptable.
+    final String definition = value.toString();
     try
     {
-      final String definition = value.toString();
       final SubstringReader reader = new SubstringReader(definition);
 
       // We'll do this a character at a time. First, skip over any
@@ -94,8 +94,8 @@
       {
         // This means that the value was empty or contained only
         // whitespace. That is illegal.
-        final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE
-            .get();
+        final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE1
+            .get(definition);
         final DecodeException e = DecodeException.error(message);
         StaticUtils.DEBUG_LOG
             .throwing("NameFormSyntax", "valueIsAcceptable", e);
@@ -187,8 +187,8 @@
         }
         else
         {
-          final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN
-              .get(tokenName);
+          final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_TOKEN1
+              .get(definition, tokenName);
           final DecodeException e = DecodeException.error(message);
           StaticUtils.DEBUG_LOG.throwing("NameFormSyntax", "valueIsAcceptable",
               e);
@@ -200,7 +200,7 @@
       // it cannot be valid.
       if (structuralClass == null)
       {
-        final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS
+        final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS1
             .get(definition);
         final DecodeException e = DecodeException.error(message);
         StaticUtils.DEBUG_LOG
@@ -221,7 +221,8 @@
     }
     catch (final DecodeException de)
     {
-      invalidReason.append(de.getMessageObject());
+      invalidReason.append(ERR_ATTR_SYNTAX_NAME_FORM_INVALID1.get(definition,
+          de.getMessageObject()));
       return false;
     }
   }

--
Gitblit v1.10.0