From 2c314e01706b5ebd2424e28ba4f04a4db210f6d2 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 7 Dec 2025 07:17:46 -0500 Subject: [PATCH 01/53] Normalize spelling --- .../java/org/apache/commons/collections4/list/TreeList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java index 5bedb5cd1b..309db07d65 100644 --- a/src/main/java/org/apache/commons/collections4/list/TreeList.java +++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java @@ -33,7 +33,7 @@ * A {@code List} implementation that is optimized for fast insertions and * removals at any index in the list. *

- * This list implementation utilises a tree structure internally to ensure that + * This list implementation utilizes a tree structure internally to ensure that * all insertions and removals are O(log n). This provides much faster performance * than both an {@code ArrayList} and a {@code LinkedList} where elements * are inserted and removed repeatedly from anywhere in the list. From 1e126b3078f40ebabc215a5cc0f24d47b0b0ddd4 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 7 Dec 2025 07:20:26 -0500 Subject: [PATCH 02/53] Javadoc --- .../java/org/apache/commons/collections4/list/TreeList.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java index 309db07d65..778e936723 100644 --- a/src/main/java/org/apache/commons/collections4/list/TreeList.java +++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java @@ -76,9 +76,11 @@ public class TreeList extends AbstractList { * The nodes don't know the index of the object they are holding. They * do know however their position relative to their parent node. * This allows to calculate the index of a node while traversing the tree. + *

*

* The Faedelung calculation stores a flag for both the left and right child * to indicate if they are a child (false) or a link as in linked list (true). + *

*/ static class AVLNode { /** The left child node or the predecessor if {@link #leftIsPrevious}.*/ @@ -132,6 +134,7 @@ private AVLNode(final int relativePosition, final E obj, * to this method will construct the subtree for elements {@code start} * through {@code end} of the collection, assuming the iterator * {@code e} already points at element {@code start}. + *

* * @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 03/53] 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 04/53] 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 05/53] 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 > 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: *

*
    - *
  • Prototype - *
  • Instantiate + *
  • Prototype
  • + *
  • Instantiate
  • *
* * @since 3.0 diff --git a/src/main/java/org/apache/commons/collections4/FluentIterable.java b/src/main/java/org/apache/commons/collections4/FluentIterable.java index 0c2b887438..e58ad1e281 100644 --- a/src/main/java/org/apache/commons/collections4/FluentIterable.java +++ b/src/main/java/org/apache/commons/collections4/FluentIterable.java @@ -35,12 +35,11 @@ *

*
    *
  • 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 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 @@ *

* *
    - *
  • {@link #fixedSizeMap(Map)} - *
  • {@link #fixedSizeSortedMap(SortedMap)} - *
  • {@link #lazyMap(Map,Factory)} - *
  • {@link #lazyMap(Map,Transformer)} - *
  • {@link #lazySortedMap(SortedMap,Factory)} - *
  • {@link #lazySortedMap(SortedMap,Transformer)} - *
  • {@link #predicatedMap(Map,Predicate,Predicate)} - *
  • {@link #predicatedSortedMap(SortedMap,Predicate,Predicate)} - *
  • {@link #transformedMap(Map, Transformer, Transformer)} - *
  • {@link #transformedSortedMap(SortedMap, Transformer, Transformer)} - *
  • {@link #multiValueMap(Map)} - *
  • {@link #multiValueMap(Map, Class)} - *
  • {@link #multiValueMap(Map, Factory)} + *
  • {@link #fixedSizeMap(Map)}
  • + *
  • {@link #fixedSizeSortedMap(SortedMap)}
  • + *
  • {@link #lazyMap(Map,Factory)}
  • + *
  • {@link #lazyMap(Map,Transformer)}
  • + *
  • {@link #lazySortedMap(SortedMap,Factory)}
  • + *
  • {@link #lazySortedMap(SortedMap,Transformer)}
  • + *
  • {@link #predicatedMap(Map,Predicate,Predicate)}
  • + *
  • {@link #predicatedSortedMap(SortedMap,Predicate,Predicate)}
  • + *
  • {@link #transformedMap(Map, Transformer, Transformer)}
  • + *
  • {@link #transformedSortedMap(SortedMap, Transformer, Transformer)}
  • + *
  • {@link #multiValueMap(Map)}
  • + *
  • {@link #multiValueMap(Map, Class)}
  • + *
  • {@link #multiValueMap(Map, Factory)}
  • *
* * @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 + *
  • Unmodifiable - ensures the map cannot be altered
  • *
*/ package org.apache.commons.collections4.bidimap; diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilter.java index b47b9a462c..5d0531c50e 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilter.java @@ -45,7 +45,7 @@ *
    *
  • 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.
  • *
diff --git a/src/main/java/org/apache/commons/collections4/collection/package-info.java b/src/main/java/org/apache/commons/collections4/collection/package-info.java index 912a520b1b..6958e97e23 100644 --- a/src/main/java/org/apache/commons/collections4/collection/package-info.java +++ b/src/main/java/org/apache/commons/collections4/collection/package-info.java @@ -20,16 +20,19 @@ * {@link java.util.Collection Collection} interface. *

* 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 ReferenceMap())} creates a garbage collector sensitive 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}
  • *
*/ package org.apache.commons.collections4; diff --git a/src/main/java/org/apache/commons/collections4/queue/package-info.java b/src/main/java/org/apache/commons/collections4/queue/package-info.java index 5c8af6316a..a5ecac4779 100644 --- a/src/main/java/org/apache/commons/collections4/queue/package-info.java +++ b/src/main/java/org/apache/commons/collections4/queue/package-info.java @@ -19,15 +19,17 @@ * Implements the {@link java.util.Queue Queue} interface. *

* 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
  • + *
  • MapBackedSet - a set formed by decorating a Map
  • *
*/ package org.apache.commons.collections4.set; diff --git a/src/main/java/org/apache/commons/collections4/splitmap/package-info.java b/src/main/java/org/apache/commons/collections4/splitmap/package-info.java index e8ca8445fa..6b4bbc1be9 100644 --- a/src/main/java/org/apache/commons/collections4/splitmap/package-info.java +++ b/src/main/java/org/apache/commons/collections4/splitmap/package-info.java @@ -32,7 +32,7 @@ *

* The following decorators are provided: *

    - *
  • Transformed - transforms each element added + *
  • Transformed - transforms each element added
  • *
*/ 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: * *
    - *
  1. D = 1000100 - *
  2. H = 1001000 - *
  3. L = 1001100 + *
  4. D = 1000100
  5. + *
  6. H = 1001000
  7. + *
  8. L = 1001100
  9. *
* * 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: * *
    - *
  1. D = 1000100 - *
  2. H = 1001000 - *
  3. L = 1001100 + *
  4. D = 1000100
  5. + *
  6. H = 1001000
  7. + *
  8. L = 1001100
  9. *
* * 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: * *
    - *
  1. D = 1000100 - *
  2. H = 1001000 - *
  3. L = 1001100 + *
  4. D = 1000100
  5. + *
  6. H = 1001000
  7. + *
  8. L = 1001100
  9. *
* * 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 06/53] 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 07/53] 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 input, M output) { + for (Map.Entry 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 08/53] 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 09/53] 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 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 10/53] 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 11/53] 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 *

* This is equivalent to - * {@code {@link #subtract subtract}({@link #union union(a,b)},{@link #intersection intersection(a,b)})} + * {@code {@link #subtract subtract}({@link #union union(a, b)},{@link #intersection intersection(a, b)})} * or - * {@code {@link #union union}({@link #subtract subtract(a,b)},{@link #subtract subtract(b,a)})}. + * {@code {@link #union union}({@link #subtract subtract(a, b)},{@link #subtract subtract(b, a)})}. *

* * @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 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 12/53] 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 13/53] 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 input, M output) { - for (Map.Entry e : input.entries()) { + public static > M invert(final MultiValuedMap input, final M output) { + for (final Map.Entry 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 14/53] 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 15/53] 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 16/53] 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 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 17/53] 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 18/53] 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 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 19/53] 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 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 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 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 20/53] 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 21/53] 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 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 * 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 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 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 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 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 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 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 22/53] 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"> Building Apache 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"> Compatibility Apache 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 Collections Apache 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"> History Apache 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"> Home Apache 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 tracking Apache 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 Lists Apache 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 collection Apache 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.2 Apache 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.1 Apache 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.2 Apache 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.0 Apache 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.1 Apache 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.2 Apache 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.3 Apache 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.4 Apache 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 guide Apache 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 23/53] 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 24/53] 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.commons commons-parent - 93 + 94 4.0.0 commons-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 25/53] 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 26/53] 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 27/53] 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 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 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 28/53] 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 { /** Store the keySet once created. */ private Set inverseKeySet; + /** Store the valuesSet once created. */ private Set inverseValuesSet; + /** Store the entrySet once created. */ private Set> inverseEntrySet; @@ -409,6 +417,7 @@ public Set values() { return inverseValuesSet; } } + /** * A view of this map. */ @@ -449,6 +458,7 @@ public boolean remove(final Object obj) { return false; } } + /** * An iterator over the inverse map entries. */ @@ -475,6 +485,7 @@ public Map.Entry previous() { return createEntry(navigatePrevious()); } } + /** * An iterator over the map. */ 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 0334b74793..2536d94b19 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/CellExtractor.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/CellExtractor.java @@ -51,6 +51,7 @@ public interface CellExtractor extends IndexExtractor { */ @FunctionalInterface interface CellPredicate { + /** * Performs an operation on the given {@code } pair. * @@ -84,6 +85,7 @@ interface CellPredicate { */ static CellExtractor from(final IndexExtractor indexExtractor) { return new CellExtractor() { + /** * Class to track cell values in the TreeMap. */ diff --git a/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java b/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java index 820727fed5..dbe9d50d9f 100644 --- a/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java +++ b/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java @@ -58,6 +58,7 @@ public class SynchronizedCollection implements Collection, Serializable { public static SynchronizedCollection synchronizedCollection(final Collection coll) { return new SynchronizedCollection<>(coll); } + /** The collection to decorate */ private final Collection collection; 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 6e42f29355..253ddce5b3 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java +++ b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java @@ -58,8 +58,10 @@ public class ComparatorChain implements Comparator, Serializable { /** The list of comparators in the chain. */ private final List> comparatorChain; + /** Order - false (clear) = ascend; true (set) = descend. */ private final BitSet orderingBits; + /** Whether the chain has been "locked". */ private boolean isLocked; diff --git a/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java index 40d8896ef9..5c21374510 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java @@ -46,6 +46,7 @@ public static Predicate andPredicate(final Predicate predicate return new AndPredicate<>(Objects.requireNonNull(predicate1, "predicate1"), Objects.requireNonNull(predicate2, "predicate2")); } + /** The array of predicates to call */ private final Predicate iPredicate1; diff --git a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java index 67eb9d0aa8..8fc4f58011 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java @@ -53,6 +53,7 @@ public static Closure forClosure(final int count, final Closure(count, closure); } + /** The number of times to loop */ private final int iCount; diff --git a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java index 964f16d900..54072b79bc 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java @@ -50,6 +50,7 @@ public class IfClosure implements Closure, Serializable { public static Closure ifClosure(final Predicate predicate, final Closure trueClosure) { return IfClosure.ifClosure(predicate, trueClosure, NOPClosure.nopClosure()); } + /** * Factory method that performs validation. * @@ -67,6 +68,7 @@ public static Closure ifClosure(final Predicate predicate, Objects.requireNonNull(trueClosure, "trueClosure"), Objects.requireNonNull(falseClosure, "falseClosure")); } + /** The test */ private final Predicate iPredicate; diff --git a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java index 97e0c21716..7743c5337a 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java @@ -53,6 +53,7 @@ public static Transformer ifTransformer(final Predicate Objects.requireNonNull(trueTransformer, "trueTransformer"), Objects.requireNonNull(falseTransformer, "falseTransformer")); } + /** * Factory method that performs validation. *

    @@ -71,6 +72,7 @@ public static Transformer ifTransformer( return new IfTransformer<>(Objects.requireNonNull(predicate, "predicate"), Objects.requireNonNull(trueTransformer, "trueTransformer"), NOPTransformer.nopTransformer()); } + /** The test */ private final Predicate iPredicate; diff --git a/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java b/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java index cb263f6f15..e8f2d22756 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java +++ b/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java @@ -63,10 +63,13 @@ public static Factory instantiateFactory(final Class classToInstantiat } return new InstantiateFactory<>(classToInstantiate, paramTypes, args); } + /** The class to create */ private final Class iClassToInstantiate; + /** The constructor parameter types */ private final Class[] iParamTypes; + /** The constructor arguments */ private final Object[] iArgs; diff --git a/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java b/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java index e1c3f09869..18361e5c19 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java @@ -49,6 +49,7 @@ public class InstantiateTransformer implements Transformer public static Transformer, T> instantiateTransformer() { return NO_ARG_INSTANCE; } + /** * Transformer method that performs validation. * diff --git a/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java b/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java index f24cea644e..263a306d09 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java @@ -51,6 +51,7 @@ public class InvokerTransformer implements Transformer { public static Transformer invokerTransformer(final String methodName) { return new InvokerTransformer<>(Objects.requireNonNull(methodName, "methodName")); } + /** * Gets an instance of this transformer calling a specific method with specific values. * @@ -76,6 +77,7 @@ public static Transformer invokerTransformer(final String methodNam } return new InvokerTransformer<>(methodName, paramTypes, args); } + /** The method name to call */ private final String iMethodName; diff --git a/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java b/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java index 4576cc85bb..92572a5831 100644 --- a/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java @@ -46,6 +46,7 @@ public static Predicate orPredicate(final Predicate predicate1 return new OrPredicate<>(Objects.requireNonNull(predicate1, "predicate1"), Objects.requireNonNull(predicate2, "predicate2")); } + /** The array of predicates to call */ private final Predicate iPredicate1; diff --git a/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java b/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java index 5333dbec44..5c1fada974 100644 --- a/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java +++ b/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java @@ -51,6 +51,7 @@ static class PrototypeCloneFactory implements Factory { /** The object to clone each time */ private final T iPrototype; + /** The method used to clone */ private transient Method iCloneMethod; diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java index a63c67c225..2d20c1ad15 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java @@ -72,6 +72,7 @@ public static Closure switchClosure(final Map, Closure> p } return new SwitchClosure<>(false, preds, closures, defaultClosure); } + /** * Factory method that performs validation and copies the parameter arrays. * @@ -98,6 +99,7 @@ public static Closure switchClosure(final Predicate[] predicat } return new SwitchClosure<>(predicates, closures, defaultClosure); } + /** The tests to consider */ private final Predicate[] iPredicates; diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java index a73a7fe4f0..213d1d5b95 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java @@ -81,6 +81,7 @@ public static Transformer switchTransformer( } return new SwitchTransformer<>(false, preds, transformers, defaultTransformer); } + /** * Factory method that performs validation and copies the parameter arrays. * @@ -109,6 +110,7 @@ public static Transformer switchTransformer(final Predicate(predicates, transformers, defaultTransformer); } + /** The tests to consider */ private final Predicate[] iPredicates; diff --git a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java index 84b235f3b0..cd9f984f58 100644 --- a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java @@ -51,8 +51,10 @@ public static Closure whileClosure(final Predicate predicate, return new WhileClosure<>(Objects.requireNonNull(predicate, "predicate"), Objects.requireNonNull(closure, "closure"), doLoop); } + /** The test condition */ private final Predicate iPredicate; + /** The closure to call */ private final Closure iClosure; diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java index f972cdf27a..b19a8ec53c 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java @@ -41,10 +41,13 @@ public class ArrayIterator implements ResettableIterator { /** The array to iterate over */ final Object array; + /** The start index to loop from */ final int startIndex; + /** The end index to loop to */ final int endIndex; + /** The current iterator index */ int index; 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 4030569e7e..9a83e7ebfc 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java @@ -31,8 +31,10 @@ public class EnumerationIterator implements Iterator { /** The collection to remove elements from */ private final Collection collection; + /** The enumeration being converted */ private Enumeration enumeration; + /** The last object retrieved */ private E last; diff --git a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java index 3d227940a8..dbba4b722f 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java @@ -60,13 +60,16 @@ public class ListIteratorWrapper implements ResettableListIterator { /** The underlying iterator being decorated. */ private final Iterator iterator; + /** The list being used to cache the iterator. */ private final List list = new ArrayList<>(); /** The current index of this iterator. */ private int currentIndex; + /** The current index of the wrapped iterator. */ private int wrappedIteratorIndex; + /** Recall whether the wrapped iterator's "cursor" is in such a state as to allow remove() to be called */ private boolean removeState; diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java index 31fb99dc6c..0bcdea5ee6 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java @@ -42,6 +42,7 @@ public class LoopingIterator implements ResettableIterator { /** The collection to base the iterator on */ private final Collection collection; + /** The current iterator */ private Iterator iterator; diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java index 0c47deecc9..1f76ddf046 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java @@ -44,6 +44,7 @@ public class LoopingListIterator implements ResettableListIterator { /** The list to base the iterator on */ private final List list; + /** The current list iterator */ private ListIterator iterator; diff --git a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java index 82f4682d9d..916eeab927 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java @@ -37,6 +37,7 @@ public class NodeListIterator implements Iterator { /** The original NodeList instance */ private final NodeList nodeList; + /** The current iterator index */ private int index; diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java index c45909d942..2c0d82631f 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java @@ -38,10 +38,13 @@ public class ObjectArrayIterator implements ResettableIterator { /** The array */ final E[] array; + /** The start index to loop from */ final int startIndex; + /** The end index to loop to */ final int endIndex; + /** The current iterator index */ int index; diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java index 2cc1f1a195..daae6e426a 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java @@ -84,17 +84,22 @@ public class ObjectGraphIterator implements Iterator { /** The stack of iterators */ private final Deque> stack = new ArrayDeque<>(8); + /** The root object in the tree */ private E root; + /** The transformer to use */ private final Transformer transformer; /** Whether there is another element in the iteration */ private boolean hasNext; + /** The current iterator */ private Iterator currentIterator; + /** The current value */ private E currentValue; + /** The last used iterator, needed for remove() */ private Iterator lastUsedIterator; diff --git a/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java index 287bdf5b7f..921c66f09a 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java @@ -42,8 +42,10 @@ public class ReverseListIterator implements ResettableListIterator { /** The list being wrapped. */ private final List list; + /** The list iterator being wrapped. */ private ListIterator iterator; + /** Flag to indicate if updating is possible at the moment. */ private boolean validForUpdate = true; diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java index 87dd8d19d2..49b4fb6872 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java @@ -32,10 +32,13 @@ public class SingletonIterator /** Whether remove is allowed */ private final boolean removeAllowed; + /** Is the cursor before the first element */ private boolean beforeFirst = true; + /** Has the element been removed */ private boolean removed; + /** The object */ private E object; diff --git a/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java b/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java index 36dc0b9f1c..f7b4113fd7 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java @@ -31,6 +31,7 @@ public class TransformIterator implements Iterator { /** The iterator being used */ private Iterator iterator; + /** The transformer being used */ private Transformer transformer; diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java index 24bdd55675..4a602681a4 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java @@ -30,6 +30,7 @@ public abstract class AbstractKeyValue implements KeyValue { /** The key */ private K key; + /** The value */ private V value; diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java index ab18d7b032..fe9e30ea2f 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java @@ -438,8 +438,10 @@ protected static class Node { /** A pointer to the node before this node */ protected Node previous; + /** A pointer to the node after this node */ protected Node next; + /** The object contained within this node */ protected E value; diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java index e2a7c52e2a..7a79d4dc3f 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java @@ -229,12 +229,16 @@ public void set(final E obj) { * @param the type of elements in this list. */ protected static class LinkedSubList extends AbstractList { + /** The main list */ AbstractLinkedListJava21 parent; + /** Offset from the main list */ int offset; + /** Sublist size */ int size; + /** Sublist modCount */ int expectedModCount; @@ -437,8 +441,10 @@ protected static class Node { /** A pointer to the node before this node */ protected Node previous; + /** A pointer to the node after this node */ protected Node next; + /** The object contained within this node */ protected E value; diff --git a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java index df080a21e5..c8e231b4c4 100644 --- a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java @@ -70,10 +70,13 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * @param the type of elements in this cursor. */ public static class Cursor extends AbstractLinkedList.LinkedListIterator { + /** Is the cursor valid (not closed) */ boolean valid = true; + /** Is the next index valid */ boolean nextIndexValid = true; + /** Flag to indicate if the current element was removed by another object. */ boolean currentRemovedByAnother; diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java index 778e936723..a0e1c71450 100644 --- a/src/main/java/org/apache/commons/collections4/list/TreeList.java +++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java @@ -83,18 +83,25 @@ public class TreeList extends AbstractList { *

    */ static class AVLNode { + /** The left child node or the predecessor if {@link #leftIsPrevious}.*/ private AVLNode left; + /** Flag indicating that left reference is not a subtree but the predecessor. */ private boolean leftIsPrevious; + /** The right child node or the successor if {@link #rightIsNext}. */ private AVLNode right; + /** Flag indicating that right reference is not a subtree but the successor. */ private boolean rightIsNext; + /** How many levels of left/right are below this one. */ private int height; + /** The relative position, root holds absolute position. */ private int relativePosition; + /** The stored element. */ private E value; @@ -757,25 +764,31 @@ public String toString() { * A list iterator over the linked list. */ static class TreeListIterator implements ListIterator, OrderedIterator { + /** The parent list */ private final TreeList parent; + /** * Cache of the next node that will be returned by {@link #next()}. */ private AVLNode next; + /** * The index of the next node to be returned. */ private int nextIndex; + /** * Cache of the last node that was returned by {@link #next()} * or {@link #previous()}. */ private AVLNode current; + /** * The index of the last node that was returned. */ private int currentIndex; + /** * The modification count that the list is expected to have. If the list * doesn't have this count, then a diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java index 683072cc82..aee103d8b7 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java @@ -235,6 +235,7 @@ public String toString() { return new StringBuilder().append(getKey()).append('=').append(getValue()).toString(); } } + /** * Base Iterator. * diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java index 4473831a57..4f17657fba 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java @@ -140,8 +140,10 @@ public K previous() { * @param the value type. */ protected static class LinkEntry extends HashEntry { + /** The entry before this one in the order */ protected LinkEntry before; + /** The entry after this one in the order */ protected LinkEntry after; 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 bf10403514..42f84c2942 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java @@ -94,6 +94,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap * Base iterator class. */ static class ReferenceBaseIterator { + /** The parent map */ final AbstractReferenceMap parent; @@ -197,6 +198,7 @@ public void remove() { * @since 3.1 */ protected static class ReferenceEntry extends HashEntry { + /** The parent map */ private final AbstractReferenceMap parent; @@ -588,6 +590,7 @@ public V next() { * A soft reference holder. */ static class SoftRef extends SoftReference { + /** The hashCode of the key (even if the reference points to a value) */ private final int hash; @@ -621,6 +624,7 @@ public int hashCode() { * A weak reference holder. */ static class WeakRef extends WeakReference { + /** The hashCode of the key (even if the reference points to a value) */ private final int hash; diff --git a/src/main/java/org/apache/commons/collections4/map/CompositeMap.java b/src/main/java/org/apache/commons/collections4/map/CompositeMap.java index 9c26db3f33..8161d6cb1f 100644 --- a/src/main/java/org/apache/commons/collections4/map/CompositeMap.java +++ b/src/main/java/org/apache/commons/collections4/map/CompositeMap.java @@ -56,6 +56,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser * @param the type of the values in the map */ public interface MapMutator extends Serializable { + /** * Called when the CompositeMap.put() method is invoked. * diff --git a/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java b/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java index 78a5bc9f5b..79e8e40f92 100644 --- a/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java @@ -625,6 +625,7 @@ public int size() { * Behavior-changing configuration options for the map */ public enum Option { + /** * Indicates that referential-equality (== instead of .equals()) should be used when locating keys. This offers similar behavior to * {@link IdentityHashMap} @@ -636,14 +637,17 @@ public enum Option { * An option specifying which Java reference type should be used to refer to a key and/or value. */ public enum ReferenceType { + /** * Indicates a normal Java strong reference should be used */ STRONG, + /** * Indicates a {@link WeakReference} should be used */ WEAK, + /** * Indicates a {@link SoftReference} should be used */ 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 ec679989e5..1d68fe033a 100644 --- a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java +++ b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java @@ -161,6 +161,7 @@ public int size() { return parent.size(); } } + /** * EntrySetIterator and MapEntry */ diff --git a/src/main/java/org/apache/commons/collections4/map/LRUMap.java b/src/main/java/org/apache/commons/collections4/map/LRUMap.java index 73ae5c539f..feecbe44c8 100644 --- a/src/main/java/org/apache/commons/collections4/map/LRUMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LRUMap.java @@ -68,11 +68,13 @@ public class LRUMap /** Serialization version */ private static final long serialVersionUID = -612114643488955218L; + /** Default maximum size */ protected static final int DEFAULT_MAX_SIZE = 100; /** Maximum size */ private transient int maxSize; + /** Scan behavior */ private final boolean scanUntilRemovable; 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 f75d62389a..7d3cd3c8d2 100644 --- a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java +++ b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java @@ -135,6 +135,7 @@ public int size() { return totalSize(); } } + /** * Inner class that provides the values iterator. */ 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 c8a29a8ae2..a9f3fc8fbd 100644 --- a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java +++ b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java @@ -183,6 +183,7 @@ public int size() { return 1; } } + /** Serialization version */ private static final long serialVersionUID = -8931271118676803261L; diff --git a/src/main/java/org/apache/commons/collections4/map/TransformedMap.java b/src/main/java/org/apache/commons/collections4/map/TransformedMap.java index d358f29539..6dcd47d879 100644 --- a/src/main/java/org/apache/commons/collections4/map/TransformedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/TransformedMap.java @@ -84,6 +84,7 @@ public static TransformedMap transformedMap(final Map map, } return decorated; } + /** * Factory method to create a transforming map. *

    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 317e7d2c5e..0e24a6e167 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java +++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java @@ -96,6 +96,7 @@ public void remove() { canRemove = false; } } + /** * Inner class iterator for the MultiSet. */ @@ -197,6 +198,7 @@ public E getElement() { * Mutable integer class for storing the data. */ protected static class MutableInteger { + /** The value of this mutable. */ protected int value; 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 9fdc2188fa..ccffd0946d 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java +++ b/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java @@ -40,6 +40,7 @@ public class SynchronizedMultiSet extends SynchronizedCollection implement * @param the type held in this Set. */ static class SynchronizedSet extends SynchronizedCollection implements Set { + /** Serialization version */ private static final long serialVersionUID = 20150629L; diff --git a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java index fd50612a20..a16ae01ad2 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java +++ b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java @@ -124,6 +124,7 @@ public int getStart() { /** The equator used for testing object equality. */ private final Equator equator; + /** Temporary variables. */ private final int[] vDown; diff --git a/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java b/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java index daea74af85..b1127a37e1 100644 --- a/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java +++ b/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java @@ -92,6 +92,7 @@ public static TransformedSplitMap transformingMap(final final Transformer valueTransformer) { return new TransformedSplitMap<>(map, keyTransformer, valueTransformer); } + /** The transformer to use for the key */ private final Transformer keyTransformer; 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 906d3c6200..a8a367c2ca 100644 --- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java +++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java @@ -342,6 +342,7 @@ public int size() { return AbstractPatriciaTrie.this.size(); } } + /** * This is a key set view of the {@link org.apache.commons.collections4.Trie} as returned by {@link Map#keySet()}. */ @@ -384,6 +385,7 @@ public int size() { return AbstractPatriciaTrie.this.size(); } } + /** * A prefix {@link RangeEntrySet} view of the {@link org.apache.commons.collections4.Trie}. */ diff --git a/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java b/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java index c35b5b785f..90f020bffd 100644 --- a/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java @@ -65,6 +65,7 @@ public int hashCode() { // please Findbugs } public static class Mock2 implements Serializable { + /** * Generated serial version ID. */ diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractCellExtractorTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractCellExtractorTest.java index 2753bd4d68..0e1a95f19a 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractCellExtractorTest.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractCellExtractorTest.java @@ -34,6 +34,7 @@ public abstract class AbstractCellExtractorTest extends AbstractIndexExtractorTe * A testing CellConsumer that always returns true. */ private static final CellPredicate TRUE_CONSUMER = (i, j) -> true; + /** * A testing CellConsumer that always returns false. */ diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractIndexExtractorTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractIndexExtractorTest.java index fefc54998c..163743c842 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractIndexExtractorTest.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractIndexExtractorTest.java @@ -66,6 +66,7 @@ int[] toArray() { private static final IntPredicate TRUE_PREDICATE = i -> true; private static final IntPredicate FALSE_PREDICATE = i -> false; + /** Flag to indicate the indices are ordered, for example from {@link IndexExtractor#processIndices(IntPredicate)}. */ protected static final int ORDERED = 0x1; diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilterTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilterTest.java index de5ba276cd..a4eb2a8553 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilterTest.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/LayeredBloomFilterTest.java @@ -260,6 +260,7 @@ void testCleanup() { f = underTest.get(0); assertEquals(3, f.sequence); // it is a new one. } + /** * Tests that the estimated union calculations are correct. */ diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/TestingHashers.java b/src/test/java/org/apache/commons/collections4/bloomfilter/TestingHashers.java index 161e2d0ff0..90dce57897 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/TestingHashers.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/TestingHashers.java @@ -22,6 +22,7 @@ * A collection of methods and statics that represent standard hashers in testing. */ public class TestingHashers { + /** * Hasher that increments from 1. */ diff --git a/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java index 4a02113a47..b7116edd76 100644 --- a/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java +++ b/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java @@ -79,6 +79,7 @@ public Collection makeConfirmedCollection() { public Collection makeConfirmedFullCollection() { return new HashSet<>(Arrays.asList(getFullElements())); } + /** * Full collection consists of 4 collections, each with one element */ @@ -93,6 +94,7 @@ public Collection makeFullCollection() { } return compositeCollection; } + /** * Empty collection is empty composite */ diff --git a/src/test/java/org/apache/commons/collections4/functors/AbstractMockPredicateTest.java b/src/test/java/org/apache/commons/collections4/functors/AbstractMockPredicateTest.java index ad6e28065c..b4bfeca14c 100644 --- a/src/test/java/org/apache/commons/collections4/functors/AbstractMockPredicateTest.java +++ b/src/test/java/org/apache/commons/collections4/functors/AbstractMockPredicateTest.java @@ -32,6 +32,7 @@ * provides methods to create and verify mock predicates to which to delegate. */ public abstract class AbstractMockPredicateTest { + /** * Mock predicates created by a single test case which need to be verified after the test completes. */ diff --git a/src/test/java/org/apache/commons/collections4/iterators/ExtendedIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/ExtendedIteratorTest.java index 612bb60629..21ae019073 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/ExtendedIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/ExtendedIteratorTest.java @@ -32,6 +32,7 @@ import org.junit.jupiter.api.Test; class ExtendedIteratorTest { + /** * Collection of {@link Integer}s */ diff --git a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java index 9cd1b4bd01..2a22a89c6d 100644 --- a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java @@ -42,6 +42,7 @@ public class SetUniqueListTest extends AbstractListTest { final class SetUniqueList307 extends SetUniqueList { + /** * Generated serial version ID. */ diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java index 1fa6a52203..1c7ee770aa 100644 --- a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java @@ -164,6 +164,7 @@ public Map.Entry getEntry(final Iterator> itConfirmed, fin } // Have to implement manually; entrySet doesn't support addAll + /** * {@inheritDoc} */ diff --git a/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java b/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java index a9871f6672..75520d1e9e 100644 --- a/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java +++ b/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java @@ -25,6 +25,7 @@ * class also has to be serialized. */ final class EmptyMapMutator implements CompositeMap.MapMutator { + /** Serialization version */ private static final long serialVersionUID = -2729718980002476794L; From b9ad3bd7728ed41c1c258ab7d3df4ab8bbaeeb7a Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 12 Jan 2026 10:49:18 -0500 Subject: [PATCH 29/53] Bump github/codeql-action from 4.31.9 to 4.31.10 --- .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 d7e8c4a82c..c4c4c67879 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@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 + uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 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@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 + uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 # â„šī¸ 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@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 + uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index ff3a7cfb9b..31cd7488e7 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@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 + uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 with: sarif_file: results.sarif From ca3d5dca50e9114f60b8b75b00cec37b23d48576 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 12 Jan 2026 11:46:59 -0500 Subject: [PATCH 30/53] Bump org.apache.commons:commons-parent from 94 to 95. --- pom.xml | 2 +- src/changes/changes.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d722763157..9cdfa0710c 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.apache.commons commons-parent - 94 + 95 4.0.0 commons-collections4 diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2c5cb27791..8f0a8ff792 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 94 #612, #645, #662, #663. + Bump org.apache.commons:commons-parent from 81 to 95 #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 99c8a4d11823b554ea9a28015d224ae8bdd4224a Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 15 Jan 2026 12:31:44 -0500 Subject: [PATCH 31/53] Move argument check deeper in. --- .../commons/collections4/list/TreeList.java | 25 ++++++++++++++----- .../collections4/list/TreeListTest.java | 12 +++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java index a0e1c71450..57c15b24ef 100644 --- a/src/main/java/org/apache/commons/collections4/list/TreeList.java +++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java @@ -804,6 +804,7 @@ static class TreeListIterator implements ListIterator, OrderedIterator * @param fromIndex the index to start at */ protected TreeListIterator(final TreeList parent, final int fromIndex) { + checkInterval(fromIndex, 0, parent.size(), parent.size()); this.parent = parent; this.expectedModCount = parent.modCount; this.next = parent.root == null ? null : parent.root.get(fromIndex); @@ -916,6 +917,21 @@ public void set(final E obj) { } } + /** + * Checks whether the index is valid. + * + * @param index the index to check. + * @param startIndex the first allowed index. + * @param endIndex the last allowed index. + * @param endIndex the size. + * @throws IndexOutOfBoundsException if the index is invalid + */ + private static void checkInterval(final int index, final int startIndex, final int endIndex, final int size) { + if (index < startIndex || index > endIndex) { + throw new IndexOutOfBoundsException("Invalid index:" + index + ", size=" + size); + } + } + /** The root node in the AVL tree */ private AVLNode root; @@ -994,9 +1010,7 @@ public boolean addAll(final Collection c) { * @throws IndexOutOfBoundsException if the index is invalid */ private void checkInterval(final int index, final int startIndex, final int endIndex) { - if (index < startIndex || index > endIndex) { - throw new IndexOutOfBoundsException("Invalid index:" + index + ", size=" + size()); - } + checkInterval(index, startIndex, endIndex, size()); } /** @@ -1072,14 +1086,13 @@ public ListIterator listIterator() { /** * Gets a ListIterator over the list. * - * @param fromIndex the index to start from - * @return the new iterator + * @param fromIndex the index to start from. + * @return the new iterator. */ @Override public ListIterator listIterator(final int fromIndex) { // override to go 75% faster // cannot use EmptyIterator as iterator.add() must work - checkInterval(fromIndex, 0, size()); return new TreeListIterator<>(this, fromIndex); } diff --git a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java index ec5b683e66..1f502208e7 100644 --- a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/TreeListTest.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.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.ArrayList; import java.util.List; @@ -100,6 +101,17 @@ public TreeList makeObject() { return new TreeList<>(); } + @Test + void testPreviousNullPointerException() throws Throwable { + final TreeList treeList = new TreeList<>(); + treeList.add("a"); + treeList.add("b"); + assertThrows(IndexOutOfBoundsException.class, () -> treeList.listIterator(3).previous()); + assertThrows(IndexOutOfBoundsException.class, () -> new TreeList.TreeListIterator(treeList, 3)); + // Test doesn't get to previous() + assertThrows(IndexOutOfBoundsException.class, () -> new TreeList.TreeListIterator(treeList, 3).previous()); + } + @Test @SuppressWarnings("unchecked") void testAddMultiple() { From 5de03cf773b915d0dbea097162996cb018d03009 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 15 Jan 2026 12:37:15 -0500 Subject: [PATCH 32/53] Rname test --- .../collections4/list/TreeListTest.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java index 1f502208e7..bff75d2bc7 100644 --- a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java @@ -101,17 +101,6 @@ public TreeList makeObject() { return new TreeList<>(); } - @Test - void testPreviousNullPointerException() throws Throwable { - final TreeList treeList = new TreeList<>(); - treeList.add("a"); - treeList.add("b"); - assertThrows(IndexOutOfBoundsException.class, () -> treeList.listIterator(3).previous()); - assertThrows(IndexOutOfBoundsException.class, () -> new TreeList.TreeListIterator(treeList, 3)); - // Test doesn't get to previous() - assertThrows(IndexOutOfBoundsException.class, () -> new TreeList.TreeListIterator(treeList, 3).previous()); - } - @Test @SuppressWarnings("unchecked") void testAddMultiple() { @@ -214,16 +203,6 @@ void testIndexOf() { assertEquals(0, l.indexOf("3")); } -// void testCheck() { -// List l = makeEmptyList(); -// l.add("A1"); -// l.add("A2"); -// l.add("A3"); -// l.add("A4"); -// l.add("A5"); -// l.add("A6"); -// } - @Test @SuppressWarnings("unchecked") void testInsertBefore() { @@ -234,6 +213,16 @@ void testInsertBefore() { assertEquals("erna", l.get(1)); } +// void testCheck() { +// List l = makeEmptyList(); +// l.add("A1"); +// l.add("A2"); +// l.add("A3"); +// l.add("A4"); +// l.add("A5"); +// l.add("A6"); +// } + @Test @SuppressWarnings("boxing") // OK in test code void testIterationOrder() { @@ -338,4 +327,15 @@ void testRemove() { assertEquals("harald", l.get(i++)); } + @Test + void testTreeListIteratorConstruction() throws Throwable { + final TreeList treeList = new TreeList<>(); + treeList.add("a"); + treeList.add("b"); + assertThrows(IndexOutOfBoundsException.class, () -> treeList.listIterator(3).previous()); + assertThrows(IndexOutOfBoundsException.class, () -> new TreeList.TreeListIterator(treeList, 3)); + // Test doesn't get to previous() + assertThrows(IndexOutOfBoundsException.class, () -> new TreeList.TreeListIterator(treeList, 3).previous()); + } + } From 76d204c89edb4fac9990876e664185fb0f8011ea Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 22 Jan 2026 15:39:17 +0000 Subject: [PATCH 33/53] Bump actions/setup-java from 5.1.0 to 5.2.0 --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e522895d12..fec72d7139 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -44,7 +44,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: distribution: 'temurin' java-version: ${{ matrix.java }} From 3d5ba81e85f6105ddbefec1c4dd532acd0e9b495 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 22 Jan 2026 18:23:48 -0500 Subject: [PATCH 34/53] Bump org.apache.commons:commons-parent from 95 to 96. --- pom.xml | 2 +- src/changes/changes.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9cdfa0710c..4ff126545e 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.apache.commons commons-parent - 95 + 96 4.0.0 commons-collections4 diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 8f0a8ff792..1fd4dd97e6 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 95 #612, #645, #662, #663. + Bump org.apache.commons:commons-parent from 81 to 96 #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 fd8490aea221b82dbca26e462f4e7fa161f45e95 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 23 Jan 2026 07:43:57 -0500 Subject: [PATCH 35/53] Bump actions/checkout from 6.0.1 to 6.0.2 --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dependency-review.yml | 2 +- .github/workflows/maven.yml | 2 +- .github/workflows/scorecards-analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c4c4c67879..cc69f53340 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 1df8666044..a04da50909 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -26,6 +26,6 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: 'Dependency Review PR' uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index fec72d7139..6f6d39bd4c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -34,7 +34,7 @@ jobs: experimental: true steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 31cd7488e7..fe272c1a38 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -40,7 +40,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false From 4907488764038d2bd8d33a4e5ee8aabe95f11e37 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 26 Jan 2026 09:36:56 -0500 Subject: [PATCH 36/53] Bump github/codeql-action from 4.31.10 to 4.31.11 --- .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 cc69f53340..17321f5dd1 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@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/init@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 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@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/autobuild@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 # â„šī¸ 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@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/analyze@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index fe272c1a38..732fdd6e03 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@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/upload-sarif@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 with: sarif_file: results.sarif From 68d0075256ec676f4fc480c9d925a62994cc205c Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 28 Jan 2026 08:39:04 -0500 Subject: [PATCH 37/53] Update test to match InterruptedException guidelines --- .../java/org/apache/commons/collections4/map/LRUMapTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java b/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java index b15998dbe1..db65f2e2a7 100644 --- a/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java @@ -612,6 +612,7 @@ public void run() { map.entrySet().removeIf(entry -> entry.getValue() == this); } } catch (final InterruptedException e) { + interrupt(); fail("Unexpected InterruptedException"); } if (i > 0) { @@ -696,6 +697,7 @@ public void run() { } } } catch (final InterruptedException e) { + interrupt(); fail("Unexpected InterruptedException"); } if (i > 0) { @@ -780,6 +782,7 @@ public void run() { } } } catch (final InterruptedException e) { + interrupt(); fail("Unexpected InterruptedException"); } if (i > 0) { @@ -859,6 +862,7 @@ public void run() { map.values().removeIf(thread1 -> thread1 == this); } } catch (final InterruptedException e) { + interrupt(); fail("Unexpected InterruptedException"); } if (i > 0) { From ef212d1f02c73b3336dd7df793ee43adf77e0c81 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 28 Jan 2026 15:45:10 -0500 Subject: [PATCH 38/53] Bump github/codeql-action from 4.31.11 to 4.32.0 --- .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 17321f5dd1..658b44aef9 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@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 + uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 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@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 + uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 # â„šī¸ 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@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 + uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 732fdd6e03..9f29f6c5fe 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@19b2f06db2b6f5108140aeb04014ef02b648f789 # v4.31.11 + uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 with: sarif_file: results.sarif From c08e9a90c1d1fe20ded8399fb67b320840ac935d Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 29 Jan 2026 17:32:27 -0500 Subject: [PATCH 39/53] Bump commons-codec:commons-codec from 1.20.0 to 1.21.0. --- pom.xml | 2 +- src/changes/changes.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4ff126545e..7cabeb09cc 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ commons-codec commons-codec - 1.20.0 + 1.21.0 true diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1fd4dd97e6..112809f79e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -53,7 +53,7 @@ Bump org.easymock:easymock from 5.5.0 to 5.6.0 #617. [test] Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.20.0 #625. [test] Bump commons-io:commons-io from 2.19.0 to 2.21.0. - Bump commons-codec:commons-codec from 1.18.0 to 1.20.0. + Bump commons-codec:commons-codec from 1.18.0 to 1.21.0. From d4319d8c301821e86bfc1bcbebcc138e1ed145dd Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 6 Feb 2026 12:34:49 +0000 Subject: [PATCH 40/53] Bump github/codeql-action from 4.32.0 to 4.32.2 --- .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 658b44aef9..3fb81ad790 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@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 + uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 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@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 + uses: github/codeql-action/autobuild@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 # â„šī¸ 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@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 + uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 9f29f6c5fe..e309855360 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@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0 + uses: github/codeql-action/upload-sarif@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 with: sarif_file: results.sarif From 7f1374e7a9d240fb5c0ba3ab4076b3c97432a917 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 6 Feb 2026 09:23:17 -0500 Subject: [PATCH 41/53] Use max-parallel: 20 as asked by Apache Infra --- .github/workflows/codeql-analysis.yml | 1 + .github/workflows/maven.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3fb81ad790..858b59d146 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,6 +37,7 @@ jobs: security-events: write strategy: + max-parallel: 20 fail-fast: false matrix: language: [ 'java' ] diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6f6d39bd4c..24b8dbba83 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,6 +26,7 @@ jobs: runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} strategy: + max-parallel: 20 matrix: java: [ 8, 11, 17, 21, 25 ] experimental: [false] From 9555b493b23672f48e1b089db0507590e8619a61 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 9 Feb 2026 13:11:30 +0000 Subject: [PATCH 42/53] Bump actions/cache from 5.0.2 to 5.0.3 --- .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 858b59d146..9ccfb03278 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 + - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 24b8dbba83..70680be10f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 + - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} From ba48e2013f589f86b506a312093d12128160e2b6 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 15 Feb 2026 10:07:46 -0500 Subject: [PATCH 43/53] Normalize Javadoc spelling --- RELEASE-NOTES.txt | 2 +- src/changes/changes.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d615e65a9a..473141ccfe 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -266,7 +266,7 @@ Fixed Bugs * COLLECTIONS-836: Correct test of BidiMap to optionally ignore testing the key set matches the values order. Ordering is not specified for some BidiMaps such as DualHashBidiMaps. Thanks to Anant Dahiya. * COLLECTIONS-737: Return 0 immediately if the given iterable is null in IterableUtils#size. Update tests. Thanks to Prodigysov. -* COLLECTIONS-697: JavaDoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented Thanks to Ranjan George. +* COLLECTIONS-697: Javadoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented Thanks to Ranjan George. * Fill in some map test cases #104. Thanks to dota17. * COLLECTIONS-738: Remove the redundant assertNull in IterableUtilsTest.find and update Javadocs. Thanks to Pengyu Nie. * COLLECTIONS-724: Simplify two remove-if loops #77. Thanks to Eitan Adler. diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 112809f79e..6c2ee7d99d 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -272,7 +272,7 @@ Return 0 immediately if the given iterable is null in IterableUtils#size. Update tests. - JavaDoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented + Javadoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented Fill in some map test cases #104. From 40c0cb45fd93f33d6168c9c4ad8346528cd6b2ba Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 20 Feb 2026 07:41:55 -0500 Subject: [PATCH 44/53] Bump github/codeql-action from 4.32.2 to 4.32.3 --- .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 9ccfb03278..b1f4f562df 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -69,7 +69,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@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/autobuild@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -83,4 +83,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index e309855360..a455aa276e 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@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 with: sarif_file: results.sarif From f42a7af2662546b4a7f8a7166c1c0cbd2b638980 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 23 Feb 2026 10:58:31 -0500 Subject: [PATCH 45/53] Bump github/codeql-action from 4.32.0 to 4.32.4 --- .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 b1f4f562df..6c4aa3f571 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -69,7 +69,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@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -83,4 +83,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index a455aa276e..38bdab4807 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@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 with: sarif_file: results.sarif From b249c17b30d4f71ecb9b659faca57e0b23997a10 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 27 Feb 2026 20:43:40 -0500 Subject: [PATCH 46/53] Bump org.apache.commons:commons-parent from 96 to 97. --- pom.xml | 2 +- src/changes/changes.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7cabeb09cc..df28581c9a 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.apache.commons commons-parent - 96 + 97 4.0.0 commons-collections4 diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6c2ee7d99d..70967d8b4f 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 96 #612, #645, #662, #663. + Bump org.apache.commons:commons-parent from 81 to 97 #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 5aa50717a2ab16b987260c09fe8db9bec26cbaa9 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 2 Mar 2026 08:33:54 -0500 Subject: [PATCH 47/53] Bump github/codeql-action from 4.32.4 to 4.32.5 --- .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 6c4aa3f571..e2ee451b4e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/init@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -69,7 +69,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@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/autobuild@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -83,4 +83,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/analyze@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 38bdab4807..39d141fbbe 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@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/upload-sarif@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 with: sarif_file: results.sarif From c1d1aa92f46b22879bedcb9cac4d19c413786e36 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 6 Mar 2026 07:35:48 -0500 Subject: [PATCH 48/53] Bump github/codeql-action from 4.32.5 to 4.32.6 --- .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 e2ee451b4e..4c52d9d27d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 + uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -69,7 +69,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@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 + uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -83,4 +83,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 + uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 39d141fbbe..c0b99d163c 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@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5 + uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 with: sarif_file: results.sarif From be6b6e49c2a9facffb534b921a37a3b948fa52ac Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 9 Mar 2026 08:43:35 -0400 Subject: [PATCH 49/53] Bump actions/upload-artifact from 6.0.0 to 7.0.0 --- .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 c0b99d163c..a35bf86eeb 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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: SARIF file path: results.sarif From 6f2ec59aef95b6528d1a2818d381fc19a82c724a Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 19 Mar 2026 19:39:10 -0400 Subject: [PATCH 50/53] Javadpc --- .../org/apache/commons/collections4/trie/PatriciaTrieTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java b/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java index 9da685ef53..d063257417 100644 --- a/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java +++ b/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; /** - * JUnit tests for the PatriciaTrie. + * Tests {@link PatriciaTrie}. * * @param the value type. */ From 33930cf1a3c3ca30b25bfe75d15e49de4aaa85cb Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 19 Mar 2026 23:46:29 +0000 Subject: [PATCH 51/53] Add a reference to safe deserlialization --- src/site/xdoc/security.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/site/xdoc/security.xml b/src/site/xdoc/security.xml index 01b6c83c50..2764a363bd 100644 --- a/src/site/xdoc/security.xml +++ b/src/site/xdoc/security.xml @@ -110,5 +110,10 @@

    Please report any errors or omissions to the dev mailing list.

    - +
    +

    + For information about safe deserialization, please see Safe Deserialization. +

    +
    +
    From 3e713212929fc5e51793203c40006c57eeb0e9bb Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 20 Mar 2026 17:32:04 -0700 Subject: [PATCH 52/53] Bump github/codeql-action from 4.32.6 to 4.34.0 --- .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 4c52d9d27d..e072e3dd79 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -69,7 +69,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@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/autobuild@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -83,4 +83,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index a35bf86eeb..7182c34001 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@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 with: sarif_file: results.sarif From b780c2989ebc3423ead8637c48afd20cbf9f805e Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 22 Mar 2026 22:23:17 -0700 Subject: [PATCH 53/53] Javadoc --- .../commons/collections4/map/ConcurrentReferenceHashMap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java b/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java index 79e8e40f92..c7cdea3950 100644 --- a/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ConcurrentReferenceHashMap.java @@ -622,7 +622,7 @@ public int size() { } /** - * Behavior-changing configuration options for the map + * Enumerates eehavior-changing configuration options for the map. */ public enum Option { @@ -634,7 +634,7 @@ public enum Option { } /** - * An option specifying which Java reference type should be used to refer to a key and/or value. + * Enumerates which Java reference type should be used to refer to a key and/or value. */ public enum ReferenceType {