paulk-asert commented on code in PR #703:
URL:
https://github.com/apache/commons-collections/pull/703#discussion_r3536438410
##########
src/main/java/org/apache/commons/collections4/Bag.java:
##########
@@ -40,8 +40,34 @@
* In an ideal world, the interface would be changed to fix the problems,
however
* it has been decided to maintain backwards compatibility instead.
* </p>
+ * <p>
+ * The {@link MultiSet} interface, added in version 4.1, provides the same
+ * functionality while complying with the {@link Collection} contract, and
+ * should be preferred for new code. Existing code can migrate as follows,
+ * with the cardinality-respecting behavior preserved through explicitly
+ * named methods:
+ * </p>
+ * <ul>
+ * <li>{@code bag.add(e)} becomes {@code multiSet.add(e)}
+ * (which always returns {@code true}, per the {@code Collection}
contract)</li>
Review Comment:
Yeah, MultiSet is clearer. Changed.
--
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]