From eca4a29bf5b638e7b8f7202c593c26fa1c336240 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 01 Jun 2016 10:14:34 +0000
Subject: [PATCH] Make DirectoryString syntax the default or the server (as it has always been)

---
 opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
index f3af802..434291b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -16,6 +16,17 @@
  */
 package org.opends.server.types;
 
+import static org.forgerock.opendj.ldap.schema.CoreSchema.*;
+import static org.forgerock.opendj.ldap.schema.SchemaOptions.*;
+import static org.opends.messages.BackendMessages.*;
+import static org.opends.messages.CoreMessages.*;
+import static org.opends.messages.SchemaMessages.*;
+import static org.opends.server.config.ConfigConstants.*;
+import static org.opends.server.types.CommonSchemaElements.*;
+import static org.opends.server.util.CollectionUtils.*;
+import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
+
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
@@ -67,14 +78,6 @@
 import org.opends.server.util.Base64;
 import org.opends.server.util.ServerConstants;
 
-import static org.opends.messages.BackendMessages.*;
-import static org.opends.messages.CoreMessages.*;
-import static org.opends.messages.SchemaMessages.*;
-import static org.opends.server.config.ConfigConstants.*;
-import static org.opends.server.util.CollectionUtils.*;
-import static org.opends.server.util.ServerConstants.*;
-import static org.opends.server.util.StaticUtils.*;
-
 /**
  * This class defines a data structure that holds information about
  * the components of the Directory Server schema.  It includes the
@@ -150,7 +153,11 @@
    */
   public Schema(org.forgerock.opendj.ldap.schema.Schema schemaNG) throws DirectoryException
   {
-    switchSchema(schemaNG);
+    final org.forgerock.opendj.ldap.schema.Schema newSchemaNG =
+        new SchemaBuilder(schemaNG)
+        .setOption(DEFAULT_SYNTAX_OID, getDirectoryStringSyntax().getOID())
+        .toSchema();
+    switchSchema(newSchemaNG);
 
     ldapSyntaxDescriptions = new ConcurrentHashMap<String,LDAPSyntaxDescription>();
     subordinateTypes = new ConcurrentHashMap<AttributeType,List<AttributeType>>();

--
Gitblit v1.10.0