This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 5b668d23c6a980290f35a848fcac05191bc23488 Author: Alex Herbert <a.herb...@sussex.ac.uk> AuthorDate: Tue Jun 13 17:27:28 2023 +0100 Update BitMap.mod javadoc Add thrown exception when divisor is zero. Add link to reference implementation of Long.remainderUnsigned. Drop redundant @since tag as it matches the entire class @since. --- .../org/apache/commons/collections4/bloomfilter/BitMap.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BitMap.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BitMap.java index 8180af708..58177bebc 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/BitMap.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BitMap.java @@ -115,14 +115,19 @@ public class BitMap { } /** - * Performs a modulus calculation on an unsigned long and an positive integer divisor. + * Performs a modulus calculation on an unsigned long and a positive integer divisor. + * + * <p>This method computes the same result as {@link Long#remainderUnsigned(long, long)} + * but assumes that the divisor is an integer in the range 1 to 2<sup>31</sup> - 1 inclusive, + * that is a strictly positive integer size. * * <p><em>If the divisor is negative the behavior is not defined.</em></p> * - * @param dividend a unsigned long value to calculate the modulus of. - * @param divisor the divisor for the modulus calculation, must be positive. + * @param dividend an unsigned long value to calculate the modulus of. + * @param divisor the divisor for the modulus calculation, must be strictly positive. * @return the remainder or modulus value. - * @since 4.5 + * @throws ArithmeticException if the divisor is zero + * @see Long#remainderUnsigned(long, long) */ public static int mod(final long dividend, final int divisor) { // See Hacker's Delight (2nd ed), section 9.3.