HCOLL-260 fixed a bug with remove() method overloading

This commit is contained in:
leventov
2014-12-22 03:59:27 +07:00
parent a4803321de
commit a65d6e8c0e
2 changed files with 7 additions and 6 deletions
@@ -1468,7 +1468,7 @@ class StatelessServerConnector<K, V> {
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<K, V> {
}
@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;
}
@@ -1193,7 +1193,8 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
*/
@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);