From a65d6e8c0ea221e670021b2e9cfd510926f4877b Mon Sep 17 00:00:00 2001 From: leventov Date: Mon, 22 Dec 2014 03:51:24 +0700 Subject: [PATCH] HCOLL-260 fixed a bug with remove() method overloading --- .../java/net/openhft/chronicle/map/TcpReplicator.java | 10 +++++----- .../net/openhft/chronicle/map/VanillaChronicleMap.java | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index fc5f41232..73fd242dd 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -1468,7 +1468,7 @@ class StatelessServerConnector { return put(reader, writer, sizeLocation, timestamp, identifier); case REMOVE: - return remove(reader, writer.in(), sizeLocation, timestamp, identifier); + return remove(reader, writer, sizeLocation, timestamp, identifier); case CLEAR: return clear(writer.in(), sizeLocation, timestamp, identifier); @@ -1699,14 +1699,14 @@ class StatelessServerConnector { } @Nullable - private Work remove(Bytes reader, @NotNull Bytes writer, final long sizeLocation, - long timestamp, byte id) { + private Work remove(Bytes reader, TcpReplicator.TcpSocketChannelEntryWriter writer, + final long sizeLocation, long timestamp, byte id) { try { map.remove(reader, writer); } catch (Throwable e) { - return sendException(writer, sizeLocation, e); + return sendException(writer.in(), sizeLocation, e); } - writeSizeAndFlags(sizeLocation, false, writer); + writeSizeAndFlags(sizeLocation, false, writer.in()); return null; } diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 550d4b331..920ded2cf 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -1193,7 +1193,8 @@ class VanillaChronicleMap, */ @Override @SuppressWarnings("unchecked") - public final boolean remove(@net.openhft.lang.model.constraints.NotNull final Object key, final Object value) { + public final boolean remove(@net.openhft.lang.model.constraints.NotNull final Object key, + final Object value) { if (value == null) return false; // CHM compatibility; I would throw NPE return (Boolean) removeIfValueIs(key, (V) value);