From a230c08e89270e07973d1285619246ac4108e977 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Thu, 7 Jul 2016 20:33:40 +0100 Subject: [PATCH] Cut blank lines --- .../impl/CompactOffHeapLinearHashTable.java | 3 - .../stage/data/bytes/EntryKeyBytesData.java | 1 - .../impl/stage/entry/HashEntryStages.java | 1 - .../hash/impl/stage/entry/ReadLock.java | 1 - .../hash/impl/stage/entry/SegmentStages.java | 1 - .../hash/impl/util/BuildVersion.java | 2 - .../chronicle/hash/impl/util/math/Gamma.java | 1 - .../impl/util/math/PoissonDistribution.java | 1 - .../hash/impl/util/math/Precision.java | 3 +- .../chronicle/map/AbstractChronicleMap.java | 1 - .../openhft/chronicle/map/JsonSerializer.java | 5 +- .../map/impl/stage/input/ReplicatedInput.java | 1 - .../map/MapEntryOperationsDelegation.java | 1 - .../AbstractChronicleMapConverter.java | 9 +- .../converters/ByteBufferConverter.java | 5 -- .../xstream/converters/ValueConverter.java | 3 - .../java/eg/OffHeapByteArrayExampleTest.java | 1 - .../java/eg/TestInstrumentVOInterface.java | 8 -- .../chronicle/map/BuildVersionTest.java | 2 - .../map/BytesMarshallableValueTest.java | 4 +- .../chronicle/map/CHMUseCasesTest.java | 43 +--------- .../map/ChronicleMapImportExportTest.java | 5 -- .../map/ChronicleMapSanityCheckTest.java | 3 +- .../chronicle/map/ChronicleMapTest.java | 84 +++++-------------- .../chronicle/map/EntryCountMapTest.java | 4 +- .../openhft/chronicle/map/Issue43Test.java | 1 - .../net/openhft/chronicle/map/Issue58.java | 7 +- .../openhft/chronicle/map/Issue63Test.java | 1 - .../map/KeySegmentDistributionTest.java | 1 - .../net/openhft/chronicle/map/LataTest.java | 1 - .../chronicle/map/WriteThroughputTest.java | 3 +- .../map/jsr166/map/ChronicleMapTest.java | 1 - .../chronicle/map/jsr166/map/MapCheck.java | 1 - .../net/openhft/chronicle/set/Builder.java | 3 +- .../set/Issue24ChronicleSetTest.java | 6 +- .../net/openhft/lang/values/DoubleArray.java | 1 - 36 files changed, 36 insertions(+), 183 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/hash/impl/CompactOffHeapLinearHashTable.java b/src/main/java/net/openhft/chronicle/hash/impl/CompactOffHeapLinearHashTable.java index 8eb3a633e..346a9ee37 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/CompactOffHeapLinearHashTable.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/CompactOffHeapLinearHashTable.java @@ -16,7 +16,6 @@ package net.openhft.chronicle.hash.impl; - import net.openhft.chronicle.core.Maths; import static net.openhft.chronicle.algo.MemoryUnit.BITS; @@ -35,7 +34,6 @@ public abstract class CompactOffHeapLinearHashTable { */ public static final double MAX_LOAD_FACTOR = 0.8; - public static int valueBits(long actualChunksPerSegment) { return 64 - Long.numberOfLeadingZeros(actualChunksPerSegment - 1L); } @@ -77,7 +75,6 @@ public abstract class CompactOffHeapLinearHashTable { public static final long UNSET_KEY = 0L; public static final long UNSET_ENTRY = 0L; - private final long capacityMask; final long capacityMask2; private final int keyBits; diff --git a/src/main/java/net/openhft/chronicle/hash/impl/stage/data/bytes/EntryKeyBytesData.java b/src/main/java/net/openhft/chronicle/hash/impl/stage/data/bytes/EntryKeyBytesData.java index 65b20a8c2..e40469b19 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/stage/data/bytes/EntryKeyBytesData.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/stage/data/bytes/EntryKeyBytesData.java @@ -35,7 +35,6 @@ public class EntryKeyBytesData extends AbstractData { @StageRef HashEntryStages entry; @StageRef CheckOnEachPublicOperation checkOnEachPublicOperation; - @Stage("CachedEntryKey") private K cachedEntryKey; @Stage("CachedEntryKey") private boolean cachedEntryKeyRead = false; diff --git a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/HashEntryStages.java b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/HashEntryStages.java index 18cc8a0a3..1af3ae338 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/HashEntryStages.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/HashEntryStages.java @@ -33,7 +33,6 @@ import org.jetbrains.annotations.NotNull; import static net.openhft.chronicle.algo.bytes.Access.checkedBytesStoreAccess; import static net.openhft.chronicle.algo.bytes.Access.nativeAccess; - @Staged public abstract class HashEntryStages implements HashEntry, ChecksumEntry { diff --git a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/ReadLock.java b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/ReadLock.java index ddbd4e67a..f69e8ad0d 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/ReadLock.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/ReadLock.java @@ -27,7 +27,6 @@ import java.util.concurrent.TimeUnit; import static net.openhft.chronicle.hash.impl.LocalLockState.READ_LOCKED; import static net.openhft.chronicle.hash.impl.LocalLockState.UNLOCKED; - @Staged public class ReadLock implements InterProcessLock { diff --git a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java index dae7e2353..e6851d00d 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java @@ -143,7 +143,6 @@ public abstract class SegmentStages implements SegmentLock, LocksInterface { return size; } - @Stage("Locks") public LocksInterface rootContextLockedOnThisSegment = null; /** * See the ChMap Ops spec, considerations of nested same-thread concurrent contexts. diff --git a/src/main/java/net/openhft/chronicle/hash/impl/util/BuildVersion.java b/src/main/java/net/openhft/chronicle/hash/impl/util/BuildVersion.java index 2b4925869..ab72767b6 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/util/BuildVersion.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/util/BuildVersion.java @@ -58,7 +58,6 @@ public final class BuildVersion { // do nothing } - // another way to get the version is to read it from the manifest final String versionFromManifest = getVersionFromManifest(); @@ -81,7 +80,6 @@ public final class BuildVersion { return ChronicleMapBuilder.class.getPackage().getImplementationVersion(); } - /** * reads the pom file to get this version, only to be used for development or within the IDE. * diff --git a/src/main/java/net/openhft/chronicle/hash/impl/util/math/Gamma.java b/src/main/java/net/openhft/chronicle/hash/impl/util/math/Gamma.java index a9ca5fad4..6228cb76c 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/util/math/Gamma.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/util/math/Gamma.java @@ -18,7 +18,6 @@ package net.openhft.chronicle.hash.impl.util.math; - /** *

* This is a utility class that provides computation methods related to the diff --git a/src/main/java/net/openhft/chronicle/hash/impl/util/math/PoissonDistribution.java b/src/main/java/net/openhft/chronicle/hash/impl/util/math/PoissonDistribution.java index 9a5c7754b..08a8b47a6 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/util/math/PoissonDistribution.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/util/math/PoissonDistribution.java @@ -18,7 +18,6 @@ package net.openhft.chronicle.hash.impl.util.math; - public class PoissonDistribution { private static final double EPSILON = 1e-12; diff --git a/src/main/java/net/openhft/chronicle/hash/impl/util/math/Precision.java b/src/main/java/net/openhft/chronicle/hash/impl/util/math/Precision.java index a338946be..779846fcb 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/util/math/Precision.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/util/math/Precision.java @@ -89,8 +89,7 @@ class Precision { } else { isEqual = deltaMinus <= (maxUlps - deltaPlus); } - - } +} return isEqual && !Double.isNaN(x) && !Double.isNaN(y); diff --git a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java index 8897b27ea..600afd411 100644 --- a/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/AbstractChronicleMap.java @@ -230,7 +230,6 @@ interface AbstractChronicleMap extends ChronicleMap { return new ChronicleMapEntrySet<>(this); } - @Override default void forEachEntry(final Consumer> action) { forEachEntryWhile(c -> { diff --git a/src/main/java/net/openhft/chronicle/map/JsonSerializer.java b/src/main/java/net/openhft/chronicle/map/JsonSerializer.java index 9194d5be5..b567470b8 100644 --- a/src/main/java/net/openhft/chronicle/map/JsonSerializer.java +++ b/src/main/java/net/openhft/chronicle/map/JsonSerializer.java @@ -45,7 +45,6 @@ class JsonSerializer { } } - static synchronized void putAll(File fromFile, Map map, List jsonConverters) throws IOException { final XStream xstream = xStream(map, jsonConverters); @@ -78,8 +77,7 @@ class JsonSerializer { " expecting an object of type com.thoughtworks.xstream.converters" + ".Converter"); } - - } +} return xstream; } catch (NoClassDefFoundError e) { @@ -109,4 +107,3 @@ class JsonSerializer { } } - diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/input/ReplicatedInput.java b/src/main/java/net/openhft/chronicle/map/impl/stage/input/ReplicatedInput.java index ecc0d8346..308453040 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/input/ReplicatedInput.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/input/ReplicatedInput.java @@ -30,7 +30,6 @@ import net.openhft.chronicle.map.replication.MapRemoteQueryContext; import net.openhft.sg.StageRef; import net.openhft.sg.Staged; - @Staged public abstract class ReplicatedInput implements RemoteOperationContext, MapRemoteQueryContext, Replica.QueryContext { diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/map/MapEntryOperationsDelegation.java b/src/main/java/net/openhft/chronicle/map/impl/stage/map/MapEntryOperationsDelegation.java index f04d66b06..a3ec5d630 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/map/MapEntryOperationsDelegation.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/map/MapEntryOperationsDelegation.java @@ -32,7 +32,6 @@ public abstract class MapEntryOperationsDelegation implements MapContex @StageRef CheckOnEachPublicOperation checkOnEachPublicOperation; @StageRef VanillaChronicleMapHolder mh; - @Override public R replaceValue(@NotNull MapEntry entry, Data newValue) { checkOnEachPublicOperation.checkOnEachPublicOperation(); diff --git a/src/main/java/net/openhft/xstream/converters/AbstractChronicleMapConverter.java b/src/main/java/net/openhft/xstream/converters/AbstractChronicleMapConverter.java index 197c6bf07..baa50b1f9 100644 --- a/src/main/java/net/openhft/xstream/converters/AbstractChronicleMapConverter.java +++ b/src/main/java/net/openhft/xstream/converters/AbstractChronicleMapConverter.java @@ -36,7 +36,6 @@ import static net.openhft.chronicle.values.ValueModel.$$NATIVE; */ class AbstractChronicleMapConverter implements Converter { - private final Map map; private final Class mapClazz; @@ -45,14 +44,12 @@ class AbstractChronicleMapConverter implements Converter { this.mapClazz = map.getClass(); } - @Override public boolean canConvert(Class aClass) { //noinspection unchecked return mapClazz.isAssignableFrom(aClass); } - @Override public void marshal(Object o, HierarchicalStreamWriter writer, MarshallingContext marshallingContext) { @@ -73,8 +70,7 @@ class AbstractChronicleMapConverter implements Converter { } writer.endNode(); } - - } +} @Override public Object unmarshal(HierarchicalStreamReader reader, @@ -154,8 +150,7 @@ class AbstractChronicleMapConverter implements Converter { } catch (Exception e1) { throw new ConversionException("class=" + clazz, e1); } - - } +} } } diff --git a/src/main/java/net/openhft/xstream/converters/ByteBufferConverter.java b/src/main/java/net/openhft/xstream/converters/ByteBufferConverter.java index 7e6171b11..14c3b7d20 100644 --- a/src/main/java/net/openhft/xstream/converters/ByteBufferConverter.java +++ b/src/main/java/net/openhft/xstream/converters/ByteBufferConverter.java @@ -42,17 +42,14 @@ public class ByteBufferConverter implements Converter { marshallingContext.convertAnother(buffer.position()); writer.endNode(); - writer.startNode("capacity"); marshallingContext.convertAnother(buffer.capacity()); writer.endNode(); - writer.startNode("limit"); marshallingContext.convertAnother(buffer.limit()); writer.endNode(); - writer.startNode("isDirect"); marshallingContext.convertAnother(buffer.isDirect()); writer.endNode(); @@ -74,7 +71,6 @@ public class ByteBufferConverter implements Converter { throw new ConversionException("", e); } - writer.endNode(); buffer.limit(limit); @@ -88,7 +84,6 @@ public class ByteBufferConverter implements Converter { int position = (Integer) unmarshallingContext.convertAnother(null, int.class); reader.moveUp(); - reader.moveDown(); int capacity = (Integer) unmarshallingContext.convertAnother(null, int.class); reader.moveUp(); diff --git a/src/main/java/net/openhft/xstream/converters/ValueConverter.java b/src/main/java/net/openhft/xstream/converters/ValueConverter.java index eb0926dca..3cc56c658 100644 --- a/src/main/java/net/openhft/xstream/converters/ValueConverter.java +++ b/src/main/java/net/openhft/xstream/converters/ValueConverter.java @@ -31,7 +31,6 @@ import org.slf4j.LoggerFactory; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; - /** * @author Rob Austin. */ @@ -67,7 +66,6 @@ public class ValueConverter implements Converter { return; } - try { final Method get = fieldModel.getOrGetVolatile(); @@ -147,7 +145,6 @@ public class ValueConverter implements Converter { } } - @Override public boolean canConvert(Class clazz) { return Values.isValueInterfaceOrImplClass(clazz); diff --git a/src/test/java/eg/OffHeapByteArrayExampleTest.java b/src/test/java/eg/OffHeapByteArrayExampleTest.java index 5406f285e..d2076410a 100644 --- a/src/test/java/eg/OffHeapByteArrayExampleTest.java +++ b/src/test/java/eg/OffHeapByteArrayExampleTest.java @@ -62,7 +62,6 @@ public class OffHeapByteArrayExampleTest { ByteArray value = Values.newHeapInstance(ByteArray.class); LongValue key = Values.newHeapInstance(LongValue.class); - key.setValue(1); // this is kind of like byteValue[1] = 'b' diff --git a/src/test/java/eg/TestInstrumentVOInterface.java b/src/test/java/eg/TestInstrumentVOInterface.java index d30b21cdd..e02d9ef87 100644 --- a/src/test/java/eg/TestInstrumentVOInterface.java +++ b/src/test/java/eg/TestInstrumentVOInterface.java @@ -24,32 +24,24 @@ import net.openhft.chronicle.values.MaxUtf8Length; */ public interface TestInstrumentVOInterface { - int getSizeOfInstrumentIDArray(); void setSizeOfInstrumentIDArray(int sizeOfInstrumentIDArray); - String getSymbol(); void setSymbol(@MaxUtf8Length(20) String symbol); - - - String getCurrencyCode(); void setCurrencyCode(@MaxUtf8Length(4) String currencyCode); - @Array(length = 2) void setInstrumentIDAt(int location, TestInstrumentIDVOInterface instrumentID); TestInstrumentIDVOInterface getInstrumentIDAt(int location); - interface TestInstrumentIDVOInterface { - String getIdSource(); void setIdSource(@MaxUtf8Length(6) String idSource); diff --git a/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java b/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java index acf7dfadc..b26709e2c 100644 --- a/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java +++ b/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java @@ -27,14 +27,12 @@ import java.io.IOException; */ public class BuildVersionTest { - @Test public void test() throws IOException, InterruptedException { // checks that we always get a version Assert.assertNotNull(BuildVersion.version()); } - /** * check that the map records the version * diff --git a/src/test/java/net/openhft/chronicle/map/BytesMarshallableValueTest.java b/src/test/java/net/openhft/chronicle/map/BytesMarshallableValueTest.java index 15e96d2a5..85177c180 100644 --- a/src/test/java/net/openhft/chronicle/map/BytesMarshallableValueTest.java +++ b/src/test/java/net/openhft/chronicle/map/BytesMarshallableValueTest.java @@ -43,7 +43,5 @@ public class BytesMarshallableValueTest { this.x = x; this.foo = foo; } - - - } +} } diff --git a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java index 1cd06f306..a876cb2cd 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java @@ -158,7 +158,6 @@ interface IBean { @RunWith(value = Parameterized.class) public class CHMUseCasesTest { - static volatile int i = 0; private final TypeOfMap typeOfMap; @@ -238,7 +237,6 @@ public class CHMUseCasesTest { assertEquals(map1.size(), map2.size()); - for (Object key : map1.keySet()) { if (map1.valueClass() == byte[].class) @@ -250,7 +248,6 @@ public class CHMUseCasesTest { byte[][] o1 = (byte[][]) map1.get(key); byte[][] o2 = (byte[][]) map2.get(key); - Assert.assertEquals(o1.length, o2.length); for (int i = 0; i < o1.length; i++) { Assert.assertArrayEquals(o1[i], o2[i]); @@ -289,7 +286,6 @@ public class CHMUseCasesTest { try (ChronicleMap actual = builder.create()) { actual.putAll(file); - if (map1.valueClass() == char[].class || map1.valueClass() == byte[].class || map1.valueClass() == byte[][].class) { @@ -448,8 +444,7 @@ public class CHMUseCasesTest { mpx1030.setAskPx(109.7); mpx1030.setBidPx(107.6); } - - } +} } @@ -532,7 +527,6 @@ public class CHMUseCasesTest { public void testStringStringMap() throws ExecutionException, InterruptedException, IOException { - ChronicleMapBuilder builder = ChronicleMapBuilder .of(String.class, String.class) .entries(1); @@ -603,7 +597,6 @@ public class CHMUseCasesTest { public void testCharSequenceCharSequenceMap() throws ExecutionException, InterruptedException, IOException { - ChronicleMapBuilder builder = ChronicleMapBuilder .of(CharSequence.class, CharSequence.class) .entries(10); @@ -623,7 +616,6 @@ public class CHMUseCasesTest { map.remove("key-1"); assertNull(map.getUsing(key, value)); - assertEquals("New World", map.getMapped("Hello", s -> "New " + s)); assertEquals(null, map.getMapped("No key", (SerializableFunction) s -> "New " + s)); @@ -647,7 +639,6 @@ public class CHMUseCasesTest { @Test public void testAcquireUsingWithCharSequence() throws IOException { - ChronicleMapBuilder builder = ChronicleMapBuilder .of(CharSequence.class, CharSequence.class) .entries(1); @@ -693,7 +684,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - IntValue using = Values.newHeapInstance(IntValue.class); using.setValue(1); @@ -716,7 +706,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - IntValue key = Values.newHeapInstance(IntValue.class); key.setValue(1); @@ -921,7 +910,6 @@ public class CHMUseCasesTest { map.put(key1, value1); assertEquals(value1, map.get(key1)); - key2 = 2; value2 = 22; map.put(key2, value2); @@ -964,7 +952,6 @@ public class CHMUseCasesTest { @Test public void testLongLongMap() throws ExecutionException, InterruptedException, IOException { - ChronicleMapBuilder builder = ChronicleMapBuilder .of(Long.class, Long.class) .entries(10); @@ -1005,7 +992,6 @@ public class CHMUseCasesTest { @Test public void testDoubleDoubleMap() throws ExecutionException, InterruptedException, IOException { - ChronicleMapBuilder builder = ChronicleMapBuilder .of(Double.class, Double.class) .entries(10); @@ -1035,9 +1021,7 @@ public class CHMUseCasesTest { } catch (Exception todoMoreSpecificException) { } - - - } +} } @Test @@ -1060,7 +1044,6 @@ public class CHMUseCasesTest { map.put(key1, value1); - assertTrue(Arrays.equals(new byte[]{11, 11}, map.getMapped(key1, new SerializableFunction() { @Override @@ -1085,7 +1068,6 @@ public class CHMUseCasesTest { byte[] a2 = map.get(key1); assertTrue(Arrays.equals(new byte[]{12, 10}, a2)); - } } @@ -1101,7 +1083,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1}); ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2}); ByteBuffer value1 = ByteBuffer.wrap(new byte[]{11, 11, 11, 11}); @@ -1111,7 +1092,6 @@ public class CHMUseCasesTest { assertBBEquals(value2, map.get(key1)); assertNull(map.get(key2)); - map.put(key1, value1); mapChecks(); @@ -1130,7 +1110,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1}); ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2}); ByteBuffer value1 = ByteBuffer.wrap(new byte[]{11, 11, 11, 11}); @@ -1201,12 +1180,10 @@ public class CHMUseCasesTest { valueA.flip(); } - value1.clear(); value1.putInt(12345); value1.flip(); - try (net.openhft.chronicle.core.io.Closeable c = map.acquireContext(key1, valueB)) { assertBBEquals(value1, valueB); @@ -1241,7 +1218,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1}); ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2}); ByteBuffer value1 = ByteBuffer.allocateDirect(4); @@ -1299,7 +1275,6 @@ public class CHMUseCasesTest { IntValue value1 = Values.newHeapInstance(IntValue.class); IntValue value2 = Values.newHeapInstance(IntValue.class); - key1.setValue(1); value1.setValue(11); map.put(key1, value1); @@ -1517,7 +1492,6 @@ public class CHMUseCasesTest { // this may change due to alignment // assertEquals(6, entrySize(map)); - // assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry); IntValue key1 = Values.newHeapInstance(IntValue.class); IntValue key2 = Values.newHeapInstance(IntValue.class); @@ -1621,7 +1595,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - // this may change due to alignment // assertEquals(8, entrySize(map)); assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry); @@ -1726,7 +1699,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry); IntValue key1 = Values.newHeapInstance(IntValue.class); IntValue key2 = Values.newHeapInstance(IntValue.class); @@ -1826,7 +1798,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - // TODO should be 5, but shorter fields based on range doesn't seem to be implemented // on data value generation level yet //assertEquals(8, entrySize(map)); this may change due to alignmented @@ -1837,7 +1808,6 @@ public class CHMUseCasesTest { UnsignedByteValue value1 = Values.newHeapInstance(UnsignedByteValue.class); UnsignedByteValue value2 = Values.newHeapInstance(UnsignedByteValue.class); - key1.setValue(1); value1.setValue(11); map.put(key1, value1); @@ -1933,7 +1903,6 @@ public class CHMUseCasesTest { try (ChronicleMap map = newInstance(builder)) { - assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry); IntValue key1 = Values.newHeapInstance(IntValue.class); @@ -1941,7 +1910,6 @@ public class CHMUseCasesTest { BooleanValue value1 = Values.newHeapInstance(BooleanValue.class); BooleanValue value2 = Values.newHeapInstance(BooleanValue.class); - key1.setValue(1); value1.setValue(true); map.put(key1, value1); @@ -2044,7 +2012,6 @@ public class CHMUseCasesTest { FloatValue value1 = Values.newHeapInstance(FloatValue.class); FloatValue value2 = Values.newHeapInstance(FloatValue.class); - key1.setValue(1); value1.setValue(11); map.put(key1, value1); @@ -2150,7 +2117,6 @@ public class CHMUseCasesTest { DoubleValue value1 = Values.newHeapInstance(DoubleValue.class); DoubleValue value2 = Values.newHeapInstance(DoubleValue.class); - key1.setValue(1); value1.setValue(11); assertEquals(null, map.get(key1)); @@ -2257,7 +2223,6 @@ public class CHMUseCasesTest { LongValue value1 = Values.newHeapInstance(LongValue.class); LongValue value2 = Values.newHeapInstance(LongValue.class); - key1.setValue(1); value1.setValue(11); assertEquals(null, map.get(key1)); @@ -2350,7 +2315,6 @@ public class CHMUseCasesTest { .valueMarshaller(ListMarshaller.of( new StringBytesReader(), CharSequenceBytesWriter.INSTANCE)); - try (ChronicleMap> map = newInstance(builder)) { map.put("1", Collections.emptyList()); map.put("2", asList("two-A")); @@ -2397,7 +2361,6 @@ public class CHMUseCasesTest { .valueMarshaller(SetMarshaller.of( new StringBytesReader(), CharSequenceBytesWriter.INSTANCE)); - try (ChronicleMap> map = newInstance(builder)) { map.put("1", Collections.emptySet()); map.put("2", new LinkedHashSet<>(asList("one"))); @@ -2445,7 +2408,6 @@ public class CHMUseCasesTest { .entries(3) .valueMarshaller(valueMarshaller); - try (ChronicleMap> map = newInstance(builder)) { map.put("1", Collections.emptyMap()); map.put("2", mapOf("one", "uni")); @@ -2602,7 +2564,6 @@ public class CHMUseCasesTest { enum TypeOfMap {SIMPLE, SIMPLE_PERSISTED} - interface I1 { @Array(length = 10) String getStrAt(int i); diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java index c99f6e330..f3698ca70 100644 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java @@ -175,7 +175,6 @@ public class ChronicleMapImportExportTest { } } - @Test public void testFromHashMap() throws IOException, InterruptedException { @@ -189,13 +188,11 @@ public class ChronicleMapImportExportTest { map.put(1, "one"); map.put(2, "two"); - final XStream xstream = new XStream(new JettisonMappedXmlDriver()); xstream.setMode(XStream.NO_REFERENCES); xstream.toXML(map, new FileOutputStream(file)); - try (ChronicleMap expected = ChronicleMapBuilder .of(Integer.class, String.class) .averageValueSize(10) @@ -213,7 +210,6 @@ public class ChronicleMapImportExportTest { Assert.assertEquals("two", expected.get(2)); } - file.deleteOnExit(); } @@ -251,7 +247,6 @@ public class ChronicleMapImportExportTest { } } - @Test public void testBondVOInterface() throws IOException, InterruptedException { diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java index e4c0688d2..d36b73355 100644 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java @@ -119,8 +119,7 @@ public class ChronicleMapSanityCheckTest { throw new RuntimeException(e); } } - - } +} enum DummyValue { DUMMY_VALUE diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java index fa203cdfa..adb08394d 100755 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java @@ -189,7 +189,6 @@ public class ChronicleMapTest { } } - @Test public void testByteArrayPersistenceFileReuse() throws IOException { final File persistenceFile = Builder.getPersistenceFile(); @@ -226,8 +225,7 @@ public class ChronicleMapTest { assertEquals(map1, map2); } - - } +} } @Test @@ -250,11 +248,9 @@ public class ChronicleMapTest { assertEquals(map1, map2); } - - } +} } - @Test public void testEqualsByteArray() { @@ -275,11 +271,9 @@ public class ChronicleMapTest { assertEquals(map1, map2); } - - } +} } - @Test public void testSize() { @@ -714,12 +708,10 @@ public class ChronicleMapTest { assertEquals(j, value3.getValue()); } } - - } +} } } - @Test public void testAcquireFromMultipleThreads() throws InterruptedException { int entries = 1000 * 1000; @@ -807,8 +799,7 @@ public class ChronicleMapTest { } } } - - } +} @Test public void testLargerEntries() { @@ -857,7 +848,6 @@ public class ChronicleMapTest { .averageKeySize(14) .averageValueSize(value0.length() + 4); - // File tmpFile = File.createTempFile("testAcquirePerf", ".deleteme"); // tmpFile.deleteOnExit(); //createPersistedTo(tmpFile); @@ -1005,7 +995,6 @@ public class ChronicleMapTest { es.awaitTermination(1, TimeUnit.MINUTES); } - static final LongValue ONE = Values.newHeapInstance(LongValue.class); static { @@ -1040,7 +1029,6 @@ public class ChronicleMapTest { final int independence = Math.min(procs, runs > 500 ? 8 : 4); System.out.println("\nKey size: " + runs + " Million entries. " + builder); - for (int j = 0; j < count; j++) { long start = System.currentTimeMillis(); List futures = new ArrayList<>(); @@ -1274,8 +1262,7 @@ public class ChronicleMapTest { assertNull(map.getUsing(key, value)); } } - - } +} } @Test @@ -1294,9 +1281,7 @@ public class ChronicleMapTest { assertValues(values, new CharSequence[]{"1", "3"}); assertValues(map.values(), new CharSequence[]{"1", "3"}); } - - } - +} @Test public void mapPutReflectedInViews() throws IOException { @@ -1316,7 +1301,6 @@ public class ChronicleMapTest { } } - @Test public void entrySetRemoveReflectedInMapAndOtherViews() throws IOException { try (ChronicleMap map = getViewTestMap(3)) { @@ -1332,7 +1316,6 @@ public class ChronicleMapTest { } } - @Test public void keySetRemoveReflectedInMapAndOtherViews() throws IOException { try (ChronicleMap map = getViewTestMap(3)) { @@ -1348,8 +1331,7 @@ public class ChronicleMapTest { assertValues(values, new CharSequence[]{"1", "3"}); } - - } +} @Test public void valuesRemoveReflectedInMap() throws IOException { @@ -1365,8 +1347,7 @@ public class ChronicleMapTest { assertValues(values, new CharSequence[]{"1", "3"}); } - - } +} @Test public void entrySetIteratorRemoveReflectedInMapAndOtherViews() throws IOException { @@ -1389,7 +1370,6 @@ public class ChronicleMapTest { } } - @Test public void keySetIteratorRemoveReflectedInMapAndOtherViews() throws IOException { try (ChronicleMap map = getViewTestMap(3)) { @@ -1410,8 +1390,7 @@ public class ChronicleMapTest { assertValues(values, expectedValues); } - - } +} @Test public void valuesIteratorRemoveReflectedInMapAndOtherViews() throws IOException { @@ -1438,8 +1417,7 @@ public class ChronicleMapTest { assertValues(values, expectedValues); } - - } +} @Test public void entrySetRemoveAllReflectedInMapAndOtherViews() throws IOException { @@ -1460,8 +1438,7 @@ public class ChronicleMapTest { assertValues(values, new CharSequence[]{"3"}); } - - } +} @Test public void keySetRemoveAllReflectedInMapAndOtherViews() throws IOException { @@ -1477,8 +1454,7 @@ public class ChronicleMapTest { assertValues(values, new CharSequence[]{"3"}); } - - } +} @Test public void valuesRemoveAllReflectedInMapAndOtherViews() throws IOException { @@ -1496,7 +1472,6 @@ public class ChronicleMapTest { } } - @Test public void entrySetRetainAllReflectedInMapAndOtherViews() throws IOException { try (ChronicleMap map = getViewTestMap(3)) { @@ -1515,7 +1490,6 @@ public class ChronicleMapTest { } } - @Test public void keySetRetainAllReflectedInMapAndOtherViews() throws IOException { try (ChronicleMap map = getViewTestMap(3)) { @@ -1530,8 +1504,7 @@ public class ChronicleMapTest { assertValues(values, new CharSequence[]{"2", "1"}); } - - } +} @Test public void valuesRetainAllReflectedInMapAndOtherViews() throws IOException { @@ -1563,8 +1536,7 @@ public class ChronicleMapTest { org.junit.Assert.assertTrue(values.isEmpty()); } - - } +} @Test public void keySetClearReflectedInMapAndOtherViews() throws IOException { @@ -1596,8 +1568,7 @@ public class ChronicleMapTest { org.junit.Assert.assertTrue(values.isEmpty()); } - - } +} @Test public void clearMapViaEntryIteratorRemoves() throws IOException { @@ -1615,8 +1586,7 @@ public class ChronicleMapTest { assertEquals(noOfElements, sum); } - - } +} @Test public void clearMapViaKeyIteratorRemoves() throws IOException { @@ -1661,7 +1631,6 @@ public class ChronicleMapTest { ++sum; } - assertEquals(noOfElements, sum); } } @@ -1690,9 +1659,7 @@ public class ChronicleMapTest { assertValues(map.values(), new String[]{"B"}); } - - } - +} @Test public void equalsTest() throws IOException { @@ -1711,9 +1678,7 @@ public class ChronicleMapTest { assertEquals(map1, map2); } } - - - } +} private static final class IncrementRunnable implements Runnable { @@ -1746,9 +1711,7 @@ public class ChronicleMapTest { e.printStackTrace(); } } - - } - +} @Test public void testPutLongValue() throws IOException { @@ -1769,8 +1732,7 @@ public class ChronicleMapTest { throw new AssertionError("Should throw either IllegalStateException or " + "NullPointerException, but succeed"); } - - } +} @Test public void testOffheapAcquireUsingLocked() throws IOException { @@ -1826,8 +1788,7 @@ public class ChronicleMapTest { assert value == v; assertEquals(1, c.entry().value().get().getValue()); } - - } +} } @Test(expected = IllegalArgumentException.class) @@ -1937,4 +1898,3 @@ public class ChronicleMapTest { } - diff --git a/src/test/java/net/openhft/chronicle/map/EntryCountMapTest.java b/src/test/java/net/openhft/chronicle/map/EntryCountMapTest.java index 568553c2a..becdcd383 100644 --- a/src/test/java/net/openhft/chronicle/map/EntryCountMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/EntryCountMapTest.java @@ -189,7 +189,6 @@ public class EntryCountMapTest { final int maxKeySize = "key:".length() + (int) round(log10(moreThanMaxSize(maxSize) * stride + counter)) + 1; - return es.submit(new Callable() { @Override public Void call() { @@ -256,8 +255,7 @@ public class EntryCountMapTest { ", seg: " + segments + ", min: " + minSize + ", size: " + map.size()); } - - } +} private static int moreThanMaxSize(int maxSize) { return maxSize * 14 / 10 + 300; diff --git a/src/test/java/net/openhft/chronicle/map/Issue43Test.java b/src/test/java/net/openhft/chronicle/map/Issue43Test.java index 61f8edc96..389ce3470 100644 --- a/src/test/java/net/openhft/chronicle/map/Issue43Test.java +++ b/src/test/java/net/openhft/chronicle/map/Issue43Test.java @@ -45,7 +45,6 @@ public class Issue43Test { } } - private static class ValueWrapper { private final double values[]; diff --git a/src/test/java/net/openhft/chronicle/map/Issue58.java b/src/test/java/net/openhft/chronicle/map/Issue58.java index a1ea962f4..8fb755463 100644 --- a/src/test/java/net/openhft/chronicle/map/Issue58.java +++ b/src/test/java/net/openhft/chronicle/map/Issue58.java @@ -77,8 +77,7 @@ public class Issue58 { .collect(toMap(k -> data.get(k), k -> k)); reverseMap.putAll(reverse); } - - } +} public void test1(Map data) throws IOException { try ( @@ -125,9 +124,7 @@ public class Issue58 { map.entrySet().forEach(e -> System.out.println(e.getKey() + "->" + e.getValue())); reverseMap.forEach((k, v) -> System.out.println(k + " -> " + v)); } - - } - +} static final class UuidMarshaller implements BytesReader, BytesWriter, EnumMarshallable { diff --git a/src/test/java/net/openhft/chronicle/map/Issue63Test.java b/src/test/java/net/openhft/chronicle/map/Issue63Test.java index b26271979..9a96fc11d 100644 --- a/src/test/java/net/openhft/chronicle/map/Issue63Test.java +++ b/src/test/java/net/openhft/chronicle/map/Issue63Test.java @@ -100,7 +100,6 @@ public class Issue63Test { .entries(10) .createPersistedTo(mapFile); - float[] exp1 = new float[]{ (float) -0.4200737, (float) -0.5428019, (float) 0.25542524, (float) -0.10631648, (float) 0.12206168, (float) 0.0411969, (float) 0.9899967, (float) 0.15887073, diff --git a/src/test/java/net/openhft/chronicle/map/KeySegmentDistributionTest.java b/src/test/java/net/openhft/chronicle/map/KeySegmentDistributionTest.java index 257900579..be3a75b34 100644 --- a/src/test/java/net/openhft/chronicle/map/KeySegmentDistributionTest.java +++ b/src/test/java/net/openhft/chronicle/map/KeySegmentDistributionTest.java @@ -40,7 +40,6 @@ public class KeySegmentDistributionTest { keySegmentDistributionTest(1000, 5); } - public void keySegmentDistributionTest(int size, int segments) { ChronicleMap map = ChronicleMapBuilder .of(CharSequence.class, Integer.class) diff --git a/src/test/java/net/openhft/chronicle/map/LataTest.java b/src/test/java/net/openhft/chronicle/map/LataTest.java index f82506b97..60b851eac 100644 --- a/src/test/java/net/openhft/chronicle/map/LataTest.java +++ b/src/test/java/net/openhft/chronicle/map/LataTest.java @@ -16,7 +16,6 @@ package net.openhft.chronicle.map; - import net.openhft.chronicle.values.MaxUtf8Length; import net.openhft.chronicle.values.Values; diff --git a/src/test/java/net/openhft/chronicle/map/WriteThroughputTest.java b/src/test/java/net/openhft/chronicle/map/WriteThroughputTest.java index 009343a80..b6044eddb 100644 --- a/src/test/java/net/openhft/chronicle/map/WriteThroughputTest.java +++ b/src/test/java/net/openhft/chronicle/map/WriteThroughputTest.java @@ -117,6 +117,5 @@ public class WriteThroughputTest { long time = System.nanoTime() - start; System.out.printf("Concurrent %,d MB took %.3f seconds%n", size * count >> 20, time / 1e9); } - - } +} } diff --git a/src/test/java/net/openhft/chronicle/map/jsr166/map/ChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/jsr166/map/ChronicleMapTest.java index 102d2d127..39c9f8dda 100644 --- a/src/test/java/net/openhft/chronicle/map/jsr166/map/ChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/jsr166/map/ChronicleMapTest.java @@ -37,7 +37,6 @@ import static org.junit.Assert.*; public class ChronicleMapTest extends JSR166TestCase { - static ChronicleMap newShmIntString(int size) throws IOException { return ChronicleMapBuilder.of(Integer.class, CharSequence.class) .averageValueSize(1) diff --git a/src/test/java/net/openhft/chronicle/map/jsr166/map/MapCheck.java b/src/test/java/net/openhft/chronicle/map/jsr166/map/MapCheck.java index 5c3068bbc..c89593157 100644 --- a/src/test/java/net/openhft/chronicle/map/jsr166/map/MapCheck.java +++ b/src/test/java/net/openhft/chronicle/map/jsr166/map/MapCheck.java @@ -109,7 +109,6 @@ public class MapCheck { serTest(size); } - static Map newMap() { try { return ChronicleMapBuilder.of(Object.class, Object.class).create(); diff --git a/src/test/java/net/openhft/chronicle/set/Builder.java b/src/test/java/net/openhft/chronicle/set/Builder.java index 19e5e9881..54491cdf2 100644 --- a/src/test/java/net/openhft/chronicle/set/Builder.java +++ b/src/test/java/net/openhft/chronicle/set/Builder.java @@ -66,8 +66,7 @@ public class Builder { System.out.println("same"); break; } - - } +} Jvm.pause(1); if (System.currentTimeMillis() - startTime > timeOutMs) break; diff --git a/src/test/java/net/openhft/chronicle/set/Issue24ChronicleSetTest.java b/src/test/java/net/openhft/chronicle/set/Issue24ChronicleSetTest.java index d6749899a..45343c3a4 100644 --- a/src/test/java/net/openhft/chronicle/set/Issue24ChronicleSetTest.java +++ b/src/test/java/net/openhft/chronicle/set/Issue24ChronicleSetTest.java @@ -66,7 +66,6 @@ public class Issue24ChronicleSetTest { } System.out.println("Finished all threads"); - } public static class WorkerThread implements Runnable { @@ -92,13 +91,11 @@ public class Issue24ChronicleSetTest { set.addAll(nomenclatures); - Set strings = new HashSet<>( selectRandomSubset(nomenclatures, nomenclatures.size() / 2)); set.addAll(strings); - Set toRemove = new HashSet<>(); Random generator = new Random(); for (int j = 0; j < 3; j++) { @@ -121,6 +118,5 @@ public class Issue24ChronicleSetTest { System.out.println(s); } } - - } +} } diff --git a/src/test/java/net/openhft/lang/values/DoubleArray.java b/src/test/java/net/openhft/lang/values/DoubleArray.java index 6333bbb24..a292286c4 100755 --- a/src/test/java/net/openhft/lang/values/DoubleArray.java +++ b/src/test/java/net/openhft/lang/values/DoubleArray.java @@ -43,7 +43,6 @@ public class DoubleArray implements Byteable, Copyable { offset = 0; } - @Override public void bytesStore(BytesStore bytes, long offset, long maxSize) { this.bs = bytes;