From 3d4c0acccda6e62b23f248d75c1cc6721fc20bdf Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 07 Jun 2016 13:51:21 +0000
Subject: [PATCH] OPENDJ-3037 inlined DirectoryServer.getAttributeType(String)

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

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
index 5dd676e..5a8be0a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
@@ -16,6 +16,7 @@
  */
 package org.opends.server.replication.plugin;
 
+import static org.forgerock.opendj.ldap.schema.CoreSchema.*;
 import static org.opends.messages.ReplicationMessages.*;
 import static org.opends.server.replication.plugin.HistAttrModificationKey.*;
 
@@ -28,6 +29,7 @@
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.forgerock.opendj.ldap.AttributeDescription;
 import org.forgerock.opendj.ldap.ByteString;
+import org.forgerock.opendj.ldap.DN;
 import org.forgerock.opendj.ldap.ModificationType;
 import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.core.DirectoryServer;
@@ -36,7 +38,6 @@
 import org.opends.server.types.Attribute;
 import org.opends.server.types.AttributeBuilder;
 import org.opends.server.types.Attributes;
-import org.forgerock.opendj.ldap.DN;
 import org.opends.server.types.Entry;
 import org.opends.server.types.Modification;
 import org.opends.server.types.operation.PreOperationAddOperation;
@@ -257,7 +258,7 @@
    */
   public static void setHistoricalAttrToOperation(PreOperationAddOperation addOperation)
   {
-    AttributeType attrType = DirectoryServer.getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
+    AttributeType attrType = DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
     String attrValue = encodeHistorical(OperationContext.getCSN(addOperation), "add");
     List<Attribute> attrs = Attributes.createAsList(attrType, attrValue);
     addOperation.setAttribute(attrType, attrs);
@@ -672,8 +673,7 @@
    */
   public static String getEntryUUID(Entry entry)
   {
-    AttributeType attrType = DirectoryServer.getAttributeType(ENTRYUUID_ATTRIBUTE_NAME);
-    List<Attribute> uuidAttrs = entry.getOperationalAttribute(attrType);
+    List<Attribute> uuidAttrs = entry.getOperationalAttribute(getEntryUUIDAttributeType());
     return extractEntryUUID(uuidAttrs, entry.getName());
   }
 
@@ -687,8 +687,7 @@
    */
   public static String getEntryUUID(PreOperationAddOperation op)
   {
-    AttributeType attrType = DirectoryServer.getAttributeType(ENTRYUUID_ATTRIBUTE_NAME);
-    List<Attribute> uuidAttrs = op.getOperationalAttributes().get(attrType);
+    List<Attribute> uuidAttrs = op.getOperationalAttributes().get(getEntryUUIDAttributeType());
     return extractEntryUUID(uuidAttrs, op.getEntryDN());
   }
 

--
Gitblit v1.10.0