Rudi Wijaya created DIRAPI-123:
----------------------------------
Summary: o.a.d.api.ldap.model.message.ModifyRequestImpl.remove()
with 0 elements should be a no-op
Key: DIRAPI-123
URL: https://issues.apache.org/jira/browse/DIRAPI-123
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() :
{code}
MessageType : MODIFY_REQUEST
Message ID : -1
Modify Request
Object : 'uid=hendy,ou=users,dc=aksimata,dc=com'
Modification[0]
Operation : add
Modification
mail: [email protected]
org.apache.directory.api.ldap.model.message.ModifyRequestImpl@57ba462
{code}
After calling ModifyRequestImpl.remove("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: [email protected]
Modification[1]
Operation : delete
Modification
mail: (null)
org.apache.directory.api.ldap.model.message.ModifyRequestImpl@152f7a24
{code}
The expected behavior should be : since it's removing a variable number of
attribute values, and the number of values is 0, hence it's a no-op.
Also, any attempt to remove "null" should be an error: (haven't checked yet)
{code}
modifyRequest.remove("mail", new String[] { null });
modifyRequest.remove("mail", new String[] { null, null });
modifyRequest.remove("mail", null);
modifyRequest.remove("mail", null, null);
{code}
--
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