From 10a90a26ff7006d6ddde8e46ee4650b44117c6cb Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Mon, 29 Sep 2014 12:32:02 +0000
Subject: [PATCH] OPENDJ-1308 Migrate schema support - SubstringMatchingRule

---
 opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java            |    2 +-
 opendj3-server-dev/src/server/org/opends/server/schema/AttributeTypeSyntax.java      |    3 +--
 opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java |    3 ++-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java b/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
index 1fa3575..0b5a3ef 100644
--- a/opendj3-server-dev/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
+++ b/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;
   }
 
   /**
diff --git a/opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java b/opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java
index 855137f..3d6399c 100644
--- a/opendj3-server-dev/src/server/org/opends/server/core/DirectoryServer.java
+++ b/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);
   }
 
   /**
diff --git a/opendj3-server-dev/src/server/org/opends/server/schema/AttributeTypeSyntax.java b/opendj3-server-dev/src/server/org/opends/server/schema/AttributeTypeSyntax.java
index 53be59a..d3b6021 100644
--- a/opendj3-server-dev/src/server/org/opends/server/schema/AttributeTypeSyntax.java
+++ b/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

--
Gitblit v1.10.0