From c5740d7b39334af983957a9c284ddd792d598f6c Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 10 Jul 2015 15:13:20 +0000
Subject: [PATCH] Code cleanup

---
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
index a7c5fef..d945761 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -60,6 +60,7 @@
 import static org.opends.server.authorization.dseecompat.Aci.*;
 import static org.opends.server.authorization.dseecompat.EnumEvalReason.*;
 import static org.opends.server.config.ConfigConstants.*;
+import static org.opends.server.core.DirectoryServer.*;
 import static org.opends.server.protocols.internal.InternalClientConnection.*;
 import static org.opends.server.protocols.internal.Requests.*;
 import static org.opends.server.schema.SchemaConstants.*;
@@ -122,10 +123,10 @@
    */
   private static void initStatics()
   {
-    aciType = getAttributeType("aci");
-    globalAciType = getAttributeType(ATTR_AUTHZ_GLOBAL_ACI);
-    debugSearchIndex = getAttributeType(SuffixContainer.ATTR_DEBUG_SEARCH_INDEX);
-    refAttrType = getAttributeType(ATTR_REFERRAL_URL);
+    aciType = getAttributeTypeOrDefault("aci");
+    globalAciType = getAttributeTypeOrDefault(ATTR_AUTHZ_GLOBAL_ACI);
+    debugSearchIndex = getAttributeTypeOrDefault(SuffixContainer.ATTR_DEBUG_SEARCH_INDEX);
+    refAttrType = getAttributeTypeOrDefault(ATTR_REFERRAL_URL);
 
     try
     {
@@ -137,13 +138,6 @@
     }
   }
 
-  private static AttributeType getAttributeType(String name)
-  {
-    return DirectoryServer.getAttributeType(name, true);
-  }
-
-
-
   /** The list that holds that ACIs keyed by the DN of the entry holding the ACI. */
   private AciList aciList;
 
@@ -315,7 +309,7 @@
       baseName = toLowerCase(rawAttributeType);
     }
 
-    container.setCurrentAttributeType(getAttributeType(baseName));
+    container.setCurrentAttributeType(getAttributeTypeOrDefault(baseName));
     container.setCurrentAttributeValue(operation.getAssertionValue());
     return isAllowed(container, operation);
   }

--
Gitblit v1.10.0