mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-260 fixed a bug with remove() method overloading
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user