[ https://issues.apache.org/jira/browse/COLLECTIONS-732?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chen updated COLLECTIONS-732: ----------------------------- Summary: Got an UnsupportedOperationException when using MultiValuedMap.MapIterator().setValue() (was: Got an UnsupportedOperationException when altering MultiValuedMap MapIterator setValue) > Got an UnsupportedOperationException when using MultiValuedMap.MapIterator().setValue() > --------------------------------------------------------------------------------------- > > Key: COLLECTIONS-732 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-732 > Project: Commons Collections > Issue Type: Bug > Components: Map > Reporter: Chen > Priority: Major > > copy from https://issues.apache.org/jira/browse/COLLECTIONS-663 > {code:java} > public void testSetValueMapIterator(){ > final ListValuedMap listMap = makeObject(); > List listA = listMap.get((K) "A"); > listA.addAll(0, Arrays.asList((V) "W", (V) "X", (V) "F")); > List listB = listMap.get((K) "B"); > listB.addAll(0, Arrays.asList((V) "Q", (V) "Q", (V) "L")); > assertEquals("{A=[W, X, F], B=[Q, Q, L]}", listMap.toString()); for(MapIterator iterator = listMap.mapIterator(); iterator.hasNext(); ){ > iterator.next(); > V value = iterator.getValue(); > if(value == "F"){ > iterator.setValue((V) "B"); > } > } > assertEquals("{A=[W, X, B], B=[Q, Q, L]}", listMap.toString()); > } > {code} > The test throws a UnsupportedOperationException when altering mapIterato setValue。 > The issue is that the code throws UnsupportedOperationException  in setValue。So,if setValue method is not supported,the Javadoc should comment。 -- This message was sent by Atlassian Jira (v8.3.4#803005)