Program: 48316
Project: 48316
Buggy source:
protected Map<Object,Object> getAllObjectInternal(final Set<Data> keys){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  Map<Object,Object> result=new HashMap<Object,Object>();
  final boolean nearCacheEnabled=mapConfig.isNearCacheEnabled();
  if (nearCacheEnabled) {
    final Iterator<Data> iterator=keys.iterator();
    while (iterator.hasNext()) {
      Data key=iterator.next();
      Object cachedValue=mapService.getFromNearCache(name,key);
      if (cachedValue != null) {
        if (!NearCache.NULL_OBJECT.equals(cachedValue)) {
          result.put(mapService.toObject(key),mapService.toObject(cachedValue));
        }
        iterator.remove();
      }
    }
  }
  if (keys.isEmpty()) {
    return result;
  }
  Collection<Integer> partitions=getPartitionsForKeys(keys);
  Map<Integer,Object> responses=null;
  try {
    responses=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,new MapGetAllOperationFactory(name,keys),partitions);
    for (    Object response : responses.values()) {
      Set<Map.Entry<Data,Data>> entries=((MapEntrySet)mapService.toObject(response)).getEntrySet();
      for (      Entry<Data,Data> entry : entries) {
        result.put(mapService.toObject(entry.getKey()),mapService.toObject(entry.getValue()));
        if (nearCacheEnabled) {
          int partitionId=nodeEngine.getPartitionService().getPartitionId(entry.getKey());
          if (!nodeEngine.getPartitionService().getPartitionOwner(partitionId).equals(nodeEngine.getClusterService().getThisAddress()) || mapConfig.getNearCacheConfig().isCacheLocalEntries()) {
            mapService.putNearCache(name,entry.getKey(),entry.getValue());
          }
        }
      }
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return result;
}

Fixed version (ground truth):
protected Map<Object,Object> getAllObjectInternal(final Set<Data> keys){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  Map<Object,Object> result=new HashMap<Object,Object>();
  final boolean nearCacheEnabled=mapConfig.isNearCacheEnabled();
  if (nearCacheEnabled) {
    final Iterator<Data> iterator=keys.iterator();
    while (iterator.hasNext()) {
      Data key=iterator.next();
      Object cachedValue=mapService.getFromNearCache(name,key);
      if (cachedValue != null) {
        if (!NearCache.NULL_OBJECT.equals(cachedValue)) {
          result.put(mapService.toObject(key),mapService.toObject(cachedValue));
        }
        iterator.remove();
      }
    }
  }
  if (keys.isEmpty()) {
    return result;
  }
  Collection<Integer> partitions=getPartitionsForKeys(keys);
  Map<Integer,Object> responses;
  try {
    responses=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,new MapGetAllOperationFactory(name,keys),partitions);
    for (    Object response : responses.values()) {
      Set<Map.Entry<Data,Data>> entries=((MapEntrySet)mapService.toObject(response)).getEntrySet();
      for (      Entry<Data,Data> entry : entries) {
        result.put(mapService.toObject(entry.getKey()),mapService.toObject(entry.getValue()));
        if (nearCacheEnabled) {
          int partitionId=nodeEngine.getPartitionService().getPartitionId(entry.getKey());
          if (!nodeEngine.getPartitionService().getPartitionOwner(partitionId).equals(nodeEngine.getClusterService().getThisAddress()) || mapConfig.getNearCacheConfig().isCacheLocalEntries()) {
            mapService.putNearCache(name,entry.getKey(),entry.getValue());
          }
        }
      }
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return result;
}