[ https://issues.apache.org/jira/browse/COLLECTIONS-709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16747504#comment-16747504 ]
Robert Wertman commented on COLLECTIONS-709: -------------------------------------------- Just realized the commit message says COMMONS-706 instead of COMMONS-709. Not sure how important that is to fix. > MultiSet.Entry::getCount() isn't 0 after removing the last element > ------------------------------------------------------------------ > > Key: COLLECTIONS-709 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-709 > Project: Commons Collections > Issue Type: Bug > Affects Versions: 4.1, 4.2 > Reporter: Robert Wertman > Priority: Minor > Fix For: 4.3 > > Time Spent: 0.5h > Remaining Estimate: 0h > > Removing the final element(s) in a MultiSet doesn't set the count on a > MultiSet.Entry to zero. > {code:java} > protected int getCountAfterRemoval(MultiSet<String> multiset) { > MultiSet.Entry<String> entry = multiset.entrySet().iterator().next(); > entry.getCount(); // = 2 > multiset.remove(entry.getElement()); > entry.getCount(); // = 1 > multiset.remove(entry.getElement()); > return entry.getCount(); // Still = 1, should be 0 > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)