sharanggupta commented on code in PR #748:
URL: 
https://github.com/apache/commons-collections/pull/748#discussion_r4308742344


##########
src/main/java/org/apache/commons/collections4/MultiValuedMap.java:
##########
@@ -181,6 +181,11 @@ default MultiValuedMap<V, K> inverted() {
      * <p>
      * A map iterator is an efficient way of iterating over maps. There is no 
need to access the entries collection or use {@code Map.Entry} objects.
      * </p>
+     * <p>
+     * The iterator visits one key-value mapping at a time, so a key with 
several values is returned once per value. The implementations in this
+     * library do not support {@link MapIterator#setValue(Object)} and throw 
an {@link UnsupportedOperationException} from it; to replace a value,

Review Comment:
   Good point, done in 434696441. The paragraph keeps the sentence about a key 
being returned once per value, and now says that some operations of the map 
iterator are optional, such as `remove()` and `setValue(Object)`, and to see 
the documentation of the implementation. The 
`AbstractMultiValuedMap.mapIterator()` Javadoc still says that its iterator 
does not support `setValue`.



##########
src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java:
##########
@@ -344,6 +344,14 @@ public void remove() {
             it.remove();
         }
 
+        /**
+         * Always throws {@link UnsupportedOperationException}, as the entries 
of a multivalued map are read-only.

Review Comment:
   Done in 434696441: it now says "Not supported, as the entries of a {@code 
MultiValuedMap} are read-only.", and the `@throws 
UnsupportedOperationException` reads "if {@link #next()} has been called" 
instead of "Always thrown otherwise".



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to