mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
29.38.2016 d3f7287f96515499730a23f82871b706b234cf96
DirectoryServer.java: Removed getAttributeTypeOrDefault(String lowerName, String upperName), replaced by getAttributeTypeOrDefault(String lowerName)
22 files modified
196 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java 35 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java 17 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java 33 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java 33 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
@@ -297,11 +297,10 @@
      final org.opends.server.types.Attribute attribute =
        LDIFReader.parseAttrDescription(wholeName);
      final String attrName = attribute.getName();
      final String lowerName = toLowerCase(attrName);
      // See if this is an objectclass or an attribute.  Then get the
      // corresponding definition and add the value to the appropriate hash.
      if (lowerName.equals("objectclass"))
      if (attrName.equalsIgnoreCase("objectclass"))
      {
        for (Object value : getAttributeValues(attrName))
        {
@@ -320,7 +319,7 @@
      }
      else
      {
        AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(lowerName, attrName);
        AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
        AttributeBuilder builder = new AttributeBuilder(attribute, true);
        for (Object value : getAttributeValues(attrName))
        {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -672,11 +672,10 @@
    {
      final Attribute attribute = parseAttrDescription(wholeName);
      final String attrName = attribute.getName();
      final String lowerName = toLowerCase(attrName);
      // See if this is an objectclass or an attribute.  Then get the
      // corresponding definition and add the value to the appropriate hash.
      if (lowerName.equals("objectclass"))
      if (attrName.equalsIgnoreCase("objectclass"))
      {
        for (Object value : csr.getAttributeValues(attrName))
        {
@@ -695,7 +694,7 @@
      }
      else
      {
        AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(lowerName, attrName);
        AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
        AttributeBuilder builder = new AttributeBuilder(attribute, true);
        for (Object value : csr.getAttributeValues(attrName))
        {
opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java
@@ -700,11 +700,11 @@
    case 2:
      // It is probably "changeNumber=xxx,cn=changelog", use equality filter
      // But it also could be "<service-id>,cn=changelog" so need to check on attribute
      equalityFilter = buildSearchFilterFrom(baseDN, CHANGE_NUMBER_ATTR_LC, CHANGE_NUMBER_ATTR);
      equalityFilter = buildSearchFilterFrom(baseDN, CHANGE_NUMBER_ATTR);
      break;
    default:
      // "replicationCSN=xxx,<service-id>,cn=changelog" : use equality filter
      equalityFilter = buildSearchFilterFrom(baseDN, "replicationcsn", "replicationCSN");
      equalityFilter = buildSearchFilterFrom(baseDN, "replicationCSN");
      break;
    }
@@ -717,10 +717,10 @@
   * @return the search filter or {@code null} if attribute is not present in
   *         the provided DN
   */
  private SearchFilter buildSearchFilterFrom(final DN baseDN, final String lowerCaseAttr, final String upperCaseAttr)
  private SearchFilter buildSearchFilterFrom(final DN baseDN, final String attrName)
  {
    final RDN rdn = baseDN.rdn();
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(lowerCaseAttr, upperCaseAttr);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
    final ByteString attrValue = rdn.getAttributeValue(attrType);
    if (attrValue != null)
    {
@@ -1502,7 +1502,7 @@
      final Map<AttributeType, List<Attribute>> userAttrs,
      final Map<AttributeType, List<Attribute>> operationalAttrs, final boolean addByType)
  {
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrNameLowercase, attrNameUppercase);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrNameUppercase);
    final Attribute a = addByType
        ? Attributes.create(attrType, attrValue)
        : Attributes.create(attrNameUppercase, attrValue);
opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
@@ -441,36 +441,32 @@
    Map<AttributeType, List<Attribute>> dseOperationalAttrs = new HashMap<>();
    Attribute publicNamingContextAttr = createAttribute(
        ATTR_NAMING_CONTEXTS, ATTR_NAMING_CONTEXTS_LC,
        DirectoryServer.getPublicNamingContexts().keySet());
        ATTR_NAMING_CONTEXTS, DirectoryServer.getPublicNamingContexts().keySet());
    addAttribute(publicNamingContextAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "ds-private-naming-contexts" attribute.
    Attribute privateNamingContextAttr = createAttribute(
        ATTR_PRIVATE_NAMING_CONTEXTS, ATTR_PRIVATE_NAMING_CONTEXTS,
        DirectoryServer.getPrivateNamingContexts().keySet());
        ATTR_PRIVATE_NAMING_CONTEXTS, DirectoryServer.getPrivateNamingContexts().keySet());
    addAttribute(privateNamingContextAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedControl" attribute.
    Attribute supportedControlAttr = createAttribute(ATTR_SUPPORTED_CONTROL,
        ATTR_SUPPORTED_CONTROL_LC, DirectoryServer.getSupportedControls());
        DirectoryServer.getSupportedControls());
    addAttribute(supportedControlAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedExtension" attribute.
    Attribute supportedExtensionAttr = createAttribute(
        ATTR_SUPPORTED_EXTENSION, ATTR_SUPPORTED_EXTENSION_LC, DirectoryServer
            .getSupportedExtensions().keySet());
        ATTR_SUPPORTED_EXTENSION, DirectoryServer.getSupportedExtensions().keySet());
    addAttribute(supportedExtensionAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedFeature" attribute.
    Attribute supportedFeatureAttr = createAttribute(ATTR_SUPPORTED_FEATURE,
        ATTR_SUPPORTED_FEATURE_LC, DirectoryServer.getSupportedFeatures());
        DirectoryServer.getSupportedFeatures());
    addAttribute(supportedFeatureAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedSASLMechanisms" attribute.
    Attribute supportedSASLMechAttr = createAttribute(
        ATTR_SUPPORTED_SASL_MECHANISMS, ATTR_SUPPORTED_SASL_MECHANISMS_LC,
        DirectoryServer.getSupportedSASLMechanisms().keySet());
        ATTR_SUPPORTED_SASL_MECHANISMS, DirectoryServer.getSupportedSASLMechanisms().keySet());
    addAttribute(supportedSASLMechAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedLDAPVersions" attribute.
@@ -480,13 +476,12 @@
      versionStrings.add(ldapVersion.toString());
    }
    Attribute supportedLDAPVersionAttr = createAttribute(
        ATTR_SUPPORTED_LDAP_VERSION, ATTR_SUPPORTED_LDAP_VERSION_LC, versionStrings);
        ATTR_SUPPORTED_LDAP_VERSION, versionStrings);
    addAttribute(supportedLDAPVersionAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedAuthPasswordSchemes" attribute.
    Attribute supportedAuthPWSchemesAttr = createAttribute(
        ATTR_SUPPORTED_AUTH_PW_SCHEMES, ATTR_SUPPORTED_AUTH_PW_SCHEMES_LC,
        DirectoryServer.getAuthPasswordStorageSchemes().keySet());
        ATTR_SUPPORTED_AUTH_PW_SCHEMES, DirectoryServer.getAuthPasswordStorageSchemes().keySet());
    addAttribute(supportedAuthPWSchemesAttr, dseUserAttrs, dseOperationalAttrs);
@@ -519,14 +514,12 @@
    // Add the "supportedTLSProtocols" attribute.
    Attribute supportedTLSProtocolsAttr = createAttribute(
        ATTR_SUPPORTED_TLS_PROTOCOLS, ATTR_SUPPORTED_TLS_PROTOCOLS_LC,
        supportedTlsProtocols);
        ATTR_SUPPORTED_TLS_PROTOCOLS, supportedTlsProtocols);
    addAttribute(supportedTLSProtocolsAttr, dseUserAttrs, dseOperationalAttrs);
    // Add the "supportedTLSCiphers" attribute.
    Attribute supportedTLSCiphersAttr = createAttribute(
        ATTR_SUPPORTED_TLS_CIPHERS, ATTR_SUPPORTED_TLS_CIPHERS_LC,
        supportedTlsCiphers);
        ATTR_SUPPORTED_TLS_CIPHERS, supportedTlsCiphers);
    addAttribute(supportedTLSCiphersAttr, dseUserAttrs, dseOperationalAttrs);
    addAll(staticDSEAttributes, dseUserAttrs, dseOperationalAttrs);
@@ -584,17 +577,13 @@
   *
   * @param name
   *          The name for the attribute.
   * @param lowerName
   *          The name for the attribute formatted in all lowercase
   *          characters.
   * @param values
   *          The set of values to use for the attribute.
   * @return The constructed attribute.
   */
  private Attribute createAttribute(String name, String lowerName,
                                    Collection<? extends Object> values)
  private Attribute createAttribute(String name, Collection<? extends Object> values)
  {
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(lowerName, name);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(name);
    AttributeBuilder builder = new AttributeBuilder(type, name);
    builder.addAllStrings(values);
opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java
@@ -243,7 +243,7 @@
  private Attribute getSingleAttribute(Entry taskEntry, String attrName, Arg1<Object> noEntryErrorMsg,
      Arg1<Object> multipleEntriesErrorMsg, Arg1<Object> noAttrValueErrorMsg) throws DirectoryException
  {
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName.toLowerCase(), attrName);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
    List<Attribute> attrList = taskEntry.getAttribute(attrType);
    if (attrList.isEmpty())
    {
opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
@@ -844,8 +844,7 @@
      String messageString = buffer.toString();
      logMessages.add(messageString);
      AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
          ATTR_TASK_LOG_MESSAGES.toLowerCase(), ATTR_TASK_LOG_MESSAGES);
      AttributeType type = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_LOG_MESSAGES);
      final List<Attribute> attrList = taskEntry.getAttribute(type);
      ByteString value = ByteString.valueOfUtf8(messageString);
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java
@@ -1802,7 +1802,7 @@
         throws DirectoryException
  {
    // Get the name of the class that implements the task logic.
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_CLASS.toLowerCase(), ATTR_TASK_CLASS);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_CLASS);
    List<Attribute> attrList = entry.getAttribute(attrType);
    if (attrList.isEmpty())
    {
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java
@@ -195,8 +195,7 @@
   */
  public ConfigAttribute getConfigAttribute(ConfigAttribute stub) throws ConfigException
  {
    String attrName = stub.getName();
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName.toLowerCase(), attrName);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(stub.getName());
    List<Attribute> attrList = entry.getAttribute(attrType);
    return !attrList.isEmpty() ? stub.getConfigAttribute(attrList) : null;
  }
opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
@@ -399,7 +399,7 @@
  {
    // It's possible that this is a monitor attribute rather than a configurable
    // one. Check all of those.
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name.toLowerCase(), name);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name);
    for (MonitorProvider<? extends MonitorProviderCfg> monitor : monitorProviders)
    {
      for (org.opends.server.types.Attribute a : monitor.getMonitorData())
@@ -581,7 +581,7 @@
      // It's possible that this is a monitor attribute rather than a
      // configurable one. Check all of those.
      AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name.toLowerCase(), name);
      AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name);
monitorLoop:
      for (MonitorProvider<? extends MonitorProviderCfg> monitor :
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java
@@ -839,8 +839,7 @@
  {
    if (attributeType == null && rawAttributeType != null)
    {
      String lowerName = toLowerCase(rawAttributeType);
      attributeType = DirectoryServer.getAttributeTypeOrDefault(lowerName, rawAttributeType);
      attributeType = DirectoryServer.getAttributeTypeOrDefault(rawAttributeType);
    }
    return attributeType;
  }
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -2542,23 +2542,6 @@
  }
  /**
   * Retrieves the attribute type for the provided lowercase name or OID. It will return a generated
   * "default" version with the uppercase name or OID if the requested attribute type is not defined
   * in the schema.
   *
   * @param lowerName
   *          The lowercase name or OID for the attribute type to retrieve.
   * @param upperName
   *          The uppercase name or OID for the attribute type to generate.
   * @return The requested attribute type, or a generated "default" version if there is no attribute
   *         with the specified type defined in the server schema
   */
  public static AttributeType getAttributeTypeOrDefault(String lowerName, String upperName)
  {
    return getAttributeType(upperName, getDefaultAttributeSyntax());
  }
  /**
   * Retrieves the attribute type for the provided name or OID. It will return a generated
   * placeholder version with the name or OID if the requested attribute type is not defined in the
   * schema.
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
@@ -626,8 +626,7 @@
      return authFailureTimes;
    }
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_FAILURE_TIME_LC, OP_ATTR_PWPOLICY_FAILURE_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_FAILURE_TIME);
    try
    {
      authFailureTimes = getGeneralizedTimes(type);
@@ -720,8 +719,7 @@
    failureTimes.add(highestFailureTime);
    // And the attribute in the user entry
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_FAILURE_TIME_LC, OP_ATTR_PWPOLICY_FAILURE_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_FAILURE_TIME);
    Attribute addAttr = Attributes.create(type, GeneralizedTimeSyntax.format(highestFailureTime));
    modifications.add(new Modification(ModificationType.ADD, addAttr, true));
@@ -801,8 +799,7 @@
    failureTimes.clear(); // Note: failureTimes != this.authFailureTimes
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_FAILURE_TIME_LC, OP_ATTR_PWPOLICY_FAILURE_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_FAILURE_TIME);
    modifications.add(new Modification(ModificationType.REPLACE, Attributes.empty(type), true));
  }
@@ -819,8 +816,7 @@
      return failureLockedTime;
    }
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_LOCKED_TIME_LC, OP_ATTR_PWPOLICY_LOCKED_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_LOCKED_TIME);
    try
    {
      failureLockedTime = getGeneralizedTime(userEntry, type);
@@ -853,8 +849,7 @@
    failureLockedTime = time;
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_LOCKED_TIME_LC, OP_ATTR_PWPOLICY_LOCKED_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_LOCKED_TIME);
    Attribute a = Attributes.create(type, GeneralizedTimeSyntax.format(failureLockedTime));
    modifications.add(new Modification(ModificationType.REPLACE, a, true));
  }
@@ -878,8 +873,7 @@
    failureLockedTime = -1L;
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_LOCKED_TIME_LC, OP_ATTR_PWPOLICY_LOCKED_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_LOCKED_TIME);
    modifications.add(new Modification(ModificationType.REPLACE, Attributes.empty(type), true));
  }
@@ -1314,8 +1308,7 @@
      return false;
    }
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_RESET_REQUIRED_LC, OP_ATTR_PWPOLICY_RESET_REQUIRED);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_RESET_REQUIRED);
    try
    {
      mustChangePassword = getBoolean(userEntry, type);
@@ -1362,8 +1355,7 @@
      return;  // requested state matches current state
    }
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_RESET_REQUIRED_LC, OP_ATTR_PWPOLICY_RESET_REQUIRED);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_RESET_REQUIRED);
    this.mustChangePassword = ConditionResult.not(this.mustChangePassword);
    if (mustChangePassword)
    {
@@ -1958,8 +1950,7 @@
  {
    if (graceLoginTimes == null)
    {
      AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME_LC, OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
      AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
      try
      {
        graceLoginTimes = getGeneralizedTimes(type);
@@ -2013,8 +2004,7 @@
    long highestGraceTime = computeHighestTime(graceTimes);
    graceTimes.add(highestGraceTime); // graceTimes == this.graceLoginTimes
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME_LC, OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
    Attribute addAttr = Attributes.create(type, GeneralizedTimeSyntax.format(highestGraceTime));
    modifications.add(new Modification(ModificationType.ADD, addAttr, true));
  }
@@ -2090,8 +2080,7 @@
    }
    graceTimes.clear(); // graceTimes == this.graceLoginTimes
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(
        OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME_LC, OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
    AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
    modifications.add(new Modification(ModificationType.REPLACE, Attributes.empty(type), true));
  }
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
@@ -1910,7 +1910,7 @@
      if (semicolonPos > 0)
      {
        String baseName = attributeType.substring(0, semicolonPos);
        attrType = DirectoryServer.getAttributeTypeOrDefault(toLowerCase(baseName), baseName);
        attrType = DirectoryServer.getAttributeTypeOrDefault(baseName);
        options = new HashSet<>();
        StringTokenizer tokenizer =
             new StringTokenizer(attributeType.substring(semicolonPos+1), ";");
@@ -1922,7 +1922,7 @@
      else
      {
        options = null;
        attrType = DirectoryServer.getAttributeTypeOrDefault(toLowerCase(attributeType), attributeType);
        attrType = DirectoryServer.getAttributeTypeOrDefault(attributeType);
      }
    }
opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
@@ -492,7 +492,7 @@
    HashSet<AttributeType> attributes = new HashSet<>();
    for (String attrName : attributeStrings)
    {
      attributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName.toLowerCase(), attrName));
      attributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
    }
    return attributes;
  }
opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
@@ -788,7 +788,7 @@
    final HashSet<AttributeType> attrTypes = new HashSet<>(attrNames.size());
    for (String attrName : attrNames)
    {
      attrTypes.add(DirectoryServer.getAttributeTypeOrDefault(attrName.toLowerCase(), attrName));
      attrTypes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
    }
    return attrTypes;
  }
opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
@@ -830,7 +830,7 @@
    Set<AttributeType> results = new HashSet<>();
    for (String attrName : attributeArg.getValues())
    {
      results.add(DirectoryServer.getAttributeTypeOrDefault(attrName.toLowerCase(), attrName));
      results.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
    }
    return results;
  }
opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
@@ -720,7 +720,7 @@
        }
        else
        {
          excludeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(lowerName, attrName));
          excludeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
        }
      }
    }
@@ -748,7 +748,7 @@
        }
        else
        {
          includeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(lowerName, attrName));
          includeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
        }
      }
    }
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -973,7 +973,7 @@
  private static AttributeType getAttributeTypeOrDefault(String attributeName)
  {
    return DirectoryServer.getAttributeTypeOrDefault(toLowerCase(attributeName), attributeName);
    return DirectoryServer.getAttributeTypeOrDefault(attributeName);
  }
  /** The attribute type for this attribute. */
opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
@@ -26,8 +26,8 @@
 */
package org.opends.server.types;
import static org.opends.server.core.DirectoryServer.*;
import static org.opends.server.util.CollectionUtils.*;
import static org.opends.server.util.StaticUtils.*;
import java.util.Arrays;
import java.util.Collection;
@@ -36,7 +36,6 @@
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.opends.server.core.DirectoryServer;
/**
 * This class contains various methods for manipulating
@@ -408,9 +407,4 @@
    }
    return builder.toAttribute();
  }
  private static AttributeType getAttributeTypeOrDefault(String attributeName)
  {
    return DirectoryServer.getAttributeTypeOrDefault(toLowerCase(attributeName), attributeName);
  }
}
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
@@ -810,27 +810,16 @@
  private static RDN newRDN(ByteString attrName, ByteString value)
  {
    String lowerName = toLC(attrName);
    String attributeNameString = attrName.toString();
    AttributeType attrType = getAttributeTypeOrDefault(lowerName, attributeNameString);
    return new RDN(attrType, attributeNameString, value);
    String name = attrName.toString();
    AttributeType attrType = getAttributeTypeOrDefault(name);
    return new RDN(attrType, name, value);
  }
  private static void addValue(ByteString attributeName, RDN rdn, ByteString empty)
  {
    String lowerName = toLC(attributeName);
    String attributeNameString = attributeName.toString();
    AttributeType attrType = getAttributeTypeOrDefault(lowerName, attributeNameString);
    rdn.addValue(attrType, attributeNameString, empty);
  }
  private static String toLC(ByteString attributeName)
  {
    StringBuilder lowerName = new StringBuilder();
    toLowerCase(attributeName, lowerName, true);
    return lowerName.toString();
    String name = attributeName.toString();
    AttributeType attrType = getAttributeTypeOrDefault(name);
    rdn.addValue(attrType, name, empty);
  }
  /**
@@ -1123,19 +1112,15 @@
  private static RDN newRDN(StringBuilder attributeName, ByteString value)
  {
    String        name      = attributeName.toString();
    String        lowerName = toLowerCase(name);
    AttributeType attrType = getAttributeTypeOrDefault(lowerName, name);
    String name = attributeName.toString();
    AttributeType attrType = getAttributeTypeOrDefault(name);
    return new RDN(attrType, name, value);
  }
  private static void addValue(StringBuilder attributeName, RDN rdn, ByteString empty)
  {
    String name = attributeName.toString();
    String lowerName = toLowerCase(name);
    AttributeType attrType = getAttributeTypeOrDefault(lowerName, name);
    AttributeType attrType = getAttributeTypeOrDefault(name);
    rdn.addValue(attrType, name, empty);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
@@ -667,12 +667,11 @@
    // Create the new RDN with the provided information.  However,
    // don't return it yet because this could be a multi-valued RDN.
    String name            = attributeName.toString();
    String lowerName       = toLowerCase(name);
    // If using default is a problem, it will be caught later either
    // by not finding the target entry or by not allowing the entry
    // to be added.
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(lowerName, name);
    AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name);
    RDN rdn = new RDN(attrType, name, parsedValue.toByteString());
@@ -781,8 +780,7 @@
      if (pos >= length)
      {
        name      = attributeName.toString();
        lowerName = toLowerCase(name);
        attrType = DirectoryServer.getAttributeTypeOrDefault(lowerName.toString(), name);
        attrType = DirectoryServer.getAttributeTypeOrDefault(name);
        rdn.addValue(attrType, name, ByteString.empty());
        return rdn;
@@ -796,11 +794,10 @@
      // Update the RDN to include the new attribute/value.
      name            = attributeName.toString();
      lowerName       = toLowerCase(name);
      // If using default is a problem, it will be caught later either
      // by not finding the target entry or by not allowing the entry
      // to be added.
      attrType = DirectoryServer.getAttributeTypeOrDefault(lowerName, name);
      attrType = DirectoryServer.getAttributeTypeOrDefault(name);
      rdn.addValue(attrType, name, parsedValue.toByteString());
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -800,15 +800,13 @@
    String attrDescr = line.substring(0, colonPos);
    final Attribute attribute = parseAttrDescription(attrDescr);
    final String attrName = attribute.getName();
    final String lowerName = toLowerCase(attrName);
    // Now parse the attribute value.
    ByteString value = parseSingleValue(lines, line, entryDN,
        colonPos, attrName);
    ByteString value = parseSingleValue(lines, line, entryDN, colonPos, attrName);
    // See if this is an objectclass or an attribute.  Then get the
    // corresponding definition and add the value to the appropriate hash.
    if (lowerName.equals("objectclass"))
    if (attrName.equalsIgnoreCase("objectclass"))
    {
      if (! importConfig.includeObjectClasses())
      {
@@ -840,7 +838,7 @@
    }
    else
    {
      AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(lowerName, attrName);
      AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
      if (! importConfig.includeAttribute(attrType))
      {
        if (logger.isTraceEnabled())