From 15d537d27c0116138191b0a60ac03b54eb00d4e5 Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Wed, 07 Feb 2007 16:51:16 +0000
Subject: [PATCH] An extra synchronization unit test and a number of bug fixes for attributes with options.

---
 opends/src/server/org/opends/server/util/LDIFReader.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/LDIFReader.java b/opends/src/server/org/opends/server/util/LDIFReader.java
index d5da92c..ba873b1 100644
--- a/opends/src/server/org/opends/server/util/LDIFReader.java
+++ b/opends/src/server/org/opends/server/util/LDIFReader.java
@@ -983,8 +983,8 @@
    *                                entry (used for writing reject information).
    * @param  line                   The line to decode.
    * @param  entryDN                The DN of the entry being decoded.
-   * @param  attributeName          The name of the attribute to return
-   *                                the values for.
+   * @param  attributeName          The name and options of the attribute to
+   *                                return the values for.
    *
    * @return                        The attribute in octet string form.
    * @throws  LDIFException         If a problem occurs while trying to decode
@@ -1007,13 +1007,17 @@
     String attrDescr = line.substring(0, colonPos);
     Attribute attribute = parseAttrDescription(attrDescr);
     String attrName = attribute.getName();
-    String lowerName = toLowerCase(attrName);
 
-    if(attributeName != null && !toLowerCase(attributeName).equals(lowerName))
+    if (attributeName != null)
     {
-      int msgID = MSGID_LDIF_INVALID_CHANGERECORD_ATTRIBUTE;
-      String message = getMessage(msgID, lowerName, attributeName);
-      throw new LDIFException(msgID, message, lastEntryLineNumber, false);
+      Attribute expectedAttr = parseAttrDescription(attributeName);
+
+      if (!attribute.equals(expectedAttr))
+      {
+        int msgID = MSGID_LDIF_INVALID_CHANGERECORD_ATTRIBUTE;
+        String message = getMessage(msgID, attrDescr, attributeName);
+        throw new LDIFException(msgID, message, lastEntryLineNumber, false);
+      }
     }
 
     //  Now parse the attribute value.

--
Gitblit v1.10.0