diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java index 6e54cf4c1..5465d0abd 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java @@ -116,7 +116,8 @@ public class DynamicHasher implements Hasher { buffer++; } return (int) Math.floorMod(function.apply(buffers.get(buffer), funcCount++), - shape.getNumberOfBits()); + // Cast to long to workaround a bug in animal-sniffer. + (long) shape.getNumberOfBits()); } throw new NoSuchElementException(); }