Program: 48497
Project: 48497
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;
      }
      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);
        }
      }
    }
  }
}

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());
    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;
      }
      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.getCost(),r.getVersion());
          mapService.publishWanReplicationUpdate(name,entryView);
        }
      }
    }
  }
}