Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.google.api.client.util.ArrayMap doesn't support iterator remove #370

Closed
yantzu opened this issue Sep 22, 2017 · 1 comment
Closed

com.google.api.client.util.ArrayMap doesn't support iterator remove #370

yantzu opened this issue Sep 22, 2017 · 1 comment
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@yantzu
Copy link
Contributor

yantzu commented Sep 22, 2017

        Map<String, String> am = new ArrayMap<String, String>();
        am.put("a", "a");
        am.put("b", "b");
        am.put("c", "c");
        Iterator<Map.Entry<String,String>> iter = am.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<String,String> entry = iter.next();
            if(!"nid".equalsIgnoreCase((String)entry.getKey())){
                iter.remove();
            }
        }

throw exception:
Exception in thread "main" java.lang.IllegalArgumentException
at com.google.api.client.util.ArrayMap$EntryIterator.remove(ArrayMap.java:390)

@mattwhisenhunt mattwhisenhunt added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Jan 8, 2018
@mattwhisenhunt
Copy link
Contributor

Fixed by #371

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants