diff --git a/src/test/java/net/openhft/chronicle/hash/impl/util/ThrowablesTest.java b/src/test/java/net/openhft/chronicle/hash/impl/util/ThrowablesTest.java index 8e238a7d2..9826d1fc2 100644 --- a/src/test/java/net/openhft/chronicle/hash/impl/util/ThrowablesTest.java +++ b/src/test/java/net/openhft/chronicle/hash/impl/util/ThrowablesTest.java @@ -48,6 +48,7 @@ public class ThrowablesTest { Throwables.propagateNotWrapping(null, IOException.class); } + @SuppressWarnings("RedundantThrows") @Test(expected = NullPointerException.class) public void testPropagateNotWrappingNullWrappingType() throws Throwable { Throwables.propagateNotWrapping(new IOException(), null); diff --git a/src/test/java/net/openhft/chronicle/map/AbstractMarshallableKeyValueTest.java b/src/test/java/net/openhft/chronicle/map/AbstractMarshallableKeyValueTest.java index d22d6731b..3abfdd30b 100644 --- a/src/test/java/net/openhft/chronicle/map/AbstractMarshallableKeyValueTest.java +++ b/src/test/java/net/openhft/chronicle/map/AbstractMarshallableKeyValueTest.java @@ -20,6 +20,7 @@ import net.openhft.chronicle.wire.SelfDescribingMarshallable; import org.junit.Test; import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; public final class AbstractMarshallableKeyValueTest { @@ -31,7 +32,7 @@ public final class AbstractMarshallableKeyValueTest { map.put(new Key(), new Value()); - assertThat(map.get(new Key()).number, is(new Value().number)); + assertEquals(new Value().number, map.get(new Key()).number); } private static final class Key extends SelfDescribingMarshallable { diff --git a/src/test/java/net/openhft/lang/values/DoubleArray.java b/src/test/java/net/openhft/lang/values/DoubleArray.java index d080f305d..be85dcbd5 100755 --- a/src/test/java/net/openhft/lang/values/DoubleArray.java +++ b/src/test/java/net/openhft/lang/values/DoubleArray.java @@ -22,14 +22,10 @@ import net.openhft.chronicle.bytes.DynamicallySized; import net.openhft.chronicle.bytes.NativeBytesStore; import net.openhft.chronicle.values.Copyable; -/** - * Created by peter.lawrey on 23/04/2015. - */ public class DoubleArray implements Byteable, Copyable, DynamicallySized { - static boolean HACK = true; - private static int CAPACITY = 0; // assume a 32-bit size. - private static int LENGTH = CAPACITY + 4; // assume a 32-bit size. - private static int BASE = LENGTH + 4; + private final static int CAPACITY = 0; // assume a 32-bit size. + private final static int LENGTH = CAPACITY + 4; // assume a 32-bit size. + private final static int BASE = LENGTH + 4; private final int capacity; private BytesStore bs; @@ -64,7 +60,7 @@ public class DoubleArray implements Byteable, Copyable, Dynamically } public int length() { - return HACK && bs == null ? 6 * 8 : bs.readInt(LENGTH + offset); + return bs == null ? 6 * 8 : bs.readInt(LENGTH + offset); } public int capacity() { diff --git a/src/test/java/net/openhft/lang/values/DoubleArrayTest.java b/src/test/java/net/openhft/lang/values/DoubleArrayTest.java index 2c91b0e35..6c54051aa 100755 --- a/src/test/java/net/openhft/lang/values/DoubleArrayTest.java +++ b/src/test/java/net/openhft/lang/values/DoubleArrayTest.java @@ -85,27 +85,4 @@ public class DoubleArrayTest { System.out.println(proxyMap.get(2)); proxyMap.close(); } - - @Test - @Ignore("TODO What is HACK???") - public void addToAMap2() { - DoubleArray.HACK = false; - DoubleArray a = new DoubleArray(10); - a.setData(new double[]{1, 2, 3, 4, 5}); - - DoubleArray b = new DoubleArray(10); - b.setData(new double[]{5, 6, 7, 8, 9}); - - ChronicleMap proxyMap = ChronicleMapBuilder - .of(Integer.class, DoubleArray.class) - .averageValueSize(6 * 8) - .create(); - proxyMap.put(1, a); - proxyMap.put(2, b); - - System.out.println(proxyMap.get(1)); - System.out.println(proxyMap.get(2)); - proxyMap.close(); - DoubleArray.HACK = true; - } } \ No newline at end of file