From 758fa048a39b3c362776400a9373ebeef86700af Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 04 Feb 2016 16:43:42 +0000
Subject: [PATCH] Removed Attribute.getOptions()

---
 opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
index 6871fe4..6d1b930 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -36,9 +36,14 @@
 import java.util.List;
 
 import org.forgerock.opendj.ldap.ByteString;
-import org.opends.server.core.DirectoryServer;
 import org.forgerock.opendj.ldap.schema.AttributeType;
-import org.opends.server.types.*;
+import org.opends.server.core.DirectoryServer;
+import org.opends.server.types.Attribute;
+import org.opends.server.types.AttributeBuilder;
+import org.opends.server.types.DN;
+import org.opends.server.types.LDIFExportConfig;
+import org.opends.server.types.ObjectClass;
+import org.opends.server.types.RDN;
 import org.opends.server.util.LDIFException;
 
 /**
@@ -387,12 +392,13 @@
             continue;
           }
 
-          StringBuilder attrName = attrNameWithOptions(a);
+          String attrName = a.getNameWithOptions();
           if (typesOnly)
           {
-            attrName.append(":");
+            StringBuilder attrLine = new StringBuilder(attrName);
+            attrLine.append(":");
 
-            writeLDIFLine(attrName, writer, wrapLines, wrapColumn);
+            writeLDIFLine(attrLine, writer, wrapLines, wrapColumn);
           }
           else
           {
@@ -430,12 +436,13 @@
               continue;
             }
 
-            StringBuilder attrName = attrNameWithOptions(a);
+            String attrName = a.getNameWithOptions();
             if (typesOnly)
             {
-              attrName.append(":");
+              StringBuilder attrLine = new StringBuilder(attrName);
+              attrLine.append(":");
 
-              writeLDIFLine(attrName, writer, wrapLines, wrapColumn);
+              writeLDIFLine(attrLine, writer, wrapLines, wrapColumn);
             }
             else
             {
@@ -457,17 +464,6 @@
     return true;
   }
 
-  private StringBuilder attrNameWithOptions(Attribute a)
-  {
-    StringBuilder attrName = new StringBuilder(a.getName());
-    for (String o : a.getOptions())
-    {
-      attrName.append(";");
-      attrName.append(o);
-    }
-    return attrName;
-  }
-
   private boolean contains(List<Attribute> urlAttrList, ByteString v)
   {
     if (urlAttrList != null)

--
Gitblit v1.10.0