Rudi Wijaya created DIRAPI-124:
----------------------------------

             Summary: o.a.d.api.ldap.model.message.ModifyRequestImpl.add() with 
0 elements should be a no-op 
                 Key: DIRAPI-124
                 URL: https://issues.apache.org/jira/browse/DIRAPI-124
             Project: Directory Client API
          Issue Type: Bug
    Affects Versions: 1.0.0-M15
            Reporter: Rudi Wijaya


 Before call to ModifyRequestImpl.add() :

{code}
MessageType : MODIFY_REQUEST
Message ID : -1
    Modify Request
        Object : 'uid=hendy,ou=users,dc=aksimata,dc=com'
org.apache.directory.api.ldap.model.message.ModifyRequestImpl@5ee989e2
{code}

After calling ModifyRequestImpl.add("mail", new String[] {}) :

{code}
MessageType : MODIFY_REQUEST
Message ID : -1
    Modify Request
        Object : 'uid=hendy,ou=users,dc=aksimata,dc=com'
            Modification[0]
                Operation :  add
                Modification
mail: (null)
mail: [email protected]
org.apache.directory.api.ldap.model.message.ModifyRequestImpl@57ba462
{code}

The expected behavior should be : since it's adding a variable number of 
attribute values, and the number of values is 0, hence it's a no-op.

Also, any attempt to add "null" should be an error: (haven't checked yet)

{code}
modifyRequest.add("mail", new String[] { null });
modifyRequest.addmail", new String[] { null, null });
modifyRequest.add(mail", null);
modifyRequest.add("mail", null, null);
{code} 

This is related to #DIRAPI-123 but since I can't edit existing issues I create 
a new ticket.

--
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

Reply via email to