diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java index 64a60bded..331afa7cb 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java @@ -116,7 +116,7 @@ public abstract class AbstractBloomFilter implements BloomFilter { */ @Override public boolean contains(final Hasher hasher) { - verifyHasher( hasher ); + verifyHasher(hasher); final long[] buff = getBits(); final OfInt iter = hasher.getBits(shape); @@ -208,9 +208,8 @@ public abstract class AbstractBloomFilter implements BloomFilter { for (int i = 0; i < limit; i++) { result[i] = mine[i] | theirs[i]; } - if (limit iter, final Shape shape) { this.shape = shape; final Set workingValues = new TreeSet<>(); - iter.forEachRemaining( idx -> { - if (idx >= this.shape.getNumberOfBits()) - { - throw new IllegalArgumentException( String.format( "Bit index (%s) is too big for %s", idx, shape )); + iter.forEachRemaining(idx -> { + if (idx >= this.shape.getNumberOfBits()) { + throw new IllegalArgumentException(String.format("Bit index (%s) is too big for %s", idx, shape)); } - if (idx < 0 ) { - throw new IllegalArgumentException( String.format( "Bit index (%s) may not be less than zero", idx )); + if (idx < 0) { + throw new IllegalArgumentException(String.format("Bit index (%s) may not be less than zero", idx)); } - workingValues.add( idx ); + workingValues.add(idx); }); this.values = new int[workingValues.size()]; - int i=0; - for (final Integer value : workingValues) - { + int i = 0; + for (final Integer value : workingValues) { values[i++] = value.intValue(); } } @@ -114,7 +110,7 @@ public final class StaticHasher implements Hasher { throw new IllegalArgumentException( String.format("shape (%s) does not match internal shape (%s)", shape, this.shape)); } - return Arrays.stream( values ).iterator(); + return Arrays.stream(values).iterator(); } @Override diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java index 3e07521ac..e7f785ede 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java @@ -59,9 +59,9 @@ public final class MD5Cyclic implements HashFunction { try { messageDigest = MessageDigest.getInstance(NAME); } catch (final NoSuchAlgorithmException e) { - throw new IllegalStateException( e.getMessage() ); + throw new IllegalStateException(e.getMessage()); } - signature = apply( HashFunctionIdentity.prepareSignatureBuffer(this), 0); + signature = apply(HashFunctionIdentity.prepareSignatureBuffer(this), 0); } @Override diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java index 9c9ed744e..c599d2b1a 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java @@ -49,7 +49,7 @@ public final class Murmur128x86Cyclic implements HashFunction { * Constructs a Murmur3 x64 128 hash. */ public Murmur128x86Cyclic() { - signature = apply( HashFunctionIdentity.prepareSignatureBuffer(this), 0); + signature = apply(HashFunctionIdentity.prepareSignatureBuffer(this), 0); } diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java index c9c212094..f612f8ccc 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java @@ -45,7 +45,7 @@ public final class Murmur32x86Iterative implements HashFunction { * Constructs a Murmur3 x86 32 hash */ public Murmur32x86Iterative() { - signature = apply( HashFunctionIdentity.prepareSignatureBuffer(this), 0); + signature = apply(HashFunctionIdentity.prepareSignatureBuffer(this), 0); } @Override diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java index 47ea409d4..b8c44493d 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java @@ -53,7 +53,7 @@ public final class ObjectsHashIterative implements HashFunction { * Constructs a hash that uses the Objects.hash method to has values. */ public ObjectsHashIterative() { - signature = apply( HashFunctionIdentity.prepareSignatureBuffer(this), 0); + signature = apply(HashFunctionIdentity.prepareSignatureBuffer(this), 0); } @Override @@ -61,7 +61,7 @@ public final class ObjectsHashIterative implements HashFunction { if (seed == 0) { last = 0; } - final long result = Arrays.deepHashCode( new Object[] {last, buffer}); + final long result = Arrays.deepHashCode(new Object[] { last, buffer }); last += result; return result; }