From 34c4cd8d324cfc9a43ca970e6491be8e965bc4dc Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Sun, 21 Jun 2015 12:25:59 +0100 Subject: [PATCH] Code tidy a wider set of code. --- .../hash/ChronicleHashErrorListeners.java | 4 +-- .../TcpTransportAndNetworkConfig.java | 6 ++-- .../openhft/chronicle/map/HashSplitting.java | 6 ++-- .../net/openhft/chronicle/map/MultiMap.java | 2 +- .../openhft/chronicle/map/NodeDiscovery.java | 6 ++-- .../chronicle/map/ReplicatedChronicleMap.java | 4 +-- .../chronicle/map/StatelessChronicleMap.java | 6 ++-- .../chronicle/map/VanillaChronicleMap.java | 4 +-- .../openhft/chronicle/map/WriterWithSize.java | 2 +- .../openhft/chronicle/set/ChronicleSet.java | 2 +- .../java/eg/TestInstrumentVOInterface.java | 28 +++++++++---------- .../chronicle/map/AcquireGetUsingMain.java | 2 +- .../chronicle/map/CHMMetaDataTest.java | 2 +- .../net/openhft/chronicle/map/CHMTest5.java | 10 +++---- .../chronicle/map/ChronicleMapTest.java | 2 +- .../chronicle/map/DemoChronicleMapTest.java | 10 +++---- .../map/ProcessInstanceLimiterMain.java | 4 +-- .../map/RecursiveRefereneChMapTest.java | 4 +-- .../map/ReplicatedChronicleMapTest.java | 2 +- .../chronicle/map/ReplicationCheckingMap.java | 2 +- .../openhft/chronicle/map/SerializerTest.java | 13 +++------ .../map/TcpTimeBasedReplicationSoakTest.java | 4 +-- .../map/example/LotsOfEntriesMain.java | 4 +-- .../map/fromdocs/BondVOInterface$$Heap.java | 3 +- .../map/fromdocs/BondVOInterface$$Native.java | 5 ++-- .../BondVOInterface$MarketPx$$Heap.java | 3 +- .../BondVOInterface$MarketPx$$Native.java | 3 +- .../map/jsr166/map/ChronicleMapTest.java | 2 +- .../jsr166/map/StatelessChronicleMapTest.java | 2 +- .../map/utility/ProcessInstanceLimiter.java | 16 +++++------ .../openhft/lang/values/IntValue$$Native.java | 3 +- .../lang/values/LongValue$$Native.java | 3 +- 32 files changed, 76 insertions(+), 93 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/hash/ChronicleHashErrorListeners.java b/src/main/java/net/openhft/chronicle/hash/ChronicleHashErrorListeners.java index 57139587a..6c2f7f0b6 100644 --- a/src/main/java/net/openhft/chronicle/hash/ChronicleHashErrorListeners.java +++ b/src/main/java/net/openhft/chronicle/hash/ChronicleHashErrorListeners.java @@ -33,7 +33,7 @@ public final class ChronicleHashErrorListeners { * We can add some configuration-on-the-first-call in the future. */ - private static enum LoggingErrorListener implements ChronicleHashErrorListener { + private enum LoggingErrorListener implements ChronicleHashErrorListener { INSTANCE; @Override @@ -52,7 +52,7 @@ public final class ChronicleHashErrorListeners { } } - private static enum ThrowingErrorListener implements ChronicleHashErrorListener { + private enum ThrowingErrorListener implements ChronicleHashErrorListener { INSTANCE; @Override diff --git a/src/main/java/net/openhft/chronicle/hash/replication/TcpTransportAndNetworkConfig.java b/src/main/java/net/openhft/chronicle/hash/replication/TcpTransportAndNetworkConfig.java index 844520181..ac51c4f1a 100644 --- a/src/main/java/net/openhft/chronicle/hash/replication/TcpTransportAndNetworkConfig.java +++ b/src/main/java/net/openhft/chronicle/hash/replication/TcpTransportAndNetworkConfig.java @@ -176,11 +176,9 @@ public final class TcpTransportAndNetworkConfig implements Serializable { if (endpoints != null ? !endpoints.equals(that.endpoints) : that.endpoints != null) return false; if (heartBeatIntervalUnit != that.heartBeatIntervalUnit) return false; - if (throttlingConfig != null ? !throttlingConfig.equals(that.throttlingConfig) : - that.throttlingConfig != null) - return false; + return !(throttlingConfig != null ? !throttlingConfig.equals(that.throttlingConfig) : + that.throttlingConfig != null); - return true; } @Override diff --git a/src/main/java/net/openhft/chronicle/map/HashSplitting.java b/src/main/java/net/openhft/chronicle/map/HashSplitting.java index 0adf99d7b..9ab4a2dfa 100644 --- a/src/main/java/net/openhft/chronicle/map/HashSplitting.java +++ b/src/main/java/net/openhft/chronicle/map/HashSplitting.java @@ -25,7 +25,7 @@ interface HashSplitting extends Serializable { int segmentIndex(long hash); long segmentHash(long hash); - static class Splitting { + class Splitting { static HashSplitting forSegments(int segments) { assert segments > 0; if (segments == 1) @@ -50,7 +50,7 @@ interface HashSplitting extends Serializable { } } - static class ForPowerOf2Segments implements HashSplitting { + class ForPowerOf2Segments implements HashSplitting { private static final long serialVersionUID = 0L; private final int mask; @@ -73,7 +73,7 @@ interface HashSplitting extends Serializable { } //TODO optimize? - static class ForNonPowerOf2Segments implements HashSplitting { + class ForNonPowerOf2Segments implements HashSplitting { private static final long serialVersionUID = 0L; private static final int MASK = Integer.MAX_VALUE; diff --git a/src/main/java/net/openhft/chronicle/map/MultiMap.java b/src/main/java/net/openhft/chronicle/map/MultiMap.java index e17ceb32f..bfa4e714e 100644 --- a/src/main/java/net/openhft/chronicle/map/MultiMap.java +++ b/src/main/java/net/openhft/chronicle/map/MultiMap.java @@ -73,7 +73,7 @@ interface MultiMap { void forEach(EntryConsumer action); - static interface EntryConsumer { + interface EntryConsumer { void accept(long key, long value); } } diff --git a/src/main/java/net/openhft/chronicle/map/NodeDiscovery.java b/src/main/java/net/openhft/chronicle/map/NodeDiscovery.java index 549698ef2..f35b2c772 100644 --- a/src/main/java/net/openhft/chronicle/map/NodeDiscovery.java +++ b/src/main/java/net/openhft/chronicle/map/NodeDiscovery.java @@ -610,9 +610,8 @@ class AddressAndPort implements Comparable, BytesMarshallable { AddressAndPort that = (AddressAndPort) o; if (port != that.port) return false; - if (!Arrays.equals(address, that.address)) return false; + return Arrays.equals(address, that.address); - return true; } @Override @@ -890,9 +889,8 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable { ProposedNodes that = (ProposedNodes) o; if (identifier != that.identifier) return false; - if (!addressAndPort.equals(that.addressAndPort)) return false; + return addressAndPort.equals(that.addressAndPort); - return true; } @Override diff --git a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java index f9a382d94..958c40c33 100644 --- a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java @@ -270,7 +270,7 @@ final class ReplicatedChronicleMap implements ChronicleMap, Closeable, Clon } }; - static enum EventId { + enum EventId { HEARTBEAT, STATEFUL_UPDATE, LONG_SIZE, @@ -551,7 +551,7 @@ class StatelessChronicleMap implements ChronicleMap, Closeable, Clon final long sizeLocation = writeEventAnSkip(GET); - copies = writeKey((K) key); + copies = writeKey(key); transactionId = send(sizeLocation, startTime); } finally { outBytesLock.unlock(); @@ -560,7 +560,7 @@ class StatelessChronicleMap implements ChronicleMap, Closeable, Clon if (eventReturnsNull(GET)) return null; - return (V) readValue(transactionId, startTime, copies, usingValue); + return readValue(transactionId, startTime, copies, usingValue); } diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 14722b0ad..6dba0ac35 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -745,7 +745,7 @@ class VanillaChronicleMap, "instance in the usual way.", e); try { - return (T) aClass.newInstance(); + return aClass.newInstance(); } catch (Exception e1) { throw new IllegalStateException("It has not been possible to create a instance " + "of class=" + aClass.getSimpleName() + @@ -1022,7 +1022,7 @@ class VanillaChronicleMap, @Override public DelegatingMetaBytesInterop> getMetaValueInterop( @NotNull ThreadLocalCopies copies, BytesInterop valueInterop, Bytes value) { - return DelegatingMetaBytesInterop.>instance(); + return DelegatingMetaBytesInterop.instance(); } @Override diff --git a/src/main/java/net/openhft/chronicle/map/WriterWithSize.java b/src/main/java/net/openhft/chronicle/map/WriterWithSize.java index 14b4f3a90..3ab1b0605 100644 --- a/src/main/java/net/openhft/chronicle/map/WriterWithSize.java +++ b/src/main/java/net/openhft/chronicle/map/WriterWithSize.java @@ -113,5 +113,5 @@ interface BufferResizer { * @param newCapacity * @return the newly resize buffer */ - public Bytes resizeBuffer(int newCapacity); + Bytes resizeBuffer(int newCapacity); } diff --git a/src/main/java/net/openhft/chronicle/set/ChronicleSet.java b/src/main/java/net/openhft/chronicle/set/ChronicleSet.java index febfe580b..064a98f39 100644 --- a/src/main/java/net/openhft/chronicle/set/ChronicleSet.java +++ b/src/main/java/net/openhft/chronicle/set/ChronicleSet.java @@ -21,5 +21,5 @@ import net.openhft.chronicle.hash.ChronicleHash; import java.util.Set; public interface ChronicleSet extends Set, ChronicleHash { - public long longSize(); + long longSize(); } diff --git a/src/test/java/eg/TestInstrumentVOInterface.java b/src/test/java/eg/TestInstrumentVOInterface.java index 6cc973208..b41317291 100644 --- a/src/test/java/eg/TestInstrumentVOInterface.java +++ b/src/test/java/eg/TestInstrumentVOInterface.java @@ -24,38 +24,36 @@ import net.openhft.lang.model.constraints.MaxSize; public interface TestInstrumentVOInterface { - public int getSizeOfInstrumentIDArray(); + int getSizeOfInstrumentIDArray(); - public void setSizeOfInstrumentIDArray(int sizeOfInstrumentIDArray); + void setSizeOfInstrumentIDArray(int sizeOfInstrumentIDArray); - public String getSymbol(); + String getSymbol(); - public void setSymbol(@MaxSize(20) String symbol); + void setSymbol(@MaxSize(20) String symbol); + String getCurrencyCode(); + + void setCurrencyCode(@MaxSize(4) String currencyCode); - public String getCurrencyCode(); + void setInstrumentIDAt(@MaxSize(2) int location, TestInstrumentIDVOInterface instrumentID); - public void setCurrencyCode(@MaxSize(4) String currencyCode); - - - public void setInstrumentIDAt(@MaxSize(2) int location, TestInstrumentIDVOInterface instrumentID); - - public TestInstrumentIDVOInterface getInstrumentIDAt(int location); + TestInstrumentIDVOInterface getInstrumentIDAt(int location); interface TestInstrumentIDVOInterface { - public String getIdSource(); + String getIdSource(); - public void setIdSource(@MaxSize(6) String idSource); + void setIdSource(@MaxSize(6) String idSource); - public String getSecurityId(); + String getSecurityId(); - public void setSecurityId(@MaxSize(100) String securityId); + void setSecurityId(@MaxSize(100) String securityId); } } diff --git a/src/test/java/net/openhft/chronicle/map/AcquireGetUsingMain.java b/src/test/java/net/openhft/chronicle/map/AcquireGetUsingMain.java index 8371659c1..cfb790e5f 100644 --- a/src/test/java/net/openhft/chronicle/map/AcquireGetUsingMain.java +++ b/src/test/java/net/openhft/chronicle/map/AcquireGetUsingMain.java @@ -82,7 +82,7 @@ public class AcquireGetUsingMain { System.out.println("2 " + data.getTimeAt(1)); } - public static interface Data { + public interface Data { void setTimeAt(@MaxSize(8) int index, long time); long getTimeAt(int index); diff --git a/src/test/java/net/openhft/chronicle/map/CHMMetaDataTest.java b/src/test/java/net/openhft/chronicle/map/CHMMetaDataTest.java index 542e592ef..6504a777a 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMMetaDataTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMMetaDataTest.java @@ -82,7 +82,7 @@ public class CHMMetaDataTest { @Override public void onRemove(Bytes entry, long metaDataPos, long keyPos, long valuePos, boolean replicationEvent) { - System.out.println("Removed entry with ts of " + entry.readLong(metaDataPos));; + System.out.println("Removed entry with ts of " + entry.readLong(metaDataPos)); } } } diff --git a/src/test/java/net/openhft/chronicle/map/CHMTest5.java b/src/test/java/net/openhft/chronicle/map/CHMTest5.java index eccf439bc..1478e092e 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMTest5.java +++ b/src/test/java/net/openhft/chronicle/map/CHMTest5.java @@ -229,14 +229,14 @@ public class CHMTest5 { } } - public static interface CHMTest5Data { - public int getMaxNumberOfProcessesAllowed(); + public interface CHMTest5Data { + int getMaxNumberOfProcessesAllowed(); - public void setMaxNumberOfProcessesAllowed(int max); + void setMaxNumberOfProcessesAllowed(int max); - public void setTimeAt(@MaxSize(4) int index, long time); + void setTimeAt(@MaxSize(4) int index, long time); - public long getTimeAt(int index); + long getTimeAt(int index); boolean compareAndSwapMaxNumberOfProcessesAllowed(int expected, int value); diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java index fcc74473a..cdf463d60 100755 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapTest.java @@ -1259,7 +1259,7 @@ public class ChronicleMapTest { @Test public void mapRemoveReflectedInViews() throws IOException { - try (ChronicleMap map = getViewTestMap(3);) { + try (ChronicleMap map = getViewTestMap(3)) { Set> entrySet = map.entrySet(); Set keySet = map.keySet(); Collection values = map.values(); diff --git a/src/test/java/net/openhft/chronicle/map/DemoChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/DemoChronicleMapTest.java index c493a6f37..51eccb99c 100755 --- a/src/test/java/net/openhft/chronicle/map/DemoChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/DemoChronicleMapTest.java @@ -115,15 +115,15 @@ public class DemoChronicleMapTest { } interface DemoOrderVOInterface { - public CharSequence getSymbol(); + CharSequence getSymbol(); // public StringBuilder getUsingSymbol(StringBuilder sb); - public void setSymbol(@MaxSize(20) CharSequence symbol); + void setSymbol(@MaxSize(20) CharSequence symbol); - public double addAtomicOrderQty(double toAdd); + double addAtomicOrderQty(double toAdd); - public double getOrderQty(); + double getOrderQty(); - public void setOrderQty(double orderQty); + void setOrderQty(double orderQty); } diff --git a/src/test/java/net/openhft/chronicle/map/ProcessInstanceLimiterMain.java b/src/test/java/net/openhft/chronicle/map/ProcessInstanceLimiterMain.java index 719fb924e..dcbf248dc 100644 --- a/src/test/java/net/openhft/chronicle/map/ProcessInstanceLimiterMain.java +++ b/src/test/java/net/openhft/chronicle/map/ProcessInstanceLimiterMain.java @@ -127,9 +127,9 @@ public class ProcessInstanceLimiterMain implements Runnable { } public interface Callback { - public void tooManyProcessesOfType(String processType); + void tooManyProcessesOfType(String processType); - public void noDefinitionForProcessesOfType(String processType); + void noDefinitionForProcessesOfType(String processType); } public static class Data implements Serializable { diff --git a/src/test/java/net/openhft/chronicle/map/RecursiveRefereneChMapTest.java b/src/test/java/net/openhft/chronicle/map/RecursiveRefereneChMapTest.java index 70a103ff3..23a5da4d2 100644 --- a/src/test/java/net/openhft/chronicle/map/RecursiveRefereneChMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/RecursiveRefereneChMapTest.java @@ -36,9 +36,9 @@ public class RecursiveRefereneChMapTest { .objectSerializer(JDKObjectSerializer.INSTANCE).create(); map.put("Test", new StupidCycle()); map.put("Test2", new StupidCycle2()); - StupidCycle cycle = (StupidCycle) map.get("Test"); + StupidCycle cycle = map.get("Test"); assertSame(cycle, cycle.cycle[0]); - StupidCycle cycle2 = (StupidCycle) map.get("Test2"); + StupidCycle cycle2 = map.get("Test2"); assertSame(cycle2, cycle2.cycle[0]); } diff --git a/src/test/java/net/openhft/chronicle/map/ReplicatedChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/ReplicatedChronicleMapTest.java index ccef8200c..08399540d 100644 --- a/src/test/java/net/openhft/chronicle/map/ReplicatedChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/ReplicatedChronicleMapTest.java @@ -183,7 +183,7 @@ public class ReplicatedChronicleMapTest extends JSR166TestCase { @Test public void testGet() throws IOException { ChronicleMap map = map5(); - assertEquals("A", (String) map.get(JSR166TestCase.one)); + assertEquals("A", map.get(JSR166TestCase.one)); ChronicleMap empty = newShmIntString(); assertNull(map.get(JSR166TestCase.notPresent)); } diff --git a/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java b/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java index d7cd923c6..c227b538d 100644 --- a/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java +++ b/src/test/java/net/openhft/chronicle/map/ReplicationCheckingMap.java @@ -102,7 +102,7 @@ public class ReplicationCheckingMap implements ChronicleMap { if (r1 != null) Assert.assertEquals(r1.toString(), r2.toString()); - return (R) r1; + return r1; } @Override diff --git a/src/test/java/net/openhft/chronicle/map/SerializerTest.java b/src/test/java/net/openhft/chronicle/map/SerializerTest.java index aa34d027a..8b1da25ea 100644 --- a/src/test/java/net/openhft/chronicle/map/SerializerTest.java +++ b/src/test/java/net/openhft/chronicle/map/SerializerTest.java @@ -160,9 +160,8 @@ public class SerializerTest { MyTestClassExternalizable that = (MyTestClassExternalizable) o; - if (a != that.a) return false; + return a == that.a; - return true; } @Override @@ -195,9 +194,8 @@ public class SerializerTest { MyTestClass myTestClass = (MyTestClass) o; - if (a != myTestClass.a) return false; + return a == myTestClass.a; - return true; } @Override @@ -227,9 +225,8 @@ public class SerializerTest { MyTestClassMarshallable that = (MyTestClassMarshallable) o; - if (a != that.a) return false; + return a == that.a; - return true; } @Override @@ -269,10 +266,8 @@ public class SerializerTest { MyTestClassObjectGraph that = (MyTestClassObjectGraph) o; - if (delegate != null ? !delegate.equals(that.delegate) : that.delegate != null) - return false; + return !(delegate != null ? !delegate.equals(that.delegate) : that.delegate != null); - return true; } @Override diff --git a/src/test/java/net/openhft/chronicle/map/TcpTimeBasedReplicationSoakTest.java b/src/test/java/net/openhft/chronicle/map/TcpTimeBasedReplicationSoakTest.java index a338a45cc..2b65e9a90 100644 --- a/src/test/java/net/openhft/chronicle/map/TcpTimeBasedReplicationSoakTest.java +++ b/src/test/java/net/openhft/chronicle/map/TcpTimeBasedReplicationSoakTest.java @@ -134,9 +134,9 @@ public class TcpTimeBasedReplicationSoakTest { final ChronicleMap map = rnd.nextBoolean() ? map1 : map2; if (rnd.nextBoolean()) { - map.put((int) rnd.nextInt(100), "test" + j); + map.put(rnd.nextInt(100), "test" + j); } else { - map.remove((int) rnd.nextInt(100)); + map.remove(rnd.nextInt(100)); } } diff --git a/src/test/java/net/openhft/chronicle/map/example/LotsOfEntriesMain.java b/src/test/java/net/openhft/chronicle/map/example/LotsOfEntriesMain.java index 2e1d7a1b2..41aef90a8 100644 --- a/src/test/java/net/openhft/chronicle/map/example/LotsOfEntriesMain.java +++ b/src/test/java/net/openhft/chronicle/map/example/LotsOfEntriesMain.java @@ -99,7 +99,7 @@ public class LotsOfEntriesMain { } interface MyFloats { - public void setValueAt(@MaxSize(6) int index, float f); + void setValueAt(@MaxSize(6) int index, float f); - public float getValueAt(int index); + float getValueAt(int index); } diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Heap.java b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Heap.java index 57b8666c2..88253e6ca 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Heap.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Heap.java @@ -160,8 +160,7 @@ public class BondVOInterface$$Heap implements BondVOInterface, BytesMarshallable for (int i = 0; i <7; i++) { if(!isEqual(getMarketPxIntraDayHistoryAt(i), that.getMarketPxIntraDayHistoryAt(i))) return false; } - if(!isEqual(getSymbol(), that.getSymbol())) return false; - return true; + return isEqual(getSymbol(), that.getSymbol()); } public String toString() { diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Native.java b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Native.java index 32df3381b..5f05ad8bf 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Native.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$$Native.java @@ -139,7 +139,7 @@ public class BondVOInterface$$Native this._bytes = bytes; this._offset = offset; for (int i = 0; i < 7; i++){ - ((Byteable) _marketPxIntraDayHistory[i]).bytes(bytes, + _marketPxIntraDayHistory[i].bytes(bytes, _offset + MARKETPXINTRADAYHISTORY + (i * 40)); } } @@ -189,8 +189,7 @@ public class BondVOInterface$$Native if(!isEqual(getMarketPxIntraDayHistoryAt(i), that.getMarketPxIntraDayHistoryAt(i))) return false; } - if(!isEqual(getSymbol(), that.getSymbol())) return false; - return true; + return isEqual(getSymbol(), that.getSymbol()); } public String toString() { diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Heap.java b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Heap.java index 3e7548f6f..7311e752d 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Heap.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Heap.java @@ -116,8 +116,7 @@ public class BondVOInterface$MarketPx$$Heap implements MarketPx, BytesMarshallab if(!isEqual(getBidPx(), that.getBidPx())) return false; if(!isEqual(getCallPx(), that.getCallPx())) return false; if(!isEqual(getMaturityPx(), that.getMaturityPx())) return false; - if(!isEqual(getParPx(), that.getParPx())) return false; - return true; + return isEqual(getParPx(), that.getParPx()); } public String toString() { diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Native.java b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Native.java index 06fa36c3e..219db44df 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Native.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/BondVOInterface$MarketPx$$Native.java @@ -151,8 +151,7 @@ public class BondVOInterface$MarketPx$$Native if(!isEqual(getBidPx(), that.getBidPx())) return false; if(!isEqual(getCallPx(), that.getCallPx())) return false; if(!isEqual(getMaturityPx(), that.getMaturityPx())) return false; - if(!isEqual(getParPx(), that.getParPx())) return false; - return true; + return isEqual(getParPx(), that.getParPx()); } public String toString() { 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 c34328561..369c11871 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 @@ -114,7 +114,7 @@ public class ChronicleMapTest extends JSR166TestCase { @Test(timeout = 5000) public void testGet() throws IOException { try (ChronicleMap map = map5()) { - assertEquals("A", (String) map.get(one)); + assertEquals("A", map.get(one)); try (ChronicleMap empty = newStrStrMap(8078)) { assertNull(map.get(notPresent)); } diff --git a/src/test/java/net/openhft/chronicle/map/jsr166/map/StatelessChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/jsr166/map/StatelessChronicleMapTest.java index b37cb8c0e..fb76835e5 100755 --- a/src/test/java/net/openhft/chronicle/map/jsr166/map/StatelessChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/jsr166/map/StatelessChronicleMapTest.java @@ -386,7 +386,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { @Test(timeout = 10000) public void testGet() throws IOException { try (ChronicleMap map = map5(s_port++)) { - assertEquals("A", (String) map.get(one)); + assertEquals("A", map.get(one)); try (ChronicleMap empty = newStrStrMap(8078)) { assertNull(map.get(notPresent)); } diff --git a/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java b/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java index 3983867d1..dd09eadd2 100644 --- a/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java +++ b/src/test/java/net/openhft/chronicle/map/utility/ProcessInstanceLimiter.java @@ -458,14 +458,14 @@ public class ProcessInstanceLimiter implements Runnable { * The Callback interface holds all the calls that can be made by the * process instance limiter. */ - public static interface Callback { + public interface Callback { /** * Called when there are already the specified number of processes of * the given type running, and this process is one too many. * * @param processType - the name of the type of process being limited */ - public void tooManyProcessesOfType(String processType); + void tooManyProcessesOfType(String processType); /** * Called when there is a lock conflict in the limiter @@ -474,7 +474,7 @@ public class ProcessInstanceLimiter implements Runnable { * @param processType - the name of the type of process being limited * @param index - the slot number held by the other process */ - public void lockConflictDetected(String processType, int index); + void lockConflictDetected(String processType, int index); /** * Called when another process has started and successfully acquired a @@ -484,7 +484,7 @@ public class ProcessInstanceLimiter implements Runnable { * @param slot - the slot number held by the other process * @param startTime - the start timestamp of the other process */ - public void anotherProcessHasStartedOnSlot(String processType, int slot, long startTime); + void anotherProcessHasStartedOnSlot(String processType, int slot, long startTime); /** * Called when this process has started and successfully acquired a slot @@ -493,7 +493,7 @@ public class ProcessInstanceLimiter implements Runnable { * @param processType - the name of the type of process being limited * @param slot - the slot number held by this process */ - public void thisProcessOfTypeHasStartedAtSlot(String processType, int slot); + void thisProcessOfTypeHasStartedAtSlot(String processType, int slot); /** * Called if the process was started but there was no data defined in @@ -501,7 +501,7 @@ public class ProcessInstanceLimiter implements Runnable { * * @param processType - the name of the type of process being limited */ - public void noDefinitionForProcessesOfType(String processType); + void noDefinitionForProcessesOfType(String processType); /** * Called when another process somehow managed to steal the slot that @@ -510,7 +510,7 @@ public class ProcessInstanceLimiter implements Runnable { * @param processType - the name of the type of process being limited * @param slot - the slot number held by this process */ - public void anotherProcessHasHijackedThisSlot(String processType, int slot); + void anotherProcessHasHijackedThisSlot(String processType, int slot); } /** @@ -519,7 +519,7 @@ public class ProcessInstanceLimiter implements Runnable { * * The Timelock field is just for locking the time field */ - public static interface Data { + public interface Data { void setTimeAt(@MaxSize(50) int index, long time); long getTimeAt(int index); diff --git a/src/test/java/net/openhft/lang/values/IntValue$$Native.java b/src/test/java/net/openhft/lang/values/IntValue$$Native.java index 2f9970347..315e3e5ba 100644 --- a/src/test/java/net/openhft/lang/values/IntValue$$Native.java +++ b/src/test/java/net/openhft/lang/values/IntValue$$Native.java @@ -126,8 +126,7 @@ public class IntValue$$Native implements IntValue, BytesMarshallable, Byteable, if (!(o instanceof IntValue)) return false; IntValue that = (IntValue) o; - if (!isEqual(getValue(), that.getValue())) return false; - return true; + return isEqual(getValue(), that.getValue()); } public String toString() { diff --git a/src/test/java/net/openhft/lang/values/LongValue$$Native.java b/src/test/java/net/openhft/lang/values/LongValue$$Native.java index e1c89d692..45c68ad1f 100644 --- a/src/test/java/net/openhft/lang/values/LongValue$$Native.java +++ b/src/test/java/net/openhft/lang/values/LongValue$$Native.java @@ -108,8 +108,7 @@ public class LongValue$$Native implements LongValue, BytesMarshallable, Byteable if (!(o instanceof LongValue)) return false; LongValue that = (LongValue) o; - if (!isEqual(getValue(), that.getValue())) return false; - return true; + return isEqual(getValue(), that.getValue()); } public String toString() {