{
// No matching rule : compare the raw values
return Arrays.equals( getNormReference(), other.getNormReference() );
}
Normalizer normalizer = equality.getNormalizer();
BinaryValue otherValue = ( BinaryValue ) normalizer.normalize( other );
if ( comparator == null )
{
return Arrays.equals( getNormReference(), otherValue.getNormReference() );
}
else
{
return comparator.compare( getNormReference(), otherValue.getNormReference() ) == 0;
}
}
catch ( LdapException ne )
{
return false;
}
}
}
else
{
// No : check for the other value
if ( other.attributeType != null )
{
// We only have one AT : we will assume that both values are for the
// same AT.
// The values may be both null
if ( isNull() )
{
return other.isNull();
}
try
{
Comparator<byte[]> comparator = other.getLdapComparator();
// Compare normalized values. We have to normalized the other value,
// as it has no AT
MatchingRule equality = other.getAttributeType().getEquality();
if ( equality == null )
{
// No matching rule : compare the raw values
return Arrays.equals( getNormReference(), other.getNormReference() );
}
Normalizer normalizer = equality.getNormalizer();
BinaryValue thisValue = ( BinaryValue ) normalizer.normalize( this );
if ( comparator == null )
{
return Arrays.equals( thisValue.getNormReference(), other.getNormReference() );
}