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

Nicolas Capponi
29.32.2014 10a90a26ff7006d6ddde8e46ee4650b44117c6cb
OPENDJ-1308 Migrate schema support - SubstringMatchingRule

Removed unnecessary casts

Reverted to SubstringMatchingRule in controlpanel.util.Utilities class
3 files modified
8 ■■■■ changed files
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java 3 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java 2 ●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/schema/AttributeTypeSyntax.java 3 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -124,6 +124,7 @@
import org.opends.server.api.EqualityMatchingRule;
import org.opends.server.api.MatchingRule;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.api.SubstringMatchingRule;
import org.opends.server.config.ConfigEntry;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.LockFileManager;
@@ -2859,7 +2860,7 @@
   * @return {@code true} if this matching rule is a substring mathing rule.
   */
  public static boolean isSubstringMatchingRule(MatchingRule matchingRule) {
    return matchingRule instanceof MatchingRule;
    return matchingRule instanceof SubstringMatchingRule;
  }
  /**
opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java
@@ -3172,7 +3172,7 @@
   */
  public static MatchingRule getSubstringMatchingRule(String lowerName)
  {
    return (MatchingRule) directoryServer.schema.getMatchingRule(lowerName);
    return directoryServer.schema.getMatchingRule(lowerName);
  }
  /**
opendj3-server-dev/src/server/org/opends/server/schema/AttributeTypeSyntax.java
@@ -675,8 +675,7 @@
        // for this attribute type.
        StringBuilder woidBuffer = new StringBuilder();
        pos = readWOID(lowerStr, woidBuffer, pos);
        MatchingRule smr =
             (MatchingRule) schema.getMatchingRule(woidBuffer.toString());
        MatchingRule smr = schema.getMatchingRule(woidBuffer.toString());
        if (smr == null)
        {
          // This is bad because we have no idea what the substring matching