You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/11/11 08:50:00 UTC

[jira] [Work logged] (COLLECTIONS-734) Encountered an IllegalStateException while traversing with Flat3Map.entrySet()

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

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

                Author: ASF GitHub Bot
            Created on: 11/Nov/19 08:49
            Start Date: 11/Nov/19 08:49
    Worklog Time Spent: 10m 
      Work Description: dota17 commented on pull request #115: [COLLECTIONS-734]Update EntryIterator.remove() to fix bug
URL: https://github.com/apache/commons-collections/pull/115
 
 
   [COLLECTIONS-734](https://issues.apache.org/jira/projects/COLLECTIONS/issues/COLLECTIONS-734?filter=allopenissues)
   In EntryIterator.remove() method, it should call currentEntry.getKey() first, then call currentEntry.setRemoved(true).
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

            Worklog Id:     (was: 341201)
    Remaining Estimate: 0h
            Time Spent: 10m

>  Encountered an IllegalStateException while traversing with Flat3Map.entrySet()
> -------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-734
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-734
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 3.0
>            Reporter: Chen
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
>  Encountered an IllegalStateException while traversing with Flat3Map.entrySet()
> {code:java}
> //代码示例
>     public void testEntrySet() {
>         final Flat3Map<Integer, String> map = new Flat3Map<>();
>         map.put(1, "A");
>         map.put(2, "B");
>         map.put(3, "C");
>         Iterator<Map.Entry<Integer, String>> it = map.entrySet().iterator();        Map.Entry<Integer, String> mapEntry1 = it.next();
>         Map.Entry<Integer, String> mapEntry2 = it.next();
>         Map.Entry<Integer, String> mapEntry3 = it.next();
>         it.remove();        assertEquals(2, map.size());
>     }
> {code}
> Using the above code will generate an IllegalStateException.
> The reason for this problem is that there is a problem with the EntryIterator.remove() method in the Flat3Map java class.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)