Program: 48776
Project: 48776
Buggy source:
public void run(){
  response=new MapEntrySet();
  MapEntrySimple entry;
  final RecordStore recordStore=mapService.getRecordStore(getPartitionId(),name);
  final Map<Data,Record> records=recordStore.getReadonlyRecordMap();
  for (  final Map.Entry<Data,Record> recordEntry : records.entrySet()) {
    final Data dataKey=recordEntry.getKey();
    final Record record=recordEntry.getValue();
    final Object valueBeforeProcess=mapService.toObject(record.getValue());
    entry=new MapEntrySimple(mapService.toObject(record.getKey()),valueBeforeProcess);
    final Object result=entryProcessor.process(entry);
    final Object valueAfterProcess=entry.getValue();
    Data dataValue=null;
    if (result != null) {
      dataValue=mapService.toData(result);
      response.add(new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,dataValue));
    }
    EntryEventType eventType=null;
    if (valueAfterProcess == null) {
      recordStore.remove(dataKey);
      eventType=EntryEventType.REMOVED;
    }
 else {
      if (valueBeforeProcess == null) {
        eventType=EntryEventType.ADDED;
      }
 else       if (!entry.isModified()) {
        eventType=__NO_NEED_TO_FIRE_EVENT;
      }
 else {
        eventType=EntryEventType.UPDATED;
      }
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,valueAfterProcess));
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,mapService.toData(record.getValue()),dataValue);
      if (mapContainer.isNearCacheEnabled() && mapContainer.getMapConfig().getNearCacheConfig().isInvalidateOnChange()) {
        mapService.invalidateAllNearCaches(name,dataKey);
      }
      if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
        if (EntryEventType.REMOVED.equals(eventType)) {
          mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
        }
 else {
          Record r=recordStore.getRecord(dataKey);
          SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),r.getStatistics(),r.getVersion());
          mapService.publishWanReplicationUpdate(name,entryView);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  response=new MapEntrySet();
  MapEntrySimple entry;
  final RecordStore recordStore=mapService.getRecordStore(getPartitionId(),name);
  final Map<Data,Record> records=recordStore.getReadonlyRecordMap();
  for (  final Map.Entry<Data,Record> recordEntry : records.entrySet()) {
    final Data dataKey=recordEntry.getKey();
    final Record record=recordEntry.getValue();
    final Object valueBeforeProcess=mapService.toObject(record.getValue());
    Object objectKey=mapService.toObject(record.getKey());
    if (getPredicate() != null) {
      QueryEntry queryEntry=new QueryEntry(getNodeEngine().getSerializationService(),dataKey,objectKey,valueBeforeProcess);
      if (!getPredicate().apply(queryEntry)) {
        continue;
      }
    }
    entry=new MapEntrySimple(objectKey,valueBeforeProcess);
    final Object result=entryProcessor.process(entry);
    final Object valueAfterProcess=entry.getValue();
    Data dataValue=null;
    if (result != null) {
      dataValue=mapService.toData(result);
      response.add(new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,dataValue));
    }
    EntryEventType eventType;
    if (valueAfterProcess == null) {
      recordStore.remove(dataKey);
      eventType=EntryEventType.REMOVED;
    }
 else {
      if (valueBeforeProcess == null) {
        eventType=EntryEventType.ADDED;
      }
 else       if (!entry.isModified()) {
        eventType=__NO_NEED_TO_FIRE_EVENT;
      }
 else {
        eventType=EntryEventType.UPDATED;
      }
      if (eventType != __NO_NEED_TO_FIRE_EVENT) {
        recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,valueAfterProcess));
      }
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,mapService.toData(record.getValue()),dataValue);
      if (mapContainer.isNearCacheEnabled() && mapContainer.getMapConfig().getNearCacheConfig().isInvalidateOnChange()) {
        mapService.invalidateAllNearCaches(name,dataKey);
      }
      if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
        if (EntryEventType.REMOVED.equals(eventType)) {
          mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
        }
 else {
          Record r=recordStore.getRecord(dataKey);
          SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),r.getStatistics(),r.getVersion());
          mapService.publishWanReplicationUpdate(name,entryView);
        }
      }
    }
  }
}