nus-yam/ex-repair huggingface dataset:
Program: 48884
Project: 48884
Buggy source:
public void readPortable(PortableReader reader) throws IOException {
  name=reader.readUTF("String_Node_Str");
  includeValue=reader.readBoolean("String_Node_Str");
  boolean hasKey=reader.readBoolean("String_Node_Str");
  if (reader.readBoolean("String_Node_Str")) {
    predicate=(Predicate)reader.readPortable("String_Node_Str");
  }
  if (hasKey) {
    final ObjectDataInput in=reader.getRawDataInput();
    key=new Data();
    key.readData(in);
  }
}

Fixed version (ground truth):
public void readPortable(PortableReader reader) throws IOException {
  name=reader.readUTF("String_Node_Str");
  includeValue=reader.readBoolean("String_Node_Str");
  boolean hasKey=reader.readBoolean("String_Node_Str");
  if (reader.readBoolean("String_Node_Str")) {
    final ObjectDataInput in=reader.getRawDataInput();
    predicate=in.readObject();
    if (hasKey) {
      key=in.readObject();
    }
  }
 else   if (hasKey) {
    final ObjectDataInput in=reader.getRawDataInput();
    key=in.readObject();
  }
}
Program: 48885
Project: 48885
Buggy source:
public boolean replace(Data dataKey,Object testValue,Object newValue){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null)   return false;
  if (mapService.compare(name,record.getValue(),testValue)) {
    newValue=mapService.interceptPut(name,record.getValue(),newValue);
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    return false;
  }
  saveIndex(record);
  return true;
}

Fixed version (ground truth):
public boolean replace(Data dataKey,Object testValue,Object newValue){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null)   return false;
  if (mapService.compare(name,record.getValue(),testValue)) {
    newValue=mapService.interceptPut(name,record.getValue(),newValue);
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    return false;
  }
  saveIndex(record);
  return true;
}
Program: 48886
Project: 48886
Buggy source:
public void putTransient(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}

Fixed version (ground truth):
public void putTransient(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}
Program: 48887
Project: 48887
Buggy source:
public Object put(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
    }
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    saveIndex(record);
  }
 else {
    oldValue=record.getValue();
    value=mapService.interceptPut(name,oldValue,value);
    if (mapService.compare(name,oldValue,value)) {
      accessRecord(record);
      updateTtl(record,ttl);
    }
 else {
      mapStoreWrite(record,dataKey,value);
      updateSizeEstimator(-calculateRecordSize(record));
      setRecordValue(record,value);
      updateSizeEstimator(calculateRecordSize(record));
      updateTtl(record,ttl);
      saveIndex(record);
    }
  }
  return oldValue;
}

Fixed version (ground truth):
public Object put(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null || record.getValue() == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
    }
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    saveIndex(record);
  }
 else {
    oldValue=record.getValue();
    value=mapService.interceptPut(name,oldValue,value);
    if (mapService.compare(name,oldValue,value)) {
      accessRecord(record);
      updateTtl(record,ttl);
    }
 else {
      mapStoreWrite(record,dataKey,value);
      updateSizeEstimator(-calculateRecordSize(record));
      setRecordValue(record,value);
      updateSizeEstimator(calculateRecordSize(record));
      updateTtl(record,ttl);
      saveIndex(record);
    }
  }
  return oldValue;
}
Program: 48888
Project: 48888
Buggy source:
public boolean merge(Data dataKey,EntryView mergingEntry,MapMergePolicy mergePolicy){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object newValue=null;
  if (record == null) {
    newValue=mergingEntry.getValue();
    record=mapService.createRecord(name,dataKey,newValue,-1);
    mapStoreWrite(record,dataKey,newValue);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    Object oldValue=record.getValue();
    EntryView existingEntry=new SimpleEntryView(mapService.toObject(record.getKey()),mapService.toObject(record.getValue()),record.getStatistics(),record.getVersion());
    newValue=mergePolicy.merge(name,mergingEntry,existingEntry);
    if (newValue == null) {
      deleteRecord(dataKey);
      removeIndex(dataKey);
      mapStoreDelete(record,dataKey);
      updateSizeEstimator(-calculateRecordSize(record));
      return true;
    }
    if (mapService.compare(name,newValue,oldValue)) {
      return true;
    }
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    recordFactory.setValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
  saveIndex(record);
  return newValue != null;
}

Fixed version (ground truth):
public boolean merge(Data dataKey,EntryView mergingEntry,MapMergePolicy mergePolicy){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object newValue=null;
  if (record == null || record.getValue() == null) {
    newValue=mergingEntry.getValue();
    record=mapService.createRecord(name,dataKey,newValue,-1);
    mapStoreWrite(record,dataKey,newValue);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    Object oldValue=record.getValue();
    EntryView existingEntry=new SimpleEntryView(mapService.toObject(record.getKey()),mapService.toObject(record.getValue()),record.getStatistics(),record.getVersion());
    newValue=mergePolicy.merge(name,mergingEntry,existingEntry);
    if (newValue == null) {
      deleteRecord(dataKey);
      removeIndex(dataKey);
      mapStoreDelete(record,dataKey);
      updateSizeEstimator(-calculateRecordSize(record));
      return true;
    }
    if (mapService.compare(name,newValue,oldValue)) {
      return true;
    }
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    recordFactory.setValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
  saveIndex(record);
  return newValue != null;
}
Program: 48889
Project: 48889
Buggy source:
public void putFromLoad(Data dataKey,Object value,long ttl){
  Record record=records.get(dataKey);
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}

Fixed version (ground truth):
public void putFromLoad(Data dataKey,Object value,long ttl){
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}
Program: 48890
Project: 48890
Buggy source:
public boolean tryPut(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return true;
}

Fixed version (ground truth):
public boolean tryPut(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return true;
}
Program: 48891
Project: 48891
Buggy source:
public boolean set(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  boolean newRecord=false;
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    newRecord=true;
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return newRecord;
}

Fixed version (ground truth):
public boolean set(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  boolean newRecord=false;
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    newRecord=true;
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return newRecord;
}
Program: 48892
Project: 48892
Buggy source:
public Object putIfAbsent(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (oldValue != null) {
        record=mapService.createRecord(name,dataKey,oldValue,-1);
        records.put(dataKey,record);
        updateSizeEstimator(calculateRecordSize(record));
      }
    }
  }
 else {
    accessRecord(record);
    oldValue=record.getValue();
  }
  if (oldValue == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return oldValue;
}

Fixed version (ground truth):
public Object putIfAbsent(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null || record.getValue() == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (oldValue != null) {
        record=mapService.createRecord(name,dataKey,oldValue,-1);
        records.put(dataKey,record);
        updateSizeEstimator(calculateRecordSize(record));
      }
    }
  }
 else {
    accessRecord(record);
    oldValue=record.getValue();
  }
  if (oldValue == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return oldValue;
}
Program: 48893
Project: 48893
Buggy source:
public Record createRecord(String name,Data dataKey,Object value,long ttl,boolean shouldSchedule){
  MapContainer mapContainer=getMapContainer(name);
  Record record=mapContainer.getRecordFactory().newRecord(dataKey,value);
  if (shouldSchedule) {
    if (ttl < 0 && mapContainer.getMapConfig().getTimeToLiveSeconds() > 0) {
      scheduleTtlEviction(name,record,mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
    }
    if (ttl > 0) {
      scheduleTtlEviction(name,record,ttl);
    }
    if (mapContainer.getMapConfig().getMaxIdleSeconds() > 0) {
      scheduleIdleEviction(name,dataKey,mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
    }
  }
  return record;
}

Fixed version (ground truth):
public Record createRecord(String name,Data dataKey,Object value,long ttl,boolean shouldSchedule){
  MapContainer mapContainer=getMapContainer(name);
  Record record=mapContainer.getRecordFactory().newRecord(dataKey,value);
  if (shouldSchedule) {
    if (ttl < 0 && mapContainer.getMapConfig().getTimeToLiveSeconds() > 0) {
      scheduleTtlEviction(name,record,mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
    }
 else     if (ttl > 0) {
      scheduleTtlEviction(name,record,ttl);
    }
 else     if (mapContainer.getStore() != null) {
      mapContainer.getTtlEvictionScheduler().cancel(record.getKey());
    }
    if (mapContainer.getMapConfig().getMaxIdleSeconds() > 0) {
      scheduleIdleEviction(name,dataKey,mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
    }
  }
  return record;
}
Program: 48894
Project: 48894
Buggy source:
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
    boolean response=(Boolean)op.getResponse();
  }
}

Fixed version (ground truth):
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
  }
  getOrCreateContainer().unlock(dataKey,caller,threadId);
}
Program: 48895
Project: 48895
Buggy source:
public Operation getBackupOperation(){
  return new TxnCommitBackupOperation(name,dataKey,opList,getCallerUuid(),threadId);
}

Fixed version (ground truth):
public Operation getBackupOperation(){
  List<Operation> backupOpList=new ArrayList<Operation>();
  for (  Operation operation : opList) {
    if (operation instanceof BackupAwareOperation) {
      backupOpList.add(operation);
    }
  }
  return new TxnCommitBackupOperation(name,dataKey,backupOpList,getCallerUuid(),threadId);
}
Program: 48896
Project: 48896
Buggy source:
public boolean replace(Data dataKey,Object testValue,Object newValue){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null)   return false;
  if (mapService.compare(name,record.getValue(),testValue)) {
    newValue=mapService.interceptPut(name,record.getValue(),newValue);
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    return false;
  }
  saveIndex(record);
  return true;
}

Fixed version (ground truth):
public boolean replace(Data dataKey,Object testValue,Object newValue){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null)   return false;
  if (mapService.compare(name,record.getValue(),testValue)) {
    newValue=mapService.interceptPut(name,record.getValue(),newValue);
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    return false;
  }
  saveIndex(record);
  return true;
}
Program: 48897
Project: 48897
Buggy source:
public void putTransient(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}

Fixed version (ground truth):
public void putTransient(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}
Program: 48898
Project: 48898
Buggy source:
public Object put(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
    }
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    saveIndex(record);
  }
 else {
    oldValue=record.getValue();
    value=mapService.interceptPut(name,oldValue,value);
    if (mapService.compare(name,oldValue,value)) {
      accessRecord(record);
      updateTtl(record,ttl);
    }
 else {
      mapStoreWrite(record,dataKey,value);
      updateSizeEstimator(-calculateRecordSize(record));
      setRecordValue(record,value);
      updateSizeEstimator(calculateRecordSize(record));
      updateTtl(record,ttl);
      saveIndex(record);
    }
  }
  return oldValue;
}

Fixed version (ground truth):
public Object put(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null || record.getValue() == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
    }
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    saveIndex(record);
  }
 else {
    oldValue=record.getValue();
    value=mapService.interceptPut(name,oldValue,value);
    if (mapService.compare(name,oldValue,value)) {
      accessRecord(record);
      updateTtl(record,ttl);
    }
 else {
      mapStoreWrite(record,dataKey,value);
      updateSizeEstimator(-calculateRecordSize(record));
      setRecordValue(record,value);
      updateSizeEstimator(calculateRecordSize(record));
      updateTtl(record,ttl);
      saveIndex(record);
    }
  }
  return oldValue;
}
Program: 48899
Project: 48899
Buggy source:
public boolean merge(Data dataKey,EntryView mergingEntry,MapMergePolicy mergePolicy){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object newValue=null;
  if (record == null) {
    newValue=mergingEntry.getValue();
    record=mapService.createRecord(name,dataKey,newValue,-1);
    mapStoreWrite(record,dataKey,newValue);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    Object oldValue=record.getValue();
    EntryView existingEntry=new SimpleEntryView(mapService.toObject(record.getKey()),mapService.toObject(record.getValue()),record.getStatistics(),record.getVersion());
    newValue=mergePolicy.merge(name,mergingEntry,existingEntry);
    if (newValue == null) {
      deleteRecord(dataKey);
      removeIndex(dataKey);
      mapStoreDelete(record,dataKey);
      updateSizeEstimator(-calculateRecordSize(record));
      return true;
    }
    if (mapService.compare(name,newValue,oldValue)) {
      return true;
    }
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    recordFactory.setValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
  saveIndex(record);
  return newValue != null;
}

Fixed version (ground truth):
public boolean merge(Data dataKey,EntryView mergingEntry,MapMergePolicy mergePolicy){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object newValue=null;
  if (record == null || record.getValue() == null) {
    newValue=mergingEntry.getValue();
    record=mapService.createRecord(name,dataKey,newValue,-1);
    mapStoreWrite(record,dataKey,newValue);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    Object oldValue=record.getValue();
    EntryView existingEntry=new SimpleEntryView(mapService.toObject(record.getKey()),mapService.toObject(record.getValue()),record.getStatistics(),record.getVersion());
    newValue=mergePolicy.merge(name,mergingEntry,existingEntry);
    if (newValue == null) {
      deleteRecord(dataKey);
      removeIndex(dataKey);
      mapStoreDelete(record,dataKey);
      updateSizeEstimator(-calculateRecordSize(record));
      return true;
    }
    if (mapService.compare(name,newValue,oldValue)) {
      return true;
    }
    mapStoreWrite(record,dataKey,newValue);
    updateSizeEstimator(-calculateRecordSize(record));
    recordFactory.setValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
  saveIndex(record);
  return newValue != null;
}
Program: 48900
Project: 48900
Buggy source:
public void putFromLoad(Data dataKey,Object value,long ttl){
  Record record=records.get(dataKey);
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}

Fixed version (ground truth):
public void putFromLoad(Data dataKey,Object value,long ttl){
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
}
Program: 48901
Project: 48901
Buggy source:
public boolean tryPut(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return true;
}

Fixed version (ground truth):
public boolean tryPut(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return true;
}
Program: 48902
Project: 48902
Buggy source:
public boolean set(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  boolean newRecord=false;
  if (record == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    newRecord=true;
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return newRecord;
}

Fixed version (ground truth):
public boolean set(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  boolean newRecord=false;
  if (record == null || record.getValue() == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    newRecord=true;
  }
 else {
    value=mapService.interceptPut(name,record.getValue(),value);
    mapStoreWrite(record,dataKey,value);
    updateSizeEstimator(-calculateRecordSize(record));
    setRecordValue(record,value);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return newRecord;
}
Program: 48903
Project: 48903
Buggy source:
public Object putIfAbsent(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (oldValue != null) {
        record=mapService.createRecord(name,dataKey,oldValue,-1);
        records.put(dataKey,record);
        updateSizeEstimator(calculateRecordSize(record));
      }
    }
  }
 else {
    accessRecord(record);
    oldValue=record.getValue();
  }
  if (oldValue == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return oldValue;
}

Fixed version (ground truth):
public Object putIfAbsent(Data dataKey,Object value,long ttl){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null || record.getValue() == null) {
    if (mapContainer.getStore() != null) {
      oldValue=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (oldValue != null) {
        record=mapService.createRecord(name,dataKey,oldValue,-1);
        records.put(dataKey,record);
        updateSizeEstimator(calculateRecordSize(record));
      }
    }
  }
 else {
    accessRecord(record);
    oldValue=record.getValue();
  }
  if (oldValue == null) {
    value=mapService.interceptPut(name,null,value);
    record=mapService.createRecord(name,dataKey,value,ttl);
    mapStoreWrite(record,dataKey,value);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
    updateTtl(record,ttl);
  }
  saveIndex(record);
  return oldValue;
}
Program: 48904
Project: 48904
Buggy source:
public Record createRecord(String name,Data dataKey,Object value,long ttl,boolean shouldSchedule){
  MapContainer mapContainer=getMapContainer(name);
  Record record=mapContainer.getRecordFactory().newRecord(dataKey,value);
  if (shouldSchedule) {
    if (ttl < 0 && mapContainer.getMapConfig().getTimeToLiveSeconds() > 0) {
      scheduleTtlEviction(name,record,mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
    }
    if (ttl > 0) {
      scheduleTtlEviction(name,record,ttl);
    }
    if (mapContainer.getMapConfig().getMaxIdleSeconds() > 0) {
      scheduleIdleEviction(name,dataKey,mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
    }
  }
  return record;
}

Fixed version (ground truth):
public Record createRecord(String name,Data dataKey,Object value,long ttl,boolean shouldSchedule){
  MapContainer mapContainer=getMapContainer(name);
  Record record=mapContainer.getRecordFactory().newRecord(dataKey,value);
  if (shouldSchedule) {
    if (ttl < 0 && mapContainer.getMapConfig().getTimeToLiveSeconds() > 0) {
      scheduleTtlEviction(name,record,mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
    }
 else     if (ttl > 0) {
      scheduleTtlEviction(name,record,ttl);
    }
 else     if (mapContainer.getStore() != null) {
      mapContainer.getTtlEvictionScheduler().cancel(record.getKey());
    }
    if (mapContainer.getMapConfig().getMaxIdleSeconds() > 0) {
      scheduleIdleEviction(name,dataKey,mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
    }
  }
  return record;
}
Program: 48906
Project: 48906
Buggy source:
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
    boolean response=(Boolean)op.getResponse();
  }
}

Fixed version (ground truth):
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
  }
  getOrCreateContainer().unlock(dataKey,caller,threadId);
}
Program: 48907
Project: 48907
Buggy source:
public Operation getBackupOperation(){
  return new TxnCommitBackupOperation(name,dataKey,opList,getCallerUuid(),threadId);
}

Fixed version (ground truth):
public Operation getBackupOperation(){
  List<Operation> backupOpList=new ArrayList<Operation>();
  for (  Operation operation : opList) {
    if (operation instanceof BackupAwareOperation) {
      BackupAwareOperation backupAwareOperation=(BackupAwareOperation)operation;
      if (backupAwareOperation.shouldBackup()) {
        backupOpList.add(backupAwareOperation.getBackupOperation());
      }
    }
  }
  return new TxnCommitBackupOperation(name,dataKey,backupOpList,getCallerUuid(),threadId);
}
Program: 48908
Project: 48908
Buggy source:
protected Comparable convert(Map.Entry mapEntry,Comparable entryValue,Comparable attributeValue){
  if (attributeValue == null) {
    return null;
  }
  AttributeType type=attributeType;
  if (type == null) {
    QueryableEntry queryableEntry=(QueryableEntry)mapEntry;
    type=queryableEntry.getAttributeType(attribute);
    attributeType=type;
  }
  if (type == AttributeType.ENUM) {
    return type.getConverter().convert(attributeValue);
  }
 else {
    if (entryValue != null && entryValue.getClass().isAssignableFrom(attributeValue.getClass())) {
      return attributeValue;
    }
 else     if (type != null) {
      return type.getConverter().convert(attributeValue);
    }
 else {
      throw new QueryException("String_Node_Str" + attributeValue.getClass());
    }
  }
}

Fixed version (ground truth):
protected Comparable convert(Map.Entry mapEntry,Comparable entryValue,Comparable attributeValue){
  if (attributeValue == null) {
    return null;
  }
  if (attributeValue instanceof IndexImpl.NullObject) {
    return IndexImpl.NULL;
  }
  AttributeType type=attributeType;
  if (type == null) {
    QueryableEntry queryableEntry=(QueryableEntry)mapEntry;
    type=queryableEntry.getAttributeType(attribute);
    attributeType=type;
  }
  if (type == AttributeType.ENUM) {
    return type.getConverter().convert(attributeValue);
  }
 else {
    if (entryValue != null && entryValue.getClass().isAssignableFrom(attributeValue.getClass())) {
      return attributeValue;
    }
 else     if (type != null) {
      return type.getConverter().convert(attributeValue);
    }
 else {
      throw new QueryException("String_Node_Str" + attributeValue.getClass());
    }
  }
}
Program: 48909
Project: 48909
Buggy source:
public void newIndex(Comparable newValue,QueryableEntry record){
  ConcurrentMap<Data,QueryableEntry> records=mapRecords.get(newValue);
  if (records == null) {
    records=new ConcurrentHashMap<Data,QueryableEntry>(1,0.75f,1);
    mapRecords.put(newValue,records);
    sortedSet.add(newValue);
  }
  records.put(record.getIndexKey(),record);
}

Fixed version (ground truth):
public void newIndex(Comparable newValue,QueryableEntry record){
  ConcurrentMap<Data,QueryableEntry> records=mapRecords.get(newValue);
  if (records == null) {
    records=new ConcurrentHashMap<Data,QueryableEntry>(1,0.75f,1);
    mapRecords.put(newValue,records);
    if (!(newValue instanceof IndexImpl.NullObject)) {
      sortedSet.add(newValue);
    }
  }
  records.put(record.getIndexKey(),record);
}
Program: 48910
Project: 48910
Buggy source:
public void run(){
  Map.Entry<Data,Object> mapEntry=recordStore.getMapEntryObject(dataKey);
  Map.Entry entry=new AbstractMap.SimpleEntry(mapService.toObject(dataKey),mapService.toObject(mapEntry.getValue()));
  response=mapService.toData(entryProcessor.process(entry));
  recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,entry.getValue()));
}

Fixed version (ground truth):
public void run(){
  Map.Entry<Data,Data> mapEntry=recordStore.getMapEntryData(dataKey);
  dataOldValue=mapEntry.getValue();
  Map.Entry entry=new AbstractMap.SimpleEntry(mapService.toObject(dataKey),mapService.toObject(mapEntry.getValue()));
  response=mapService.toData(entryProcessor.process(entry));
  if (entry.getValue() == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (mapEntry.getValue() == null) {
      eventType=EntryEventType.ADDED;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    dataValue=mapService.toData(entry.getValue());
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
  }
}
Program: 48911
Project: 48911
Buggy source:
public void afterRun() throws Exception {
  super.afterRun();
  invalidateNearCaches();
}

Fixed version (ground truth):
public void afterRun() throws Exception {
  super.afterRun();
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataOldValue,dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),recordStore.getRecords().get(dataKey));
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}
Program: 48912
Project: 48912
Buggy source:
public void processBackup(Map.Entry entry){
  entry.setValue((Integer)entry.getValue() + 1);
}

Fixed version (ground truth):
public void processBackup(Map.Entry entry){
  entry.setValue(value);
}
Program: 48913
Project: 48913
Buggy source:
public void run(){
  Map.Entry<Data,Object> mapEntry=recordStore.getMapEntryObject(dataKey);
  Map.Entry entry=new AbstractMap.SimpleEntry(mapService.toObject(dataKey),mapService.toObject(mapEntry.getValue()));
  response=mapService.toData(entryProcessor.process(entry));
  if (entry.getValue() == null) {
    recordStore.remove(dataKey);
  }
 else {
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,entry.getValue()));
  }
}

Fixed version (ground truth):
public void run(){
  Map.Entry<Data,Data> mapEntry=recordStore.getMapEntryData(dataKey);
  dataOldValue=mapEntry.getValue();
  Map.Entry entry=new AbstractMap.SimpleEntry(mapService.toObject(dataKey),mapService.toObject(mapEntry.getValue()));
  response=mapService.toData(entryProcessor.process(entry));
  if (entry.getValue() == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (mapEntry.getValue() == null) {
      eventType=EntryEventType.ADDED;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    dataValue=mapService.toData(entry.getValue());
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
  }
}
Program: 48914
Project: 48914
Buggy source:
public void afterRun() throws Exception {
  super.afterRun();
  invalidateNearCaches();
}

Fixed version (ground truth):
public void afterRun() throws Exception {
  super.afterRun();
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataOldValue,dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),recordStore.getRecords().get(dataKey));
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}
Program: 48915
Project: 48915
Buggy source:
public void processBackup(Map.Entry entry){
  entry.setValue((Integer)entry.getValue() + 1);
}

Fixed version (ground truth):
public void processBackup(Map.Entry entry){
  entry.setValue(value);
}
Program: 48916
Project: 48916
Buggy source:
public void memberAdded(MembershipEvent membershipEvent){
  try {
    Member member=membershipEvent.getMember();
    if (member != null && instance.node.isMaster() && urlChanged) {
      ManagementCenterConfigOperation operation=new ManagementCenterConfigOperation(webServerUrl);
      call(((MemberImpl)member).getAddress(),operation);
    }
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void memberAdded(MembershipEvent membershipEvent){
  try {
    Member member=membershipEvent.getMember();
    if (member != null && instance.node.isMaster() && urlChanged) {
      ManagementCenterConfigOperation operation=new ManagementCenterConfigOperation(webServerUrl);
      callOnMember(member,operation);
    }
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str",e);
  }
}
Program: 48917
Project: 48917
Buggy source:
public byte[] changeWebServerUrlOverCluster(String groupName,String groupPass,String newUrl){
  try {
    GroupConfig groupConfig=instance.getConfig().getGroupConfig();
    if (!(groupConfig.getName().equals(groupName) && groupConfig.getPassword().equals(groupPass)))     return HttpCommand.RES_403;
    ManagementCenterConfigOperation operation=new ManagementCenterConfigOperation(newUrl);
    sendToAllMembers(operation);
  }
 catch (  Throwable throwable) {
    logger.warning("String_Node_Str",throwable);
    return HttpCommand.RES_500;
  }
  return HttpCommand.RES_204;
}

Fixed version (ground truth):
public byte[] changeWebServerUrlOverCluster(String groupName,String groupPass,String newUrl){
  try {
    GroupConfig groupConfig=instance.getConfig().getGroupConfig();
    if (!(groupConfig.getName().equals(groupName) && groupConfig.getPassword().equals(groupPass)))     return HttpCommand.RES_403;
    final Collection<MemberImpl> memberList=instance.node.clusterService.getMemberList();
    for (    MemberImpl member : memberList) {
      send(member.getAddress(),new ManagementCenterConfigOperation(newUrl));
    }
  }
 catch (  Throwable throwable) {
    logger.warning("String_Node_Str",throwable);
    return HttpCommand.RES_500;
  }
  return HttpCommand.RES_204;
}
Program: 48918
Project: 48918
Buggy source:
public void writeResponse(ManagementCenterService mcs,ObjectDataOutput dos) throws Exception {
  Object result=null;
  ScriptExecutorOperation operation=new ScriptExecutorOperation(engine,script,bindings);
  if (targetAllMembers) {
    result=mcs.callOnAllMembers(operation);
  }
 else   if (targets.isEmpty()) {
    result=NULL;
  }
 else   if (targets.size() == 1) {
    result=mcs.call(targets.iterator().next(),operation);
  }
 else {
    result=mcs.callOnAddresses(targets,operation);
  }
  if (result != null) {
    if (result instanceof Map) {
      dos.writeByte(MAP);
      writeMap(dos,(Map)result);
    }
 else     if (result instanceof Collection) {
      dos.writeByte(COLLECTION);
      writeCollection(dos,(Collection)result);
    }
 else {
      dos.writeByte(OTHER);
      dos.writeObject(result);
    }
  }
 else {
    dos.writeByte(NULL);
  }
}

Fixed version (ground truth):
public void writeResponse(ManagementCenterService mcs,ObjectDataOutput dos) throws Exception {
  Object result=null;
  if (targetAllMembers) {
    final Set<Member> members=mcs.getHazelcastInstance().getCluster().getMembers();
    final ArrayList list=new ArrayList(members.size());
    for (    Member member : members) {
      list.add(mcs.callOnMember(member,new ScriptExecutorOperation(engine,script,bindings)));
    }
    result=list;
  }
 else {
    final ArrayList list=new ArrayList(targets.size());
    for (    Address address : targets) {
      list.add(mcs.callOnAddress(address,new ScriptExecutorOperation(engine,script,bindings)));
    }
    result=list;
  }
  if (result != null) {
    if (result instanceof Map) {
      dos.writeByte(MAP);
      writeMap(dos,(Map)result);
    }
 else     if (result instanceof Collection) {
      dos.writeByte(COLLECTION);
      writeCollection(dos,(Collection)result);
    }
 else {
      dos.writeByte(OTHER);
      dos.writeObject(result);
    }
  }
 else {
    dos.writeByte(NULL);
  }
}
Program: 48919
Project: 48919
Buggy source:
public void writeResponse(ManagementCenterService mcs,ObjectDataOutput dos) throws Exception {
  dos.writeBoolean(update);
  if (update) {
    mcs.callOnAllMembers(new UpdateMapConfigOperation(map,config));
    dos.writeUTF("String_Node_Str");
  }
 else {
    MapConfig cfg=(MapConfig)mcs.call(target,new GetMapConfigOperation(map));
    if (cfg != null) {
      dos.writeBoolean(true);
      new MapConfigAdapter(cfg).writeData(dos);
    }
 else {
      dos.writeBoolean(false);
    }
  }
}

Fixed version (ground truth):
public void writeResponse(ManagementCenterService mcs,ObjectDataOutput dos) throws Exception {
  dos.writeBoolean(update);
  if (update) {
    final Set<Member> members=mcs.getHazelcastInstance().getCluster().getMembers();
    for (    Member member : members) {
      mcs.callOnMember(member,new UpdateMapConfigOperation(map,config));
    }
    dos.writeUTF("String_Node_Str");
  }
 else {
    MapConfig cfg=(MapConfig)mcs.callOnAddress(target,new GetMapConfigOperation(map));
    if (cfg != null) {
      dos.writeBoolean(true);
      new MapConfigAdapter(cfg).writeData(dos);
    }
 else {
      dos.writeBoolean(false);
    }
  }
}
Program: 48920
Project: 48920
Buggy source:
public void writeResponse(ManagementCenterService mcs,ObjectDataOutput dos) throws Exception {
  String threadDump=(String)mcs.call(target,new ThreadDumpOperation(isDeadlock));
  if (threadDump != null) {
    dos.writeBoolean(true);
    writeLongString(dos,threadDump);
  }
 else {
    dos.writeBoolean(false);
  }
}

Fixed version (ground truth):
public void writeResponse(ManagementCenterService mcs,ObjectDataOutput dos) throws Exception {
  String threadDump=(String)mcs.callOnAddress(target,new ThreadDumpOperation(isDeadlock));
  if (threadDump != null) {
    dos.writeBoolean(true);
    writeLongString(dos,threadDump);
  }
 else {
    dos.writeBoolean(false);
  }
}
Program: 48921
Project: 48921
Buggy source:
protected Set<Data> localKeySetInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnTargetPartitions(SERVICE_NAME,new BinaryOperationFactory(new MapKeySetOperation(name),nodeEngine),nodeEngine.getThisAddress());
    Set<Data> keySet=new HashSet<Data>();
    for (    Object result : results.values()) {
      Set keys=((MapKeySet)getService().toObject(result)).getKeySet();
      keySet.addAll(keys);
    }
    return keySet;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected Set<Data> localKeySetInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  Set<Data> keySet=new HashSet<Data>();
  try {
    List<Integer> memberPartitions=nodeEngine.getPartitionService().getMemberPartitions(nodeEngine.getThisAddress());
    for (    Integer memberPartition : memberPartitions) {
      RecordStore recordStore=mapService.getRecordStore(memberPartition,name);
      keySet.addAll(recordStore.getRecords().keySet());
    }
    return keySet;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}