Announcement Announcement Module
Collapse
No announcement yet.
DirContextAdapter.getModificationItems() returns password when password unchanged Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DirContextAdapter.getModificationItems() returns password when password unchanged

    Hello,

    * We have a Person.java pojo containing a password property of type byte[]. The password property is set to and from the Sun Directory Server using a ContextMapper/ContextAssembler implementation.
    * Problem: is DirContextAdapter.getModificationsItems() always returns the password attribute as an updated attribute. This is because the two byte arrays have a different hashcode despite having identical content. Therefore b1[].equals(b2[]) returns false.

    This could be a problem say if:

    * Service subscriber 1 gets a handle to a Person pojo
    * Service subscriber 2 gets a handle to a Person pojo, updates password attribute and saves.
    * Service subscriber 1 updates "golden rating" attribute and saves. The new password is blown away.


    Possible Solution: Perhaps DirContextAdapter.isChanged() should use Arrays.equals(byte[], byte[]) for attributes of type byte[].



    Best Regards,
    Jasper

  • #2
    This is probably something we should fix. Please post a jira issue.

    Comment

    Working...
    X