You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/07/10 13:01:59 UTC
(commons-collections) 05/05: Merge remote-tracking branch 'origin/master'
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit c23b20d0842d5a18f312b7417444058c27abd966
Merge: ad382383e fb2b16456
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jul 10 08:57:42 2026 -0400
Merge remote-tracking branch 'origin/master'
src/changes/changes.xml | 1 +
.../commons/collections4/bag/AbstractMapBag.java | 17 +++++++++++------
.../collections4/multiset/AbstractMapMultiSet.java | 15 +++++++++------
.../apache/commons/collections4/bag/HashBagTest.java | 20 ++++++++++++++++++++
.../collections4/multiset/HashMultiSetTest.java | 18 ++++++++++++++++++
5 files changed, 59 insertions(+), 12 deletions(-)
diff --cc src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
index b54877f39,2b2245e2d..e8146bc20
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
@@@ -277,13 -277,13 +277,13 @@@ public abstract class AbstractMapMultiS
}
}
- /** The map to use to store the data */
+ /** The map to use to store the data. */
private transient Map<E, MutableInteger> map;
- /** The current total size of the multiset. */
- private transient int size;
+ /** The current total size of the multiset; kept exact past {@link Integer#MAX_VALUE}, {@link #size()} saturates */
+ private transient long size;
- /** The modification count for fail fast iterators */
+ /** The modification count for fail fast iterators. */
private transient int modCount;
/**
@@@ -523,9 -525,10 +525,10 @@@
}
/**
- * Returns the number of elements in this multiset.
+ * Returns the number of elements in this multiset, or {@code Integer.MAX_VALUE}
+ * if the multiset contains more than {@code Integer.MAX_VALUE} elements.
*
- * @return current size of the multiset
+ * @return current size of the multiset.
*/
@Override
public int size() {