Program: 49396
Project: 49396
Buggy source:
public void publishEvent(Address caller,String mapName,int eventType,Data dataKey,Data dataOldValue,Data dataValue){
  Collection<EventRegistration> candidates=nodeEngine.getEventService().getRegistrations(SERVICE_NAME,mapName);
  Set<EventRegistration> registrationsWithValue=new HashSet<EventRegistration>();
  Set<EventRegistration> registrationsWithoutValue=new HashSet<EventRegistration>();
  if (candidates.isEmpty())   return;
  Object key=null;
  Object value=null;
  Object oldValue=null;
  for (  EventRegistration candidate : candidates) {
    EventFilter filter=candidate.getFilter();
    if (filter instanceof EventServiceImpl.EmptyFilter) {
      registrationsWithValue.add(candidate);
    }
 else     if (filter instanceof QueryEventFilter) {
      Object testValue;
      if (eventType == EntryEvent.TYPE_REMOVED) {
        oldValue=oldValue != null ? oldValue : toObject(dataOldValue);
        testValue=oldValue;
      }
 else {
        value=value != null ? value : toObject(dataValue);
        testValue=value;
      }
      key=key != null ? key : toObject(key);
      QueryEventFilter queryEventFilter=(QueryEventFilter)filter;
      if (queryEventFilter.eval(new SimpleMapEntry(key,testValue))) {
        if (queryEventFilter.isIncludeValue()) {
          registrationsWithValue.add(candidate);
        }
 else {
          registrationsWithoutValue.add(candidate);
        }
      }
    }
 else     if (filter.eval(dataKey)) {
      EntryEventFilter eventFilter=(EntryEventFilter)filter;
      if (eventFilter.isIncludeValue()) {
        registrationsWithValue.add(candidate);
      }
 else {
        registrationsWithoutValue.add(candidate);
      }
    }
  }
  if (registrationsWithValue.isEmpty() && registrationsWithoutValue.isEmpty())   return;
  String source=nodeEngine.getThisAddress().toString();
  EventData event=new EventData(source,mapName,caller,dataKey,dataValue,dataOldValue,eventType);
  nodeEngine.getEventService().publishEvent(SERVICE_NAME,registrationsWithValue,event);
  nodeEngine.getEventService().publishEvent(SERVICE_NAME,registrationsWithoutValue,event.cloneWithoutValues());
}

Fixed version (ground truth):
public void publishEvent(Address caller,String mapName,int eventType,Data dataKey,Data dataOldValue,Data dataValue){
  Collection<EventRegistration> candidates=nodeEngine.getEventService().getRegistrations(SERVICE_NAME,mapName);
  Set<EventRegistration> registrationsWithValue=new HashSet<EventRegistration>();
  Set<EventRegistration> registrationsWithoutValue=new HashSet<EventRegistration>();
  if (candidates.isEmpty())   return;
  Object key=null;
  Object value=null;
  Object oldValue=null;
  for (  EventRegistration candidate : candidates) {
    EventFilter filter=candidate.getFilter();
    if (filter instanceof EventServiceImpl.EmptyFilter) {
      registrationsWithValue.add(candidate);
    }
 else     if (filter instanceof QueryEventFilter) {
      Object testValue;
      if (eventType == EntryEvent.TYPE_REMOVED || eventType == EntryEvent.TYPE_EVICTED) {
        oldValue=oldValue != null ? oldValue : toObject(dataOldValue);
        testValue=oldValue;
      }
 else {
        value=value != null ? value : toObject(dataValue);
        testValue=value;
      }
      key=key != null ? key : toObject(key);
      QueryEventFilter queryEventFilter=(QueryEventFilter)filter;
      if (queryEventFilter.eval(new SimpleMapEntry(key,testValue))) {
        if (queryEventFilter.isIncludeValue()) {
          registrationsWithValue.add(candidate);
        }
 else {
          registrationsWithoutValue.add(candidate);
        }
      }
    }
 else     if (filter.eval(dataKey)) {
      EntryEventFilter eventFilter=(EntryEventFilter)filter;
      if (eventFilter.isIncludeValue()) {
        registrationsWithValue.add(candidate);
      }
 else {
        registrationsWithoutValue.add(candidate);
      }
    }
  }
  if (registrationsWithValue.isEmpty() && registrationsWithoutValue.isEmpty())   return;
  String source=nodeEngine.getThisAddress().toString();
  EventData event=new EventData(source,mapName,caller,dataKey,dataValue,dataOldValue,eventType);
  nodeEngine.getEventService().publishEvent(SERVICE_NAME,registrationsWithValue,event);
  nodeEngine.getEventService().publishEvent(SERVICE_NAME,registrationsWithoutValue,event.cloneWithoutValues());
}