[ 
https://issues.apache.org/jira/browse/COLLECTIONS-709?focusedWorklogId=187450&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-187450
 ]

ASF GitHub Bot logged work on COLLECTIONS-709:
----------------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Jan/19 23:40
            Start Date: 19/Jan/19 23:40
    Worklog Time Spent: 10m 
      Work Description: grimreaper commented on issue #66: COLLECTIONS-709 Set 
Entry count to 0 after remove
URL: 
https://github.com/apache/commons-collections/pull/66#issuecomment-455824429
 
 
   This seems reasonable to me.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 187450)
    Time Spent: 20m  (was: 10m)

> 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
>          Time Spent: 20m
>  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)

Reply via email to