[jbosscache-issues] [JBoss JIRA] Created: (JBCACHE-1594) Duplicated Keys in PojoCache Set implementation

David Beltrán (JIRA) jira-events at lists.jboss.org
Fri Oct 29 08:26:55 EDT 2010


Duplicated Keys in PojoCache Set implementation 
------------------------------------------------

                 Key: JBCACHE-1594
                 URL: https://jira.jboss.org/browse/JBCACHE-1594
             Project: JBoss Cache
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 1.4.1.SP13
            Reporter: David Beltrán
            Assignee: Manik Surtani


In the class CachedSetImpl  method add, the check with the below code is not correct:

for (Iterator iter = new IteratorImpl(keys); iter.hasNext();)
         if (iter.next() == o)
            return false;


the if line is using == instead of equals.

This have the effect of admitting an object which it's not actually present in the Set but it's equal to other members.

Using contains can be a workaround for this issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jbosscache-issues mailing list