From c38f72900e121badd214396309a318991940f01d Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 01 Jun 2016 20:24:40 +0000
Subject: [PATCH] OPENDJ-3037 remove two register*() methods from Schema class

---
 opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java |   21 ++-------------------
 1 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
index 516fa78..f499920 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
@@ -48,7 +48,6 @@
 import static org.opends.messages.TaskMessages.*;
 import static org.opends.server.config.ConfigConstants.*;
 import static org.opends.server.core.DirectoryServer.*;
-import static org.opends.server.util.ServerConstants.*;
 import static org.opends.server.util.StaticUtils.*;
 
 /**
@@ -187,26 +186,10 @@
           for (Modification m : modList)
           {
             Attribute a = m.getAttribute();
-            AttributeType attrType = a.getAttributeDescription().getAttributeType();
-            AttributeBuilder builder = new AttributeBuilder(attrType);
+            AttributeBuilder builder = new AttributeBuilder(a.getAttributeDescription());
             for (ByteString v : a)
             {
-              String s = v.toString();
-              if (!s.contains(SCHEMA_PROPERTY_FILENAME))
-              {
-                if (s.endsWith(" )"))
-                {
-                 s = s.substring(0, s.length()-1) + SCHEMA_PROPERTY_FILENAME +
-                     " '" + schemaFile + "' )";
-                }
-                else if (s.endsWith(")"))
-                {
-                 s = s.substring(0, s.length()-1) + " " +
-                     SCHEMA_PROPERTY_FILENAME + " '" + schemaFile + "' )";
-                }
-              }
-
-              builder.add(s);
+              builder.add(Schema.addSchemaFileToElementDefinitionIfAbsent(v.toString(), schemaFile));
             }
 
             mods.add(new Modification(m.getModificationType(), builder.toAttribute()));

--
Gitblit v1.10.0