Program: 46144
Project: 46144
Buggy source:
@Override public Map<K,V> getAll(Set<? extends K> keys,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(keys);
  if (keys.isEmpty()) {
    return Collections.EMPTY_MAP;
  }
  final Set<Data> keySet=new HashSet<Data>(keys.size());
  for (  K key : keys) {
    final Data k=toData(key);
    keySet.add(k);
  }
  Map<K,V> result=getAllFromNearCache(keySet);
  if (keySet.isEmpty()) {
    return result;
  }
  List<Map.Entry<Data,Data>> entries;
  Map<Data,Boolean> markers=createHashMap(keySet.size());
  try {
    for (    Data key : keySet) {
      markers.put(key,keyStateMarker.markIfUnmarked(key));
    }
    Data expiryPolicyData=toData(expiryPolicy);
    ClientMessage request=CacheGetAllCodec.encodeRequest(nameWithPrefix,keySet,expiryPolicyData);
    ClientMessage responseMessage=invoke(request);
    entries=CacheGetAllCodec.decodeResponse(responseMessage).response;
    for (    Map.Entry<Data,Data> dataEntry : entries) {
      Data keyData=dataEntry.getKey();
      Data valueData=dataEntry.getValue();
      K key=toObject(keyData);
      V value=toObject(valueData);
      result.put(key,value);
      storeInNearCache(keyData,valueData,value,markers.remove(keyData));
    }
  }
  finally {
    unmarkRemainingMarkedKeys(markers);
  }
  if (statisticsEnabled) {
    statistics.increaseCacheHits(entries.size());
    statistics.addGetTimeNanos(System.nanoTime() - start);
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<K,V> getAll(Set<? extends K> keys,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(keys);
  if (keys.isEmpty()) {
    return emptyMap();
  }
  final Set<Data> keySet=new HashSet<Data>(keys.size());
  for (  K key : keys) {
    final Data k=toData(key);
    keySet.add(k);
  }
  Map<K,V> result=createHashMap(keys.size());
  populateResultFromNearCache(keySet,result);
  if (keySet.isEmpty()) {
    return result;
  }
  List<Map.Entry<Data,Data>> entries;
  Map<Data,Long> reservations=createHashMap(keySet.size());
  try {
    for (    Data key : keySet) {
      long reservationId=tryReserveForUpdate(key);
      if (reservationId != NOT_RESERVED) {
        reservations.put(key,reservationId);
      }
    }
    Data expiryPolicyData=toData(expiryPolicy);
    ClientMessage request=CacheGetAllCodec.encodeRequest(nameWithPrefix,keySet,expiryPolicyData);
    ClientMessage responseMessage=invoke(request);
    entries=CacheGetAllCodec.decodeResponse(responseMessage).response;
    for (    Map.Entry<Data,Data> dataEntry : entries) {
      Data keyData=dataEntry.getKey();
      Data valueData=dataEntry.getValue();
      K key=toObject(keyData);
      V value=toObject(valueData);
      result.put(key,value);
      Long reservationId=reservations.get(keyData);
      if (reservationId != null) {
        storeInNearCache(keyData,valueData,value,reservationId,false);
        reservations.remove(keyData);
      }
    }
  }
  finally {
    releaseRemainingReservedKeys(reservations);
  }
  if (statisticsEnabled) {
    statistics.increaseCacheHits(entries.size());
    statistics.addGetTimeNanos(System.nanoTime() - start);
  }
  return result;
}