This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git

commit de05f5f126e39a0e907abbcec68ee2554eece779
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Apr 13 16:14:55 2024 -0400

    Use long lines
---
 .../apache/commons/collections4/bloomfilter/Shape.java    | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/collections4/bloomfilter/Shape.java 
b/src/main/java/org/apache/commons/collections4/bloomfilter/Shape.java
index 86cd9cd07..8a184e7da 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/Shape.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/Shape.java
@@ -111,8 +111,7 @@ public final class Shape {
         // than integer math.
         final long k = Math.round(LN_2 * numberOfBits / numberOfItems);
         if (k < 1) {
-            throw new IllegalArgumentException(
-                    String.format("Filter too small: Calculated number of hash 
functions (%s) was less than 1", k));
+            throw new IllegalArgumentException(String.format("Filter too 
small: Calculated number of hash functions (%s) was less than 1", k));
         }
         // Normally we would check that numberOfHashFunctions <= 
Integer.MAX_VALUE but
         // since numberOfBits is at most Integer.MAX_VALUE the numerator of
@@ -164,8 +163,7 @@ public final class Shape {
      */
     private static int checkNumberOfHashFunctions(final int 
numberOfHashFunctions) {
         if (numberOfHashFunctions < 1) {
-            throw new IllegalArgumentException(
-                    "Number of hash functions must be greater than 0: " + 
numberOfHashFunctions);
+            throw new IllegalArgumentException("Number of hash functions must 
be greater than 0: " + numberOfHashFunctions);
         }
         return numberOfHashFunctions;
     }
@@ -329,8 +327,7 @@ public final class Shape {
 
         // Number of items (n):
         // n = ceil(m / (-k / ln(1 - exp(ln(p) / k))))
-        final double n = Math.ceil(numberOfBits
-                / (-numberOfHashFunctions / 
Math.log(-Math.expm1(Math.log(probability) / numberOfHashFunctions))));
+        final double n = Math.ceil(numberOfBits / (-numberOfHashFunctions / 
Math.log(-Math.expm1(Math.log(probability) / numberOfHashFunctions))));
 
         // log of probability is always < 0
         // number of hash functions is >= 1
@@ -377,8 +374,7 @@ public final class Shape {
         // Shape is final so no check for the same class as inheritance is not 
possible
         if (obj instanceof Shape) {
             final Shape other = (Shape) obj;
-            return numberOfBits == other.numberOfBits &&
-                   numberOfHashFunctions == other.numberOfHashFunctions;
+            return numberOfBits == other.numberOfBits && numberOfHashFunctions 
== other.numberOfHashFunctions;
         }
         return false;
     }
@@ -462,8 +458,7 @@ public final class Shape {
         if (numberOfItems == 0) {
             return 0;
         }
-        return Math.pow(-Math.expm1(-1.0 * numberOfHashFunctions * 
numberOfItems / numberOfBits),
-                numberOfHashFunctions);
+        return Math.pow(-Math.expm1(-1.0 * numberOfHashFunctions * 
numberOfItems / numberOfBits), numberOfHashFunctions);
     }
 
     @Override

Reply via email to