directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hendy Irawan (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DIRSHARED-142) Value<?> objects containing byte[] of same content should be equals() == true
Date Tue, 30 Oct 2012 16:20:12 GMT

    [ https://issues.apache.org/jira/browse/DIRSHARED-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486982#comment-13486982
] 

Hendy Irawan edited comment on DIRSHARED-142 at 10/30/12 4:18 PM:
------------------------------------------------------------------

It turns out both Value's are schema-aware.

In my case, the culprit happens on this line:

{code}
                if ( !attributeType.equals( other.attributeType ) ) // returns false here
                {
                    return false;
                }
{code}

The first attributeType (coming from LdapNetworkConnection's SchemaManager) is this :

{code}
ATTRIBUTE_TYPE ( 2.5.4.35
 NAME 'userPassword'
 DESC RFC2256/2307: password of user
 EQUALITY octetStringMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
 USAGE userApplications
 X-SCHEMA system
 )
{code}

The second attributeType, coming from new DefaultSchemaManager(), is :

{code}
ATTRIBUTE_TYPE ( 2.5.4.35
 NAME 'userPassword'
 DESC RFC2256/2307: password of user
 EQUALITY octetStringMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
 USAGE userApplications
 )
{code}

The only difference is the LDAP connection one has " X-SCHEMA system", but the rest, even
the OID is the same, so I guess it should be treated the same (?).

so something's probably wrong with AttributeType.equals() ...
                
      was (Author: ceefour):
    In my case, the culprit happens on this line:

                if ( !attributeType.equals( other.attributeType ) ) // returns false here
                {
                    return false;
                }

inspecting both attributeTypes are actually this :

ATTRIBUTE_TYPE ( 2.5.4.35
 NAME 'userPassword'
 DESC RFC2256/2307: password of user
 EQUALITY octetStringMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
 USAGE userApplications
 X-SCHEMA system
 )

so something's probably wrong with AttributeType.equals() ...
                  
> Value<?> objects containing byte[] of same content should be equals() == true
> -----------------------------------------------------------------------------
>
>                 Key: DIRSHARED-142
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-142
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M13
>            Reporter: Hendy Irawan
>
> 1. get two Attribute objects from different sources, e.g. from LDAP connection vs. by
creating an entry programmatically
> 2. attribute1.get().equals( attribute2.get() ) will return false, which is wrong, because
:
> Arrays.equals((byte[])attribute1.get().getNormValue(), (byte[]) attribute2.get().getNormValue())
> will return true in this case.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message