Claudenw commented on code in PR #492:
URL:
https://github.com/apache/commons-collections/pull/492#discussion_r1616139486
##########
src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java:
##########
@@ -229,47 +229,47 @@ default boolean merge(final Hasher hasher) {
}
/**
- * Merges the specified index producer into this Bloom filter.
+ * Merges the specified index extractor into this Bloom filter.
*
- * <p>Specifically: all unique cells for the indices identified by the
{@code indexProducer} will be incremented by 1.</p>
+ * <p>Specifically: all unique cells for the indices identified by the
{@code indexExtractor} will be incremented by 1.</p>
*
* <p>This method will return {@code true} if the filter is valid after
the operation.</p>
*
- * <p>Note: If indices that are returned multiple times should be
incremented multiple times convert the IndexProducer
- * to a CellProducer and add that.</p>
+ * <p>Note: If indices that are returned multiple times should be
incremented multiple times convert the IndexExtractor
+ * to a CellExtractor and add that.</p>
*
- * @param indexProducer the IndexProducer
+ * @param indexExtractor the IndexExtractor
* @return {@code true} if the removal was successful and the state is
valid
* @see #isValid()
- * @see #add(CellProducer)
+ * @see #add(CellExtractor)
*/
@Override
- default boolean merge(final IndexProducer indexProducer) {
- Objects.requireNonNull(indexProducer, "indexProducer");
+ default boolean merge(final IndexExtractor indexExtractor) {
+ Objects.requireNonNull(indexExtractor, "indexExtractor");
try {
- return add(CellProducer.from(indexProducer.uniqueIndices()));
+ return add(CellExtractor.from(indexExtractor.uniqueIndices()));
} catch (final IndexOutOfBoundsException e) {
throw new IllegalArgumentException(
String.format("Filter only accepts values in the [0,%d)
range", getShape().getNumberOfBits()), e);
}
}
/**
- * Removes the specified BitMapProducer from this Bloom filter.
+ * Removes the specified BitMapExtractor from this Bloom filter.
*
- * <p>Specifically all cells for the indices produced by the {@code
bitMapProducer} will be
+ * <p>Specifically all cells for the indices produced by the {@code
bitMapExtractor} will be
* decremented by 1.</p>
*
* <p>This method will return {@code true} if the filter is valid after
the operation.</p>
*
- * @param bitMapProducer the BitMapProducer to provide the indexes
+ * @param bitMapExtractor the BitMapExtractor to provide the indexes
* @return {@code true} if the removal was successful and the state is
valid
* @see #isValid()
- * @see #subtract(CellProducer)
+ * @see #subtract(CellExtractor)
*/
- default boolean remove(final BitMapProducer bitMapProducer) {
- Objects.requireNonNull(bitMapProducer, "bitMapProducer");
- return remove(IndexProducer.fromBitMapProducer(bitMapProducer));
+ default boolean remove(final BitMapExtractor bitMapExtractor) {
+ Objects.requireNonNull(bitMapExtractor, "bitMapExtractor");
Review Comment:
removed unnecessary `Objects.requireNonNull` calls
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]