From aab06371ebecd75d655436cf6045fffc8302c2e0 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 29 Jan 2016 15:01:26 +0000
Subject: [PATCH] *.java: Replaced DirectoryServer.getAttributeTypeOrNull(String) != null by DirectoryServer.getAttributeType(String).isPlaceHolder()

---
 opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java                                    |   18 +++---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java                                |    6 +-
 opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java                         |    8 +-
 opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java                                 |   20 +++++-
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java             |    4 
 opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java                       |    6 -
 opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java                          |   14 +++-
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java                                 |    4 
 opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java                              |   14 +++-
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java                           |    4 
 opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java                                                 |   16 ++--
 opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java                                          |    6 +-
 opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java                       |    8 +-
 opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java |   10 +-
 14 files changed, 82 insertions(+), 56 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
index 4eb96b1..f3c7f77 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
@@ -161,10 +161,8 @@
     ifNull(value);
 
     String name = value.trim();
-    AttributeType type = isCheckSchema
-        ? DirectoryServer.getAttributeTypeOrNull(name)
-        : DirectoryServer.getAttributeType(name);
-    if (type == null) {
+    AttributeType type = DirectoryServer.getAttributeType(name);
+    if (isCheckSchema && type.isPlaceHolder()) {
       throw PropertyException.illegalPropertyValueException(this, value);
     }
     try {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java
index 190abeb..84f6859 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternRDN.java
@@ -176,8 +176,8 @@
       AttributeType thatType = rdn.getAttributeType(0);
       if (!typePatterns[0].equals("*"))
       {
-        AttributeType thisType = DirectoryServer.getAttributeTypeOrNull(typePatterns[0]);
-        if (thisType == null || !thisType.equals(thatType))
+        AttributeType thisType = DirectoryServer.getAttributeType(typePatterns[0]);
+        if (thisType.isPlaceHolder() || !thisType.equals(thatType))
         {
           return false;
         }
@@ -208,8 +208,8 @@
 
     for (int i = 0; i < numValues; i++)
     {
-      AttributeType type = DirectoryServer.getAttributeTypeOrNull(typePatterns[i]);
-      if (type == null)
+      AttributeType type = DirectoryServer.getAttributeType(typePatterns[i]);
+      if (type.isPlaceHolder())
       {
         return false;
       }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
index ddc1d0c..c6f4b84 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
@@ -308,8 +308,8 @@
           return false;
         }
 
-        AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(sortAttrs[i]);
-        if(attrType == null)
+        AttributeType attrType = DirectoryServer.getAttributeType(sortAttrs[i]);
+        if (attrType.isPlaceHolder())
         {
           unacceptableReasons.add(ERR_CONFIG_VLV_INDEX_UNDEFINED_ATTR.get(sortAttrs[i], cfg.getName()));
           return false;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
index 5e1ab2d..33a94db 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -330,8 +330,8 @@
         throw new ConfigException(ERR_CONFIG_VLV_INDEX_UNDEFINED_ATTR.get(sortKeys[i], getName()));
       }
 
-      final AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(sortAttrs[i]);
-      if (attrType == null)
+      final AttributeType attrType = DirectoryServer.getAttributeType(sortAttrs[i]);
+      if (attrType.isPlaceHolder())
       {
         throw new ConfigException(ERR_CONFIG_VLV_INDEX_UNDEFINED_ATTR.get(sortAttrs[i], getName()));
       }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
index de2ed27..d0338a7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
@@ -52,6 +52,7 @@
 import org.forgerock.opendj.ldap.ByteSequence;
 import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.ConditionResult;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.backends.VerifyConfig;
 import org.opends.server.backends.pluggable.AttributeIndex.MatchingRuleIndex;
 import org.opends.server.backends.pluggable.spi.Cursor;
@@ -60,7 +61,6 @@
 import org.opends.server.backends.pluggable.spi.SequentialCursor;
 import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
 import org.opends.server.core.DirectoryServer;
-import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.types.DN;
 import org.opends.server.types.DirectoryException;
 import org.opends.server.types.Entry;
@@ -220,8 +220,8 @@
           }
           else
           {
-            AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(lowerName);
-            if (attrType == null)
+            AttributeType attrType = DirectoryServer.getAttributeType(lowerName);
+            if (attrType.isPlaceHolder())
             {
               throw new StorageRuntimeException(ERR_ATTRIBUTE_INDEX_NOT_CONFIGURED.get(index).toString());
             }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java b/opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java
index 8a87356..ad1fd44 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java
@@ -109,8 +109,8 @@
         {
           reader.readStartSequence();
           String attrName = reader.readOctetStringAsString();
-          AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(attrName);
-          if (attrType == null)
+          AttributeType attrType = DirectoryServer.getAttributeType(attrName);
+          if (attrType.isPlaceHolder())
           {
             //This attribute is not defined in the schema. There is no point
             //iterating over the next attribute and return a partially sorted result.
@@ -441,8 +441,8 @@
     ArrayList<SortKey> sortKeys = new ArrayList<>();
     for(String[] decodedKey : decodedKeyList)
     {
-      AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(decodedKey[0]);
-      if (attrType == null)
+      AttributeType attrType = DirectoryServer.getAttributeType(decodedKey[0]);
+      if (attrType.isPlaceHolder())
       {
         //This attribute is not defined in the schema. There is no point
         //iterating over the next attribute and return a partially sorted result.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java b/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
index eca9d7f..cd63c05 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
@@ -30,7 +30,12 @@
 import static org.opends.messages.CoreMessages.*;
 import static org.opends.server.schema.SchemaConstants.*;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.forgerock.i18n.LocalizableMessage;
@@ -46,7 +51,14 @@
 import org.opends.server.api.PasswordGenerator;
 import org.opends.server.api.PasswordStorageScheme;
 import org.opends.server.api.PasswordValidator;
-import org.opends.server.types.*;
+import org.opends.server.types.Attribute;
+import org.opends.server.types.DN;
+import org.opends.server.types.DirectoryException;
+import org.opends.server.types.Entry;
+import org.opends.server.types.InitializationException;
+import org.opends.server.types.ObjectClass;
+import org.opends.server.types.Operation;
+import org.opends.server.types.SubEntry;
 
 /**
  * This class represents subentry password policy based on Password Policy for
@@ -174,8 +186,8 @@
     String value = getAttrValue(entry, PWD_ATTR_ATTRIBUTE);
     if (value != null && value.length() > 0)
     {
-      this.pPasswordAttribute = DirectoryServer.getAttributeTypeOrNull(value);
-      if (this.pPasswordAttribute == null)
+      this.pPasswordAttribute = DirectoryServer.getAttributeType(value);
+      if (this.pPasswordAttribute.isPlaceHolder())
       {
         throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
             ERR_PWPOLICY_UNDEFINED_PASSWORD_ATTRIBUTE.get(this.passwordPolicySubentryDN, value));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
index edbccce..4379f54 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerImpl.java
@@ -58,6 +58,7 @@
 import org.forgerock.opendj.ldap.ModificationType;
 import org.forgerock.opendj.ldap.ResultCode;
 import org.forgerock.opendj.ldap.SearchScope;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.forgerock.util.Reject;
 import org.opends.admin.ads.ADSContext;
 import org.opends.server.admin.server.ConfigurationChangeListener;
@@ -79,7 +80,6 @@
 import org.opends.server.tools.LDAPConnectionOptions;
 import org.opends.server.tools.LDAPReader;
 import org.opends.server.tools.LDAPWriter;
-import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.types.*;
 import org.opends.server.util.Base64;
 import org.opends.server.util.SelectableCertificateKeyManager;
@@ -235,14 +235,14 @@
     this.serverContext = serverContext;
     if (!schemaInitDone) {
       // Initialize various schema references.
-      attrKeyID = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_KEY_ID);
-      attrPublicKeyCertificate = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE);
-      attrTransformation = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_CIPHER_TRANSFORMATION_NAME);
-      attrMacAlgorithm = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_MAC_ALGORITHM_NAME);
-      attrSymmetricKey = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_SYMMETRIC_KEY);
-      attrInitVectorLength = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_INIT_VECTOR_LENGTH_BITS);
-      attrKeyLength = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_KEY_LENGTH_BITS);
-      attrCompromisedTime = DirectoryServer.getAttributeTypeOrNull(ATTR_CRYPTO_KEY_COMPROMISED_TIME);
+      attrKeyID = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID);
+      attrPublicKeyCertificate = DirectoryServer.getAttributeType(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE);
+      attrTransformation = DirectoryServer.getAttributeType(ATTR_CRYPTO_CIPHER_TRANSFORMATION_NAME);
+      attrMacAlgorithm = DirectoryServer.getAttributeType(ATTR_CRYPTO_MAC_ALGORITHM_NAME);
+      attrSymmetricKey = DirectoryServer.getAttributeType(ATTR_CRYPTO_SYMMETRIC_KEY);
+      attrInitVectorLength = DirectoryServer.getAttributeType(ATTR_CRYPTO_INIT_VECTOR_LENGTH_BITS);
+      attrKeyLength = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_LENGTH_BITS);
+      attrCompromisedTime = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_COMPROMISED_TIME);
       ocCertRequest = DirectoryServer.getObjectClass("ds-cfg-self-signed-cert-request"); // TODO: ConfigConstants
       ocInstanceKey = DirectoryServer.getObjectClass(OC_CRYPTO_INSTANCE_KEY);
       ocCipherKey = DirectoryServer.getObjectClass(OC_CRYPTO_CIPHER_KEY);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
index 15d0057..2a94fa9 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java
@@ -392,8 +392,8 @@
               else if (lowerTokenStr.startsWith("notification-user-attr:"))
               {
                 String attrName = lowerTokenStr.substring(23);
-                AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(attrName);
-                if (attrType == null)
+                AttributeType attrType = DirectoryServer.getAttributeType(attrName);
+                if (attrType.isPlaceHolder())
                 {
                   throw new ConfigException(
                                  ERR_SMTP_ASNH_TEMPLATE_UNDEFINED_ATTR_TYPE.get(
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
index 03a20bb..555e90e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/SubjectAttributeToUserAttributeCertificateMapper.java
@@ -50,6 +50,7 @@
 import org.forgerock.opendj.config.server.ConfigException;
 import org.forgerock.opendj.ldap.ResultCode;
 import org.forgerock.opendj.ldap.SearchScope;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.admin.server.ConfigurationChangeListener;
 import org.opends.server.admin.std.server.CertificateMapperCfg;
 import org.opends.server.admin.std.server.SubjectAttributeToUserAttributeCertificateMapperCfg;
@@ -59,7 +60,6 @@
 import org.opends.server.protocols.internal.InternalClientConnection;
 import org.opends.server.protocols.internal.InternalSearchOperation;
 import org.opends.server.protocols.internal.SearchRequest;
-import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.types.DN;
 import org.opends.server.types.DirectoryException;
 import org.opends.server.types.Entry;
@@ -399,8 +399,8 @@
         return null;
       }
 
-      AttributeType userAttrType = DirectoryServer.getAttributeTypeOrNull(userAttrName);
-      if (userAttrType == null)
+      AttributeType userAttrType = DirectoryServer.getAttributeType(userAttrName);
+      if (userAttrType.isPlaceHolder())
       {
         ccr.setResultCodeIfSuccess(ResultCode.CONSTRAINT_VIOLATION);
         ccr.addMessage(ERR_SATUACM_NO_SUCH_ATTR.get(mapStr, cfgEntryDN, userAttrName));
@@ -429,7 +429,7 @@
    */
   private static String normalizeAttributeName(String attrName)
   {
-    AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(attrName);
-    return attrType != null ? attrType.getNormalizedNameOrOID() : attrName;
+    AttributeType attrType = DirectoryServer.getAttributeType(attrName);
+    return attrType.isPlaceHolder() ? attrName : attrType.getNormalizedNameOrOID();
   }
 }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
index 81ef5b7..b9f1ad2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/AttributeCleanupPlugin.java
@@ -29,7 +29,13 @@
 import static org.opends.messages.PluginMessages.*;
 import static com.forgerock.opendj.util.StaticUtils.toLowerCase;
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
@@ -46,7 +52,9 @@
 import org.opends.server.api.plugin.PluginResult;
 import org.opends.server.api.plugin.PluginType;
 import org.opends.server.core.DirectoryServer;
-import org.opends.server.types.*;
+import org.opends.server.types.InitializationException;
+import org.opends.server.types.RawAttribute;
+import org.opends.server.types.RawModification;
 import org.opends.server.types.operation.PreParseAddOperation;
 import org.opends.server.types.operation.PreParseModifyOperation;
 
@@ -306,7 +314,7 @@
           ? toAttr
           : toAttr.substring(semicolonPos + 1);
 
-      if (DirectoryServer.getAttributeTypeOrNull(toAttrType) == null)
+      if (DirectoryServer.getAttributeType(toAttrType).isPlaceHolder())
       {
         messages.add(ERR_PLUGIN_ATTR_CLEANUP_ATTRIBUTE_MISSING.get(toAttr));
         isValid = false;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
index 600b031..6c1de45 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -74,7 +74,15 @@
 import org.opends.server.protocols.internal.InternalClientConnection;
 import org.opends.server.protocols.internal.InternalSearchOperation;
 import org.opends.server.protocols.internal.SearchRequest;
-import org.opends.server.types.*;
+import org.opends.server.types.Attribute;
+import org.opends.server.types.Attributes;
+import org.opends.server.types.DN;
+import org.opends.server.types.DirectoryException;
+import org.opends.server.types.Entry;
+import org.opends.server.types.IndexType;
+import org.opends.server.types.Modification;
+import org.opends.server.types.SearchFilter;
+import org.opends.server.types.SearchResultEntry;
 import org.opends.server.types.operation.PostOperationDeleteOperation;
 import org.opends.server.types.operation.PostOperationModifyDNOperation;
 import org.opends.server.types.operation.PreOperationAddOperation;
@@ -346,8 +354,8 @@
        * type has to be present in the attributeType list.
        */
 
-      AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(attr);
-      if (attrType == null || !theAttributeTypes.contains(attrType))
+      AttributeType attrType = DirectoryServer.getAttributeType(attr);
+      if (attrType.isPlaceHolder() || !theAttributeTypes.contains(attrType))
       {
         isAcceptable = false;
         unacceptableReasons.add(ERR_PLUGIN_REFERENT_ATTR_NOT_LISTED.get(attr));
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
index b054d5e..affa1d0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -2501,8 +2501,8 @@
     }
 
 
-    AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(attrTypeName);
-    if (attrType == null)
+    AttributeType attrType = DirectoryServer.getAttributeType(attrTypeName);
+    if (attrType.isPlaceHolder())
     {
       // This should not happen
       // The server doesn't have this attribute type defined.
@@ -2547,8 +2547,8 @@
    */
   public Set<String> getReferralURLs()
   {
-    AttributeType referralType = DirectoryServer.getAttributeTypeOrNull(ATTR_REFERRAL_URL);
-    if (referralType == null)
+    AttributeType referralType = DirectoryServer.getAttributeType(ATTR_REFERRAL_URL);
+    if (referralType.isPlaceHolder())
     {
       // This should not happen -- The server doesn't have a ref attribute type defined.
       logger.trace("No %s attribute type is defined in the server schema.", ATTR_REFERRAL_URL);
@@ -2608,8 +2608,8 @@
    */
   public DN getAliasedDN() throws DirectoryException
   {
-    AttributeType aliasType = DirectoryServer.getAttributeTypeOrNull(ATTR_REFERRAL_URL);
-    if (aliasType == null)
+    AttributeType aliasType = DirectoryServer.getAttributeType(ATTR_REFERRAL_URL);
+    if (aliasType.isPlaceHolder())
     {
       // This should not happen -- The server doesn't have an aliasedObjectName attribute type defined.
       logger.trace("No %s attribute type is defined in the server schema.", ATTR_ALIAS_DN);
@@ -4525,8 +4525,8 @@
           options = null;
         }
 
-        AttributeType attrType = DirectoryServer.getAttributeTypeOrNull(name);
-        if (attrType == null)
+        AttributeType attrType = DirectoryServer.getAttributeType(name);
+        if (attrType.isPlaceHolder())
         {
           // Unrecognized attribute type - do best effort search.
           for (Map.Entry<AttributeType, List<Attribute>> e :
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
index 2e2d7a8..b91970b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
@@ -27,7 +27,6 @@
  */
 package org.opends.server.types;
 
-import org.forgerock.opendj.ldap.schema.AttributeType;
 import static org.opends.messages.CoreMessages.*;
 import static org.opends.server.util.ServerConstants.*;
 import static org.opends.server.util.StaticUtils.*;
@@ -48,6 +47,7 @@
 import org.forgerock.opendj.ldap.ByteStringBuilder;
 import org.forgerock.opendj.ldap.ConditionResult;
 import org.forgerock.opendj.ldap.ResultCode;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.forgerock.opendj.ldap.schema.MatchingRule;
 import org.opends.server.core.DirectoryServer;
 
@@ -2056,8 +2056,8 @@
 
   private static AttributeType getAttributeType(String attrType, StringBuilder lowerType)
   {
-    AttributeType attributeType = DirectoryServer.getAttributeTypeOrNull(lowerType.toString());
-    if (attributeType == null)
+    AttributeType attributeType = DirectoryServer.getAttributeType(lowerType.toString());
+    if (attributeType.isPlaceHolder())
     {
       String typeStr = attrType.substring(0, lowerType.length());
       attributeType = DirectoryServer.getAttributeType(typeStr);

--
Gitblit v1.10.0