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

Jean-Noël Rouvignac
02.37.2016 aed1c25445b53aee1043dfad76f95a025986783f
OPENDJ-3037 remove now unnecessary calls to toLowerCase() for parameters of Schema.getMatchingRule()
8 files modified
49 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java 17 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/schema/FakeByteStringIndex.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java
@@ -28,12 +28,13 @@
import java.util.concurrent.ConcurrentLinkedQueue;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.ConditionResult;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.forgerock.opendj.config.Configuration;
import org.opends.server.backends.RebuildConfig;
import org.opends.server.backends.VerifyConfig;
import org.opends.server.core.AddOperation;
@@ -49,7 +50,6 @@
import org.opends.server.types.BackupConfig;
import org.opends.server.types.BackupDirectory;
import org.opends.server.types.CanceledOperationException;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.IndexType;
@@ -321,17 +321,10 @@
          return false;
        }
        MatchingRule matchingRule;
        String matchingRuleID = filter.getMatchingRuleID();
        if (matchingRuleID != null)
        {
          matchingRule = DirectoryServer.getMatchingRule(
                              matchingRuleID.toLowerCase());
        }
        else
        {
          matchingRule = attrType.getEqualityMatchingRule();
        }
        MatchingRule matchingRule = matchingRuleID != null
            ? DirectoryServer.getMatchingRule(matchingRuleID)
            : attrType.getEqualityMatchingRule();
        // FIXME isIndexed() always return false down below
        return matchingRule != null && isIndexed(attrType, matchingRule);
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
@@ -19,7 +19,6 @@
import static org.opends.messages.BackendMessages.*;
import static org.opends.server.backends.pluggable.EntryIDSet.*;
import static org.opends.server.util.StaticUtils.*;
import java.io.Closeable;
import java.util.ArrayList;
@@ -410,7 +409,7 @@
    final Map<Indexer, Boolean> indexers = new HashMap<>();
    for (final String ruleName : extensibleRules)
    {
      final MatchingRule rule = DirectoryServer.getMatchingRule(toLowerCase(ruleName));
      final MatchingRule rule = DirectoryServer.getMatchingRule(ruleName);
      throwIfNoMatchingRule(attributeType, indexType, rule);
      for (Indexer indexer : rule.createIndexers(options))
      {
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java
@@ -944,7 +944,7 @@
  {
    if (matchingRule == null && matchingRuleID != null)
    {
      matchingRule = DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
      matchingRule = DirectoryServer.getMatchingRule(matchingRuleID);
    }
    return matchingRule;
  }
opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java
@@ -110,10 +110,8 @@
          if(reader.hasNextElement() &&
              reader.peekType() == TYPE_ORDERING_RULE_ID)
          {
            String orderingRuleID =
                toLowerCase(reader.readOctetStringAsString());
            orderingRule =
                DirectoryServer.getMatchingRule(orderingRuleID);
            String orderingRuleID = reader.readOctetStringAsString();
            orderingRule = DirectoryServer.getMatchingRule(orderingRuleID);
            if (orderingRule == null)
            {
              LocalizableMessage message =
@@ -433,7 +431,7 @@
      MatchingRule orderingRule = null;
      if(decodedKey[1] != null)
      {
        orderingRule = DirectoryServer.getMatchingRule(decodedKey[1].toLowerCase());
        orderingRule = DirectoryServer.getMatchingRule(decodedKey[1]);
        if (orderingRule == null)
        {
          LocalizableMessage message = INFO_SORTREQ_CONTROL_UNDEFINED_ORDERING_RULE.get(decodedKey[1]);
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
@@ -1911,7 +1911,7 @@
            ERR_LDAP_FILTER_VALUE_WITH_NO_ATTR_OR_MR.get());
      }
      MatchingRule mr = DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
      MatchingRule mr = DirectoryServer.getMatchingRule(matchingRuleID);
      if (mr == null)
      {
        throw new DirectoryException(ResultCode.INAPPROPRIATE_MATCHING,
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
@@ -2035,7 +2035,7 @@
            ERR_SEARCH_FILTER_EXTENSIBLE_MATCH_NO_AD_OR_MR.get(filterString, startPos));
      }
      MatchingRule mr = DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
      MatchingRule mr = DirectoryServer.getMatchingRule(matchingRuleID);
      if (mr == null)
      {
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
@@ -3177,9 +3177,7 @@
    if (matchingRuleID != null)
    {
      matchingRule =
           DirectoryServer.getMatchingRule(
                toLowerCase(matchingRuleID));
      matchingRule = DirectoryServer.getMatchingRule(matchingRuleID);
      if (matchingRule == null)
      {
        if (logger.isTraceEnabled())
@@ -3641,7 +3639,7 @@
      }
      else
      {
        MatchingRule mrule = DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
        MatchingRule mrule = DirectoryServer.getMatchingRule(matchingRuleID);
        if (mrule == null)
        {
          return false;
opendj-server-legacy/src/test/java/org/opends/server/schema/FakeByteStringIndex.java
@@ -11,7 +11,7 @@
 * Header, with the fields enclosed by brackets [] replaced by your own identifying
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2015 ForgeRock AS.
 * Copyright 2015-2016 ForgeRock AS.
 */
package org.opends.server.schema;
@@ -46,7 +46,7 @@
  FakeByteStringIndex(String mrName) throws DecodeException
  {
    matchingRule = DirectoryServer.getMatchingRule(mrName.toLowerCase());
    matchingRule = DirectoryServer.getMatchingRule(mrName);
    IndexingOptions options = mock(IndexingOptions.class);
    indexer = matchingRule.createIndexers(options).iterator().next();
  }
opendj-server-legacy/src/test/java/org/opends/server/schema/TimeBasedMatchingRuleTest.java
@@ -31,13 +31,13 @@
import org.forgerock.opendj.ldap.AttributeDescription;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ConditionResult;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.DecodeException;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.opends.server.TestCaseUtils;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.Attribute;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.FilterType;
import org.opends.server.types.SearchFilter;
@@ -200,8 +200,7 @@
  public void testPartialDateNTimeMatch(long timeInMillis, String generalizedTime, String assertionValue)
      throws Exception
  {
    MatchingRule partialTimeRule = DirectoryServer.getMatchingRule(
            EXT_PARTIAL_DATE_TIME_NAME.toLowerCase());
    MatchingRule partialTimeRule = DirectoryServer.getMatchingRule(EXT_PARTIAL_DATE_TIME_NAME);
    Assertion assertion = partialTimeRule.getAssertion(ByteString.valueOfUtf8(assertionValue));
    assertEquals(assertion.matches(ByteString.valueOfLong(timeInMillis)), ConditionResult.TRUE);
  }