From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk

---
 opends/src/server/org/opends/server/api/EqualityMatchingRule.java |   54 ++++++++++--------------------------------------------
 1 files changed, 10 insertions(+), 44 deletions(-)

diff --git a/opends/src/server/org/opends/server/api/EqualityMatchingRule.java b/opends/src/server/org/opends/server/api/EqualityMatchingRule.java
index b240484..9a0fb1b 100644
--- a/opends/src/server/org/opends/server/api/EqualityMatchingRule.java
+++ b/opends/src/server/org/opends/server/api/EqualityMatchingRule.java
@@ -28,13 +28,7 @@
 
 
 
-import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.AttributeValue;
-import org.opends.server.types.ByteString;
-import org.opends.server.types.ConditionResult;
-import org.opends.server.types.DebugLogLevel;
-
-import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.types.*;
 
 
 
@@ -51,11 +45,6 @@
 public abstract class EqualityMatchingRule extends MatchingRule
 {
   /**
-   * The tracer object for the debug logger.
-   */
-  private static final DebugTracer TRACER = getTracer();
-
-  /**
    * Indicates whether the two provided normalized values are equal to
    * each other.
    *
@@ -67,10 +56,10 @@
    * @return  {@code true} if the provided values are equal, or
    *          {@code false} if not.
    */
-  public abstract boolean areEqual(ByteString value1,
-                                   ByteString value2);
-
-
+  public boolean areEqual(ByteSequence value1, ByteSequence value2)
+  {
+    return value1.equals(value2);
+  }
 
   /**
    * Indicates whether the provided attribute value should be
@@ -90,8 +79,9 @@
    *          a match for the provided assertion value, or
    *          {@code false} if not.
    */
-  public ConditionResult valuesMatch(ByteString attributeValue,
-                                     ByteString assertionValue)
+  @Override
+  public ConditionResult valuesMatch(ByteSequence attributeValue,
+                                     ByteSequence assertionValue)
   {
     if (areEqual(attributeValue, assertionValue))
     {
@@ -122,33 +112,9 @@
    * @return  The hash code generated for the provided attribute
    *          value.
    */
-  public int generateHashCode(AttributeValue attributeValue)
+  public int generateHashCode(ByteSequence attributeValue)
   {
-    try
-    {
-      return attributeValue.getNormalizedValue().hashCode();
-    }
-    catch (Exception e)
-    {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
-
-      try
-      {
-        return attributeValue.getValue().hashCode();
-      }
-      catch (Exception e2)
-      {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e2);
-        }
-
-        return 0;
-      }
-    }
+    return attributeValue.hashCode();
   }
 }
 

--
Gitblit v1.10.0