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


##########
src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java:
##########
@@ -344,6 +344,14 @@ public void remove() {
             it.remove();
         }
 
+        /**
+         * Not supported, as the entries of a {@code MultiValuedMap} are 
read-only.

Review Comment:
   @sharanggupta 
   
   This is wrong.
   
   The new Javadoc overstates what is guaranteed. [`entries()` is 
overridable](/Users/garygregory/git/commons/commons-collections/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java:681),
 and the iterator calls that method dynamically. A subclass could supply 
entries supporting setValue(), allowing the iterator’s method to return 
normally.
   
   Consequently, these new descriptions are too absolute:
   - “Not supported” applies to the default entries.
   - “value Ignored” is misleading: the argument is forwarded.
   - “Never returns normally” is not guaranteed.
   - UnsupportedOperationException “if next() has been called” depends on the 
current entry’s implementation.
   The method should document delegation, with `@param value The new value`, 
`@return The previous value`, and an exception condition such as “if the 
current entry does not support replacing its value.” The default 
implementation’s limitation can then be explained separately.



##########
src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java:
##########
@@ -344,6 +344,14 @@ public void remove() {
             it.remove();
         }
 
+        /**
+         * Not supported, as the entries of a {@code MultiValuedMap} are 
read-only.
+         *
+         * @param value Ignored.

Review Comment:
   Wrong again, see above, it's obviously not ignored if you read the code.



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