From 3cc522e06e56a95c9d7ea043b8d97cae8ddb1181 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 10 Jun 2016 07:39:35 +0000
Subject: [PATCH] Code cleanup in schema

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java |    7 +++----
 opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java           |    7 ++++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
index 59416a7..d62ad64 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -513,8 +513,7 @@
     {
       for (AVA ava : rdn)
       {
-        AttributeType attrType = ava.getAttributeType();
-        Attribute attribute = Attributes.create(attrType, ava.getAttributeValue());
+        Attribute attribute = Attributes.create(ava.getAttributeType(), ava.getAttributeValue());
         addAttributeToSchemaEntry(attribute, userAttrs, operationalAttrs);
       }
     }
@@ -571,7 +570,7 @@
         Attributes.create(getModifyTimestampAttributeType(), modifyTimestamp), userAttrs, operationalAttrs);
 
     // Add the extra attributes.
-    for (Attribute attribute : DirectoryServer.getSchema().getExtraAttributes().values())
+    for (Attribute attribute : DirectoryServer.getSchema().getExtraAttributes())
     {
       addAttributeToSchemaEntry(attribute, userAttrs, operationalAttrs);
     }
@@ -2255,7 +2254,7 @@
 
     if (FILE_USER_SCHEMA_ELEMENTS.equals(schemaFile))
     {
-      for (Attribute attribute : schema.getExtraAttributes().values())
+      for (Attribute attribute : schema.getExtraAttributes())
       {
         AttributeType attributeType = attribute.getAttributeDescription().getAttributeType();
         schemaEntry.putAttribute(attributeType, newArrayList(attribute));
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 0a034cb..79104b0 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
@@ -475,7 +475,8 @@
     AttributeType.Builder b = builder.buildAttributeType(attributeType);
     if (schemaFile != null)
     {
-      b.removeExtraProperty(SCHEMA_PROPERTY_FILENAME).extraProperties(SCHEMA_PROPERTY_FILENAME, schemaFile);
+      b.removeExtraProperty(SCHEMA_PROPERTY_FILENAME)
+       .extraProperties(SCHEMA_PROPERTY_FILENAME, schemaFile);
     }
     if (overwriteExisting)
     {
@@ -1537,9 +1538,9 @@
    *
    * @return  The extraAttributes stored in this schema.
    */
-  public Map<String, Attribute> getExtraAttributes()
+  public Collection<Attribute> getExtraAttributes()
   {
-    return extraAttributes;
+    return extraAttributes.values();
   }
 
 

--
Gitblit v1.10.0