From bed78c121f8854abaf6e384ba58d1437f42613a2 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 10 Oct 2025 12:01:07 +0000
Subject: [PATCH 001/110] Bump github/codeql-action from 3.30.6 to 4.30.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.6 to 4.30.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/64d10c13136e1c5bce3e5fbde8d4906eeaafc885...e296a935590eb16afc0c0108289f68c87e2a89a5)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 4.30.7
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 6ab048dec7..0c8beaed61 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
+ uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
+ uses: github/codeql-action/autobuild@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
+ uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 6ae094550f..fddd1b2267 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
+ uses: github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # 3.29.5
with:
sarif_file: results.sarif
From 19119be9ab677d1b4b3b205fa03f5f0b28c93e9b Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Fri, 10 Oct 2025 14:00:02 -0400
Subject: [PATCH 002/110] [COLLECTIONS-877]
OrderedProperties.stringPropertyNames() returns an unordered set
---
src/changes/changes.xml | 1 +
.../properties/OrderedProperties.java | 25 +++++++++++++++++++
.../properties/OrderedPropertiesTest.java | 14 +++++++++++
3 files changed, 40 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1c12696ad0..d3b79e20b8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -35,6 +35,7 @@
Calling SetUtils.union on multiple instances of SetView causes JVM to hangImprove IteratorUtils.chainedIterator() performance.Fix UselessOverridingMethod in org.apache.commons.collections4.properties.PropertiesFactory.
+ OrderedProperties.stringPropertyNames() returns an unordered set.Add generics to UnmodifiableIterator for the wrapped type.
diff --git a/src/main/java/org/apache/commons/collections4/properties/OrderedProperties.java b/src/main/java/org/apache/commons/collections4/properties/OrderedProperties.java
index fb39e749d1..909ec5d82d 100644
--- a/src/main/java/org/apache/commons/collections4/properties/OrderedProperties.java
+++ b/src/main/java/org/apache/commons/collections4/properties/OrderedProperties.java
@@ -84,6 +84,26 @@ public Set
*
* @param iterator an iterator over the collection, which should already point
* to the element at index {@code start} within the collection
@@ -949,6 +952,7 @@ public void add(final int index, final E obj) {
*
* This method runs in O(n + log m) time, where m is
* the size of this list and n is the size of {@code c}.
+ *
*
* @param c the collection to be added to this list
* @return {@code true} if this list changed as a result of the call
From 5fbdf9222830b82447f0ad2acf935c0cae350039 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 12 Dec 2025 08:16:46 -0500
Subject: [PATCH 059/110] Bump github/codeql-action from 4.31.7 to 4.31.8
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index c928d7b1b4..8223940b02 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
+ uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
+ uses: github/codeql-action/autobuild@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
+ uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 7405a82abd..ebc1751c52 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
+ uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
with:
sarif_file: results.sarif
From 9949ab1df31c4bf5c6c3ae51c1831ffbdb2fef9a Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 12 Dec 2025 14:27:00 -0500
Subject: [PATCH 060/110] Bump actions/cache from 4.3.0 to 5.0.1
---
.github/workflows/codeql-analysis.yml | 2 +-
.github/workflows/maven.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 8223940b02..b1cc918df2 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -48,7 +48,7 @@ jobs:
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
+ - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index a9af1283e7..e522895d12 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
+ - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
From de7f14bf44c9eebf1314c69feeabadb4759c6261 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 13 Dec 2025 08:32:07 -0500
Subject: [PATCH 061/110] Fix malformed Javadoc comments
---
src/changes/changes.xml | 1 +
.../commons/collections4/ClosureUtils.java | 26 ++++++-------
.../commons/collections4/CollectionUtils.java | 20 +++++-----
.../commons/collections4/FactoryUtils.java | 14 +++----
.../commons/collections4/FluentIterable.java | 15 ++++----
.../commons/collections4/IterableUtils.java | 4 +-
.../commons/collections4/IteratorUtils.java | 22 +++++------
.../apache/commons/collections4/MapUtils.java | 26 ++++++-------
.../commons/collections4/PredicateUtils.java | 36 +++++++++---------
.../collections4/TransformerUtils.java | 38 +++++++++----------
.../collections4/bag/package-info.java | 14 +++----
.../collections4/bidimap/package-info.java | 10 ++---
.../bloomfilter/LayeredBloomFilter.java | 2 +-
.../collections4/collection/package-info.java | 15 +++++---
.../collections4/keyvalue/package-info.java | 7 ++--
.../commons/collections4/map/Flat3Map.java | 10 ++---
.../commons/collections4/map/MultiKeyMap.java | 6 +--
.../collections4/map/SingletonMap.java | 6 +--
.../collections4/map/package-info.java | 38 ++++++++++---------
.../collections4/multimap/package-info.java | 10 +++--
.../collections4/multiset/package-info.java | 10 +++--
.../commons/collections4/package-info.java | 2 +-
.../collections4/queue/package-info.java | 10 +++--
.../collections4/set/package-info.java | 16 +++++---
.../collections4/splitmap/package-info.java | 2 +-
.../trie/AbstractPatriciaTrie.java | 18 ++++-----
.../collections4/trie/package-info.java | 7 +++-
27 files changed, 202 insertions(+), 183 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 01f289224e..3ccd92dac4 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -41,6 +41,7 @@
Fix SortedProperties.stringPropertyNames() returned an unsorted Set.Fix SortedProperties.forEach() called its consumer out of order.Fix Apache RAT plugin console warnings.
+ Fix malformed Javadoc comments.Add generics to UnmodifiableIterator for the wrapped type.Add a Maven benchmark profile for JMH.
diff --git a/src/main/java/org/apache/commons/collections4/ClosureUtils.java b/src/main/java/org/apache/commons/collections4/ClosureUtils.java
index d65472f177..4ad525c4dd 100644
--- a/src/main/java/org/apache/commons/collections4/ClosureUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ClosureUtils.java
@@ -35,25 +35,25 @@
* {@code ClosureUtils} provides reference implementations and utilities
* for the Closure functor interface. The supplied closures are:
*
- *
Invoker - invokes a method on the input object
- *
For - repeatedly calls a closure for a fixed number of times
- *
While - repeatedly calls a closure while a predicate is true
- *
Chained - chains two or more closures together
- *
If - calls one closure or another based on a predicate
- *
Switch - calls one closure based on one or more predicates
- *
SwitchMap - calls one closure looked up from a Map
- *
Transformer - wraps a Transformer as a Closure
- *
NOP - does nothing
- *
Exception - always throws an exception
+ *
Invoker - invokes a method on the input object
+ *
For - repeatedly calls a closure for a fixed number of times
+ *
While - repeatedly calls a closure while a predicate is true
+ *
Chained - chains two or more closures together
+ *
If - calls one closure or another based on a predicate
+ *
Switch - calls one closure based on one or more predicates
+ *
SwitchMap - calls one closure looked up from a Map
+ *
Transformer - wraps a Transformer as a Closure
+ *
NOP - does nothing
+ *
Exception - always throws an exception
*
*
* Since v4.1 only closures which are considered to be safe are
* Serializable. Closures considered to be unsafe for serialization are:
*
*
- *
Invoker
- *
For
- *
While
+ *
Invoker
+ *
For
+ *
While
*
*
* @since 3.0
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index b782bbf267..d28636ee9c 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -1838,11 +1838,11 @@ public static super O>> R selectRejected(final Iterab
* This method can handles objects as follows
*
*
- *
Collection - the collection size
- *
Map - the map size
- *
Array - the array size
- *
Iterator - the number of elements remaining in the iterator
- *
Enumeration - the number of elements remaining in the enumeration
+ *
Collection - the collection size
+ *
Map - the map size
+ *
Array - the array size
+ *
Iterator - the number of elements remaining in the iterator
+ *
Enumeration - the number of elements remaining in the enumeration
*
*
* @param object the object to get the size of, may be null
@@ -1887,11 +1887,11 @@ public static int size(final Object object) {
* This method can handles objects as follows
*
*
- *
Collection - via collection isEmpty
- *
Map - via map isEmpty
- *
Array - using array size
- *
Iterator - via hasNext
- *
Enumeration - via hasMoreElements
+ *
Collection - via collection isEmpty
+ *
Map - via map isEmpty
+ *
Array - using array size
+ *
Iterator - via hasNext
+ *
Enumeration - via hasMoreElements
*
*
* Note: This method is named to avoid clashing with
diff --git a/src/main/java/org/apache/commons/collections4/FactoryUtils.java b/src/main/java/org/apache/commons/collections4/FactoryUtils.java
index 74628112ee..b80c7faf56 100644
--- a/src/main/java/org/apache/commons/collections4/FactoryUtils.java
+++ b/src/main/java/org/apache/commons/collections4/FactoryUtils.java
@@ -25,19 +25,19 @@
* {@code FactoryUtils} provides reference implementations and utilities
* for the Factory functor interface. The supplied factories are:
*
- *
Prototype - clones a specified object
- *
Instantiate - creates objects using reflection
- *
Constant - always returns the same object
- *
Null - always returns null
- *
Exception - always throws an exception
+ *
Prototype - clones a specified object
+ *
Instantiate - creates objects using reflection
+ *
Constant - always returns the same object
+ *
Null - always returns null
+ *
Exception - always throws an exception
*
*
* Since v4.1 only factories which are considered to be safe are
* Serializable. Factories considered to be unsafe for serialization are:
*
fluent methods which return a new {@code FluentIterable} instance,
- * providing a view of the original iterable (for example filter(Predicate));
+ * providing a view of the original iterable (for example filter(Predicate));
*
conversion methods which copy the FluentIterable's contents into a
- * new collection or array (for example toList());
+ * new collection or array (for example toList());
*
utility methods which answer questions about the FluentIterable's
- * contents (for example size(), anyMatch(Predicate)).
- *
+ * contents (for example size(), anyMatch(Predicate)).
*
*
* The following example outputs the first 3 even numbers in the range [1, 10]
@@ -218,8 +217,8 @@ public Enumeration asEnumeration() {
* Example: natural ordering
*
*
- *
this contains elements [1, 3, 5, 7]
- *
other contains elements [2, 4, 6, 8]
+ *
this contains elements [1, 3, 5, 7]
+ *
other contains elements [2, 4, 6, 8]
*
*
* The returned iterable will traverse the elements in the following
@@ -243,8 +242,8 @@ public FluentIterable collate(final Iterable extends E> other) {
* Example: descending order
*
*
- *
this contains elements [7, 5, 3, 1]
- *
other contains elements [8, 6, 4, 2]
+ *
this contains elements [7, 5, 3, 1]
+ *
other contains elements [8, 6, 4, 2]
*
*
* The returned iterable will traverse the elements in the following
diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java
index 0a2e1d224c..d36a1317a3 100644
--- a/src/main/java/org/apache/commons/collections4/IterableUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java
@@ -39,10 +39,10 @@
*
*
*
All decorator methods are not null-safe for the provided Iterable argument; for example, they will throw a {@link NullPointerException} if a
- * null Iterable is passed as argument.
+ * null Iterable is passed as argument.
*
All other utility methods are null-safe for the provided Iterable argument; for example, they will treat a null Iterable the same way as an empty one.
* For other arguments which are null, a {@link Predicate} will result in a {@link NullPointerException}. Exception: passing a null {@link Comparator} is
- * equivalent to a Comparator with natural ordering.
+ * equivalent to a Comparator with natural ordering.
*
*
* @since 4.1
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index ac11f21abc..41858a7af8 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -866,17 +866,17 @@ static E get(final Iterator iterator, final int index, final IntFunction<
* This method can handle objects as follows
*
*
- *
null - empty iterator
- *
Iterator - returned directly
- *
Enumeration - wrapped
- *
Collection - iterator from collection returned
- *
Map - values iterator returned
- *
Dictionary - values (elements) enumeration returned as iterator
- *
array - iterator over array returned
- *
object with iterator() public method accessed by reflection
- *
object - singleton iterator
- *
NodeList - iterator over the list
- *
Node - iterator over the child nodes
+ *
null - empty iterator
+ *
Iterator - returned directly
+ *
Enumeration - wrapped
+ *
Collection - iterator from collection returned
+ *
Map - values iterator returned
+ *
Dictionary - values (elements) enumeration returned as iterator
+ *
array - iterator over array returned
+ *
object with iterator() public method accessed by reflection
+ *
object - singleton iterator
+ *
NodeList - iterator over the list
+ *
Node - iterator over the child nodes
*
*
* @param obj the object to convert to an iterator
diff --git a/src/main/java/org/apache/commons/collections4/MapUtils.java b/src/main/java/org/apache/commons/collections4/MapUtils.java
index 2f52dd9ba1..800199dfe2 100644
--- a/src/main/java/org/apache/commons/collections4/MapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MapUtils.java
@@ -60,19 +60,19 @@
*
*
*
*
* @since 1.0
diff --git a/src/main/java/org/apache/commons/collections4/PredicateUtils.java b/src/main/java/org/apache/commons/collections4/PredicateUtils.java
index bce080858b..0229f05037 100644
--- a/src/main/java/org/apache/commons/collections4/PredicateUtils.java
+++ b/src/main/java/org/apache/commons/collections4/PredicateUtils.java
@@ -45,24 +45,24 @@
* {@code PredicateUtils} provides reference implementations and utilities
* for the Predicate functor interface. The supplied predicates are:
*
- *
Invoker - returns the result of a method call on the input object
- *
InstanceOf - true if the object is an instanceof a class
- *
Equal - true if the object equals() a specified object
- *
Identity - true if the object == a specified object
- *
Null - true if the object is null
- *
NotNull - true if the object is not null
- *
Unique - true if the object has not already been evaluated
- *
And/All - true if all of the predicates are true
- *
Or/Any - true if any of the predicates is true
- *
Either/One - true if only one of the predicate is true
- *
Neither/None - true if none of the predicates are true
- *
Not - true if the predicate is false, and vice versa
- *
Transformer - wraps a Transformer as a Predicate
- *
True - always return true
- *
False - always return false
- *
Exception - always throws an exception
- *
NullIsException/NullIsFalse/NullIsTrue - check for null input
- *
Transformed - transforms the input before calling the predicate
+ *
Invoker - returns the result of a method call on the input object
+ *
InstanceOf - true if the object is an instanceof a class
+ *
Equal - true if the object equals() a specified object
+ *
Identity - true if the object == a specified object
+ *
Null - true if the object is null
+ *
NotNull - true if the object is not null
+ *
Unique - true if the object has not already been evaluated
+ *
And/All - true if all of the predicates are true
+ *
Or/Any - true if any of the predicates is true
+ *
Either/One - true if only one of the predicate is true
+ *
Neither/None - true if none of the predicates are true
+ *
Not - true if the predicate is false, and vice versa
+ *
Transformer - wraps a Transformer as a Predicate
+ *
True - always return true
+ *
False - always return false
+ *
Exception - always throws an exception
+ *
NullIsException/NullIsFalse/NullIsTrue - check for null input
+ *
Transformed - transforms the input before calling the predicate
*
*
* All the supplied predicates are Serializable.
diff --git a/src/main/java/org/apache/commons/collections4/TransformerUtils.java b/src/main/java/org/apache/commons/collections4/TransformerUtils.java
index 9fd16482ab..3b1bdceabe 100644
--- a/src/main/java/org/apache/commons/collections4/TransformerUtils.java
+++ b/src/main/java/org/apache/commons/collections4/TransformerUtils.java
@@ -40,31 +40,31 @@
* {@code TransformerUtils} provides reference implementations and
* utilities for the Transformer functor interface. The supplied transformers are:
*
- *
Invoker - returns the result of a method call on the input object
- *
Clone - returns a clone of the input object
- *
Constant - always returns the same object
- *
Closure - performs a Closure and returns the input object
- *
Predicate - returns the result of the predicate as a Boolean
- *
Factory - returns a new object from a factory
- *
Chained - chains two or more transformers together
- *
If - calls one transformer or another based on a predicate
- *
Switch - calls one transformer based on one or more predicates
- *
SwitchMap - calls one transformer looked up from a Map
- *
Instantiate - the Class input object is instantiated
- *
Map - returns an object from a supplied Map
- *
Null - always returns null
- *
NOP - returns the input object, which should be immutable
- *
Exception - always throws an exception
- *
StringValue - returns a {@link String} representation of the input object
+ *
Invoker - returns the result of a method call on the input object
+ *
Clone - returns a clone of the input object
+ *
Constant - always returns the same object
+ *
Closure - performs a Closure and returns the input object
+ *
Predicate - returns the result of the predicate as a Boolean
+ *
Factory - returns a new object from a factory
+ *
Chained - chains two or more transformers together
+ *
If - calls one transformer or another based on a predicate
+ *
Switch - calls one transformer based on one or more predicates
+ *
SwitchMap - calls one transformer looked up from a Map
+ *
Instantiate - the Class input object is instantiated
+ *
Map - returns an object from a supplied Map
+ *
Null - always returns null
+ *
NOP - returns the input object, which should be immutable
+ *
Exception - always throws an exception
+ *
StringValue - returns a {@link String} representation of the input object
*
*
* Since v4.1 only transformers which are considered to be safe are
* Serializable. Transformers considered to be unsafe for serialization are:
*
*
- *
Invoker
- *
Clone
- *
Instantiate
+ *
Invoker
+ *
Clone
+ *
Instantiate
*
*
* @since 3.0
diff --git a/src/main/java/org/apache/commons/collections4/bag/package-info.java b/src/main/java/org/apache/commons/collections4/bag/package-info.java
index d28e0b1974..cb8284af79 100644
--- a/src/main/java/org/apache/commons/collections4/bag/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/bag/package-info.java
@@ -23,18 +23,18 @@
* The following implementations are provided in the package:
*
*
- *
HashBag - implementation that uses a HashMap to store the data
- *
TreeBag - implementation that uses a TreeMap to store the data
+ *
HashBag - implementation that uses a HashMap to store the data
+ *
TreeBag - implementation that uses a TreeMap to store the data
*
*
* The following decorators are provided in the package:
*
*
- *
Synchronized - synchronizes method access for multithreaded environments
- *
Unmodifiable - ensures the bag cannot be altered
- *
Predicated - ensures that only elements that are valid according to a predicate can be added
- *
Transformed - transforms each element added to the bag
- *
Collection - ensures compliance with the java.util.Collection contract
+ *
Synchronized - synchronizes method access for multithreaded environments
+ *
Unmodifiable - ensures the bag cannot be altered
+ *
Predicated - ensures that only elements that are valid according to a predicate can be added
+ *
Transformed - transforms each element added to the bag
+ *
Collection - ensures compliance with the java.util.Collection contract
*
*/
package org.apache.commons.collections4.bag;
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/package-info.java b/src/main/java/org/apache/commons/collections4/bidimap/package-info.java
index 28983f2811..3b447054a7 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/package-info.java
@@ -27,16 +27,16 @@
* The following implementations are provided in the package:
*
*
- *
DualHashBidiMap - uses two HashMaps to implement BidiMap
- *
DualLinkedHashBidiMap - uses two LinkedHashMaps to implement BidiMap
- *
DualTreeBidiMap - uses two TreeMaps to implement SortedBidiMap
- *
TreeBidiMap - red-black tree implementation of OrderedBidiMap
+ *
DualHashBidiMap - uses two HashMaps to implement BidiMap
+ *
DualLinkedHashBidiMap - uses two LinkedHashMaps to implement BidiMap
+ *
DualTreeBidiMap - uses two TreeMaps to implement SortedBidiMap
+ *
TreeBidiMap - red-black tree implementation of OrderedBidiMap
*
*
* The following decorators are provided in the package:
*
*
- *
Unmodifiable - ensures the map cannot be altered
+ *
Level 0 is the oldest layer and the highest level is the newest.
*
There is always at least one enclosed filter.
- *
The newest filter is the {@code target} into which merges are performed.
+ *
The newest filter is the {@code target} into which merges are performed.
*
Whenever the target is retrieved, or a {@code merge} operation is performed the code checks if any older layers should be removed, and if so removes
* them. It also checks it a new layer should be added, and if so adds it and sets the {@code target} before the operation.
* The following implementations are provided in the package:
+ *
*
- *
CompositeCollection - a collection that combines multiple collections into one
+ *
CompositeCollection - a collection that combines multiple collections into one
*
+ *
* The following decorators are provided in the package:
+ *
*
- *
Synchronized - synchronizes method access for multithreaded environments
- *
Unmodifiable - ensures the collection cannot be altered
- *
Predicated - ensures that only elements that are valid according to a predicate can be added
- *
Transformed - transforms elements as they are added
- *
Indexed - provides a map-like view onto another collection
+ *
Synchronized - synchronizes method access for multithreaded environments
+ *
Unmodifiable - ensures the collection cannot be altered
+ *
Predicated - ensures that only elements that are valid according to a predicate can be added
+ *
Transformed - transforms elements as they are added
+ *
Indexed - provides a map-like view onto another collection
*
*/
package org.apache.commons.collections4.collection;
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java b/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java
index f6f305feb6..4a1b204464 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/package-info.java
@@ -20,10 +20,11 @@
* These are usually used in maps, however they can be used as data holders in any collection.
*
* The following key/value designs are included:
+ *
*
- *
Map Entry - various map entry implementations
- *
KeyValue - a key and value pair, without map entry semantics
- *
MultiKey - a holder of multiple keys tied together
+ *
Map Entry - various map entry implementations
+ *
KeyValue - a key and value pair, without map entry semantics
+ *
MultiKey - a holder of multiple keys tied together
*
*/
package org.apache.commons.collections4.keyvalue;
diff --git a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java
index f9d7dbaec8..ec679989e5 100644
--- a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java
+++ b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java
@@ -44,11 +44,11 @@
* It also has good garbage collection characteristics.
*
*
- *
Optimized for operation at size 3 or less.
- *
Still works well once size 3 exceeded.
- *
Gets at size 3 or less are about 0-10% faster than HashMap,
- *
Puts at size 3 or less are over 4 times faster than HashMap.
- *
Performance 5% slower than HashMap once size 3 exceeded once.
+ *
Optimized for operation at size 3 or less.
+ *
Still works well once size 3 exceeded.
+ *
Gets at size 3 or less are about 0-10% faster than HashMap,
+ *
Puts at size 3 or less are over 4 times faster than HashMap.
+ *
Performance 5% slower than HashMap once size 3 exceeded once.
*
*
* The design uses two distinct modes of operation - flat and delegate.
diff --git a/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java b/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java
index 7bb9e50f89..0882943fdb 100644
--- a/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java
@@ -50,9 +50,9 @@
* enables extra behavior to be added easily.
*
*
- *
{@code MultiKeyMap.decorate(new LinkedMap())} creates an ordered map.
- *
{@code MultiKeyMap.decorate(new LRUMap())} creates an least recently used map.
- *
{@code MultiKeyMap.decorate(new LinkedMap())} creates an ordered map.
+ *
{@code MultiKeyMap.decorate(new LRUMap())} creates an least recently used map.
+ *
{@code MultiKeyMap.decorate(new ReferenceMap())} creates a garbage collector sensitive map.
*
*
* Note that {@code IdentityMap} and {@code ReferenceIdentityMap} are unsuitable
diff --git a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
index dff5a199b5..b70367ca0b 100644
--- a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
@@ -52,9 +52,9 @@
* The key and value can be obtained by:
*
*
- *
normal Map methods and views
- *
the {@code MapIterator}, see {@link #mapIterator()}
- *
the {@code KeyValue} interface (just cast - no object creation)
+ *
normal Map methods and views
+ *
the {@code MapIterator}, see {@link #mapIterator()}
+ *
the {@code KeyValue} interface (just cast - no object creation)
*
*
* @param the type of the keys in this map
diff --git a/src/main/java/org/apache/commons/collections4/map/package-info.java b/src/main/java/org/apache/commons/collections4/map/package-info.java
index 84364141c3..c70baf0915 100644
--- a/src/main/java/org/apache/commons/collections4/map/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/map/package-info.java
@@ -25,29 +25,31 @@
* simple iteration of map keys and values.
*
* The following implementations are provided:
+ *
*
- *
CaseInsensitiveMap - map that compares keys in a case insensitive way
- *
CompositeMap - map that combines multiple maps into a single view
- *
HashedMap - general purpose HashMap replacement supporting MapIterator
- *
Flat3Map - designed for good performance at size 3 or less
- *
LinkedMap - a hash map that maintains insertion order, supporting OrderedMapIterator
- *
LRUMap - a hash map that maintains a maximum size by removing the least recently used entries
- *
MultiKeyMap - map that provides special methods for using more than one key to access the value
- *
ReferenceMap - allows the garbage collector to collect keys and values using equals() for comparison
- *
ReferenceIdentityMap - allows the garbage collector to collect keys and values using == for comparison
- *
SingletonMap - a fully featured map to hold one key-value pair
- *
StaticBucketMap - internally synchronized and designed for thread-contentious environments
+ *
CaseInsensitiveMap - map that compares keys in a case insensitive way
+ *
CompositeMap - map that combines multiple maps into a single view
+ *
HashedMap - general purpose HashMap replacement supporting MapIterator
+ *
Flat3Map - designed for good performance at size 3 or less
+ *
LinkedMap - a hash map that maintains insertion order, supporting OrderedMapIterator
+ *
LRUMap - a hash map that maintains a maximum size by removing the least recently used entries
+ *
MultiKeyMap - map that provides special methods for using more than one key to access the value
+ *
ReferenceMap - allows the garbage collector to collect keys and values using equals() for comparison
+ *
ReferenceIdentityMap - allows the garbage collector to collect keys and values using == for comparison
+ *
SingletonMap - a fully featured map to hold one key-value pair
+ *
StaticBucketMap - internally synchronized and designed for thread-contentious environments
*
*
* The following decorators are provided:
+ *
*
- *
Unmodifiable - ensures the collection cannot be altered
- *
Predicated - ensures that only elements that are valid according to a predicate can be added
- *
Transformed - transforms each element added
- *
FixedSize - ensures that the size of the map cannot change
- *
Defaulted - provides default values for non-existing keys
- *
Lazy - creates objects in the map on demand
- *
ListOrdered - ensures that insertion order is retained
+ *
Unmodifiable - ensures the collection cannot be altered
+ *
Predicated - ensures that only elements that are valid according to a predicate can be added
+ *
Transformed - transforms each element added
+ *
FixedSize - ensures that the size of the map cannot change
+ *
Defaulted - provides default values for non-existing keys
+ *
Lazy - creates objects in the map on demand
+ *
ListOrdered - ensures that insertion order is retained
*
*/
package org.apache.commons.collections4.map;
diff --git a/src/main/java/org/apache/commons/collections4/multimap/package-info.java b/src/main/java/org/apache/commons/collections4/multimap/package-info.java
index 85cb3686c9..4936635078 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/package-info.java
@@ -20,15 +20,17 @@
* A MultiValuedMap holds a collection of values against each key.
*
* The following implementations are provided in the package:
+ *
*
- *
ArrayListValuedHashMap - ListValuedMap implementation using a HashMap/ArrayList
- *
HashSetValuedHashMap - SetValuedMap implementation using a HashMap/HashSet
+ *
ArrayListValuedHashMap - ListValuedMap implementation using a HashMap/ArrayList
+ *
HashSetValuedHashMap - SetValuedMap implementation using a HashMap/HashSet
*
*
* The following decorators are provided in the package:
+ *
*
- *
Transformed - transforms elements added to the MultiValuedMap
- *
Unmodifiable - ensures the collection cannot be altered
+ *
Transformed - transforms elements added to the MultiValuedMap
+ *
Unmodifiable - ensures the collection cannot be altered
*
*/
package org.apache.commons.collections4.multimap;
diff --git a/src/main/java/org/apache/commons/collections4/multiset/package-info.java b/src/main/java/org/apache/commons/collections4/multiset/package-info.java
index 58c1b4cd6c..5b8486f549 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/package-info.java
@@ -21,15 +21,17 @@
* A multiset stores an object and a count of the number of occurrences of the object.
*
* The following implementations are provided in the package:
+ *
*
- *
HashMultiSet - implementation that uses a HashMap to store the data
+ *
HashMultiSet - implementation that uses a HashMap to store the data
*
*
* The following decorators are provided in the package:
+ *
*
- *
Predicated - ensures that only elements that are valid according to a predicate can be added
- *
Synchronized - synchronizes method access for multithreaded environments
- *
Unmodifiable - ensures the multiset cannot be altered
+ *
Predicated - ensures that only elements that are valid according to a predicate can be added
+ *
Synchronized - synchronizes method access for multithreaded environments
+ *
Unmodifiable - ensures the multiset cannot be altered
*
*/
package org.apache.commons.collections4.multiset;
diff --git a/src/main/java/org/apache/commons/collections4/package-info.java b/src/main/java/org/apache/commons/collections4/package-info.java
index ef1e29105e..7e45d23606 100644
--- a/src/main/java/org/apache/commons/collections4/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/package-info.java
@@ -21,7 +21,7 @@
* The following collection implementations are provided in the package:
*
*
- *
ArrayStack - a non synchronized Stack that follows the same API as {@code java.util Stack}
+ *
ArrayStack - a non synchronized Stack that follows the same API as {@code java.util Stack}
* The following implementations are provided in the package:
+ *
*
- *
CircularFifoQueue - implements a queue with a fixed size that discards oldest when full
+ *
CircularFifoQueue - implements a queue with a fixed size that discards oldest when full
*
*
* The following decorators are provided in the package:
+ *
*
- *
Predicated - ensures that only elements that are valid according to a predicate can be added
- *
Transformed - transforms elements added to the queue
- *
Unmodifiable - ensures the collection cannot be altered
+ *
Predicated - ensures that only elements that are valid according to a predicate can be added
+ *
Transformed - transforms elements added to the queue
+ *
Unmodifiable - ensures the collection cannot be altered
*
*/
package org.apache.commons.collections4.queue;
diff --git a/src/main/java/org/apache/commons/collections4/set/package-info.java b/src/main/java/org/apache/commons/collections4/set/package-info.java
index 6448335055..25a8a31b30 100644
--- a/src/main/java/org/apache/commons/collections4/set/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/set/package-info.java
@@ -23,18 +23,22 @@
* The implementations are in the form of direct implementations and decorators.
* A decorator wraps another implementation of the interface to add some
* specific additional functionality.
+ *
*
* The following implementations are provided in the package:
+ *
*
- *
CompositeSet - a set that combines multiple sets into one
+ *
CompositeSet - a set that combines multiple sets into one
*
+ *
* The following decorators are provided in the package:
+ *
*
- *
Unmodifiable - ensures the collection cannot be altered
- *
Predicated - ensures that only elements that are valid according to a predicate can be added
- *
Transformed - transforms each element added
- *
ListOrdered - ensures that insertion order is retained
- *
MapBackedSet - a set formed by decorating a Map
+ *
Unmodifiable - ensures the collection cannot be altered
+ *
Predicated - ensures that only elements that are valid according to a predicate can be added
+ *
Transformed - transforms each element added
+ *
ListOrdered - ensures that insertion order is retained
*/
package org.apache.commons.collections4.splitmap;
diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
index eead2e7233..906d3c6200 100644
--- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
@@ -2259,9 +2259,9 @@ private void removeInternalEntry(final TrieEntry h) {
* For example, given the keys:
*
*
- *
D = 1000100
- *
H = 1001000
- *
L = 1001100
+ *
D = 1000100
+ *
H = 1001000
+ *
L = 1001100
*
*
* If the {@link org.apache.commons.collections4.Trie} contained 'H' and 'L', a lookup of 'D' would
@@ -2288,9 +2288,9 @@ public Map.Entry select(final K key) {
* For example, given the keys:
*
*
- *
D = 1000100
- *
H = 1001000
- *
L = 1001100
+ *
D = 1000100
+ *
H = 1001000
+ *
L = 1001100
*
*
* If the {@link org.apache.commons.collections4.Trie} contained 'H' and 'L', a lookup of 'D' would
@@ -2340,9 +2340,9 @@ private boolean selectR(final TrieEntry h, final int bitIndex,
* For example, given the keys:
*
*
- *
D = 1000100
- *
H = 1001000
- *
L = 1001100
+ *
D = 1000100
+ *
H = 1001000
+ *
L = 1001100
*
*
* If the {@link org.apache.commons.collections4.Trie} contained 'H' and 'L', a lookup of 'D' would
diff --git a/src/main/java/org/apache/commons/collections4/trie/package-info.java b/src/main/java/org/apache/commons/collections4/trie/package-info.java
index 293c3074a8..04d203d0f0 100644
--- a/src/main/java/org/apache/commons/collections4/trie/package-info.java
+++ b/src/main/java/org/apache/commons/collections4/trie/package-info.java
@@ -22,15 +22,18 @@
* The implementations are in the form of direct implementations and decorators.
* A decorator wraps another implementation of the interface to add some
* specific additional functionality.
+ *
*
* The following implementations are provided in the package:
+ *
*
- *
PatriciaTrie - an implementation of a PATRICIA trie
+ *
PatriciaTrie - an implementation of a PATRICIA trie
*
*
* The following decorators are provided:
+ *
*
- *
Unmodifiable - ensures the collection cannot be altered
+ *
Unmodifiable - ensures the collection cannot be altered
*
*/
package org.apache.commons.collections4.trie;
From a60ee0c714939816cbb44833b11ea263a1defa23 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 17 Dec 2025 07:50:34 -0500
Subject: [PATCH 062/110] Bump github/codeql-action from 4.31.8 to 4.31.9
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index b1cc918df2..d7e8c4a82c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
+ uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
+ uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
+ uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index ebc1751c52..4652677d02 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
+ uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
sarif_file: results.sarif
From d7a8201d50f1a5c291d64015200a9648c6eb6ac2 Mon Sep 17 00:00:00 2001
From: Paul King
Date: Fri, 12 Dec 2025 21:15:50 +1000
Subject: [PATCH 063/110] provide an inverse method for multimaps
---
.../commons/collections4/MultiMapUtils.java | 22 ++++++++++++++++
.../commons/collections4/MultiValuedMap.java | 11 ++++++++
.../multimap/ArrayListValuedHashMap.java | 6 +++++
.../ArrayListValuedLinkedHashMap.java | 6 +++++
.../multimap/HashSetValuedHashMap.java | 6 +++++
.../LinkedHashSetValuedLinkedHashMap.java | 6 +++++
.../collections4/MultiMapUtilsTest.java | 26 +++++++++++++++++++
.../multimap/ArrayListValuedHashMapTest.java | 13 ++++++++++
.../ArrayListValuedLinkedHashMapTest.java | 13 ++++++++++
.../multimap/HashSetValuedHashMapTest.java | 13 ++++++++++
.../LinkedHashSetValuedLinkedHashMapTest.java | 13 ++++++++++
.../TransformedMultiValuedMapTest.java | 6 +++++
12 files changed, 141 insertions(+)
diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
index ef7fc8c96c..c698a38e50 100644
--- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
@@ -20,6 +20,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.apache.commons.collections4.bag.HashBag;
@@ -170,6 +171,27 @@ public static boolean isEmpty(final MultiValuedMap, ?> map) {
return map == null || map.isEmpty();
}
+ /**
+ * A utility method to invert the mappings from an input MultiValuedMap
+ * and add them to an output MultiValuedMap. Use this method to have complete
+ * control of the output MultiValuedMap or when merging several inverse mappings.
+ * In simple cases, consider just using the {@link MultiValuedMap#inverted()} method.
+ *
+ * @param input take key-to-value mappings from here
+ * @param output add value-to-key mappings here
+ * @param the output MultiValuedMap key type
+ * @param the output MultiValuedMap value type
+ * @param the output MultiValuedMap with key and value types reversed compared with input
+ * @return the updated output MultiValuedMap
+ */
+ public static >
+ M invert(MultiValuedMap extends V, ? extends K> input, M output) {
+ for (Map.Entry extends V, ? extends K> e : input.entries()) {
+ output.put(e.getValue(), e.getKey());
+ }
+ return output;
+ }
+
/**
* Creates a {@link ListValuedMap} with an {@link java.util.ArrayList ArrayList} as
* collection class to store the values mapped to a key.
diff --git a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
index 96d2f6b086..350e74e7e1 100644
--- a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
@@ -140,6 +140,17 @@ public interface MultiValuedMap {
*/
Collection get(K key);
+ /**
+ * Returns a new MultiValuedMap with inverted mappings.
+ * The new multimap will have a value-to-key mapping
+ * for each key-to-value mapping in the original.
+ *
+ * @return a new MultiValuedMap with inverted mappings
+ */
+ default MultiValuedMap inverted() {
+ throw new UnsupportedOperationException();
+ }
+
/**
* Returns {@code true} if this map contains no key-value mappings.
*
diff --git a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
index a9d2a11537..47586dc631 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
@@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiValuedMap;
/**
@@ -118,6 +119,11 @@ protected ArrayList createCollection() {
return new ArrayList<>(initialListCapacity);
}
+ @Override
+ public ArrayListValuedHashMap inverted() {
+ return MultiMapUtils.invert(this, new ArrayListValuedHashMap());
+ }
+
/**
* Deserializes an instance from an ObjectInputStream.
*
diff --git a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMap.java
index f1b797b532..2556ab3f74 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMap.java
@@ -25,6 +25,7 @@
import java.util.LinkedHashMap;
import java.util.Map;
+import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiValuedMap;
/**
@@ -118,6 +119,11 @@ protected ArrayList createCollection() {
return new ArrayList<>(initialListCapacity);
}
+ @Override
+ public ArrayListValuedLinkedHashMap inverted() {
+ return MultiMapUtils.invert(this, new ArrayListValuedLinkedHashMap<>());
+ }
+
/**
* Deserializes an instance from an ObjectInputStream.
*
diff --git a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
index b122e2c410..184730cbfb 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
@@ -24,6 +24,7 @@
import java.util.HashSet;
import java.util.Map;
+import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiValuedMap;
/**
@@ -117,6 +118,11 @@ protected HashSet createCollection() {
return new HashSet<>(initialSetCapacity);
}
+ @Override
+ public HashSetValuedHashMap inverted() {
+ return MultiMapUtils.invert(this, new HashSetValuedHashMap());
+ }
+
/**
* Deserializes an instance from an ObjectInputStream.
*
diff --git a/src/main/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMap.java
index c8be8751dc..c381893b6a 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMap.java
@@ -24,6 +24,7 @@
import java.util.LinkedHashSet;
import java.util.Map;
+import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiValuedMap;
/**
@@ -117,6 +118,11 @@ protected LinkedHashSet createCollection() {
return new LinkedHashSet<>(initialSetCapacity);
}
+ @Override
+ public LinkedHashSetValuedLinkedHashMap inverted() {
+ return MultiMapUtils.invert(this, new LinkedHashSetValuedLinkedHashMap());
+ }
+
/**
* Deserializes an instance from an ObjectInputStream.
*
diff --git a/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java b/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
index 14f177f2b4..7ff98ba078 100644
--- a/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
@@ -29,6 +29,8 @@
import java.util.Set;
import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
+import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
+import org.apache.commons.collections4.multimap.LinkedHashSetValuedLinkedHashMap;
import org.junit.jupiter.api.Test;
/**
@@ -116,6 +118,30 @@ void testGetValuesAsSet() {
assertEquals(new HashSet<>(Arrays.asList(values)), set);
}
+ @Test
+ void testInvert() {
+ final HashSetValuedHashMap usages = new HashSetValuedHashMap<>();
+
+ final LinkedHashSetValuedLinkedHashMap deps = new LinkedHashSetValuedLinkedHashMap<>();
+ deps.put("commons-configuration2", "commons-logging");
+ deps.put("commons-configuration2", "commons-lang3");
+ deps.put("commons-configuration2", "commons-text");
+ deps.put("commons-beanutils", "commons-collections");
+ deps.put("commons-beanutils", "commons-logging");
+ MultiMapUtils.invert(deps, usages);
+ final Set loggingUsagesCompile = usages.get("commons-logging");
+ assertEquals("[commons-configuration2, commons-beanutils]", loggingUsagesCompile.toString());
+ final Set codecUsagesCompile = usages.get("commons-codec");
+ assertEquals("[]", codecUsagesCompile.toString());
+
+ final LinkedHashSetValuedLinkedHashMap optionalDeps = new LinkedHashSetValuedLinkedHashMap<>();
+ optionalDeps.put("commons-configuration2", "commons-codec");
+ optionalDeps.put("commons-collections", "commons-codec");
+ MultiMapUtils.invert(optionalDeps, usages);
+ final Set codecUsagesAll = usages.get("commons-codec");
+ assertEquals("[commons-collections, commons-configuration2]", codecUsagesAll.toString());
+ }
+
@Test
void testIsEmptyWithEmptyMap() {
assertTrue(MultiMapUtils.isEmpty(new ArrayListValuedHashMap<>()));
diff --git a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
index 47e9a63e60..f65ee297c0 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
@@ -93,6 +93,19 @@ void testEqualsHashCodeContract() {
assertNotSame(map1.hashCode(), map2.hashCode());
}
+ @Test
+ void testInverted() {
+ final ArrayListValuedHashMap shopping = new ArrayListValuedHashMap<>(4);
+ shopping.put("Alice", "Bread");
+ shopping.put("Alice", "Milk");
+ shopping.put("Alice", "Milk");
+ shopping.put("Bob", "Pizza");
+ shopping.put("Bob", "Bread");
+ shopping.put("Bob", "Bread");
+ assertEquals("{Pizza=[Bob], Bread=[Bob, Bob, Alice], Milk=[Alice, Alice]}",
+ shopping.inverted().toString());
+ }
+
@Test
@SuppressWarnings("unchecked")
void testListValuedMapAdd() {
diff --git a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMapTest.java
index 74353b50ab..550a192409 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedLinkedHashMapTest.java
@@ -99,6 +99,19 @@ void testEqualsHashCodeContract() {
assertNotSame(map1.hashCode(), map2.hashCode());
}
+ @Test
+ void testInverted() {
+ final ArrayListValuedLinkedHashMap shopping = new ArrayListValuedLinkedHashMap<>(4);
+ shopping.put("Alice", "Bread");
+ shopping.put("Alice", "Milk");
+ shopping.put("Alice", "Milk");
+ shopping.put("Bob", "Pizza");
+ shopping.put("Bob", "Bread");
+ shopping.put("Bob", "Bread");
+ assertEquals("{Bread=[Alice, Bob, Bob], Milk=[Alice, Alice], Pizza=[Bob]}",
+ shopping.inverted().toString());
+ }
+
@Test
@SuppressWarnings("unchecked")
void testListValuedMapAdd() {
diff --git a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
index 7b50d6cd13..419ae3814f 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
@@ -110,6 +110,19 @@ void testHashSetValueHashMap_1() {
assertEquals("{}", map3.toString());
}
+ @Test
+ void testInverted() {
+ final HashSetValuedHashMap dependencies = new HashSetValuedHashMap<>();
+ dependencies.put("commons-configuration2", "commons-logging");
+ dependencies.put("commons-configuration2", "commons-lang3");
+ dependencies.put("commons-configuration2", "commons-text");
+ dependencies.put("commons-beanutils", "commons-collections");
+ dependencies.put("commons-beanutils", "commons-logging");
+ final Set loggingUsages = dependencies.inverted().get("commons-logging");
+ assertEquals("[commons-beanutils, commons-configuration2]",
+ loggingUsages.toString());
+ }
+
@Test
@SuppressWarnings("unchecked")
void testSetValuedMapAdd() {
diff --git a/src/test/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMapTest.java
index 2b37cb76d2..561432363b 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/LinkedHashSetValuedLinkedHashMapTest.java
@@ -96,6 +96,19 @@ void testHashSetValueHashMap_1() {
assertEquals("{}", map3.toString());
}
+ @Test
+ void testInverted() {
+ final LinkedHashSetValuedLinkedHashMap citiesLived = new LinkedHashSetValuedLinkedHashMap<>(4);
+ citiesLived.put("Alice", "N.Y.");
+ citiesLived.put("Alice", "L.A.");
+ citiesLived.put("Alice", "Chicago");
+ citiesLived.put("Bob", "N.Y.");
+ citiesLived.put("Cara", "L.A.");
+ citiesLived.put("Cara", "Chicago");
+ assertEquals("{N.Y.=[Alice, Bob], L.A.=[Alice, Cara], Chicago=[Alice, Cara]}",
+ citiesLived.inverted().toString());
+ }
+
@Test
void testLinkedHashSetValuedLinkedHashMap_2() {
final Map map = new HashMap<>();
diff --git a/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
index 37ef87d8f0..d83b47108a 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
@@ -19,6 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Collection;
@@ -99,6 +100,11 @@ void testFactory_decorateTransform() {
assertTrue(transMap.get((K) "D").contains(Integer.valueOf(4)));
}
+ @Test
+ void testInvertedIsUnsupportedByDefault() {
+ assertThrows(UnsupportedOperationException.class, () -> makeObject().inverted());
+ }
+
@Test
@SuppressWarnings("unchecked")
void testKeyTransformedMap() {
From e605b5863156d9c15e17ccc01cb5a1df7b33fcb1 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 19 Dec 2025 14:20:29 -0500
Subject: [PATCH 064/110] Add MultiValuedMap.inverted() #665
---
src/changes/changes.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 3ccd92dac4..8ffe49634a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -41,10 +41,11 @@
Fix SortedProperties.stringPropertyNames() returned an unsorted Set.Fix SortedProperties.forEach() called its consumer out of order.Fix Apache RAT plugin console warnings.
- Fix malformed Javadoc comments.
+ Add MultiValuedMap.inverted() #665.Add generics to UnmodifiableIterator for the wrapped type.Add a Maven benchmark profile for JMH.
+ Add a Maven benchmark profile for JMH.Bump org.apache.commons:commons-parent from 81 to 93 #612, #645, #662, #663.Bump com.google.guava:guava-testlib from 33.3.1-jre to 33.5.0-jre #644.
From fab8020385737d57c66ae1ca4164dfeec039741e Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 19 Dec 2025 14:21:21 -0500
Subject: [PATCH 065/110] Sort members
---
.../commons/collections4/MultiMapUtils.java | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
index c698a38e50..82bebab7c8 100644
--- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
@@ -158,19 +158,6 @@ public static Set getValuesAsSet(final MultiValuedMap map, final
return null;
}
- /**
- * Null-safe check if the specified {@code MultiValuedMap} is empty.
- *
- * If the provided map is null, returns true.
- *
- *
- * @param map the map to check, may be null
- * @return true if the map is empty or null
- */
- public static boolean isEmpty(final MultiValuedMap, ?> map) {
- return map == null || map.isEmpty();
- }
-
/**
* A utility method to invert the mappings from an input MultiValuedMap
* and add them to an output MultiValuedMap. Use this method to have complete
@@ -192,6 +179,19 @@ M invert(MultiValuedMap extends V, ? extends K> input, M output) {
return output;
}
+ /**
+ * Null-safe check if the specified {@code MultiValuedMap} is empty.
+ *
+ * If the provided map is null, returns true.
+ *
+ *
+ * @param map the map to check, may be null
+ * @return true if the map is empty or null
+ */
+ public static boolean isEmpty(final MultiValuedMap, ?> map) {
+ return map == null || map.isEmpty();
+ }
+
/**
* Creates a {@link ListValuedMap} with an {@link java.util.ArrayList ArrayList} as
* collection class to store the values mapped to a key.
From 1fba2968f86adb5a140f2349b63cdce36fd63f08 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sun, 21 Dec 2025 15:30:28 -0500
Subject: [PATCH 066/110] Javadoc
---
.../commons/collections4/comparators/BooleanComparator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java b/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java
index aca9fe7bb6..429c1af745 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java
@@ -176,7 +176,7 @@ public int hashCode() {
* I sort {@code true} values before
* {@code false} values. In other words,
* returns {@code true} iff
- * {@link #compare(Boolean,Boolean) compare(Boolean.FALSE,Boolean.TRUE)}
+ * {@link #compare(Boolean,Boolean) compare(Boolean.FALSE, Boolean.TRUE)}
* returns a positive value.
*
* @return the trueFirst flag
From c1f3cb2382c6edb6324ab50e925af8ef52add786 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sun, 21 Dec 2025 15:32:21 -0500
Subject: [PATCH 067/110] Javadoc
---
.../java/org/apache/commons/collections4/CollectionUtils.java | 4 ++--
.../commons/collections4/bloomfilter/BitMapExtractor.java | 2 +-
.../collections4/bloomfilter/BloomFilterExtractor.java | 2 +-
.../commons/collections4/bloomfilter/CellExtractor.java | 2 +-
.../commons/collections4/bloomfilter/LongBiPredicate.java | 2 +-
.../commons/collections4/comparators/ComparatorChain.java | 4 ++--
.../apache/commons/collections4/iterators/IteratorChain.java | 2 +-
.../org/apache/commons/collections4/map/MultiValueMap.java | 4 ++--
8 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index d28636ee9c..2ba14cc76e 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -736,9 +736,9 @@ public static int countMatches(final Iterable input, final Predicate su
*
*
*
* @param a the first collection, must not be null
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java
index 343d6b1338..886a43057b 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java
@@ -131,7 +131,7 @@ long[] toArray() {
* arrays reimplement this method.
*
*
- * @param other The other BitMapExtractor that provides the y values in the (x,y) pair.
+ * @param other The other BitMapExtractor that provides the y values in the (x, y) pair.
* @param func The function to apply.
* @return A LongPredicate that tests this BitMapExtractor's bitmap values in order.
*/
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilterExtractor.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilterExtractor.java
index 88a24166e1..a7e27fc0ef 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilterExtractor.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilterExtractor.java
@@ -120,7 +120,7 @@ default BloomFilter flatten() {
* instances, or references to the filters in the collection.
*
*
- * @param other The other BloomFilterExtractor that provides the y values in the (x,y) pair.
+ * @param other The other BloomFilterExtractor that provides the y values in the (x, y) pair.
* @param func The function to apply.
* @return {@code true} if the {@code func} returned {@code true} for every pair, {@code false} otherwise.
*/
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/CellExtractor.java b/src/main/java/org/apache/commons/collections4/bloomfilter/CellExtractor.java
index f6c8e574fc..0334b74793 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/CellExtractor.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/CellExtractor.java
@@ -70,7 +70,7 @@ interface CellPredicate {
*
The CellExtractor aggregates duplicate indices from the IndexExtractor.
*
*
- *
A CellExtractor that outputs the mapping [(1,2),(2,3),(3,1)] can be created from many combinations
+ *
A CellExtractor that outputs the mapping [(1, 2),(2, 3),(3, 1)] can be created from many combinations
* of indices including:
*
* [1, 1, 2, 2, 2, 3]
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/LongBiPredicate.java b/src/main/java/org/apache/commons/collections4/bloomfilter/LongBiPredicate.java
index ff2f3b49d7..9d36ed692c 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/LongBiPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/LongBiPredicate.java
@@ -20,7 +20,7 @@
* Represents a function that accepts a two long-valued argument and produces a binary result.
* This is the long-consuming primitive specialization for {@code BiPredicate}.
*
- * This is a functional interface whose functional method is {@code test(long,long)}.
+ * This is a functional interface whose functional method is {@code test(long, long)}.
*
*
* @since 4.5.0-M1
diff --git a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
index 05fa8acabd..5916d5b74b 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
@@ -66,7 +66,7 @@ public class ComparatorChain implements Comparator, Serializable {
/**
* Constructs a ComparatorChain with no Comparators.
* You must add at least one Comparator before calling
- * the compare(Object,Object) method, or an
+ * the compare(Object, Object) method, or an
* UnsupportedOperationException is thrown
*/
public ComparatorChain() {
@@ -182,7 +182,7 @@ private void checkLocked() {
/**
* Perform comparisons on the Objects as per
- * Comparator.compare(o1,o2).
+ * Comparator.compare(o1, o2).
*
* @param o1 the first object to compare
* @param o2 the second object to compare
diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java
index 19ed92d6a6..031fb650c0 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java
@@ -69,7 +69,7 @@ public class IteratorChain implements Iterator {
private Iterator extends E> lastUsedIterator;
/**
- * ComparatorChain is "locked" after the first time compare(Object,Object)
+ * ComparatorChain is "locked" after the first time compare(Object, Object)
* is called
*/
private boolean isLocked;
diff --git a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
index c1756e3fa9..f75d62389a 100644
--- a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
@@ -471,9 +471,9 @@ public boolean putAll(final K key, final Collection values) {
* correctly handled.
*
* If you call this method with a normal map, each entry is
- * added using {@code put(Object,Object)}.
+ * added using {@code put(Object, Object)}.
* If you call this method with a multi map, each entry is
- * added using {@code putAll(Object,Collection)}.
+ * added using {@code putAll(Object, Collection)}.
*
*
* @param map the map to copy (either a normal or multi map)
From c4ad5f53ad36fcb249fb7683e09d6127a9484dcd Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 26 Dec 2025 16:14:42 -0500
Subject: [PATCH 068/110] Javadoc: Fix double the
---
.../apache/commons/collections4/bloomfilter/LayerManager.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java b/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
index 1cb64ded8f..607bf0517a 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
@@ -138,7 +138,7 @@ public static > Consumer> noCleanup() {
}
/**
- * Removes the earliest filters in the list when the the number of filters
+ * Removes the earliest filters in the list when the number of filters
* exceeds maxSize.
*
* @param Type of BloomFilter.
@@ -292,7 +292,7 @@ public static > Builder builder() {
/**
* Constructs a new instance.
*
- * @param filterSupplier the non-null supplier of new Bloom filters to add the the list
+ * @param filterSupplier the non-null supplier of new Bloom filters to add the list
* when necessary.
* @param extendCheck The non-null predicate that checks if a new filter should be
* added to the list.
From fde741e259c9b9d37664303da01524aa2ab01abc Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 27 Dec 2025 07:28:41 -0500
Subject: [PATCH 069/110] Javadoc Add missing @since
Better text
---
.../commons/collections4/MultiMapUtils.java | 28 ++++++++++---------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
index 82bebab7c8..226f1dc522 100644
--- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
@@ -159,21 +159,23 @@ public static Set getValuesAsSet(final MultiValuedMap map, final
}
/**
- * A utility method to invert the mappings from an input MultiValuedMap
- * and add them to an output MultiValuedMap. Use this method to have complete
- * control of the output MultiValuedMap or when merging several inverse mappings.
- * In simple cases, consider just using the {@link MultiValuedMap#inverted()} method.
+ * Inverts the mappings from an input MultiValuedMap by adding entries to an output MultiValuedMap. The input is unchanged.
+ *
+ * Use this method to have complete control of the output MultiValuedMap or when merging several inverse mappings. In simple cases, consider using
+ * {@link MultiValuedMap#inverted()} method.
+ *
*
- * @param input take key-to-value mappings from here
- * @param output add value-to-key mappings here
- * @param the output MultiValuedMap key type
- * @param the output MultiValuedMap value type
- * @param the output MultiValuedMap with key and value types reversed compared with input
- * @return the updated output MultiValuedMap
+ * @param the input value type and output key type.
+ * @param the input key type and output value type.
+ * @param the output MultiValuedMap type where {@code K} is the key type and {@code V} is the value type.
+ * @param input The input key-value mappings of type {@code }.
+ * @param output The output value-key mappings of type {@code }.
+ * @return The updated output MultiValuedMap of type {@code }
+ * @see MultiValuedMap#inverted()
+ * @since 4.6.0
*/
- public static >
- M invert(MultiValuedMap extends V, ? extends K> input, M output) {
- for (Map.Entry extends V, ? extends K> e : input.entries()) {
+ public static > M invert(final MultiValuedMap extends V, ? extends K> input, final M output) {
+ for (final Map.Entry extends V, ? extends K> e : input.entries()) {
output.put(e.getValue(), e.getKey());
}
return output;
From 9b122c48770ef1c3403864a88006d864e66f6520 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 27 Dec 2025 07:28:51 -0500
Subject: [PATCH 070/110] Better exception message
---
.../java/org/apache/commons/collections4/MultiValuedMap.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
index 350e74e7e1..4264e6836a 100644
--- a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
@@ -148,7 +148,7 @@ public interface MultiValuedMap {
* @return a new MultiValuedMap with inverted mappings
*/
default MultiValuedMap inverted() {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException(getClass() + ".inverted()");
}
/**
From 7f5cde16eddb67df2927abfb1ab3105cfba37b74 Mon Sep 17 00:00:00 2001
From: Sebb
Date: Sat, 27 Dec 2025 12:52:06 +0000
Subject: [PATCH 071/110] Add missing @since for inverted()
---
.../java/org/apache/commons/collections4/MultiValuedMap.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
index 4264e6836a..31ae1f005d 100644
--- a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java
@@ -146,6 +146,7 @@ public interface MultiValuedMap {
* for each key-to-value mapping in the original.
*
* @return a new MultiValuedMap with inverted mappings
+ * @since 4.6.0
*/
default MultiValuedMap inverted() {
throw new UnsupportedOperationException(getClass() + ".inverted()");
From c292567c96daa9a48ae0eb7a33fbd907497457d5 Mon Sep 17 00:00:00 2001
From: Sebb
Date: Sun, 28 Dec 2025 14:05:09 +0000
Subject: [PATCH 072/110] Suppress PMD false positive
---
.../java/org/apache/commons/collections4/IterableUtils.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java
index d36a1317a3..5a06d3fb08 100644
--- a/src/main/java/org/apache/commons/collections4/IterableUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java
@@ -624,7 +624,7 @@ public Iterator iterator() {
return new LazyIteratorChain() {
@Override
protected Iterator extends E> nextIterator(final int count) {
- if (IterableUtils.isEmpty(iterable)) {
+ if (IterableUtils.isEmpty(iterable)) { //NOPMD: qualifier is needed here
return null;
}
return iterable.iterator();
From f0cb3c97857f4b5bfe364d49f07e29d6931f2ad8 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Mon, 29 Dec 2025 08:51:25 -0500
Subject: [PATCH 073/110] Bump notice file end year from 2025 to 2026
---
NOTICE.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/NOTICE.txt b/NOTICE.txt
index 518b76e2c9..8c3e93e4e8 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
Apache Commons Collections
-Copyright 2001-2025 The Apache Software Foundation
+Copyright 2001-2026 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
From 561aab8132fc8b12077f22850402c272d8821268 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Tue, 30 Dec 2025 13:32:43 +0000
Subject: [PATCH 074/110] Javadoc typos
---
.../commons/collections4/iterators/UniqueFilterIterator.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java
index 88eadd41ca..7370b1bd57 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java
@@ -31,9 +31,9 @@
public class UniqueFilterIterator extends FilterIterator {
/**
- * Constructs a new {@code UniqueFilterIterator}.
+ * Constructs a new {@code UniqueFilterIterator}.
*
- * @param iterator the iterator to use
+ * @param iterator the iterator to use
*/
public UniqueFilterIterator(final Iterator extends E> iterator) {
super(iterator, UniquePredicate.uniquePredicate());
From 84000199ea2a1c2e90761e4a96e3fdc9fcfe9694 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Tue, 30 Dec 2025 13:35:57 +0000
Subject: [PATCH 075/110] Javadoc
---
.../comparators/NullComparator.java | 146 +++++++++---------
1 file changed, 71 insertions(+), 75 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
index 882fc9fc50..b38c6203b1 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
@@ -35,99 +35,96 @@ public class NullComparator implements Comparator, Serializable {
private static final long serialVersionUID = -5820772575483504339L;
/**
- * The comparator to use when comparing two non-{@code null} objects.
- **/
+ * The comparator to use when comparing two non-{@code null} objects.
+ */
private final Comparator super E> nonNullComparator;
/**
- * Specifies whether a {@code null} are compared as higher than
- * non-{@code null} objects.
- **/
+ * Specifies whether a {@code null} are compared as higher than
+ * non-{@code null} objects.
+ */
private final boolean nullsAreHigh;
/**
- * Construct an instance that sorts {@code null} higher than any
- * non-{@code null} object it is compared with. When comparing two
- * non-{@code null} objects, the {@link ComparableComparator} is
- * used.
- **/
+ * Construct an instance that sorts {@code null} higher than any
+ * non-{@code null} object it is compared with. When comparing two
+ * non-{@code null} objects, the {@link ComparableComparator} is
+ * used.
+ */
public NullComparator() {
this(ComparatorUtils.NATURAL_COMPARATOR, true);
}
/**
- * Construct an instance that sorts {@code null} higher or lower than
- * any non-{@code null} object it is compared with. When comparing
- * two non-{@code null} objects, the {@link ComparableComparator} is
- * used.
+ * Construct an instance that sorts {@code null} higher or lower than
+ * any non-{@code null} object it is compared with. When comparing
+ * two non-{@code null} objects, the {@link ComparableComparator} is
+ * used.
*
- * @param nullsAreHigh a {@code true} value indicates that
- * {@code null} should be compared as higher than a
- * non-{@code null} object. A {@code false} value indicates
- * that {@code null} should be compared as lower than a
- * non-{@code null} object.
- **/
+ * @param nullsAreHigh a {@code true} value indicates that
+ * {@code null} should be compared as higher than a
+ * non-{@code null} object. A {@code false} value indicates
+ * that {@code null} should be compared as lower than a
+ * non-{@code null} object.
+ */
public NullComparator(final boolean nullsAreHigh) {
this(ComparatorUtils.NATURAL_COMPARATOR, nullsAreHigh);
}
/**
- * Construct an instance that sorts {@code null} higher than any
- * non-{@code null} object it is compared with. When comparing two
- * non-{@code null} objects, the specified {@link Comparator} is
- * used.
+ * Construct an instance that sorts {@code null} higher than any
+ * non-{@code null} object it is compared with. When comparing two
+ * non-{@code null} objects, the specified {@link Comparator} is
+ * used.
*
- * @param nonNullComparator the comparator to use when comparing two
- * non-{@code null} objects. This argument cannot be
- * {@code null}
- *
- * @throws NullPointerException if {@code nonNullComparator} is
- * {@code null}
- **/
+ * @param nonNullComparator the comparator to use when comparing two
+ * non-{@code null} objects. This argument cannot be
+ * {@code null}
+ * @throws NullPointerException if {@code nonNullComparator} is
+ * {@code null}
+ */
public NullComparator(final Comparator super E> nonNullComparator) {
this(nonNullComparator, true);
}
/**
- * Construct an instance that sorts {@code null} higher or lower than
- * any non-{@code null} object it is compared with. When comparing
- * two non-{@code null} objects, the specified {@link Comparator} is
- * used.
- *
- * @param nonNullComparator the comparator to use when comparing two
- * non-{@code null} objects. This argument cannot be
- * {@code null}
+ * Construct an instance that sorts {@code null} higher or lower than
+ * any non-{@code null} object it is compared with. When comparing
+ * two non-{@code null} objects, the specified {@link Comparator} is
+ * used.
*
- * @param nullsAreHigh a {@code true} value indicates that
- * {@code null} should be compared as higher than a
- * non-{@code null} object. A {@code false} value indicates
- * that {@code null} should be compared as lower than a
- * non-{@code null} object.
- *
- * @throws NullPointerException if {@code nonNullComparator} is
- * {@code null}
- **/
+ * @param nonNullComparator the comparator to use when comparing two
+ * non-{@code null} objects. This argument cannot be
+ * {@code null}
+ * @param nullsAreHigh a {@code true} value indicates that
+ * {@code null} should be compared as higher than a
+ * non-{@code null} object. A {@code false} value indicates
+ * that {@code null} should be compared as lower than a
+ * non-{@code null} object.
+ * @throws NullPointerException if {@code nonNullComparator} is
+ * {@code null}
+ */
public NullComparator(final Comparator super E> nonNullComparator, final boolean nullsAreHigh) {
this.nonNullComparator = Objects.requireNonNull(nonNullComparator, "nonNullComparator");
this.nullsAreHigh = nullsAreHigh;
}
/**
- * Perform a comparison between two objects. If both objects are
- * {@code null}, a {@code 0} value is returned. If one object
- * is {@code null} and the other is not, the result is determined on
- * whether the Comparator was constructed to have nulls as higher or lower
- * than other objects. If neither object is {@code null}, an
- * underlying comparator specified in the constructor (or the default) is
- * used to compare the non-{@code null} objects.
+ * Perform a comparison between two objects. If both objects are
+ * {@code null}, a {@code 0} value is returned. If one object
+ * is {@code null} and the other is not, the result is determined on
+ * whether the Comparator was constructed to have nulls as higher or lower
+ * than other objects. If neither object is {@code null}, an
+ * underlying comparator specified in the constructor (or the default) is
+ * used to compare the non-{@code null} objects.
*
- * @param o1 the first object to compare
- * @param o2 the object to compare it to.
- * @return {@code -1} if {@code o1} is "lower" than (less than,
- * before, etc.) {@code o2}; {@code 1} if {@code o1} is
- * "higher" than (greater than, after, etc.) {@code o2}; or
- * {@code 0} if {@code o1} and {@code o2} are equal.
- **/
+ * @param o1 the first object to compare
+ * @param o2 the object to compare it to.
+ * @return {@code -1} if {@code o1} is "lower" than (less than,
+ * before, etc.) {@code o2}; {@code 1} if {@code o1} is
+ * "higher" than (greater than, after, etc.) {@code o2}; or
+ * {@code 0} if {@code o1} and {@code o2} are equal.
+ */
@Override
public int compare(final E o1, final E o2) {
if (o1 == o2) {
@@ -143,16 +140,15 @@ public int compare(final E o1, final E o2) {
}
/**
- * Determines whether the specified object represents a comparator that is
- * equal to this comparator.
- *
- * @param obj the object to compare this comparator with.
+ * Determines whether the specified object represents a comparator that is
+ * equal to this comparator.
*
- * @return {@code true} if the specified object is a NullComparator
- * with equivalent {@code null} comparison behavior
- * (i.e. {@code null} high or low) and with equivalent underlying
- * non-{@code null} object comparators.
- **/
+ * @param obj the object to compare this comparator with.
+ * @return {@code true} if the specified object is a NullComparator
+ * with equivalent {@code null} comparison behavior
+ * (i.e. {@code null} high or low) and with equivalent underlying
+ * non-{@code null} object comparators.
+ */
@Override
public boolean equals(final Object obj) {
if (obj == null) {
@@ -172,11 +168,11 @@ public boolean equals(final Object obj) {
}
/**
- * Implement a hash code for this comparator that is consistent with
- * {@link #equals(Object)}.
+ * Implement a hash code for this comparator that is consistent with
+ * {@link #equals(Object)}.
*
- * @return a hash code for this comparator.
- **/
+ * @return a hash code for this comparator.
+ */
@Override
public int hashCode() {
return (nullsAreHigh ? -1 : 1) * nonNullComparator.hashCode();
From 8831944e5c176688a89d6cfbded8dbe1951cc8a7 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Tue, 30 Dec 2025 13:39:38 +0000
Subject: [PATCH 076/110] Javadoc
---
.../collection/AbstractCollectionTest.java | 208 +++++++++---------
.../collections4/list/AbstractListTest.java | 106 ++++-----
2 files changed, 158 insertions(+), 156 deletions(-)
diff --git a/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
index bec79c3e09..425b83b007 100644
--- a/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
+++ b/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
@@ -261,45 +261,45 @@ private static void assertUnorderedArrayEquals(final Object[] a1, final Object[]
}
/**
- * A collection instance that will be used for testing.
+ * A collection instance that will be used for testing.
*/
private Collection collection;
/**
- * Confirmed collection. This is an instance of a collection that is
- * confirmed to conform exactly to the java.util.Collection contract.
- * Modification operations are tested by performing a mod on your
- * collection, performing the exact same mod on an equivalent confirmed
- * collection, and then calling verify() to make sure your collection
- * still matches the confirmed collection.
+ * Confirmed collection. This is an instance of a collection that is
+ * confirmed to conform exactly to the java.util.Collection contract.
+ * Modification operations are tested by performing a mod on your
+ * collection, performing the exact same mod on an equivalent confirmed
+ * collection, and then calling verify() to make sure your collection
+ * still matches the confirmed collection.
*/
private Collection confirmed;
/**
- * Specifies whether equal elements in the collection are, in fact,
- * distinguishable with information not readily available.
- *
- * If a particular value is to be removed from the collection, then there is
- * one and only one value that can be removed, even if there are other
- * elements which are equal to it.
- *
- *
- * In most collection cases, elements are not distinguishable (equal is
- * equal), thus this method defaults to return false. In some cases,
- * however, they are. For example, the collection returned from the map's
- * values() collection view are backed by the map, so while there may be
- * two values that are equal, their associated keys are not. Since the
- * keys are distinguishable, the values are.
- *
- *
- * This flag is used to skip some verifications for iterator.remove()
- * where it is impossible to perform an equivalent modification on the
- * confirmed collection because it is not possible to determine which
- * value in the confirmed collection to actually remove. Tests that
- * override the default (i.e. where equal elements are distinguishable),
- * should provide additional tests on iterator.remove() to make sure the
- * proper elements are removed when remove() is called on the iterator.
- *
+ * Specifies whether equal elements in the collection are, in fact,
+ * distinguishable with information not readily available.
+ *
+ * If a particular value is to be removed from the collection, then there is
+ * one and only one value that can be removed, even if there are other
+ * elements which are equal to it.
+ *
+ *
+ * In most collection cases, elements are not distinguishable (equal is
+ * equal), thus this method defaults to return false. In some cases,
+ * however, they are. For example, the collection returned from the map's
+ * values() collection view are backed by the map, so while there may be
+ * two values that are equal, their associated keys are not. Since the
+ * keys are distinguishable, the values are.
+ *
+ *
+ * This flag is used to skip some verifications for iterator.remove()
+ * where it is impossible to perform an equivalent modification on the
+ * confirmed collection because it is not possible to determine which
+ * value in the confirmed collection to actually remove. Tests that
+ * override the default (i.e. where equal elements are distinguishable),
+ * should provide additional tests on iterator.remove() to make sure the
+ * proper elements are removed when remove() is called on the iterator.
+ *
*/
public boolean areEqualElementsDistinguishable() {
return false;
@@ -323,18 +323,18 @@ public Collection getConfirmed() {
}
/**
- * Returns an array of objects that are contained in a collection
- * produced by {@link #makeFullCollection()}.
- *
- * Every element in the returned array must be an element in a full collection.
- *
- *
- * The default implementation returns a heterogeneous array of
- * objects with some duplicates. null is added if allowed.
- * Override if you require specific testing elements. Note that if you
- * override {@link #makeFullCollection()}, you must override
- * this method to reflect the contents of a full collection.
- *
+ * Returns an array of objects that are contained in a collection
+ * produced by {@link #makeFullCollection()}.
+ *
+ * Every element in the returned array must be an element in a full collection.
+ *
+ *
+ * The default implementation returns a heterogeneous array of
+ * objects with some duplicates. null is added if allowed.
+ * Override if you require specific testing elements. Note that if you
+ * override {@link #makeFullCollection()}, you must override
+ * this method to reflect the contents of a full collection.
+ *
*/
@SuppressWarnings("unchecked")
public E[] getFullElements() {
@@ -347,12 +347,12 @@ public E[] getFullElements() {
}
/**
- * Returns a list of elements suitable for return by
- * {@link #getFullElements()}. The array returned by this method
- * does not include null, but does include a variety of objects
- * of different types. Override getFullElements to return
- * the results of this method if your collection does not support
- * the null element.
+ * Returns a list of elements suitable for return by
+ * {@link #getFullElements()}. The array returned by this method
+ * does not include null, but does include a variety of objects
+ * of different types. Override getFullElements to return
+ * the results of this method if your collection does not support
+ * the null element.
*/
@SuppressWarnings("unchecked")
public E[] getFullNonNullElements() {
@@ -379,10 +379,10 @@ public E[] getFullNonNullElements() {
}
/**
- * Returns a list of string elements suitable for return by
- * {@link #getFullElements()}. Override getFullElements to return
- * the results of this method if your collection does not support
- * heterogeneous elements or the null element.
+ * Returns a list of string elements suitable for return by
+ * {@link #getFullElements()}. Override getFullElements to return
+ * the results of this method if your collection does not support
+ * heterogeneous elements or the null element.
*/
public Object[] getFullNonNullStringElements() {
return new Object[] {
@@ -404,22 +404,22 @@ protected int getIterationBehaviour() {
}
/**
- * Returns an array of elements that are not contained in a
- * full collection. Every element in the returned array must
- * not exist in a collection returned by {@link #makeFullCollection()}.
- * The default implementation returns a heterogeneous array of elements
- * without null. Note that some of the tests add these elements
- * to an empty or full collection, so if your collection restricts
- * certain kinds of elements, you should override this method.
+ * Returns an array of elements that are not contained in a
+ * full collection. Every element in the returned array must
+ * not exist in a collection returned by {@link #makeFullCollection()}.
+ * The default implementation returns a heterogeneous array of elements
+ * without null. Note that some of the tests add these elements
+ * to an empty or full collection, so if your collection restricts
+ * certain kinds of elements, you should override this method.
*/
public E[] getOtherElements() {
return getOtherNonNullElements();
}
/**
- * Returns the default list of objects returned by
- * {@link #getOtherElements()}. Includes many objects
- * of different types.
+ * Returns the default list of objects returned by
+ * {@link #getOtherElements()}. Includes many objects
+ * of different types.
*/
@SuppressWarnings("unchecked")
public E[] getOtherNonNullElements() {
@@ -437,10 +437,10 @@ public E[] getOtherNonNullElements() {
}
/**
- * Returns a list of string elements suitable for return by
- * {@link #getOtherElements()}. Override getOtherElements to return
- * the results of this method if your collection does not support
- * heterogeneous elements or the null element.
+ * Returns a list of string elements suitable for return by
+ * {@link #getOtherElements()}. Override getOtherElements to return
+ * the results of this method if your collection does not support
+ * heterogeneous elements or the null element.
*/
public Object[] getOtherNonNullStringElements() {
return new Object[] {
@@ -450,14 +450,14 @@ public Object[] getOtherNonNullStringElements() {
}
/**
- * Returns true if the collections produced by
- * {@link #makeObject()} and {@link #makeFullCollection()}
- * support the {@code add} and {@code addAll}
- * operations.
- *
- * Default implementation returns true. Override if your collection
- * class does not support add or addAll.
- *
+ * Returns true if the collections produced by
+ * {@link #makeObject()} and {@link #makeFullCollection()}
+ * support the {@code add} and {@code addAll}
+ * operations.
+ *
+ * Default implementation returns true. Override if your collection
+ * class does not support add or addAll.
+ *
*/
public boolean isAddSupported() {
return true;
@@ -489,44 +489,44 @@ public boolean isNullSupported() {
}
/**
- * Returns true if the collections produced by
- * {@link #makeObject()} and {@link #makeFullCollection()}
- * support the {@code remove}, {@code removeAll},
- * {@code retainAll}, {@code clear} and
- * {@code iterator().remove()} methods.
- * Default implementation returns true. Override if your collection
- * class does not support removal operations.
+ * Returns true if the collections produced by
+ * {@link #makeObject()} and {@link #makeFullCollection()}
+ * support the {@code remove}, {@code removeAll},
+ * {@code retainAll}, {@code clear} and
+ * {@code iterator().remove()} methods.
+ * Default implementation returns true. Override if your collection
+ * class does not support removal operations.
*/
public boolean isRemoveSupported() {
return true;
}
/**
- * Returns a confirmed empty collection.
- * For instance, an {@link java.util.ArrayList} for lists or a
- * {@link java.util.HashSet} for sets.
+ * Returns a confirmed empty collection.
+ * For instance, an {@link java.util.ArrayList} for lists or a
+ * {@link java.util.HashSet} for sets.
*
- * @return a confirmed empty collection
+ * @return a confirmed empty collection
*/
public abstract Collection makeConfirmedCollection();
/**
- * Returns a confirmed full collection.
- * For instance, an {@link java.util.ArrayList} for lists or a
- * {@link java.util.HashSet} for sets. The returned collection
- * should contain the elements returned by {@link #getFullElements()}.
+ * Returns a confirmed full collection.
+ * For instance, an {@link java.util.ArrayList} for lists or a
+ * {@link java.util.HashSet} for sets. The returned collection
+ * should contain the elements returned by {@link #getFullElements()}.
*
- * @return a confirmed full collection
+ * @return a confirmed full collection
*/
public abstract Collection makeConfirmedFullCollection();
/**
- * Returns a full collection to be used for testing. The collection
- * returned by this method should contain every element returned by
- * {@link #getFullElements()}. The default implementation, in fact,
- * simply invokes {@code addAll} on an empty collection with
- * the results of {@link #getFullElements()}. Override this default
- * if your collection doesn't support addAll.
+ * Returns a full collection to be used for testing. The collection
+ * returned by this method should contain every element returned by
+ * {@link #getFullElements()}. The default implementation, in fact,
+ * simply invokes {@code addAll} on an empty collection with
+ * the results of {@link #getFullElements()}. Override this default
+ * if your collection doesn't support addAll.
*/
public Collection makeFullCollection() {
final Collection c = makeObject();
@@ -541,9 +541,9 @@ public Collection makeFullCollection() {
public abstract Collection makeObject();
/**
- * Resets the {@link #collection} and {@link #confirmed} fields to empty
- * collections. Invoke this method before performing a modification
- * test.
+ * Resets the {@link #collection} and {@link #confirmed} fields to empty
+ * collections. Invoke this method before performing a modification
+ * test.
*/
public void resetEmpty() {
this.setCollection(makeObject());
@@ -551,9 +551,9 @@ public void resetEmpty() {
}
/**
- * Resets the {@link #collection} and {@link #confirmed} fields to full
- * collections. Invoke this method before performing a modification
- * test.
+ * Resets the {@link #collection} and {@link #confirmed} fields to full
+ * collections. Invoke this method before performing a modification
+ * test.
*/
public void resetFull() {
this.setCollection(makeFullCollection());
@@ -562,6 +562,7 @@ public void resetFull() {
/**
* Sets the collection.
+ *
* @param collection the Collection to set
*/
public void setCollection(final Collection collection) {
@@ -570,6 +571,7 @@ public void setCollection(final Collection collection) {
/**
* Sets the confirmed.
+ *
* @param confirmed the Collection to set
*/
public void setConfirmed(final Collection confirmed) {
diff --git a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
index 839b82d42e..f1dad5c1b6 100644
--- a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
+++ b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
@@ -167,10 +167,10 @@ public boolean supportsSet() {
}
/**
- * Traverses to the beginning of the given iterator.
+ * Traverses to the beginning of the given iterator.
*
- * @param iter the iterator to traverse
- * @param i the starting index
+ * @param iter the iterator to traverse
+ * @param i the starting index
*/
private void backwardTest(final ListIterator iter, int i) {
final List list = getCollection();
@@ -203,14 +203,14 @@ public BulkTest bulkTestListIterator() {
}
/**
- * Returns a {@link BulkTest} for testing {@link List#subList(int,int)}.
- * The returned bulk test will run through every {@code TestList}
- * method, including another {@code bulkTestSubList}.
- * Sublists are tested until the size of the sublist is less than 10.
- * Each sublist is 6 elements smaller than its parent list.
- * (By default this means that two rounds of sublists will be tested).
- * The verify() method is overloaded to test that the original list is
- * modified when the sublist is.
+ * Returns a {@link BulkTest} for testing {@link List#subList(int,int)}.
+ * The returned bulk test will run through every {@code TestList}
+ * method, including another {@code bulkTestSubList}.
+ * Sublists are tested until the size of the sublist is less than 10.
+ * Each sublist is 6 elements smaller than its parent list.
+ * (By default this means that two rounds of sublists will be tested).
+ * The verify() method is overloaded to test that the original list is
+ * modified when the sublist is.
*/
public BulkTest bulkTestSubList() {
if (getFullElements().length - 6 < 10) {
@@ -271,10 +271,10 @@ protected void failFastMethod(final List list, final Method m) {
}
/**
- * Traverses to the end of the given iterator.
+ * Traverses to the end of the given iterator.
*
- * @param iter the iterator to traverse
- * @param i the starting index
+ * @param iter the iterator to traverse
+ * @param i the starting index
*/
private void forwardTest(final ListIterator iter, int i) {
final List list = getCollection();
@@ -328,11 +328,11 @@ public boolean isEqualsCheckable() {
}
/**
- * Returns true if the collections produced by
- * {@link #makeObject()} and {@link #makeFullCollection()}
- * support the set operation.
- * Default implementation returns true. Override if your collection
- * class does not support set.
+ * Returns true if the collections produced by
+ * {@link #makeObject()} and {@link #makeFullCollection()}
+ * support the set operation.
+ * Default implementation returns true. Override if your collection
+ * class does not support set.
*/
public boolean isSetSupported() {
return true;
@@ -458,7 +458,7 @@ void testFullListSerialization() throws IOException, ClassNotFoundException {
}
/**
- * Tests {@link List#add(int,Object)}.
+ * Tests {@link List#add(int,Object)}.
*/
@Test
void testListAddByIndex() {
@@ -478,8 +478,8 @@ void testListAddByIndex() {
}
/**
- * Tests bounds checking for {@link List#add(int, Object)} on an
- * empty list.
+ * Tests bounds checking for {@link List#add(int, Object)} on an
+ * empty list.
*/
@Test
void testListAddByIndexBoundsChecking() {
@@ -507,8 +507,8 @@ void testListAddByIndexBoundsChecking() {
}
/**
- * Tests bounds checking for {@link List#add(int, Object)} on a
- * full list.
+ * Tests bounds checking for {@link List#add(int, Object)} on a
+ * full list.
*/
@Test
void testListAddByIndexBoundsChecking2() {
@@ -536,7 +536,7 @@ void testListAddByIndexBoundsChecking2() {
}
/**
- * Tests {@link List#equals(Object)}.
+ * Tests {@link List#equals(Object)}.
*/
@Test
void testListEquals() {
@@ -607,7 +607,7 @@ public int size() {
}
/**
- * Tests {@link List#get(int)}.
+ * Tests {@link List#get(int)}.
*/
@Test
void testListGetByIndex() {
@@ -621,8 +621,8 @@ void testListGetByIndex() {
}
/**
- * Tests bounds checking for {@link List#get(int)} on an
- * empty list.
+ * Tests bounds checking for {@link List#get(int)} on an
+ * empty list.
*/
@Test
void testListGetByIndexBoundsChecking() {
@@ -645,8 +645,8 @@ void testListGetByIndexBoundsChecking() {
}
/**
- * Tests bounds checking for {@link List#get(int)} on a
- * full list.
+ * Tests bounds checking for {@link List#get(int)} on a
+ * full list.
*/
@Test
void testListGetByIndexBoundsChecking2() {
@@ -666,7 +666,7 @@ void testListGetByIndexBoundsChecking2() {
}
/**
- * Tests {@link List#hashCode()}.
+ * Tests {@link List#hashCode()}.
*/
@Test
void testListHashCode() {
@@ -684,7 +684,7 @@ void testListHashCode() {
}
/**
- * Tests {@link List#indexOf}.
+ * Tests {@link List#indexOf}.
*/
@Test
void testListIndexOf() {
@@ -707,8 +707,8 @@ void testListIndexOf() {
}
/**
- * Tests the {@link ListIterator#add(Object)} method of the list
- * iterator.
+ * Tests the {@link ListIterator#add(Object)} method of the list
+ * iterator.
*/
@Test
void testListIteratorAdd() {
@@ -743,8 +743,8 @@ void testListIteratorAdd() {
}
/**
- * Tests the {@link ListIterator#set(Object)} method of the list
- * iterator.
+ * Tests the {@link ListIterator#set(Object)} method of the list
+ * iterator.
*/
@Test
void testListIteratorSet() {
@@ -767,7 +767,7 @@ void testListIteratorSet() {
}
/**
- * Tests {@link List#lastIndexOf}.
+ * Tests {@link List#lastIndexOf}.
*/
@Test
void testListLastIndexOf() {
@@ -790,7 +790,7 @@ void testListLastIndexOf() {
}
/**
- * Tests the read-only bits of {@link List#listIterator()}.
+ * Tests the read-only bits of {@link List#listIterator()}.
*/
@Test
void testListListIterator() {
@@ -800,7 +800,7 @@ void testListListIterator() {
}
/**
- * Tests the read-only bits of {@link List#listIterator(int)}.
+ * Tests the read-only bits of {@link List#listIterator(int)}.
*/
@Test
void testListListIteratorByIndex() {
@@ -945,7 +945,7 @@ void testListListIteratorPreviousRemovePrevious() {
}
/**
- * Tests {@link List#remove(int)}.
+ * Tests {@link List#remove(int)}.
*/
@Test
void testListRemoveByIndex() {
@@ -964,8 +964,8 @@ void testListRemoveByIndex() {
}
/**
- * Tests bounds checking for {@link List#remove(int)} on an
- * empty list.
+ * Tests bounds checking for {@link List#remove(int)} on an
+ * empty list.
*/
@Test
void testListRemoveByIndexBoundsChecking() {
@@ -992,8 +992,8 @@ void testListRemoveByIndexBoundsChecking() {
}
/**
- * Tests bounds checking for {@link List#remove(int)} on a
- * full list.
+ * Tests bounds checking for {@link List#remove(int)} on a
+ * full list.
*/
@Test
void testListRemoveByIndexBoundsChecking2() {
@@ -1017,7 +1017,7 @@ void testListRemoveByIndexBoundsChecking2() {
}
/**
- * Test {@link List#set(int,Object)}.
+ * Test {@link List#set(int,Object)}.
*/
@Test
void testListSetByIndex() {
@@ -1039,8 +1039,8 @@ void testListSetByIndex() {
}
/**
- * Tests bounds checking for {@link List#set(int,Object)} on an
- * empty list.
+ * Tests bounds checking for {@link List#set(int,Object)} on an
+ * empty list.
*/
@Test
void testListSetByIndexBoundsChecking() {
@@ -1068,8 +1068,8 @@ void testListSetByIndexBoundsChecking() {
}
/**
- * Tests bounds checking for {@link List#set(int,Object)} on a
- * full list.
+ * Tests bounds checking for {@link List#set(int,Object)} on a
+ * full list.
*/
@Test
void testListSetByIndexBoundsChecking2() {
@@ -1169,8 +1169,8 @@ void testListSubListFailFastOnRemove() {
}
/**
- * If {@link #isSetSupported()} returns false, tests that set operation
- * raises UnsupportedOperationException.
+ * If {@link #isSetSupported()} returns false, tests that set operation
+ * raises UnsupportedOperationException.
*/
@Test
void testUnsupportedSet() {
@@ -1187,8 +1187,8 @@ void testUnsupportedSet() {
}
/**
- * Verifies that the test list implementation matches the confirmed list
- * implementation.
+ * Verifies that the test list implementation matches the confirmed list
+ * implementation.
*/
@Override
@SuppressWarnings("unchecked")
From 879d274971eceb8aace62f44ce6201516ac53038 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 31 Dec 2025 17:41:48 -0500
Subject: [PATCH 077/110] Javadoc: Empty Javadoc line before the 1st tag.
---
.../apache/commons/collections4/CollectionUtils.java | 6 ++++++
.../apache/commons/collections4/FluentIterable.java | 1 +
.../apache/commons/collections4/IteratorUtils.java | 1 +
.../org/apache/commons/collections4/ListUtils.java | 1 +
.../org/apache/commons/collections4/SetUtils.java | 2 ++
.../apache/commons/collections4/SortedBidiMap.java | 1 +
.../collections4/bag/AbstractBagDecorator.java | 1 +
.../commons/collections4/bag/AbstractMapBag.java | 2 ++
.../collections4/bag/AbstractSortedBagDecorator.java | 1 +
.../commons/collections4/bag/SynchronizedBag.java | 1 +
.../collections4/bidimap/AbstractDualBidiMap.java | 5 +++++
.../commons/collections4/bidimap/DualTreeBidiMap.java | 2 ++
.../commons/collections4/bidimap/TreeBidiMap.java | 2 ++
.../collections4/bloomfilter/BitMapExtractor.java | 1 +
.../commons/collections4/bloomfilter/BloomFilter.java | 1 +
.../collections4/bloomfilter/CountingBloomFilter.java | 2 ++
.../commons/collections4/bloomfilter/IndexFilter.java | 3 +++
.../collections4/bloomfilter/LayerManager.java | 1 +
.../collection/AbstractCollectionDecorator.java | 1 +
.../collections4/collection/CompositeCollection.java | 11 +++++++++++
.../collections4/iterators/BoundedIterator.java | 1 +
.../collections4/iterators/EmptyMapIterator.java | 2 ++
.../iterators/EmptyOrderedMapIterator.java | 2 ++
.../collections4/iterators/FilterListIterator.java | 2 ++
.../collections4/iterators/PermutationIterator.java | 3 +++
.../collections4/iterators/SingletonListIterator.java | 1 +
.../commons/collections4/keyvalue/MultiKey.java | 2 ++
.../collections4/list/AbstractListDecorator.java | 1 +
.../collections4/map/AbstractMapDecorator.java | 1 +
.../collections4/map/AbstractOrderedMapDecorator.java | 1 +
.../collections4/map/AbstractReferenceMap.java | 2 ++
.../collections4/map/AbstractSortedMapDecorator.java | 2 ++
.../map/EntrySetToMapIteratorAdapter.java | 2 ++
.../collections4/multimap/AbstractListValuedMap.java | 1 +
.../collections4/multimap/AbstractSetValuedMap.java | 1 +
.../collections4/multiset/AbstractMapMultiSet.java | 4 ++++
.../collections4/multiset/SynchronizedMultiSet.java | 1 +
.../collections4/set/AbstractSetDecorator.java | 1 +
.../collections4/set/AbstractSortedSetDecorator.java | 1 +
.../apache/commons/collections4/set/CompositeSet.java | 3 +++
.../splitmap/AbstractIterableGetMapDecorator.java | 2 ++
.../collections4/trie/AbstractBitwiseTrie.java | 1 +
.../collections4/trie/analyzer/StringKeyAnalyzer.java | 1 +
43 files changed, 84 insertions(+)
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index 2ba14cc76e..9cc1b80e60 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -58,6 +58,7 @@ public class CollectionUtils {
/**
* Helper class to easily access cardinality properties of two collections.
+ *
* @param the element type
*/
private static class CardinalityHelper {
@@ -169,6 +170,7 @@ public int hashCode() {
/**
* Helper class for set-related operations, for example union, subtract, intersection.
+ *
* @param the element type
*/
private static final class SetOperationCardinalityHelper extends CardinalityHelper implements Iterable {
@@ -181,6 +183,7 @@ private static final class SetOperationCardinalityHelper extends CardinalityH
/**
* Create a new set operation helper from the two collections.
+ *
* @param a the first collection
* @param b the second collection
*/
@@ -200,6 +203,7 @@ public Iterator iterator() {
/**
* Returns the resulting collection.
+ *
* @return the result
*/
public Collection list() {
@@ -208,6 +212,7 @@ public Collection list() {
/**
* Add the object {@code count} times to the result collection.
+ *
* @param obj the object to add
* @param count the count
*/
@@ -373,6 +378,7 @@ public static int cardinality(final O obj, final Iterable super O> collect
/**
* Ensures an index is not negative.
+ *
* @param index the index to check.
* @throws IndexOutOfBoundsException if the index is negative.
*/
diff --git a/src/main/java/org/apache/commons/collections4/FluentIterable.java b/src/main/java/org/apache/commons/collections4/FluentIterable.java
index e58ad1e281..77523d3596 100644
--- a/src/main/java/org/apache/commons/collections4/FluentIterable.java
+++ b/src/main/java/org/apache/commons/collections4/FluentIterable.java
@@ -138,6 +138,7 @@ public static FluentIterable of(final T... elements) {
/**
* Create a new FluentIterable by wrapping the provided iterable.
+ *
* @param iterable the iterable to wrap
*/
private FluentIterable(final Iterable iterable) {
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index 41858a7af8..cf27afb197 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -759,6 +759,7 @@ private static E find(final Iterator iterator, final Predicate super E>
* The Iterator is advanced to {@code 0} (or to the end, if
* {@code 0} exceeds the number of entries) as a side effect of this method.
*
+ *
* @param the type of object in the {@link Iterator}
* @param iterator the iterator to get a value from
* @return the first object
diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java
index 1fb90acc69..7d658cb434 100644
--- a/src/main/java/org/apache/commons/collections4/ListUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ListUtils.java
@@ -96,6 +96,7 @@ public void visitKeepCommand(final E object) {
/**
* Provides a partition view on a {@link List}.
+ *
* @since 4.0
*/
private static final class Partition extends AbstractList> {
diff --git a/src/main/java/org/apache/commons/collections4/SetUtils.java b/src/main/java/org/apache/commons/collections4/SetUtils.java
index bc375cfe4a..a6029f9d15 100644
--- a/src/main/java/org/apache/commons/collections4/SetUtils.java
+++ b/src/main/java/org/apache/commons/collections4/SetUtils.java
@@ -81,6 +81,7 @@ public > void copyInto(final S set) {
/**
* Return an iterator for this view; the returned iterator is
* not required to be unmodifiable.
+ *
* @return a new iterator for this view
*/
protected abstract Iterator createIterator();
@@ -644,6 +645,7 @@ public static SortedSet unmodifiableNavigableSet(final NavigableSet se
/**
* Creates an unmodifiable set from the given items. If the passed var-args argument is {@code
* null}, then the method returns {@code null}.
+ *
* @param the element type
* @param items the elements that make up the new set
* @return a set
diff --git a/src/main/java/org/apache/commons/collections4/SortedBidiMap.java b/src/main/java/org/apache/commons/collections4/SortedBidiMap.java
index 5d175aaf08..72cd7e779c 100644
--- a/src/main/java/org/apache/commons/collections4/SortedBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/SortedBidiMap.java
@@ -56,6 +56,7 @@ public interface SortedBidiMap extends OrderedBidiMap, SortedMap super V> valueComparator();
diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java b/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java
index ea94dd2012..a932fcff2c 100644
--- a/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java
@@ -38,6 +38,7 @@ public abstract class AbstractBagDecorator
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractBagDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java b/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java
index 4619afc92d..f64d19c933 100644
--- a/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java
+++ b/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java
@@ -121,6 +121,7 @@ protected static class MutableInteger {
/**
* Constructs a new instance.
+ *
* @param value the initial value
*/
MutableInteger(final int value) {
@@ -479,6 +480,7 @@ public boolean removeAll(final Collection> coll) {
/**
* Remove any members of the bag that are not in the given bag, respecting
* cardinality.
+ *
* @see #retainAll(Collection)
* @param other the bag to retain
* @return {@code true} if this call changed the collection
diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java b/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java
index d73a5569b0..723fc65f9e 100644
--- a/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java
@@ -37,6 +37,7 @@ public abstract class AbstractSortedBagDecorator
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractSortedBagDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java b/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java
index 1313f1cc62..5990e1a830 100644
--- a/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java
+++ b/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java
@@ -46,6 +46,7 @@ final class SynchronizedBagSet extends SynchronizedCollection implements Set<
/**
* Constructs a new instance.
+ *
* @param set the set to decorate
* @param lock the lock to use, shared with the bag
*/
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java
index 67c20c236c..f22501b846 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java
@@ -67,6 +67,7 @@ protected static class BidiMapIterator implements MapIterator, Reset
/**
* Constructs a new instance.
+ *
* @param parent the parent map
*/
protected BidiMapIterator(final AbstractDualBidiMap parent) {
@@ -210,6 +211,7 @@ protected static class EntrySetIterator extends AbstractIteratorDecorator<
/**
* Constructs a new instance.
+ *
* @param iterator the iterator to decorate
* @param parent the parent map
*/
@@ -298,6 +300,7 @@ protected static class KeySetIterator extends AbstractIteratorDecorator {
/**
* Constructs a new instance.
+ *
* @param iterator the iterator to decorate
* @param parent the parent map
*/
@@ -339,6 +342,7 @@ protected static class MapEntry extends AbstractMapEntryDecorator {
/**
* Constructs a new instance.
+ *
* @param entry the entry to decorate
* @param parent the parent map
*/
@@ -419,6 +423,7 @@ protected static class ValuesIterator extends AbstractIteratorDecorator {
/**
* Constructs a new instance.
+ *
* @param iterator the iterator to decorate
* @param parent the parent map
*/
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
index f539081ca4..e897be87b2 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
@@ -78,6 +78,7 @@ protected static class BidiOrderedMapIterator implements OrderedMapIterato
/**
* Constructs a new instance.
+ *
* @param parent the parent map
*/
protected BidiOrderedMapIterator(final AbstractDualBidiMap parent) {
@@ -174,6 +175,7 @@ public String toString() {
protected static class ViewMap extends AbstractSortedMapDecorator {
/**
* Constructs a new instance.
+ *
* @param bidi the parent bidi map
* @param sm the subMap sorted map
*/
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
index c7ed23ff94..2524c11a96 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
@@ -95,6 +95,7 @@ abstract class AbstractView extends AbstractSet {
/**
* Constructs a new instance.
+ *
* @param orderType the KEY or VALUE int for the order
*/
AbstractView(final DataElement orderType) {
@@ -130,6 +131,7 @@ abstract class AbstractViewIterator {
/**
* Constructs a new instance.
+ *
* @param orderType the KEY or VALUE int for the order
*/
AbstractViewIterator(final DataElement orderType) {
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java
index 886a43057b..fcb101e757 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BitMapExtractor.java
@@ -94,6 +94,7 @@ static BitMapExtractor fromIndexExtractor(final IndexExtractor extractor, final
* The default implementation of this method is slow. It is recommended
* that implementing classes reimplement this method.
*
+ *
* @return An array of bit map data.
*/
default long[] asBitMapArray() {
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java
index 7f89b26e91..b006e5317c 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java
@@ -232,6 +232,7 @@ default int estimateUnion(final BloomFilter> other) {
/**
* Gets the shape that was used when the filter was built.
+ *
* @return The shape the filter was built with.
*/
Shape getShape();
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java
index cdad5286e6..0a1dbed676 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java
@@ -234,6 +234,7 @@ default boolean merge(final Hasher hasher) {
* to a CellExtractor and add that.
*
Implementations should throw {@code IllegalArgumentException} and no other exception on bad input.
*
+ *
* @param indexExtractor the IndexExtractor
* @return {@code true} if the removal was successful and the state is valid
* @see #isValid()
@@ -348,6 +349,7 @@ default boolean remove(final IndexExtractor indexExtractor) {
/**
* The default implementation is a no-op since the counting bloom filter returns an unique IndexExtractor by default.
+ *
* @return this counting Bloom filter.
*/
@Override
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/IndexFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/IndexFilter.java
index a494ee9aa2..646093f298 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/IndexFilter.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/IndexFilter.java
@@ -32,6 +32,7 @@ public final class IndexFilter {
/**
* An IndexTracker implementation that uses an array of integers to track whether or not a
* number has been seen. Suitable for Shapes that have few hash functions.
+ *
* @since 4.5.0
*/
static class ArrayTracker implements IntPredicate {
@@ -40,6 +41,7 @@ static class ArrayTracker implements IntPredicate {
/**
* Constructs the tracker based on the shape.
+ *
* @param shape the shape to build the tracker for.
*/
ArrayTracker(final Shape shape) {
@@ -70,6 +72,7 @@ static class BitMapTracker implements IntPredicate {
/**
* Constructs a bit map based tracker for the specified shape.
+ *
* @param shape The shape that is being generated.
*/
BitMapTracker(final Shape shape) {
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java b/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
index 607bf0517a..7aa9b1c590 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
@@ -361,6 +361,7 @@ public LayerManager copy() {
/**
* Gets the Bloom filter from the first layer.
* No extension check is performed during this call.
+ *
* @return The Bloom filter from the first layer.
* @see #getTarget()
*/
diff --git a/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java b/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java
index 34ce3d3d70..e764eb5566 100644
--- a/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java
@@ -67,6 +67,7 @@ public abstract class AbstractCollectionDecorator
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractCollectionDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java b/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java
index 1b21ab3332..d89db8d669 100644
--- a/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java
+++ b/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java
@@ -37,6 +37,7 @@
* Add and remove operations require the use of a pluggable strategy. If no
* strategy is provided then add and remove are unsupported.
*
+ *
* @param the type of the elements in the collection
* @since 3.0
*/
@@ -228,6 +229,7 @@ public void addComposited(final Collection compositeCollection1,
*
* This implementation calls {@code clear()} on each collection.
*
+ *
* @throws UnsupportedOperationException if clear is unsupported
*/
@Override
@@ -242,6 +244,7 @@ public void clear() {
*
* This implementation calls {@code contains()} on each collection.
*
+ *
* @param obj the object to search for
* @return true if obj is contained in any of the contained collections
*/
@@ -261,6 +264,7 @@ public boolean contains(final Object obj) {
* This implementation calls {@code contains()} for each element in the
* specified collection.
*
+ *
* @param coll the collection to check for
* @return true if all elements contained
*/
@@ -288,6 +292,7 @@ public List> getCollections() {
/**
* Gets the collection mutator to be used for this CompositeCollection.
+ *
* @return CollectionMutator<E>
*/
protected CollectionMutator getMutator() {
@@ -299,6 +304,7 @@ protected CollectionMutator getMutator() {
*
* This implementation calls {@code isEmpty()} on each collection.
*
+ *
* @return true if all of the contained collections are empty
*/
@Override
@@ -316,6 +322,7 @@ public boolean isEmpty() {
*
* This implementation uses an {@code IteratorChain}.
*
+ *
* @return an {@code IteratorChain} instance which supports
* {@code remove()}. Iteration occurs over contained collections in
* the order they were added, but this behavior should not be relied upon.
@@ -356,6 +363,7 @@ public boolean remove(final Object obj) {
*
* This implementation calls {@code removeAll} on each collection.
*
+ *
* @param coll the collection to remove
* @return true if the collection was modified
* @throws UnsupportedOperationException if removeAll is unsupported
@@ -386,6 +394,7 @@ public void removeComposited(final Collection coll) {
*
* This implementation calls {@code removeIf} on each collection.
*
+ *
* @param filter a predicate which returns true for elements to be removed
* @return true if the collection was modified
* @throws UnsupportedOperationException if removeIf is unsupported
@@ -409,6 +418,7 @@ public boolean removeIf(final Predicate super E> filter) {
*
* This implementation calls {@code retainAll()} on each collection.
*
+ *
* @param coll the collection to remove
* @return true if the collection was modified
* @throws UnsupportedOperationException if retainAll is unsupported
@@ -438,6 +448,7 @@ public void setMutator(final CollectionMutator mutator) {
*
* This implementation calls {@code size()} on each collection.
*
+ *
* @return total number of elements in all contained containers
*/
@Override
diff --git a/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java b/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java
index 73d3b2f316..300910b442 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java
@@ -82,6 +82,7 @@ public BoundedIterator(final Iterator extends E> iterator, final long offset,
/**
* Checks whether the iterator is still within its bounded range.
+ *
* @return {@code true} if the iterator is within its bounds, {@code false} otherwise
*/
private boolean checkBounds() {
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java
index 52265fec20..1aac23f18b 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyMapIterator.java
@@ -30,6 +30,7 @@ public class EmptyMapIterator extends AbstractEmptyMapIterator imple
/**
* Singleton instance of the iterator.
+ *
* @since 3.1
*/
@SuppressWarnings("rawtypes")
@@ -37,6 +38,7 @@ public class EmptyMapIterator extends AbstractEmptyMapIterator imple
/**
* Gets a typed instance of the iterator.
+ *
* @param the key type
* @param the value type
* @return {@link MapIterator}<K, V>
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java
index 0ee07de620..b3e0fb4de7 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyOrderedMapIterator.java
@@ -30,6 +30,7 @@ public class EmptyOrderedMapIterator extends AbstractEmptyMapIterator extends AbstractEmptyMapIterator the key type
* @param the value type
* @return {@link OrderedMapIterator}<K, V>
diff --git a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
index 7a2e88b72b..67fb422c49 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
@@ -109,6 +109,7 @@ public FilterListIterator(final Predicate super E> predicate) {
/**
* Not supported.
+ *
* @param o the element to insert
*/
@Override
@@ -194,6 +195,7 @@ public void remove() {
/**
* Not supported.
+ *
* @param ignored the element with which to replace the last element returned by
* {@code next} or {@code previous}
*/
diff --git a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
index 542cdae0d0..6aace66579 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
@@ -71,6 +71,7 @@ public class PermutationIterator implements Iterator> {
/**
* Standard constructor for this class.
+ *
* @param collection the collection to generate permutations for
* @throws NullPointerException if coll is null
*/
@@ -91,6 +92,7 @@ public PermutationIterator(final Collection extends E> collection) {
/**
* Indicates if there are more permutation available.
+ *
* @return true if there are more permutations, otherwise false
*/
@Override
@@ -100,6 +102,7 @@ public boolean hasNext() {
/**
* Returns the next permutation of the input collection.
+ *
* @return a list of the permutator's elements representing a permutation
* @throws NoSuchElementException if there are no more permutations
*/
diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java
index 6496e41a79..53529a98b2 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java
@@ -140,6 +140,7 @@ public int previousIndex() {
/**
* Remove the object from this iterator.
+ *
* @throws IllegalStateException if the {@code next} or {@code previous}
* method has not yet been called, or the {@code remove} method
* has already been called after the last call to {@code next}
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
index 4515372d23..dcc621eb3b 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
@@ -233,6 +233,7 @@ public MultiKey(final K[] keys, final boolean makeClone) {
/**
* Calculate the hash code of the instance using the provided keys.
+ *
* @param keys the keys to calculate the hash code for
*/
private void calculateHashCode(final Object[] keys) {
@@ -316,6 +317,7 @@ public int hashCode() {
* Recalculate the hash code after deserialization. The hash code of some
* keys might have change (hash codes based on the system hash code are
* only stable for the same process).
+ *
* @return the instance with recalculated hash code
*/
protected Object readResolve() {
diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractListDecorator.java b/src/main/java/org/apache/commons/collections4/list/AbstractListDecorator.java
index 25ecf62669..ee85167de5 100644
--- a/src/main/java/org/apache/commons/collections4/list/AbstractListDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/list/AbstractListDecorator.java
@@ -38,6 +38,7 @@ public abstract class AbstractListDecorator extends AbstractCollectionDecorat
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractListDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractMapDecorator.java b/src/main/java/org/apache/commons/collections4/map/AbstractMapDecorator.java
index 5047b1ac76..ffcae5ee29 100644
--- a/src/main/java/org/apache/commons/collections4/map/AbstractMapDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/map/AbstractMapDecorator.java
@@ -47,6 +47,7 @@ public abstract class AbstractMapDecorator extends AbstractIterableMap extends AbstractMapDecor
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractOrderedMapDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
index 3b08521555..bf10403514 100644
--- a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
@@ -309,6 +309,7 @@ protected void onPurge() {
/**
* Purges the specified reference
+ *
* @param ref the reference to purge
* @return true or false
*/
@@ -517,6 +518,7 @@ public enum ReferenceStrength {
/**
* Resolve enum from int.
+ *
* @param value the int value
* @return ReferenceType
* @throws IllegalArgumentException if the specified value is invalid.
diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractSortedMapDecorator.java b/src/main/java/org/apache/commons/collections4/map/AbstractSortedMapDecorator.java
index 78a49ef6a1..75a6d7dca3 100644
--- a/src/main/java/org/apache/commons/collections4/map/AbstractSortedMapDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/map/AbstractSortedMapDecorator.java
@@ -59,6 +59,7 @@ protected static class SortedMapIterator extends EntrySetToMapIteratorAdap
/**
* Create a new AbstractSortedMapDecorator.SortedMapIterator.
+ *
* @param entrySet the entrySet to iterate
*/
protected SortedMapIterator(final Set> entrySet) {
@@ -94,6 +95,7 @@ public synchronized void reset() {
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractSortedMapDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/map/EntrySetToMapIteratorAdapter.java b/src/main/java/org/apache/commons/collections4/map/EntrySetToMapIteratorAdapter.java
index 3f9d57ee3d..636e14d9e6 100644
--- a/src/main/java/org/apache/commons/collections4/map/EntrySetToMapIteratorAdapter.java
+++ b/src/main/java/org/apache/commons/collections4/map/EntrySetToMapIteratorAdapter.java
@@ -43,6 +43,7 @@ public class EntrySetToMapIteratorAdapter implements MapIterator, Re
/**
* Create a new EntrySetToMapIteratorAdapter.
+ *
* @param entrySet the entrySet to adapt
*/
public EntrySetToMapIteratorAdapter(final Set> entrySet) {
@@ -52,6 +53,7 @@ public EntrySetToMapIteratorAdapter(final Set> entrySet) {
/**
* Gets the currently active entry.
+ *
* @return Map.Entry<K, V>
*/
protected synchronized Map.Entry current() {
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
index f14371f9bc..de34ee31bb 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
@@ -242,6 +242,7 @@ protected AbstractListValuedMap(final Map> map) {
/**
* Creates a new value collection using the provided factory.
+ *
* @return a new list
*/
@Override
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
index 5f3b940cf4..ff98ea2b75 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
@@ -87,6 +87,7 @@ protected AbstractSetValuedMap(final Map> map) {
/**
* Creates a new value collection using the provided factory.
+ *
* @return a new set
*/
@Override
diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
index 19e7f620c3..317e7d2c5e 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
@@ -64,6 +64,7 @@ protected static class EntrySetIterator implements Iterator> {
/**
* Constructs a new instance.
+ *
* @param decorated the iterator to decorate
* @param parent the parent multiset
*/
@@ -174,6 +175,7 @@ protected static class MultiSetEntry extends AbstractEntry {
/**
* Constructs a new instance.
+ *
* @param parentEntry the entry to decorate
*/
protected MultiSetEntry(final Map.Entry parentEntry) {
@@ -200,6 +202,7 @@ protected static class MutableInteger {
/**
* Constructs a new instance.
+ *
* @param value the initial value
*/
MutableInteger(final int value) {
@@ -238,6 +241,7 @@ protected static class UniqueSetIterator extends AbstractIteratorDecorator
/**
* Constructs a new instance.
+ *
* @param iterator the iterator to decorate
* @param parent the parent multiset
*/
diff --git a/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
index 426ad6438e..9fdc2188fa 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
@@ -45,6 +45,7 @@ static class SynchronizedSet extends SynchronizedCollection implements Set
/**
* Constructs a new instance.
+ *
* @param set the set to decorate
* @param lock the lock to use, shared with the multiset
*/
diff --git a/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java b/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java
index 7df2cd040d..9b0d010d86 100644
--- a/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java
@@ -37,6 +37,7 @@ public abstract class AbstractSetDecorator extends AbstractCollectionDecorato
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractSetDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java b/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java
index 4ac4831f1f..14d8d82778 100644
--- a/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java
@@ -38,6 +38,7 @@ public abstract class AbstractSortedSetDecorator
/**
* Constructor only used in deserialization, do not use otherwise.
+ *
* @since 3.1
*/
protected AbstractSortedSetDecorator() {
diff --git a/src/main/java/org/apache/commons/collections4/set/CompositeSet.java b/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
index 6560153fc8..7c51e5eee0 100644
--- a/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
@@ -289,6 +289,7 @@ public boolean containsAll(final Collection> coll) {
/**
* {@inheritDoc}
+ *
* @see java.util.Set#equals
*/
@Override
@@ -302,6 +303,7 @@ public boolean equals(final Object obj) {
/**
* Gets the set mutator to be used for this CompositeSet.
+ *
* @return the set mutator
*/
protected SetMutator getMutator() {
@@ -319,6 +321,7 @@ public List> getSets() {
/**
* {@inheritDoc}
+ *
* @see java.util.Set#hashCode
*/
@Override
diff --git a/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java b/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java
index 6b394e1fce..60bfe5df54 100644
--- a/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java
@@ -46,6 +46,7 @@ protected AbstractIterableGetMapDecorator() {
/**
* Create a new AbstractSplitMapDecorator.
+ *
* @param map the map to decorate, must not be null
* @throws NullPointerException if map is null
*/
@@ -107,6 +108,7 @@ public Set keySet() {
/**
* Gets a MapIterator over this Get.
+ *
* @return MapIterator<K, V>
*/
@Override
diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java
index b934f7c83f..5e7d69a2d2 100644
--- a/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java
@@ -184,6 +184,7 @@ final boolean compareKeys(final K key, final K other) {
/**
* Gets the {@link KeyAnalyzer} that constructed the {@link Trie}.
+ *
* @return the {@link KeyAnalyzer} used by this {@link Trie}
*/
protected KeyAnalyzer super K> getKeyAnalyzer() {
diff --git a/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java b/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java
index d3d76a2589..6b0aaa6dfb 100644
--- a/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java
+++ b/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java
@@ -23,6 +23,7 @@
*
* This class is stateless.
*
+ *
* @since 4.0
*/
public class StringKeyAnalyzer extends KeyAnalyzer {
From 7209aabe965d128b3c3372d094a75b7558ea5cc8 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Thu, 1 Jan 2026 07:53:13 -0500
Subject: [PATCH 078/110] Fix XML Schema xsi:schemaLocation name (as opposed to
URI)
---
src/site/xdoc/building.xml | 2 +-
src/site/xdoc/compatibility.xml | 2 +-
src/site/xdoc/download_collections.xml | 2 +-
src/site/xdoc/history.xml | 2 +-
src/site/xdoc/index.xml | 2 +-
src/site/xdoc/issue-tracking.xml | 2 +-
src/site/xdoc/mail-lists.xml | 2 +-
src/site/xdoc/pick.xml | 2 +-
src/site/xdoc/proposal.xml | 2 +-
src/site/xdoc/release_3_2.xml | 2 +-
src/site/xdoc/release_3_2_1.xml | 2 +-
src/site/xdoc/release_3_2_2.xml | 2 +-
src/site/xdoc/release_4_0.xml | 2 +-
src/site/xdoc/release_4_1.xml | 2 +-
src/site/xdoc/release_4_2.xml | 2 +-
src/site/xdoc/release_4_3.xml | 2 +-
src/site/xdoc/release_4_4.xml | 2 +-
src/site/xdoc/userguide.xml | 2 +-
18 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml
index 29a33f8a6c..504ffd3041 100644
--- a/src/site/xdoc/building.xml
+++ b/src/site/xdoc/building.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
BuildingApache Commons Team
diff --git a/src/site/xdoc/compatibility.xml b/src/site/xdoc/compatibility.xml
index 7663e6a1eb..65d5728a0b 100644
--- a/src/site/xdoc/compatibility.xml
+++ b/src/site/xdoc/compatibility.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
CompatibilityApache Commons Team
diff --git a/src/site/xdoc/download_collections.xml b/src/site/xdoc/download_collections.xml
index c04d1ce314..789da0245e 100644
--- a/src/site/xdoc/download_collections.xml
+++ b/src/site/xdoc/download_collections.xml
@@ -58,7 +58,7 @@ limitations under the License.
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Download Apache Commons CollectionsApache Commons Team
diff --git a/src/site/xdoc/history.xml b/src/site/xdoc/history.xml
index 5cdffe4bd8..9dbca3f23c 100644
--- a/src/site/xdoc/history.xml
+++ b/src/site/xdoc/history.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
HistoryApache Commons Team
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index 9b2609847c..aa7af2ae4e 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
HomeApache Commons Team
diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml
index 6f617d9a2c..f296f577a0 100644
--- a/src/site/xdoc/issue-tracking.xml
+++ b/src/site/xdoc/issue-tracking.xml
@@ -43,7 +43,7 @@ limitations under the License.
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Apache Commons Collections Issue trackingApache Commons Team
diff --git a/src/site/xdoc/mail-lists.xml b/src/site/xdoc/mail-lists.xml
index 58d28d1246..e59bf52bb5 100644
--- a/src/site/xdoc/mail-lists.xml
+++ b/src/site/xdoc/mail-lists.xml
@@ -41,7 +41,7 @@ limitations under the License.
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Apache Commons Collections Mailing ListsApache Commons Team
diff --git a/src/site/xdoc/pick.xml b/src/site/xdoc/pick.xml
index 392fad52b0..408f51dc7f 100644
--- a/src/site/xdoc/pick.xml
+++ b/src/site/xdoc/pick.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Choosing a collectionApache Commons Team
diff --git a/src/site/xdoc/proposal.xml b/src/site/xdoc/proposal.xml
index f0a9481925..e936cfaf2e 100644
--- a/src/site/xdoc/proposal.xml
+++ b/src/site/xdoc/proposal.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Proposal
diff --git a/src/site/xdoc/release_3_2.xml b/src/site/xdoc/release_3_2.xml
index f729134ba9..e26d065ef0 100644
--- a/src/site/xdoc/release_3_2.xml
+++ b/src/site/xdoc/release_3_2.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for version 3.2Apache Commons Team
diff --git a/src/site/xdoc/release_3_2_1.xml b/src/site/xdoc/release_3_2_1.xml
index 329d61d03e..1d486c3723 100644
--- a/src/site/xdoc/release_3_2_1.xml
+++ b/src/site/xdoc/release_3_2_1.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for version 3.2.1Apache Commons Team
diff --git a/src/site/xdoc/release_3_2_2.xml b/src/site/xdoc/release_3_2_2.xml
index a4c9847c04..90ac6aae95 100644
--- a/src/site/xdoc/release_3_2_2.xml
+++ b/src/site/xdoc/release_3_2_2.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for version 3.2.2Apache Commons Team
diff --git a/src/site/xdoc/release_4_0.xml b/src/site/xdoc/release_4_0.xml
index 122d5a2334..f101757346 100644
--- a/src/site/xdoc/release_4_0.xml
+++ b/src/site/xdoc/release_4_0.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for version 4.0Apache Commons Team
diff --git a/src/site/xdoc/release_4_1.xml b/src/site/xdoc/release_4_1.xml
index ab372a377f..d5628cec0e 100644
--- a/src/site/xdoc/release_4_1.xml
+++ b/src/site/xdoc/release_4_1.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for version 4.1Apache Commons Team
diff --git a/src/site/xdoc/release_4_2.xml b/src/site/xdoc/release_4_2.xml
index 89b1a4927a..757d3b2a55 100644
--- a/src/site/xdoc/release_4_2.xml
+++ b/src/site/xdoc/release_4_2.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for v4.2Apache Commons Team
diff --git a/src/site/xdoc/release_4_3.xml b/src/site/xdoc/release_4_3.xml
index db6ac4433c..0d77a48097 100644
--- a/src/site/xdoc/release_4_3.xml
+++ b/src/site/xdoc/release_4_3.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for v4.3Apache Commons Team
diff --git a/src/site/xdoc/release_4_4.xml b/src/site/xdoc/release_4_4.xml
index d1f668f889..de24fbdc44 100644
--- a/src/site/xdoc/release_4_4.xml
+++ b/src/site/xdoc/release_4_4.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Release notes for v4.4Apache Commons Team
diff --git a/src/site/xdoc/userguide.xml b/src/site/xdoc/userguide.xml
index 28cece2c26..07a96019bc 100644
--- a/src/site/xdoc/userguide.xml
+++ b/src/site/xdoc/userguide.xml
@@ -17,7 +17,7 @@
-->
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
User guideApache Commons Team
From 268ee340f0d0be4fa6f65ba1571fa7fd1c6e88e4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 1 Jan 2026 12:53:57 +0000
Subject: [PATCH 079/110] Bump actions/upload-artifact from 5.0.0 to 6.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/330a01c490aca151604b8cf639adc76d48f6c5d4...b7c566a772e6b6bfb58ed0dc250532a479d7789f)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-version: 6.0.0
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/scorecards-analysis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 4652677d02..ff3a7cfb9b 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -57,7 +57,7 @@ jobs:
publish_results: true
- name: "Upload artifact"
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
From 9f34893fb78269c3a9a9a89576bdaae676b66729 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 2 Jan 2026 17:06:34 -0500
Subject: [PATCH 080/110] Bump org.apache.commons:commons-parent from 93 to 94
---
pom.xml | 2 +-
src/changes/changes.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index c51e26167d..d722763157 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
org.apache.commonscommons-parent
- 93
+ 944.0.0commons-collections4
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8ffe49634a..2c5cb27791 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -47,7 +47,7 @@
Add a Maven benchmark profile for JMH.Add a Maven benchmark profile for JMH.
- Bump org.apache.commons:commons-parent from 81 to 93 #612, #645, #662, #663.
+ Bump org.apache.commons:commons-parent from 81 to 94 #612, #645, #662, #663.Bump com.google.guava:guava-testlib from 33.3.1-jre to 33.5.0-jre #644.Bump PMD from 7.8.0 to 7.13.0 (now inherited from parent POM).Bump org.easymock:easymock from 5.5.0 to 5.6.0 #617.
From 2bed7c70a2cd38cfc965079f7273888e46ca54b0 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 2 Jan 2026 18:21:02 -0500
Subject: [PATCH 081/110] Javadoc
---
.../apache/commons/collections4/functors/AbstractPredicate.java | 2 +-
.../collections4/functors/AbstractQuantifierPredicate.java | 2 +-
.../org/apache/commons/collections4/sequence/EditCommand.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
index 5b7e409173..34a824df6a 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
@@ -19,7 +19,7 @@
import org.apache.commons.collections4.Predicate;
/**
- * Abstract base class for predicates.
+ * Abstrac class for predicates.
*
* @param the type of the input to the predicate.
* @since 4.5.0-M3
diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
index c8b902aa04..cd0ee6219c 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
@@ -21,7 +21,7 @@
import org.apache.commons.collections4.Predicate;
/**
- * Abstract base class for quantification predicates, for example All, Any, None.
+ * Abstrac class for quantification predicates, for example All, Any, None.
*
* @param the type of the input to the predicate.
* @since 4.0
diff --git a/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java b/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java
index 5bdff115e5..0c76014199 100644
--- a/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java
+++ b/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java
@@ -17,7 +17,7 @@
package org.apache.commons.collections4.sequence;
/**
- * Abstract base class for all commands used to transform an objects sequence
+ * Abstrac class for all commands used to transform an objects sequence
* into another one.
*
* When two objects sequences are compared through the
From 9213396e69133e8ffff41b4abe44d6ffb8b59999 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 2 Jan 2026 18:35:13 -0500
Subject: [PATCH 082/110] Javadoc
---
.../apache/commons/collections4/functors/AbstractPredicate.java | 2 +-
.../collections4/functors/AbstractQuantifierPredicate.java | 2 +-
.../org/apache/commons/collections4/sequence/EditCommand.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
index 34a824df6a..d091bd6321 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AbstractPredicate.java
@@ -19,7 +19,7 @@
import org.apache.commons.collections4.Predicate;
/**
- * Abstrac class for predicates.
+ * Abstract class for predicates.
*
* @param the type of the input to the predicate.
* @since 4.5.0-M3
diff --git a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
index cd0ee6219c..062799ddfb 100644
--- a/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
+++ b/src/main/java/org/apache/commons/collections4/functors/AbstractQuantifierPredicate.java
@@ -21,7 +21,7 @@
import org.apache.commons.collections4.Predicate;
/**
- * Abstrac class for quantification predicates, for example All, Any, None.
+ * Abstract class for quantification predicates, for example All, Any, None.
*
* @param the type of the input to the predicate.
* @since 4.0
diff --git a/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java b/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java
index 0c76014199..8e3d92d8c8 100644
--- a/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java
+++ b/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java
@@ -17,7 +17,7 @@
package org.apache.commons.collections4.sequence;
/**
- * Abstrac class for all commands used to transform an objects sequence
+ * Abstract class for all commands used to transform an objects sequence
* into another one.
*
* When two objects sequences are compared through the
From e74b48b03b275b6d8f6b7d29c9bd4c4c6d14def6 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sun, 4 Jan 2026 11:04:47 -0500
Subject: [PATCH 083/110] Remove old comments
---
.../java/org/apache/commons/collections4/IteratorUtils.java | 1 -
src/main/java/org/apache/commons/collections4/SetUtils.java | 1 -
.../commons/collections4/comparators/ComparatorChain.java | 2 +-
.../collections4/comparators/FixedOrderComparator.java | 4 ----
.../commons/collections4/iterators/EnumerationIterator.java | 2 --
.../org/apache/commons/collections4/map/SingletonMap.java | 3 ---
.../org/apache/commons/collections4/AbstractObjectTest.java | 1 -
.../collections4/collection/AbstractCollectionTest.java | 1 -
.../collections4/multimap/AbstractMultiValuedMapTest.java | 1 -
9 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index cf27afb197..ed65c964f1 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -392,7 +392,6 @@ public static Iterable asMultipleUseIterable(final Iterator extends E>
return new IteratorIterable<>(iterator, true);
}
- // Bounded
/**
* Decorates the specified iterator to return at most the given number
* of elements.
diff --git a/src/main/java/org/apache/commons/collections4/SetUtils.java b/src/main/java/org/apache/commons/collections4/SetUtils.java
index a6029f9d15..9b77528dfa 100644
--- a/src/main/java/org/apache/commons/collections4/SetUtils.java
+++ b/src/main/java/org/apache/commons/collections4/SetUtils.java
@@ -480,7 +480,6 @@ public static Set synchronizedSet(final Set set) {
return Collections.synchronizedSet(set);
}
- // SortedSet
/**
* Returns a synchronized sorted set backed by the given sorted set.
*
diff --git a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
index 5916d5b74b..6e42f29355 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
@@ -60,7 +60,7 @@ public class ComparatorChain implements Comparator, Serializable {
private final List> comparatorChain;
/** Order - false (clear) = ascend; true (set) = descend. */
private final BitSet orderingBits;
- /** Whether the chain has been "locked". */
+ /** Whether the chain has been "locked". */
private boolean isLocked;
/**
diff --git a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
index 42490a70f0..fa9b3a25a6 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java
@@ -90,7 +90,6 @@ public enum UnknownObjectBehavior {
/** The behavior in the case of an unknown object */
private UnknownObjectBehavior unknownObjectBehavior = UnknownObjectBehavior.EXCEPTION;
- // Constructors
/**
* Constructs an empty FixedOrderComparator.
*/
@@ -127,7 +126,6 @@ public FixedOrderComparator(final T... items) {
}
}
- // Methods for adding items
/**
* Adds an item, which compares as after all items known to the Comparator.
* If the item is already known to the Comparator, its old position is
@@ -178,7 +176,6 @@ protected void checkLocked() {
}
}
- // Comparator methods
/**
* Compares two objects according to the order of this Comparator.
*
@@ -245,7 +242,6 @@ public int hashCode() {
return Objects.hash(counter, isLocked, map, unknownObjectBehavior);
}
- // Bean methods / state querying methods
/**
* Returns true if modifications cannot be made to the FixedOrderComparator.
* FixedOrderComparators cannot be modified once they have performed a comparison.
diff --git a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java
index 95333b4078..4030569e7e 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java
@@ -36,7 +36,6 @@ public class EnumerationIterator implements Iterator {
/** The last object retrieved */
private E last;
- // Constructors
/**
* Constructs a new {@code EnumerationIterator} that will not
* function until {@link #setEnumeration(Enumeration)} is called.
@@ -77,7 +76,6 @@ public Enumeration extends E> getEnumeration() {
return enumeration;
}
- // Iterator interface
/**
* Returns true if the underlying enumeration has more elements.
*
diff --git a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
index b70367ca0b..c8a29a8ae2 100644
--- a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
@@ -336,7 +336,6 @@ public K firstKey() {
return getKey();
}
- // Map
/**
* Gets the value mapped to the key specified.
*
@@ -351,7 +350,6 @@ public V get(final Object key) {
return null;
}
- // KeyValue
/**
* Gets the key.
*
@@ -413,7 +411,6 @@ protected boolean isEqualValue(final Object value) {
return Objects.equals(value, getValue());
}
- // BoundedMap
/**
* Is the map currently full, always true.
*
diff --git a/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java b/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java
index db2eaa5cbc..4a31e6e848 100644
--- a/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java
+++ b/src/test/java/org/apache/commons/collections4/AbstractObjectTest.java
@@ -74,7 +74,6 @@ protected String getCanonicalFullCollectionName(final Object object) {
return retval.toString();
}
- // protected implementation
/**
* Gets the version of Collections that this object tries to
* maintain serialization compatibility with. Defaults to 4, due to
diff --git a/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
index 425b83b007..1645d72c13 100644
--- a/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
+++ b/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
@@ -578,7 +578,6 @@ public void setConfirmed(final Collection confirmed) {
this.confirmed = confirmed;
}
- // Tests
/**
* Tests {@link Collection#add(Object)}.
*/
diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
index ff6a7b152e..f6ec78ce00 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -435,7 +435,6 @@ public BulkTest bulkTestAsMap() {
return new MultiValuedMapAsMapTest();
}
- // Bulk Tests
/**
* Bulk test {@link MultiValuedMap#entries()}. This method runs through all
* of the tests in {@link AbstractCollectionTest}. After modification
From 86e97e6d336ff00b8bea697041da0a4d7172e0db Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sun, 4 Jan 2026 11:22:38 -0500
Subject: [PATCH 084/110] Javadoc
Add an empty line before a Javadoc comment
---
.../org/apache/commons/collections4/Equator.java | 1 +
.../apache/commons/collections4/IterableGet.java | 1 +
.../apache/commons/collections4/IteratorUtils.java | 1 +
.../commons/collections4/bag/SynchronizedBag.java | 1 +
.../collections4/bidimap/AbstractDualBidiMap.java | 2 ++
.../collections4/bidimap/DualTreeBidiMap.java | 1 +
.../commons/collections4/bidimap/TreeBidiMap.java | 11 +++++++++++
.../collections4/bloomfilter/CellExtractor.java | 2 ++
.../collection/SynchronizedCollection.java | 1 +
.../collections4/comparators/ComparatorChain.java | 2 ++
.../commons/collections4/functors/AndPredicate.java | 1 +
.../commons/collections4/functors/ForClosure.java | 1 +
.../commons/collections4/functors/IfClosure.java | 2 ++
.../collections4/functors/IfTransformer.java | 2 ++
.../collections4/functors/InstantiateFactory.java | 3 +++
.../functors/InstantiateTransformer.java | 1 +
.../collections4/functors/InvokerTransformer.java | 2 ++
.../commons/collections4/functors/OrPredicate.java | 1 +
.../collections4/functors/PrototypeFactory.java | 1 +
.../collections4/functors/SwitchClosure.java | 2 ++
.../collections4/functors/SwitchTransformer.java | 2 ++
.../commons/collections4/functors/WhileClosure.java | 2 ++
.../collections4/iterators/ArrayIterator.java | 3 +++
.../collections4/iterators/EnumerationIterator.java | 2 ++
.../collections4/iterators/ListIteratorWrapper.java | 3 +++
.../collections4/iterators/LoopingIterator.java | 1 +
.../collections4/iterators/LoopingListIterator.java | 1 +
.../collections4/iterators/NodeListIterator.java | 1 +
.../collections4/iterators/ObjectArrayIterator.java | 3 +++
.../collections4/iterators/ObjectGraphIterator.java | 5 +++++
.../collections4/iterators/ReverseListIterator.java | 2 ++
.../collections4/iterators/SingletonIterator.java | 3 +++
.../collections4/iterators/TransformIterator.java | 1 +
.../collections4/keyvalue/AbstractKeyValue.java | 1 +
.../collections4/list/AbstractLinkedList.java | 2 ++
.../collections4/list/AbstractLinkedListJava21.java | 6 ++++++
.../collections4/list/CursorableLinkedList.java | 3 +++
.../apache/commons/collections4/list/TreeList.java | 13 +++++++++++++
.../commons/collections4/map/AbstractHashedMap.java | 1 +
.../commons/collections4/map/AbstractLinkedMap.java | 2 ++
.../collections4/map/AbstractReferenceMap.java | 4 ++++
.../commons/collections4/map/CompositeMap.java | 1 +
.../map/ConcurrentReferenceHashMap.java | 4 ++++
.../apache/commons/collections4/map/Flat3Map.java | 1 +
.../org/apache/commons/collections4/map/LRUMap.java | 2 ++
.../commons/collections4/map/MultiValueMap.java | 1 +
.../commons/collections4/map/SingletonMap.java | 1 +
.../commons/collections4/map/TransformedMap.java | 1 +
.../collections4/multiset/AbstractMapMultiSet.java | 2 ++
.../collections4/multiset/SynchronizedMultiSet.java | 1 +
.../collections4/sequence/SequencesComparator.java | 1 +
.../collections4/splitmap/TransformedSplitMap.java | 1 +
.../collections4/trie/AbstractPatriciaTrie.java | 2 ++
.../commons/collections4/FactoryUtilsTest.java | 1 +
.../bloomfilter/AbstractCellExtractorTest.java | 1 +
.../bloomfilter/AbstractIndexExtractorTest.java | 1 +
.../bloomfilter/LayeredBloomFilterTest.java | 1 +
.../collections4/bloomfilter/TestingHashers.java | 1 +
.../collection/CompositeCollectionTest.java | 2 ++
.../functors/AbstractMockPredicateTest.java | 1 +
.../iterators/ExtendedIteratorTest.java | 1 +
.../collections4/list/SetUniqueListTest.java | 1 +
.../commons/collections4/map/AbstractMapTest.java | 1 +
.../commons/collections4/map/EmptyMapMutator.java | 1 +
64 files changed, 130 insertions(+)
diff --git a/src/main/java/org/apache/commons/collections4/Equator.java b/src/main/java/org/apache/commons/collections4/Equator.java
index c43ab1d748..9d99322ffc 100644
--- a/src/main/java/org/apache/commons/collections4/Equator.java
+++ b/src/main/java/org/apache/commons/collections4/Equator.java
@@ -27,6 +27,7 @@
* @since 4.0
*/
public interface Equator {
+
/**
* Evaluates the two arguments for their equality.
*
diff --git a/src/main/java/org/apache/commons/collections4/IterableGet.java b/src/main/java/org/apache/commons/collections4/IterableGet.java
index 85aca7634b..0c3b893729 100644
--- a/src/main/java/org/apache/commons/collections4/IterableGet.java
+++ b/src/main/java/org/apache/commons/collections4/IterableGet.java
@@ -25,6 +25,7 @@
* @see Put
*/
public interface IterableGet extends Get {
+
/**
* Obtains a {@code MapIterator} over the map.
*
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index ed65c964f1..6a7e53d0de 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -112,6 +112,7 @@ public class IteratorUtils {
*/
@SuppressWarnings("rawtypes")
public static final OrderedMapIterator EMPTY_ORDERED_MAP_ITERATOR = EmptyOrderedMapIterator.INSTANCE;
+
/**
* Default delimiter used to delimit elements while converting an Iterator
* to its String representation.
diff --git a/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java b/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java
index 5990e1a830..ea95fb28ff 100644
--- a/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java
+++ b/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java
@@ -41,6 +41,7 @@ public class SynchronizedBag extends SynchronizedCollection implements Bag
* Synchronized Set for the Bag class.
*/
final class SynchronizedBagSet extends SynchronizedCollection implements Set {
+
/** Serialization version */
private static final long serialVersionUID = 2990565892366827855L;
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java
index f22501b846..333179cc4a 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java
@@ -747,6 +747,7 @@ public boolean isEmpty() {
}
// Map views
+
/**
* Gets a keySet view of the map.
* Changes made on the view are reflected in the map.
@@ -763,6 +764,7 @@ public Set keySet() {
}
// BidiMap
+
/**
* Obtains a {@code MapIterator} over the map.
* The iterator implements {@link BidiMapIterator}.
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
index e897be87b2..e1fcbe5c94 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
@@ -173,6 +173,7 @@ public String toString() {
* @param the type of the values.
*/
protected static class ViewMap extends AbstractSortedMapDecorator {
+
/**
* Constructs a new instance.
*
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
index 2524c11a96..f04dcf93a9 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
@@ -120,12 +120,16 @@ abstract class AbstractViewIterator {
/** Whether to return KEY or VALUE order. */
private final DataElement orderType;
+
/** The last node returned by the iterator. */
Node lastReturnedNode;
+
/** The next node to be returned by the iterator. */
private Node nextNode;
+
/** The previous node in the sequence returned by the iterator. */
private Node previousNode;
+
/** The modification count. */
private int expectedModifications;
@@ -216,6 +220,7 @@ public String toString() {
return description;
}
}
+
/**
* A view of this map.
*/
@@ -256,6 +261,7 @@ public boolean remove(final Object obj) {
return false;
}
}
+
/**
* The inverse map implementation.
*/
@@ -263,8 +269,10 @@ final class Inverse implements OrderedBidiMap