mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-17 23:44:48 +00:00
Formatting.
This commit is contained in:
parent
7d06bd77e9
commit
a1ce1c2121
@ -208,8 +208,7 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||
for (int i = 0; i < limit; i++) {
|
||||
result[i] = mine[i] | theirs[i];
|
||||
}
|
||||
if (limit<result.length)
|
||||
{
|
||||
if (limit < result.length) {
|
||||
System.arraycopy(remainder, limit, result, limit, result.length - limit);
|
||||
}
|
||||
return BitSet.valueOf(result).cardinality();
|
||||
@ -277,8 +276,7 @@ public abstract class AbstractBloomFilter implements BloomFilter {
|
||||
for (int i = 0; i < limit; i++) {
|
||||
result[i] = mine[i] ^ theirs[i];
|
||||
}
|
||||
if (limit<result.length)
|
||||
{
|
||||
if (limit < result.length) {
|
||||
System.arraycopy(remainder, limit, result, limit, result.length - limit);
|
||||
}
|
||||
return BitSet.valueOf(result).cardinality();
|
||||
|
@ -47,12 +47,10 @@ public final class StaticHasher implements Hasher {
|
||||
*/
|
||||
public StaticHasher(final Hasher hasher, final Shape shape) {
|
||||
this(hasher.getBits(shape), shape);
|
||||
if (
|
||||
HashFunctionIdentity.COMMON_COMPARATOR.compare(
|
||||
hasher.getHashFunctionIdentity(), shape.getHashFunctionIdentity()) != 0) {
|
||||
if (HashFunctionIdentity.COMMON_COMPARATOR.compare(hasher.getHashFunctionIdentity(),
|
||||
shape.getHashFunctionIdentity()) != 0) {
|
||||
throw new IllegalArgumentException(String.format("Hasher (%s) is not the same as for shape (%s)",
|
||||
HashFunctionIdentity.asCommonString( hasher.getHashFunctionIdentity()),
|
||||
shape.toString()));
|
||||
HashFunctionIdentity.asCommonString(hasher.getHashFunctionIdentity()), shape.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,8 +64,7 @@ public final class StaticHasher implements Hasher {
|
||||
this.shape = shape;
|
||||
final Set<Integer> workingValues = new TreeSet<>();
|
||||
iter.forEachRemaining(idx -> {
|
||||
if (idx >= this.shape.getNumberOfBits())
|
||||
{
|
||||
if (idx >= this.shape.getNumberOfBits()) {
|
||||
throw new IllegalArgumentException(String.format("Bit index (%s) is too big for %s", idx, shape));
|
||||
}
|
||||
if (idx < 0) {
|
||||
@ -77,8 +74,7 @@ public final class StaticHasher implements Hasher {
|
||||
});
|
||||
this.values = new int[workingValues.size()];
|
||||
int i = 0;
|
||||
for (final Integer value : workingValues)
|
||||
{
|
||||
for (final Integer value : workingValues) {
|
||||
values[i++] = value.intValue();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user