You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/12/16 01:47:45 UTC

svn commit: r891085 - /directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java

Author: elecharny
Date: Wed Dec 16 00:47:45 2009
New Revision: 891085

URL: http://svn.apache.org/viewvc?rev=891085&view=rev
Log:
Fixed the value comparisons : the MatchingRule was not used to normalize values before the comparison.

Modified:
    directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java?rev=891085&r1=891084&r2=891085&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java Wed Dec 16 00:47:45 2009
@@ -422,7 +422,15 @@
                 }
                 else
                 {
-                    return comparator.compare( getNormalizedValue(), other.getNormalizedValue() ) == 0;
+                    if ( isNormalized() )
+                    {
+                        return comparator.compare( getNormalizedValue(), other.getNormalizedValue() ) == 0;
+                    }
+                    else
+                    {
+                        Normalizer normalizer = attributeType.getEquality().getNormalizer();
+                        return comparator.compare( normalizer.normalize( get() ), normalizer.normalize( other.get() ) ) == 0;
+                    }
                 }
             }
             catch ( NamingException ne )