The Apache Commons Collections package contains types that extend and augment the Java Collections Framework.
This milestone release requires Java 8 and adds the package `org.apache.commons.collections4.bloomfilter`.
Changes in this version
-----------------------
New features
------------
* COLLECTIONS-852: Add layered Bloom filter clean method #476. Thanks to Claude Warren, Alex Herbert.
* COLLECTIONS-842: Deprecate Lists incompatible with Java 21, add new variant of AbstractLinkedList #485. Thanks to Julian Reschke.
Fixed Bugs
----------
* Deprecate Closure in favor of java.util.function.Consumer. Thanks to Gary Gregory.
* Deprecate Factory in favor of java.util.function.Supplier. Thanks to Gary Gregory.
* Deprecate Predicate in favor of java.util.function.Predicate. Thanks to Gary Gregory.
* Deprecate Transformer in favor of java.util.function.Function. Thanks to Gary Gregory.
* COLLECTIONS-853: Change LayerManager to use List and added generics to LayerdedBloomFilter #481. Thanks to Claude Warren, Alex Herbert, Gary Gregory.
* Fix PMD UselessOverridingMethod in PropertiesFactory.EmptyProperties. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in AbstractHashedMap. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in AbstractLinkedMap. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in CaseInsensitiveMap. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in CollectionUtils. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in DefaultEquator. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in IndexUtils. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in LinkIterator. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in MapUtils. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in PredicateUtils. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in ReferenceMapIterator. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in StringKeyAnalyzer. Thanks to PMD, Gary Gregory.
* Fix PMD UnnecessaryFullyQualifiedName in TransformerUtils. Thanks to PMD, Gary Gregory.
* COLLECTIONS-854: Renaming bloomfilter components and methods as per ticket #492. Thanks to Claude Warren, Alex Herbert, Gary Gregory.
* Fix Java 22 builds through Easymock upgrade #502. Thanks to Gary Gregory.
* COLLECTIONS-855: Fixed hashing calculation as per report #501. Thanks to Claude Warren, Alex Herbert, Gary Gregory.
Changes
-------
* Bump org.apache.commons:commons-parent from 67 to 71 #473, #503. Thanks to Dependabot, Gary Gregory.
* Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #475. Thanks to Dependabot.
* Bump optional commons-codec:commons-codec from 1.16.1 to 1.17.0. Thanks to Dependabot.
* Bump com.google.guava:guava-testlib from 33.1.0-jre to 33.2.1-jre #487, #500. Thanks to Dependabot.
* Bump org.easymock:easymock from 5.2.0 to 5.3.0 #502. Thanks to Dependabot.
For complete information on Apache Commons Collections, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Commons Collections website:
The Apache Commons Collections package contains types that extend and augment the Java Collections Framework.
This milestone release requires Java 8 and adds the package `org.apache.commons.collections4.bloomfilter` for review.
Changes in this version
-----------------------
New features
------------
* COLLECTIONS-843: Implement Layered Bloom filter #402. Thanks to Claude Warren, Alex Herbert, Gary Gregory.
* COLLECTIONS-748: Let org.apache.commons.collections4.properties.[Sorted]PropertiesFactory accept XML input. Thanks to Gary Gregory.
* COLLECTIONS-772: Add private constructor to ArrayUtils; better Javadocs, #195. Thanks to Arturo Bernal, Alex Herbert, Gary Gregory, Bruno P. Kinoshita.
* COLLECTIONS-760: Add tests for MapUtils. Thanks to Isira Seneviratne.
* Test subMap and tailMap #94. Thanks to dota17.
* Add junit for add, remove, setCount and entrySet in the UnmodifiableMultiSetTest #95. Thanks to dota17.
* Add two test cases in UnmodifiableQueueTest #96. Thanks to dota17.
* Update two test cases in AbstractMultiValuedMapTest testPutAll_map1 testPutAll_map2 #97. Thanks to dota17.
* Add a test case for AbstractMultiValuedMapTest testToString() #100. Thanks to dota17.
* Add a test case AbstractMultiValuedMapTest#testMultiValuedMapIterator() #108. Thanks to dota17.
* Add junit for getWithNull and subList in LazyListTest; #103. Thanks to dota17.
* Add test cases to ArrayListValuedHashMapTest; #106. Thanks to dota17.
* Add test cases in UnmodifiableMultiValuedMapTest; #102. Thanks to dota17.
* COLLECTIONS-674: Add CollectionUtils removeRange, removeCount #91. Thanks to dota17.
* Add ListUtils.getFirst() and getLast(). Thanks to Gary Gregory.
* Add singleton ObjectToStringComparator.INSTANCE. Thanks to Gary Gregory.
* Add github/codeql-action.
* COLLECTIONS-811: Add Guava testlib tests. Thanks to Ben Manes.
* COLLECTIONS-728: Add BloomFilter contribution. Thanks to Claude Warren.
* COLLECTIONS-726: Add lambdas function to provide default values in MapUtils #81. Thanks to liuhaozzu, Gary Gregory.
* Add three test cases in UnmodifiableQueueTest #105. Thanks to dota17.
* COLLECTIONS-744: Add org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration). Thanks to Gary Gregory.
* COLLECTIONS-746: Add org.apache.commons.collections4.properties.PropertiesFactory.EMPTY_PROPERTIES. Thanks to Gary Gregory.
* COLLECTIONS-746: Add PropertiesFactory. Thanks to Gary Gregory.
* Add org.apache.commons.collections4.properties.OrderedProperties and OrderedPropertiesFactory. Thanks to Gary Gregory.
* Make AbstractPatriciaTrie public #407. Thanks to Vadim, Claude Warren, Gary Gregory, Alex Herbert.
* Add test cases for indexOf and contains method of ArrayUtils class #215. Thanks to Ajay Kumar Jha, Bruno P. Kinoshita, Claude Warren.
* Add Maven property project.build.outputTimestamp for build reproducibility. Thanks to Gary Gregory.
Fixed Bugs
----------
* COLLECTIONS-780: Use assertThrows V2. Thanks to Arturo Bernal.
* COLLECTIONS-778: Use assertThrows. Thanks to Arturo Bernal.
* COLLECTIONS-771: Fix flaky AbstractMultiValuedMapTest#testToString. Thanks to Xin Tong.
* COLLECTIONS-769: Fix flaky UnmodifiableMultiValuedMapTest. Thanks to Xin (Cynthia) Tong.
* COLLECTIONS-764: Refine javadoc and fix typos. Thanks to XenoAmess.
* COLLECTIONS-765: Update Javadoc of ListIteratorWrapper#remove. Thanks to Tobias Kiecker.
* COLLECTIONS-708: Add hashCode method to CollectionUtils that supports an equator parameter. Thanks to dota17.
* COLLECTIONS-759: Fix checkstyle issues regarding missing newline at end of file, and CRLF vs LF.
* COLLECTIONS-727: A potential misleading comment #82. Thanks to XiangzheXu, XZ-X.
* COLLECTIONS-679: Using existing class in example given in Javadocs. #85. Thanks to David Mollitor, Mikko Maunu.
* COLLECTIONS-729: Add test cases to IteratorUtilsTest #86. Thanks to dota17.
* Fix typos in release notes and Javadoc for AbstractHashedMap and AbstractHashedMapTest #88. Thanks to dota17.
* COLLECTIONS-740: Add missing @throws comment for SwitchTransformer.switchTransformer. #124. Thanks to Pengyu Nie.
* COLLECTIONS-739: Fix inconsistent @throws comments in DefaultedMap #123. Thanks to Pengyu Nie.
* Fix links to release notes and update contents for 4.4 #127. Thanks to Dominik Stadler.
* Fix checkstyle syntax (was scope, is now accessModifiers) via PR #235. Thanks to Jin Xu.
* COLLECTIONS-786: Fix PassiveExpiringMap documentation for methods that involve accessing the entire map. Thanks to vandrewskis.
* SortedProperties should sort entrySet() as well as keys() #256. Thanks to Michael Berry.
* COLLECTIONS-796: SetUniqueList.createSetBasedOnList doesn't add list elements to return value. Thanks to Clemens Kurz.
* COLLECTIONS-799: UnmodifiableNavigableSet can be modified by pollFirst() and pollLast(). Thanks to Stefano Cordio.
* Use Java 8 and method reference. #274. Thanks to Arturo Bernal.
* COLLECTIONS-788: Use Java 8 features #228. Thanks to Arturo Bernal.
* COLLECTIONS-807: Upgraded org.junit.Test to org.junit.jupiter.api.Test #295, #304. Thanks to Pradeesh Kumar, samabcde.
* COLLECTIONS-802: ReferenceMap iterator remove violates contract #300. Thanks to samabcde, Ben Manes.
* COLLECTIONS-812: Fix flaky EmptyPropertiesTest#testSave. Thanks to Ng Tsz Sum.
* Use java.lang.Objects#equals; eliminate a couple of nulls #307. Thanks to Steve Bosman.
* COLLECTIONS-814: CollectionUtils.removeAll() not throwing NPE #340. Thanks to angusdev.
* Fix minor typos #323 Thanks to Marc Wrobel.
* AbstractReferenceMap.SoftRef implements hashCode() but not equals(). Thanks to Gary Gregory.
* AbstractReferenceMap.WeakRef implements hashCode() but not equals(). Thanks to Gary Gregory.
* Use Java style array decelerations #362. Thanks to Arturo Bernal.
* COLLECTIONS-806: Remove use of JUnit4 junit.framework.Test class #371. Thanks to Piyush Sagar.
* COLLECTIONS-839: Migrate Map tests to JUnit 5 assertions #391. Thanks to Sam Ng, Gary Gregory, Bruno P. Kinoshita.
* COLLECTIONS-835: Fix links in javadoc and documentations #325. Thanks to Marc Wrobel.
* Correct test of Collection toArray(Object[]) vs toArray() to optionally ignore array order.
Ordering is not specified for some collections such as Bags. Thanks to Partha Protim Paul.
* COLLECTIONS-836: Correct test of BidiMap to optionally ignore testing the key set matches the values order.
Ordering is not specified for some BidiMaps such as DualHashBidiMaps. Thanks to Anant Dahiya.
* COLLECTIONS-737: Return 0 immediately if the given iterable is null in IterableUtils#size. Update tests. Thanks to Prodigysov.
* COLLECTIONS-697: JavaDoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented Thanks to Ranjan George.
* Fill in some map test cases #104. Thanks to dota17.
* COLLECTIONS-738: Remove the redundant assertNull in IterableUtilsTest.find and update Javadocs. Thanks to Pengyu Nie.
* COLLECTIONS-724: Simplify two remove-if loops #77. Thanks to Eitan Adler.
* Fix inconsistent @throws comments in ListOrderedSet #125. Thanks to Chen.
* COLLECTIONS-704: Update size to capacity for GrowthList #90. Thanks to dota17.
* TransformedSortedBagTest should work with TransformedSortedBag, not TransformedBag #98. Thanks to dota17.
* Remove the parentheses in the error message in CircularFifoQueue #107. Thanks to dota17.
* COLLECTIONS-747: MultiKey.getKeys class cast exception. Thanks to Gary Gregory, Walter Laan.
* COLLECTIONS-759: Use newline at end of file, and convert to Unix (LF instead of CRLF) fixing checkstyle #147. Thanks to Bruno P. Kinoshita.
* Fixed the typo and deal the NPE with Objects.requireNonNull #118. Thanks to Chen.
* COLLECTIONS-757: Javadoc BidiMap classes #146. Thanks to Chen.
* COLLECTIONS-773: Assert ensureCapacity #198. Thanks to Martin Monperrus.
* COLLECTIONS-775: Fix flaky CollectionUtilsTest.getFromMap() #200. Thanks to Xin Tong, Bruno P. Kinoshita, Gary Gregory.
* Minor Improvements #203, #208. Thanks to Arturo Bernal.
* Fix typo erroring -> erring #202. Thanks to EruDev.
* COLLECTIONS-734: Encountered an IllegalStateException while traversing with Flat3Map.entrySet(). #115. Thanks to Chen.
* Better NPE messages in CollectionUtils with Objects.requireNonNull #117. Thanks to Chen, Bruno P. Kinoshita, Gary Gregory, Michael Osipov.
* Improve MapUtils with the null checks, add JUnit for it and add Javadoc for the parameter indent. #126. Thanks to Chen.
* COLLECTIONS-793: Simplify Assertion. Thanks to Arturo Bernal.
* [StepSecurity] ci: Harden GitHub Actions #401. Thanks to step-security-bot, Gary Gregory.
* Fix punctuation and minor Javadoc issues #409. Thanks to Martin Wiesner, Bruno P. Kinoshita, Gary Gregory.
* Deprecate IterableUtils 0-argument constructor. Thanks to Gary Gregory.
* COLLECTIONS-850: Tests in org.apache.commons.collections4.multimap should not depend on map iteration order, see also #429. Thanks to Gary Gregory, Anirudh Madhavan.
* COLLECTIONS-850: Reimplement FixedOrderComparator#equals() and hashCode(), see also #392. Thanks to Gary Gregory, Saurabh Rahate.
Changes
-------
* Bump org.easymock:easymock from 4.0.2 to 5.2.0 #352, #355, #375, #414. Thanks to Gary Gregory, Dependabot.
* Bump actions/cache. Thanks to Dependabot, Gary Gregory.
* Bump actions/setup-java. Thanks to Dependabot, Gary Gregory.
* Bump actions/checkout. Thanks to Dependabot, Gary Gregory.
* Bump codecov/codecov-action. Thanks to Dependabot.
* Bump Apache commons-parent from 48 to 67. Thanks to Gary Gregory, Dependabot.
* Bump Jacoco from 0.8.4 to 0.8.8. Thanks to Gary Gregory.
* Bump tests from Apache Commons Lang 3.9 to 3.11. Thanks to Gary Gregory.
* Bump maven-checkstyle-plugin 3.1.0 to 3.2.1 #379. Thanks to Gary Gregory.
* Bump checkstyle from 8.29 to 9.3. Thanks to Gary Gregory.
* COLLECTIONS-754: Bump to JUnit v5.6.2 #136. Thanks to John Patrick.
* COLLECTIONS-777: Migrate JUnit 4.12 to 5.9.1 #324, #338. Thanks to John Patrick, Gary Gregory, Dependabot.
* COLLECTIONS-753: Bump Hamcrest to 2.2. Thanks to John Patrick.
* Remove deprecated sudo setting. #161. Thanks to dengliming.
* Bump tests from commons-io:commons-io 2.6 to 2.16.0 #180, #469. Thanks to Gary Gregory.
* Bump maven-pmd-plugin from 3.12.0 to 3.19.0 #167, #196, #253, #311, #334. Thanks to Dependabot, Gary Gregory.
* Bump optional commons-codec:commons-codec from 1.14 to 1.16.1. Thanks to Gary Gregory.
* Bump commons.junit.version from 5.6.2 to 5.8.2 #181 #213 #236 #252 #254 #268. Thanks to Dependabot.
* COLLECTIONS-774: Bump maven-antrun-plugin from 1.8 to 3.1.0 #170, #303. Thanks to Dependabot.
* Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2 #211. Thanks to Dependabot.
* COLLECTIONS-779: Migrate assert to Assertions #209. Thanks to Arturo Bernal, Gary Gregory.
* COLLECTIONS-781: Add and use CollectionUtils.INDEX_NOT_FOUND constant. Thanks to Arturo Bernal, Gary Gregory.
* Bump commons-lang3 from 3.11 to 3.14.0. Thanks to Dependabot, Gary Gregory.
* COLLECTIONS-785: Add new variables to oac.collections4.CollectionUtils and use them in the code base. Thanks to Arturo Bernal.
* Bump easymock from 4.2 to 4.3 #226. Thanks to Dependabot.
* Bump maven-pmd-plugin from 3.15.0 to 3.16.0 #286. Thanks to Dependabot.
* Bump commons-parent from 52 to 58 #299, #368, #373, #393. Thanks to Dependabot, Gary Gregory.
* Bump japicmp from 0.15.4 to 0.16.0. Thanks to Dependabot.
* Bump pmd from 6.46.0 to 6.52.0 #318, #327, #333, #347. Thanks to Dependabot, Gary Gregory.
* Bump guava-testlib from 31.1-jre to 33.1.0-jre #394, #395, #404, #405, #411, #423, #438, #462. Thanks to Dependabot.
For complete information on Apache Commons Collections, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Commons Collections website:
* COLLECTIONS-681: Add test for MultiSetUtils Thanks to Stephan Fuhrmann.
* COLLECTIONS-658: Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility.
* COLLECTIONS-589: Add null-safe MapUtils.size(Map<?, ?>) method. Thanks to Gary Gregory.
* COLLECTIONS-586: PatriciaTrie prefixMap clear throws NullPointerException. Thanks to Shailender Bathula, Gary Gregory.
* COLLECTIONS-654: Add class SortedProperties to sort keys.
* COLLECTIONS-668: Add CollectionUtils containsAny method for primitive array: org.apache.commons.collections4.CollectionUtils.containsAny(Collection<?>, T...). Thanks to Gary Gregory.
* COLLECTIONS-575: Synchronized queue wrapper in QueueUtils. Thanks to Guram Savinov, Grzegorz Rożniecki, Bruno P. Kinoshita, Gary Gregory.
* COLLECTIONS-670: Add org.apache.commons.collections4.IteratorUtils.first(Iterator). Thanks to Gary Gregory.
* COLLECTIONS-671: Add org.apache.commons.collections4.IterableUtils.first(Iterable). Thanks to Gary Gregory.
Fixed Bugs
----------
* COLLECTIONS-599: HashEntry array object naming data initialized with double the size during deserialization. Thanks to Tejas Patel, Saleem Akbar, Gary Gregory.
* COLLECTIONS-662: Unit tests MapUtilsTest and ListIteratorWrapperTest no longer fail on Java 9. Thanks to Vamsi Kavuri.
* COLLECTIONS-661: Intermittent test failures in Windows for HashSetValuedHashMap.
* COLLECTIONS-660: Uncomment test in AbstractMapTest regarding LRUMap equals.
* COLLECTIONS-656: Fix site build on Java 8.
* COLLECTIONS-653: Update Javadoc to Build on Java 1.8.
* COLLECTIONS-606: Build status, Coverage status and Maven central weren't in README.md Thanks to Vamsi Kavuri.
* COLLECTIONS-594: Website spelling error: MultiValuedMapList. Thanks to Javen O'Neal.
* COLLECTIONS-597: Correction of Javadoc for org.apache.commons.collections4.functors.CatchAndRethrowClosure. Thanks to Enrique.
* COLLECTIONS-678: The verification of unsupported iterator methods is not complete. Thanks to Oscar Luis Vera Pérez.
* COLLECTIONS-673: ListUtils.partition potential integer overflow. Thanks to John Mark, Stephan Fuhrmann.
Changes
-------
* COLLECTIONS-602: Improve efficiency of DefaultedMap.get. Thanks to John Mark.
* COLLECTIONS-603: Small improvements for generics, conditional statements, and warnings suppressions. Thanks to Artem Konovalov.
* COLLECTIONS-655: Update platform from Java 6 to Java 7.
* COLLECTIONS-666: org.apache.commons.collections4.ListUtils.union(List, List) should pre-allocate result list. Thanks to BELUGA BEHR.
* COLLECTIONS-669: Update org.apache.commons.collections4.CollectionUtils.addAll(Collection<C>, C[]) to addAll(Collection<C>, C...). Thanks to BELUGA BEHR, Gary Gregory.