Add and fix Checkstyle ParenPad
This commit is contained in:
parent
0dfce09f26
commit
a8a0bba75e
|
@ -147,7 +147,7 @@ public interface CountingBloomFilter extends BloomFilter, CellExtractor {
|
||||||
* @see #getMaxInsert(CellExtractor)
|
* @see #getMaxInsert(CellExtractor)
|
||||||
*/
|
*/
|
||||||
default int getMaxInsert(final IndexExtractor indexExtractor) {
|
default int getMaxInsert(final IndexExtractor indexExtractor) {
|
||||||
return getMaxInsert(CellExtractor.from(indexExtractor.uniqueIndices()) );
|
return getMaxInsert(CellExtractor.from(indexExtractor.uniqueIndices()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -105,18 +105,12 @@ public class ArrayIterator<E> implements ResettableIterator<E> {
|
||||||
* @param type the index type (for error messages)
|
* @param type the index type (for error messages)
|
||||||
* @throws IndexOutOfBoundsException if the index is invalid
|
* @throws IndexOutOfBoundsException if the index is invalid
|
||||||
*/
|
*/
|
||||||
protected void checkBound(final int bound, final int len, final String type ) {
|
protected void checkBound(final int bound, final int len, final String type) {
|
||||||
if (bound > len) {
|
if (bound > len) {
|
||||||
throw new ArrayIndexOutOfBoundsException(
|
throw new ArrayIndexOutOfBoundsException("Attempt to make an ArrayIterator that " + type + "s beyond the end of the array. ");
|
||||||
"Attempt to make an ArrayIterator that " + type +
|
|
||||||
"s beyond the end of the array. "
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (bound < 0) {
|
if (bound < 0) {
|
||||||
throw new ArrayIndexOutOfBoundsException(
|
throw new ArrayIndexOutOfBoundsException("Attempt to make an ArrayIterator that " + type + "s before the start of the array. ");
|
||||||
"Attempt to make an ArrayIterator that " + type +
|
|
||||||
"s before the start of the array. "
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class FilterListIterator<E> implements ListIterator<E> {
|
||||||
*
|
*
|
||||||
* @param iterator the iterator to use
|
* @param iterator the iterator to use
|
||||||
*/
|
*/
|
||||||
public FilterListIterator(final ListIterator<? extends E> iterator ) {
|
public FilterListIterator(final ListIterator<? extends E> iterator) {
|
||||||
this.iterator = iterator;
|
this.iterator = iterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,8 +342,8 @@ public abstract class AbstractCountingBloomFilterTest<T extends CountingBloomFil
|
||||||
final CountingBloomFilter bf7 = createFilter(getTestShape(), TestingHashers.FROM1);
|
final CountingBloomFilter bf7 = createFilter(getTestShape(), TestingHashers.FROM1);
|
||||||
final BitMapExtractor bmp2 = BitMapExtractor.fromIndexExtractor(ip2, getTestShape().getNumberOfBits());
|
final BitMapExtractor bmp2 = BitMapExtractor.fromIndexExtractor(ip2, getTestShape().getNumberOfBits());
|
||||||
assertThrows(IllegalArgumentException.class, () -> bf7.remove(bmp2));
|
assertThrows(IllegalArgumentException.class, () -> bf7.remove(bmp2));
|
||||||
assertThrows(IllegalArgumentException.class, () -> bf7.remove( new BadHasher(-1)));
|
assertThrows(IllegalArgumentException.class, () -> bf7.remove(new BadHasher(-1)));
|
||||||
assertThrows(IllegalArgumentException.class, () -> bf7.remove( new BadHasher(getTestShape().getNumberOfBits())));
|
assertThrows(IllegalArgumentException.class, () -> bf7.remove(new BadHasher(getTestShape().getNumberOfBits())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -358,7 +358,7 @@ public abstract class AbstractCountingBloomFilterTest<T extends CountingBloomFil
|
||||||
final CountingBloomFilter bf2 = createFilter(getTestShape(), TestingHashers.FROM11);
|
final CountingBloomFilter bf2 = createFilter(getTestShape(), TestingHashers.FROM11);
|
||||||
|
|
||||||
assertTrue(bf1.subtract(bf2), "Subtract should work");
|
assertTrue(bf1.subtract(bf2), "Subtract should work");
|
||||||
assertFalse(bf1.contains( TestingHashers.populateFromHashersFrom1AndFrom11(new SimpleBloomFilter(getTestShape()))), "Should not contain bitHasher");
|
assertFalse(bf1.contains(TestingHashers.populateFromHashersFrom1AndFrom11(new SimpleBloomFilter(getTestShape()))), "Should not contain bitHasher");
|
||||||
assertTrue(bf1.contains(TestingHashers.FROM1), "Should contain TestingHashers.from1");
|
assertTrue(bf1.contains(TestingHashers.FROM1), "Should contain TestingHashers.from1");
|
||||||
|
|
||||||
assertCounts(bf1, from1Counts);
|
assertCounts(bf1, from1Counts);
|
||||||
|
@ -375,8 +375,8 @@ public abstract class AbstractCountingBloomFilterTest<T extends CountingBloomFil
|
||||||
|
|
||||||
assertCounts(bf3, new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0});
|
assertCounts(bf3, new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0});
|
||||||
|
|
||||||
assertThrows(IllegalArgumentException.class, () -> bf3.remove( new BadHasher(-1)));
|
assertThrows(IllegalArgumentException.class, () -> bf3.remove(new BadHasher(-1)));
|
||||||
assertThrows(IllegalArgumentException.class, () -> bf3.remove( new BadHasher(getTestShape().getNumberOfBits())));
|
assertThrows(IllegalArgumentException.class, () -> bf3.remove(new BadHasher(getTestShape().getNumberOfBits())));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyMaxInsert(final CountingBloomFilter bf, final int from1, final int from11) {
|
private void verifyMaxInsert(final CountingBloomFilter bf, final int from1, final int from11) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class DefaultCellExtractorTest extends AbstractCellExtractorTest {
|
||||||
protected CellExtractor createExtractor() {
|
protected CellExtractor createExtractor() {
|
||||||
return consumer -> {
|
return consumer -> {
|
||||||
for (int i = 0; i < indices.length; i++) {
|
for (int i = 0; i < indices.length; i++) {
|
||||||
if (!consumer.test(indices[i], values[i] )) {
|
if (!consumer.test(indices[i], values[i])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,8 +233,8 @@ public class LayeredBloomFilterTest extends AbstractBloomFilterTest<LayeredBloom
|
||||||
final LayerManager layerManager = LayerManager.builder()
|
final LayerManager layerManager = LayerManager.builder()
|
||||||
.setSupplier(() -> new NumberedBloomFilter(getTestShape(), 3, sequence[0]++))
|
.setSupplier(() -> new NumberedBloomFilter(getTestShape(), 3, sequence[0]++))
|
||||||
.setExtendCheck(ExtendCheck.neverAdvance())
|
.setExtendCheck(ExtendCheck.neverAdvance())
|
||||||
.setCleanup(ll -> ll.removeIf( f -> (((NumberedBloomFilter) f).value-- == 0))).get();
|
.setCleanup(ll -> ll.removeIf(f -> (((NumberedBloomFilter) f).value-- == 0))).get();
|
||||||
final LayeredBloomFilter underTest = new LayeredBloomFilter(getTestShape(), layerManager );
|
final LayeredBloomFilter underTest = new LayeredBloomFilter(getTestShape(), layerManager);
|
||||||
assertEquals(1, underTest.getDepth());
|
assertEquals(1, underTest.getDepth());
|
||||||
underTest.merge(TestingHashers.randomHasher());
|
underTest.merge(TestingHashers.randomHasher());
|
||||||
underTest.cleanup(); // first count == 2
|
underTest.cleanup(); // first count == 2
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class TransformedSplitMapTest extends BulkTest {
|
||||||
final TransformedSplitMap<String, String, String, String> map =
|
final TransformedSplitMap<String, String, String, String> map =
|
||||||
TransformedSplitMap.transformingMap(new HashMap<>(),
|
TransformedSplitMap.transformingMap(new HashMap<>(),
|
||||||
NOPTransformer.<String>nopTransformer(),
|
NOPTransformer.<String>nopTransformer(),
|
||||||
NOPTransformer.<String>nopTransformer() );
|
NOPTransformer.<String>nopTransformer());
|
||||||
|
|
||||||
final ObjectInputStream in = new ObjectInputStream(new FileInputStream(TEST_DATA_PATH + "/TransformedSplitMap.emptyCollection.version4.obj"));
|
final ObjectInputStream in = new ObjectInputStream(new FileInputStream(TEST_DATA_PATH + "/TransformedSplitMap.emptyCollection.version4.obj"));
|
||||||
final Object readObject = in.readObject();
|
final Object readObject = in.readObject();
|
||||||
|
|
Loading…
Reference in New Issue