From a90890af51b755a0a6862a32306b1a979d5a9612 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 11 Mar 2014 13:42:19 +0000
Subject: [PATCH] OPENDJ-1368 (CR-3157) Remove AttributeValue

---
 opendj3-server-dev/src/server/org/opends/server/api/AuthenticationPolicyState.java |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/api/AuthenticationPolicyState.java b/opendj3-server-dev/src/server/org/opends/server/api/AuthenticationPolicyState.java
index ed59ee5..eeeccce 100644
--- a/opendj3-server-dev/src/server/org/opends/server/api/AuthenticationPolicyState.java
+++ b/opendj3-server-dev/src/server/org/opends/server/api/AuthenticationPolicyState.java
@@ -24,28 +24,23 @@
  *      Portions Copyright 2011-2014 ForgeRock AS.
  *      Portions Copyright 2014 ForgeRock AS
  */
-
 package org.opends.server.api;
 
-
-
 import java.util.List;
 
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.ConditionResult;
+import org.forgerock.opendj.ldap.ResultCode;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.schema.GeneralizedTimeSyntax;
 import org.opends.server.types.*;
-import org.forgerock.opendj.ldap.ResultCode;
 
 import static org.opends.messages.CoreMessages.*;
 import static org.opends.server.config.ConfigConstants.*;
 import static org.opends.server.util.StaticUtils.*;
 
-
-
 /**
  * The authentication policy context associated with a user's entry, which is
  * responsible for managing the user's account, their password, as well as
@@ -206,8 +201,9 @@
         final AttributeValue v = a.iterator().next();
         try
         {
-          timeValue = GeneralizedTimeSyntax.decodeGeneralizedTimeValue(v
-              .getNormalizedValue());
+          EqualityMatchingRule rule = attributeType.getEqualityMatchingRule();
+          ByteString normValue = rule.normalizeAttributeValue(v.getValue());
+          timeValue = GeneralizedTimeSyntax.decodeGeneralizedTimeValue(normValue);
         }
         catch (final Exception e)
         {

--
Gitblit v1.10.0