From 250c9bdd3c13d06682fd9f06f11ff2e426ac353a Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 29 Mar 2016 10:16:14 +0000
Subject: [PATCH] Prep work for OPENDJ-2803 Migrate Attribute

---
 opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
index 4a78299..97928d4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFWriter.java
@@ -297,7 +297,7 @@
       {
         for (ByteString v : a)
         {
-          final String attrName = a.getNameWithOptions();
+          final String attrName = a.getAttributeDescription().toString();
           writeAttribute(attrName, v, writer, wrapLines, wrapColumn);
         }
       }
@@ -431,7 +431,7 @@
     {
       for (Attribute a : entry.getUserAttribute(attrType))
       {
-        StringBuilder attrName = new StringBuilder(a.getNameWithOptions());
+        String attrName = a.getAttributeDescription().toString();
         for (ByteString v : a)
         {
           writeAttribute(attrName, v, writer, wrapLines, wrapColumn);
@@ -495,9 +495,10 @@
       {
         for (Attribute a : entry.getUserAttribute(attrType))
         {
-          StringBuilder attrName = new StringBuilder();
+          final String attrDesc = a.getAttributeDescription().toString();
+          final StringBuilder attrName = new StringBuilder(2 + attrDesc.length());
           attrName.append("# ");
-          attrName.append(a.getNameWithOptions());
+          attrName.append(attrDesc);
 
           for (ByteString v : a)
           {
@@ -557,7 +558,7 @@
       Modification m    = iterator.next();
       Attribute    a    = m.getAttribute();
 
-      String name = a.getNameWithOptions();
+      String name = a.getAttributeDescription().toString();
 
       StringBuilder modTypeLine = new StringBuilder();
       modTypeLine.append(m.getModificationType());

--
Gitblit v1.10.0