nus-yam/ex-repair huggingface dataset:
Program: 113701
Project: 113701
Buggy source:
private void processStep2(final xtreemfs_mkvolRequest rqArgs,final String volumeId,final MRCRequest rq,RPCResponse<ServiceSet> rpcResponse){
  try {
    ServiceSet response=rpcResponse.get();
    for (    Service reg : response)     if (rqArgs.getVolume_name().equals(reg.getName())) {
      String uuid=reg.getUuid();
      throw new UserException(ErrNo.EEXIST,"String_Node_Str" + rqArgs.getVolume_name() + "String_Node_Str"+ uuid+ "String_Node_Str");
    }
    ServiceDataMap dmap=new ServiceDataMap();
    dmap.put("String_Node_Str",master.getConfig().getUUID().toString());
    dmap.put("String_Node_Str","String_Node_Str");
    Service vol=new Service(volumeId,0,Constants.SERVICE_TYPE_VOLUME,rqArgs.getVolume_name(),0,dmap);
    RPCResponse<Long> rpcResponse2=master.getDirClient().xtreemfs_service_register(null,vol);
    rpcResponse2.registerListener(new RPCResponseAvailableListener<Long>(){
      @Override public void responseAvailable(      RPCResponse<Long> r){
        processStep3(rqArgs,volumeId,rq,r);
      }
    }
);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
 finally {
    rpcResponse.freeBuffers();
  }
}

Fixed version (ground truth):
private void processStep2(final xtreemfs_mkvolRequest rqArgs,final String volumeId,final MRCRequest rq,RPCResponse<ServiceSet> rpcResponse){
  try {
    ServiceSet response=rpcResponse.get();
    for (    Service reg : response)     if (rqArgs.getVolume_name().equals(reg.getName())) {
      String uuid=reg.getUuid();
      throw new UserException(ErrNo.EEXIST,"String_Node_Str" + rqArgs.getVolume_name() + "String_Node_Str"+ uuid+ "String_Node_Str");
    }
    ServiceDataMap dmap=new ServiceDataMap();
    dmap.put("String_Node_Str",master.getConfig().getUUID().toString());
    dmap.put("String_Node_Str","String_Node_Str");
    Service vol=new Service(volumeId,0,Constants.SERVICE_TYPE_VOLUME,rqArgs.getVolume_name(),0,dmap);
    RPCResponse<Long> rpcResponse2=master.getDirClient().xtreemfs_service_register(null,vol);
    rpcResponse2.registerListener(new RPCResponseAvailableListener<Long>(){
      @Override public void responseAvailable(      RPCResponse<Long> r){
        processStep3(rqArgs,volumeId,rq,r);
      }
    }
);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
 finally {
    rpcResponse.freeBuffers();
  }
}
Program: 113702
Project: 113702
Buggy source:
@Override public void startRequest(final MRCRequest rq){
  try {
    final xtreemfs_mkvolRequest rqArgs=(xtreemfs_mkvolRequest)rq.getRequestArgs();
    validateContext(rq);
    if (master.getOSDStatusManager().getOSDSelectionPolicy((short)rqArgs.getOsd_selection_policy()) == null)     throw new UserException(ErrNo.EINVAL,"String_Node_Str" + rqArgs.getOsd_selection_policy());
    if (master.getFileAccessManager().getFileAccessPolicy((short)rqArgs.getAccess_control_policy()) == null)     throw new UserException(ErrNo.EINVAL,"String_Node_Str" + rqArgs.getAccess_control_policy());
    final String volumeId=master.getVolumeManager().newVolumeId();
    Map<String,Object> queryMap=new HashMap<String,Object>();
    queryMap.put("String_Node_Str",rqArgs.getVolume_name());
    List<String> attrs=new LinkedList<String>();
    attrs.add("String_Node_Str");
    RPCResponse<ServiceSet> response=master.getDirClient().xtreemfs_service_get_by_type(null,Constants.SERVICE_TYPE_VOLUME);
    response.registerListener(new RPCResponseAvailableListener<ServiceSet>(){
      @Override public void responseAvailable(      RPCResponse<ServiceSet> r){
        processStep2(rqArgs,volumeId,rq,r);
      }
    }
);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(final MRCRequest rq){
  try {
    final xtreemfs_mkvolRequest rqArgs=(xtreemfs_mkvolRequest)rq.getRequestArgs();
    validateContext(rq);
    if (master.getOSDStatusManager().getOSDSelectionPolicy((short)rqArgs.getOsd_selection_policy()) == null)     throw new UserException(ErrNo.EINVAL,"String_Node_Str" + rqArgs.getOsd_selection_policy());
    if (master.getFileAccessManager().getFileAccessPolicy((short)rqArgs.getAccess_control_policy()) == null)     throw new UserException(ErrNo.EINVAL,"String_Node_Str" + rqArgs.getAccess_control_policy());
    final String volumeId=master.getVolumeManager().newVolumeId();
    Map<String,Object> queryMap=new HashMap<String,Object>();
    queryMap.put("String_Node_Str",rqArgs.getVolume_name());
    List<String> attrs=new LinkedList<String>();
    attrs.add("String_Node_Str");
    RPCResponse<ServiceSet> response=master.getDirClient().xtreemfs_service_get_by_type(null,Constants.SERVICE_TYPE_VOLUME);
    response.registerListener(new RPCResponseAvailableListener<ServiceSet>(){
      @Override public void responseAvailable(      RPCResponse<ServiceSet> r){
        processStep2(rqArgs,volumeId,rq,r);
      }
    }
);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113703
Project: 113703
Buggy source:
public void processStep3(final xtreemfs_mkvolRequest rqArgs,final String volumeId,final MRCRequest rq,RPCResponse<Long> rpcResponse){
  try {
    rpcResponse.get();
    master.getVolumeManager().createVolume(master.getFileAccessManager(),volumeId,rqArgs.getVolume_name(),(short)rqArgs.getAccess_control_policy(),(short)rqArgs.getOsd_selection_policy(),null,rq.getDetails().userId,rq.getDetails().groupIds.get(0),rqArgs.getDefault_striping_policy());
    rq.setResponse(new xtreemfs_mkvolResponse());
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
 finally {
    rpcResponse.freeBuffers();
  }
}

Fixed version (ground truth):
public void processStep3(final xtreemfs_mkvolRequest rqArgs,final String volumeId,final MRCRequest rq,RPCResponse<Long> rpcResponse){
  try {
    rpcResponse.get();
    master.getVolumeManager().createVolume(master.getFileAccessManager(),volumeId,rqArgs.getVolume_name(),(short)rqArgs.getAccess_control_policy(),(short)rqArgs.getOsd_selection_policy(),null,rq.getDetails().userId,rq.getDetails().groupIds.get(0),rqArgs.getDefault_striping_policy());
    rq.setResponse(new xtreemfs_mkvolResponse());
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
 finally {
    rpcResponse.freeBuffers();
  }
}
Program: 113705
Project: 113705
Buggy source:
private void processStep2(xtreemfs_rmvolRequest rqArgs,final String volumeId,final MRCRequest rq,final RPCResponse rpcResponse){
  try {
    rpcResponse.get();
    master.getVolumeManager().deleteVolume(volumeId,master,rq);
    rq.setResponse(new xtreemfs_rmvolResponse());
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
 finally {
    rpcResponse.freeBuffers();
  }
}

Fixed version (ground truth):
private void processStep2(xtreemfs_rmvolRequest rqArgs,final String volumeId,final MRCRequest rq,final RPCResponse rpcResponse){
  try {
    rpcResponse.get();
    master.getVolumeManager().deleteVolume(volumeId,master,rq);
    rq.setResponse(new xtreemfs_rmvolResponse());
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
 finally {
    rpcResponse.freeBuffers();
  }
}
Program: 113706
Project: 113706
Buggy source:
@Override public void startRequest(final MRCRequest rq){
  try {
    final xtreemfs_rmvolRequest rqArgs=(xtreemfs_rmvolRequest)rq.getRequestArgs();
    final VolumeInfo volume=master.getVolumeManager().getVolumeByName(rqArgs.getVolume_name());
    final StorageManager sMan=master.getVolumeManager().getStorageManager(volume.getId());
    FileMetadata file=sMan.getMetadata(0,volume.getName());
    master.getFileAccessManager().checkPrivilegedPermissions(sMan,file,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    RPCResponse response=master.getDirClient().xtreemfs_service_deregister(null,volume.getId());
    response.registerListener(new RPCResponseAvailableListener(){
      @Override public void responseAvailable(      RPCResponse r){
        processStep2(rqArgs,volume.getId(),rq,r);
      }
    }
);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(final MRCRequest rq){
  try {
    final xtreemfs_rmvolRequest rqArgs=(xtreemfs_rmvolRequest)rq.getRequestArgs();
    final VolumeInfo volume=master.getVolumeManager().getVolumeByName(rqArgs.getVolume_name());
    final StorageManager sMan=master.getVolumeManager().getStorageManager(volume.getId());
    FileMetadata file=sMan.getMetadata(0,volume.getName());
    master.getFileAccessManager().checkPrivilegedPermissions(sMan,file,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    RPCResponse response=master.getDirClient().xtreemfs_service_deregister(null,volume.getId());
    response.registerListener(new RPCResponseAvailableListener(){
      @Override public void responseAvailable(      RPCResponse r){
        processStep2(rqArgs,volume.getId(),rq,r);
      }
    }
);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113707
Project: 113707
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_dump_databaseRequest rqArgs=(xtreemfs_dump_databaseRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    BufferedWriter xmlWriter=new BufferedWriter(new FileWriter(rqArgs.getDump_file()));
    xmlWriter.write("String_Node_Str");
    xmlWriter.write("String_Node_Str" + VersionManagement.getMrcDataVersion() + "String_Node_Str");
    for (    VolumeInfo volume : vMan.getVolumes()) {
      xmlWriter.write("String_Node_Str" + volume.getId() + "String_Node_Str"+ volume.getName()+ "String_Node_Str"+ volume.getAcPolicyId()+ "String_Node_Str"+ volume.getOsdPolicyId()+ (volume.getOsdPolicyArgs() != null ? "String_Node_Str" + volume.getOsdPolicyArgs() : "String_Node_Str")+ "String_Node_Str");
      StorageManager sMan=vMan.getStorageManager(volume.getId());
      sMan.dumpDB(xmlWriter);
      xmlWriter.write("String_Node_Str");
    }
    xmlWriter.write("String_Node_Str");
    xmlWriter.close();
    rq.setResponse(new xtreemfs_dump_databaseResponse());
    finishRequest(rq);
  }
 catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_dump_databaseRequest rqArgs=(xtreemfs_dump_databaseRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    BufferedWriter xmlWriter=new BufferedWriter(new FileWriter(rqArgs.getDump_file()));
    xmlWriter.write("String_Node_Str");
    xmlWriter.write("String_Node_Str" + VersionManagement.getMrcDataVersion() + "String_Node_Str");
    for (    VolumeInfo volume : vMan.getVolumes()) {
      xmlWriter.write("String_Node_Str" + volume.getId() + "String_Node_Str"+ volume.getName()+ "String_Node_Str"+ volume.getAcPolicyId()+ "String_Node_Str"+ volume.getOsdPolicyId()+ (volume.getOsdPolicyArgs() != null ? "String_Node_Str" + volume.getOsdPolicyArgs() : "String_Node_Str")+ "String_Node_Str");
      StorageManager sMan=vMan.getStorageManager(volume.getId());
      sMan.dumpDB(xmlWriter);
      xmlWriter.write("String_Node_Str");
    }
    xmlWriter.write("String_Node_Str");
    xmlWriter.close();
    rq.setResponse(new xtreemfs_dump_databaseResponse());
    finishRequest(rq);
  }
 catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113708
Project: 113708
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    Collection<VolumeInfo> volumes=master.getVolumeManager().getVolumes();
    Map<String,String> map=new HashMap<String,String>();
    for (    VolumeInfo data : volumes)     map.put(data.getId(),data.getName());
    finishRequest(rq);
  }
 catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    Collection<VolumeInfo> volumes=master.getVolumeManager().getVolumes();
    Map<String,String> map=new HashMap<String,String>();
    for (    VolumeInfo data : volumes)     map.put(data.getId(),data.getName());
    finishRequest(rq);
  }
 catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113709
Project: 113709
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_get_suitable_osdsRequest rqArgs=(xtreemfs_get_suitable_osdsRequest)rq.getRequestArgs();
    String volumeId=null;
    try {
      String globalFileId=rqArgs.getFile_id();
      int i=globalFileId.indexOf(':');
      volumeId=globalFileId.substring(0,i);
    }
 catch (    Exception exc) {
      throw new UserException("String_Node_Str" + rqArgs.getFile_id() + "String_Node_Str");
    }
    ServiceSet usableOSDs=master.getOSDStatusManager().getUsableOSDs(volumeId);
    StringSet uuids=new StringSet();
    for (int i=0; i < usableOSDs.calculateSize(); i++)     uuids.add(usableOSDs.get(i).getUuid());
    rq.setResponse(new xtreemfs_get_suitable_osdsResponse(uuids));
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_get_suitable_osdsRequest rqArgs=(xtreemfs_get_suitable_osdsRequest)rq.getRequestArgs();
    String volumeId=null;
    try {
      String globalFileId=rqArgs.getFile_id();
      int i=globalFileId.indexOf(':');
      volumeId=globalFileId.substring(0,i);
    }
 catch (    Exception exc) {
      throw new UserException("String_Node_Str" + rqArgs.getFile_id() + "String_Node_Str");
    }
    ServiceSet usableOSDs=master.getOSDStatusManager().getUsableOSDs(volumeId);
    StringSet uuids=new StringSet();
    for (int i=0; i < usableOSDs.calculateSize(); i++)     uuids.add(usableOSDs.get(i).getUuid());
    rq.setResponse(new xtreemfs_get_suitable_osdsResponse(uuids));
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113717
Project: 113717
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_renew_capabilityRequest rqArgs=(xtreemfs_renew_capabilityRequest)rq.getRequestArgs();
    Capability cap=new Capability(rqArgs.getOld_xcap(),master.getConfig().getCapabilitySecret());
    if (!cap.hasValidSignature())     throw new UserException(cap + "String_Node_Str");
    if (cap.hasExpired())     throw new UserException(cap + "String_Node_Str");
    Capability newCap=new Capability(cap.getFileId(),cap.getAccessMode(),TimeSync.getGlobalTime() / 1000 + Capability.DEFAULT_VALIDITY,cap.getClientIdentity(),cap.getEpochNo(),master.getConfig().getCapabilitySecret());
    rq.setResponse(new xtreemfs_renew_capabilityResponse(newCap.getXCap()));
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_renew_capabilityRequest rqArgs=(xtreemfs_renew_capabilityRequest)rq.getRequestArgs();
    Capability cap=new Capability(rqArgs.getOld_xcap(),master.getConfig().getCapabilitySecret());
    if (!cap.hasValidSignature())     throw new UserException(cap + "String_Node_Str");
    if (cap.hasExpired())     throw new UserException(cap + "String_Node_Str");
    Capability newCap=new Capability(cap.getFileId(),cap.getAccessMode(),TimeSync.getGlobalTime() / 1000 + Capability.DEFAULT_VALIDITY,cap.getClientIdentity(),cap.getEpochNo(),master.getConfig().getCapabilitySecret());
    rq.setResponse(new xtreemfs_renew_capabilityResponse(newCap.getXCap()));
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113722
Project: 113722
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    final statfsRequest rqArgs=(statfsRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    final VolumeInfo volume=vMan.getVolumeByName(rqArgs.getVolume_name());
    long blocks=master.getOSDStatusManager().getFreeSpace(volume.getId()) / 1024L;
    statfs_ statfs=new statfs_(1024,blocks,volume.getId(),1024);
    rq.setResponse(new statfsResponse(statfs));
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    final statfsRequest rqArgs=(statfsRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    final VolumeInfo volume=vMan.getVolumeByName(rqArgs.getVolume_name());
    long blocks=master.getOSDStatusManager().getFreeSpace(volume.getId()) / 1024L;
    statfs_ statfs=new statfs_(1024,blocks,volume.getId(),1024);
    rq.setResponse(new statfsResponse(statfs));
    finishRequest(rq);
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}
Program: 113726
Project: 113726
Buggy source:
public Long getObjectChecksum(long objId){
  Long c=objChecksums.get(objId);
  return (c == null) ? -1 : c;
}

Fixed version (ground truth):
public Long getObjectChecksum(long objId){
  Long c=objChecksums.get(objId);
  return (c == null) ? 0 : c;
}
Program: 113727
Project: 113727
Buggy source:
/** 
 * Returns checksum value (as Hex-String) and resets the Algorithm.
 * @return checksum
 */
public String getValue();

Fixed version (ground truth):
/** 
 * Returns checksum value (as Hex-String) and resets the Algorithm.
 * @return checksum
 */
public long getValue();
Program: 113728
Project: 113728
Buggy source:
@Override public String getValue(){
  String value=Long.toHexString(realAlgorithm.getValue());
  realAlgorithm.reset();
  return value;
}

Fixed version (ground truth):
@Override public long getValue(){
  final long tmp=realAlgorithm.getValue();
  realAlgorithm.reset();
  return tmp;
}
Program: 113729
Project: 113729
Buggy source:
@Override public String getValue(){
  String value;
  if (this.hash != null)   value=this.hash;
 else   value="String_Node_Str";
  reset();
  return value;
}

Fixed version (ground truth):
@Override public long getValue(){
  long value;
  if (this.hash != null)   value=this.hash;
 else   value=0;
  reset();
  return value;
}
Program: 113730
Project: 113730
Buggy source:
/** 
 * Updates checksum with specified data.
 * @param data
 */
public void digest(String data){
  this.hash=Integer.toHexString(data.hashCode());
}

Fixed version (ground truth):
/** 
 * Updates checksum with specified data.
 * @param data
 */
public void digest(String data){
  this.hash=Long.valueOf(data.hashCode());
}
Program: 113731
Project: 113731
Buggy source:
@Override public void update(ByteBuffer data){
  byte[] array;
  if (data.hasArray()) {
    array=data.array();
  }
 else {
    array=new byte[data.capacity()];
    final int oldPos=data.position();
    data.position(0);
    data.get(array);
    data.position(oldPos);
  }
  this.hash=Integer.toHexString(new String(array).hashCode());
}

Fixed version (ground truth):
@Override public void update(ByteBuffer data){
  byte[] array;
  if (data.hasArray()) {
    array=data.array();
  }
 else {
    array=new byte[data.capacity()];
    final int oldPos=data.position();
    data.position(0);
    data.get(array);
    data.position(oldPos);
  }
  this.hash=(long)new String(array).hashCode();
}
Program: 113732
Project: 113732
Buggy source:
@Override public String getValue(){
  String value;
  if (this.hash != null)   value=this.hash;
 else   value="String_Node_Str";
  reset();
  return value;
}

Fixed version (ground truth):
@Override public long getValue(){
  long value;
  if (this.hash != null)   value=this.hash;
 else   value=0;
  reset();
  return value;
}
Program: 113733
Project: 113733
Buggy source:
/** 
 * SDBM algorithm
 * @param str
 * @return
 */
protected static String sdbmHash(String str){
  long hash=0;
  for (  int c : str.toCharArray()) {
    hash=c + (hash << 6) + (hash << 16) - hash;
  }
  return Long.toHexString(hash);
}

Fixed version (ground truth):
/** 
 * SDBM algorithm
 * @param str
 * @return
 */
protected static long sdbmHash(String str){
  long hash=0;
  for (  int c : str.toCharArray()) {
    hash=c + (hash << 6) + (hash << 16) - hash;
  }
  return hash;
}
Program: 113736
Project: 113736
Buggy source:
@Override public void startRequest(final OSDRequest rq){
  final readRequest args=(readRequest)rq.getRequestArgs();
  if (args.getObject_number() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (args.getOffset() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (args.getLength() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  master.getStorageStage().readObject(args.getFile_id(),args.getObject_number(),rq.getLocationList().getLocalReplica().getStripingPolicy(),rq,new ReadObjectCallback(){
    @Override public void readComplete(    ObjectInformation result,    Exception error){
      step2(rq,args,result,error);
    }
  }
);
}

Fixed version (ground truth):
@Override public void startRequest(final OSDRequest rq){
  final readRequest args=(readRequest)rq.getRequestArgs();
  System.out.println("String_Node_Str" + args);
  if (args.getObject_number() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (args.getOffset() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (args.getLength() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  final StripingPolicyImpl sp=rq.getLocationList().getLocalReplica().getStripingPolicy();
  if (args.getLength() + args.getOffset() > sp.getStripeSizeForObject(0)) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str" + sp.getStripeSizeForObject(0) + "String_Node_Str","String_Node_Str"));
    return;
  }
  master.getStorageStage().readObject(args.getFile_id(),args.getObject_number(),sp,rq,new ReadObjectCallback(){
    @Override public void readComplete(    ObjectInformation result,    Exception error){
      step2(rq,args,result,error);
    }
  }
);
}
Program: 113737
Project: 113737
Buggy source:
private void readFinish(OSDRequest rq,readRequest args,ObjectInformation result,boolean isLastObjectOrEOF){
  final boolean isRangeRequested=(args.getOffset() > 0) || (args.getLength() < result.getStripeSize());
  ObjectData data;
  if (isRangeRequested) {
    data=result.getObjectData(isLastObjectOrEOF,args.getOffset(),args.getLength());
  }
 else {
    data=result.getObjectData(isLastObjectOrEOF);
  }
  master.objectSent();
  if (data.getData() != null)   master.dataSent(data.getData().capacity());
  sendResponse(rq,data);
}

Fixed version (ground truth):
private void readFinish(OSDRequest rq,readRequest args,ObjectInformation result,boolean isLastObjectOrEOF){
  final boolean isRangeRequested=(args.getOffset() > 0) || (args.getLength() < result.getStripeSize());
  ObjectData data;
  if (isRangeRequested) {
    data=result.getObjectData(isLastObjectOrEOF,args.getOffset(),args.getLength());
  }
 else {
    data=result.getObjectData(isLastObjectOrEOF);
  }
  master.objectSent();
  if (data.getData() != null)   master.dataSent(data.getData().capacity());
  System.out.println("String_Node_Str" + data);
  sendResponse(rq,data);
}
Program: 113738
Project: 113738
Buggy source:
@Override public void startRequest(final OSDRequest rq){
  final truncateRequest args=(truncateRequest)rq.getRequestArgs();
  if (args.getNew_file_size() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (!rq.getLocationList().getLocalReplica().isHeadOsd(localUUID)) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  master.getStorageStage().truncate(args.getFile_id(),args.getNew_file_size(),rq.getLocationList().getLocalReplica().getStripingPolicy(),rq.getLocationList().getLocalReplica(),rq.getCapability().getEpochNo(),rq,new TruncateCallback(){
    @Override public void truncateComplete(    OSDWriteResponse result,    Exception error){
      step2(rq,args,result,error);
    }
  }
);
}

Fixed version (ground truth):
@Override public void startRequest(final OSDRequest rq){
  final truncateRequest args=(truncateRequest)rq.getRequestArgs();
  System.out.println("String_Node_Str" + args);
  if (args.getNew_file_size() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (!rq.getLocationList().getLocalReplica().isHeadOsd(localUUID)) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  master.getStorageStage().truncate(args.getFile_id(),args.getNew_file_size(),rq.getLocationList().getLocalReplica().getStripingPolicy(),rq.getLocationList().getLocalReplica(),rq.getCapability().getEpochNo(),rq,new TruncateCallback(){
    @Override public void truncateComplete(    OSDWriteResponse result,    Exception error){
      step2(rq,args,result,error);
    }
  }
);
}
Program: 113739
Project: 113739
Buggy source:
@Override public void startRequest(final OSDRequest rq){
  final writeRequest args=(writeRequest)rq.getRequestArgs();
  if (args.getObject_number() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (args.getOffset() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  final StripingPolicyImpl sp=rq.getLocationList().getLocalReplica().getStripingPolicy();
  if (args.getOffset() >= sp.getStripeSizeForObject(args.getObject_number())) {
    rq.sendOSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str");
    return;
  }
  master.objectReceived();
  master.dataReceived(args.getObject_data().getData().capacity());
  master.getStorageStage().writeObject(args.getFile_id(),args.getObject_number(),sp,args.getOffset(),args.getObject_data().getData(),rq.getCowPolicy(),rq.getLocationList(),rq,new WriteObjectCallback(){
    @Override public void writeComplete(    OSDWriteResponse result,    Exception error){
      step2(rq,result,error);
    }
  }
);
}

Fixed version (ground truth):
@Override public void startRequest(final OSDRequest rq){
  final writeRequest args=(writeRequest)rq.getRequestArgs();
  System.out.println("String_Node_Str" + args);
  if (args.getObject_number() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  if (args.getOffset() < 0) {
    rq.sendException(new OSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str","String_Node_Str"));
    return;
  }
  final StripingPolicyImpl sp=rq.getLocationList().getLocalReplica().getStripingPolicy();
  if (args.getOffset() >= sp.getStripeSizeForObject(args.getObject_number())) {
    rq.sendOSDException(ErrorCodes.INVALID_PARAMS,"String_Node_Str");
    return;
  }
  master.objectReceived();
  master.dataReceived(args.getObject_data().getData().capacity());
  master.getStorageStage().writeObject(args.getFile_id(),args.getObject_number(),sp,args.getOffset(),args.getObject_data().getData(),rq.getCowPolicy(),rq.getLocationList(),rq,new WriteObjectCallback(){
    @Override public void writeComplete(    OSDWriteResponse result,    Exception error){
      step2(rq,result,error);
    }
  }
);
}
Program: 113740
Project: 113740
Buggy source:
public void sendResponse(OSDRequest rq,OSDWriteResponse result){
  writeResponse response=new writeResponse(result);
  rq.sendSuccess(response);
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str");
}

Fixed version (ground truth):
public void sendResponse(OSDRequest rq,OSDWriteResponse result){
  System.out.println("String_Node_Str" + result);
  writeResponse response=new writeResponse(result);
  rq.sendSuccess(response);
}
Program: 113741
Project: 113741
Buggy source:
public static void main(String[] args){
  try {
    Map<String,CliOption> options=new HashMap<String,CliOption>();
    List<String> arguments=new ArrayList<String>(1);
    CLIParser.parseCLI(args,options,arguments);
    if (arguments.size() != 2) {
      return;
    }
    TimeSync.initialize(null,60 * 1000,50);
    Logging.start(Logging.LEVEL_WARN);
    ONCRPCServiceURL mrcUrl=new ONCRPCServiceURL(arguments.get(0));
    String path=arguments.get(1);
    RPCNIOSocketClient rpcClient=new RPCNIOSocketClient(null,15 * 1000,5 * 60 * 1000);
    rpcClient.start();
    rpcClient.waitForStartup();
    MRCClient c=new MRCClient(rpcClient,new InetSocketAddress(mrcUrl.getHost(),mrcUrl.getPort()));
    final String user="String_Node_Str";
    final List<String> groups=new ArrayList(1);
    groups.add("String_Node_Str");
    RPCResponse<DirectoryEntrySet> r=c.readdir(null,user,groups,path);
    DirectoryEntrySet entries=r.get();
    r.freeBuffers();
    for (    DirectoryEntry e : entries) {
      System.out.println(e.getEntry_name() + "String_Node_Str" + e.getStbuf().getMode());
    }
    rpcClient.shutdown();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    Map<String,CliOption> options=new HashMap<String,CliOption>();
    List<String> arguments=new ArrayList<String>(1);
    CLIParser.parseCLI(args,options,arguments);
    if (arguments.size() != 2) {
      return;
    }
    TimeSync.initialize(null,60 * 1000,50);
    Logging.start(Logging.LEVEL_WARN);
    ONCRPCServiceURL mrcUrl=new ONCRPCServiceURL(arguments.get(0));
    String path=arguments.get(1);
    RPCNIOSocketClient rpcClient=new RPCNIOSocketClient(null,15 * 1000,5 * 60 * 1000);
    rpcClient.start();
    rpcClient.waitForStartup();
    MRCClient c=new MRCClient(rpcClient,new InetSocketAddress(mrcUrl.getHost(),mrcUrl.getPort()));
    final String user="String_Node_Str";
    final List<String> groups=new ArrayList(1);
    groups.add("String_Node_Str");
    RPCResponse<DirectoryEntrySet> r=c.readdir(null,user,groups,path);
    DirectoryEntrySet entries=r.get();
    r.freeBuffers();
    for (    DirectoryEntry e : entries) {
      System.out.println(e.getEntry_name() + "String_Node_Str" + e.getStbuf().getMode()+ "String_Node_Str"+ OutputUtils.formatBytes(e.getStbuf().getSize())+ "String_Node_Str"+ e.getStbuf().getAttributes());
    }
    rpcClient.shutdown();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  }
}
Program: 113744
Project: 113744
Buggy source:
public void read() throws IOException {
  this.debugLevel=this.readRequiredInt("String_Node_Str");
  this.port=this.readRequiredInt("String_Node_Str");
  this.httpPort=this.readRequiredInt("String_Node_Str");
  this.address=this.readOptionalInetAddr("String_Node_Str",null);
  if (this.useSSL=this.readRequiredBoolean("String_Node_Str")) {
    this.serviceCredsFile=this.readRequiredString("String_Node_Str");
    this.serviceCredsPassphrase=this.readRequiredString("String_Node_Str");
    this.serviceCredsContainer=this.readRequiredString("String_Node_Str");
    this.trustedCertsFile=this.readRequiredString("String_Node_Str");
    this.trustedCertsPassphrase=this.readRequiredString("String_Node_Str");
    this.trustedCertsContainer=this.readRequiredString("String_Node_Str");
  }
  this.geoCoordinates=this.readOptionalString("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void read() throws IOException {
  this.debugLevel=this.readRequiredInt("String_Node_Str");
  this.port=this.readRequiredInt("String_Node_Str");
  this.httpPort=this.readRequiredInt("String_Node_Str");
  this.address=this.readOptionalInetAddr("String_Node_Str",null);
  if (this.useSSL=this.readRequiredBoolean("String_Node_Str")) {
    this.serviceCredsFile=this.readRequiredString("String_Node_Str");
    this.serviceCredsPassphrase=this.readRequiredString("String_Node_Str");
    this.serviceCredsContainer=this.readRequiredString("String_Node_Str");
    this.trustedCertsFile=this.readRequiredString("String_Node_Str");
    this.trustedCertsPassphrase=this.readRequiredString("String_Node_Str");
    this.trustedCertsContainer=this.readRequiredString("String_Node_Str");
  }
  this.geoCoordinates=this.readOptionalString("String_Node_Str","String_Node_Str");
  this.adminPassword=this.readOptionalString("String_Node_Str","String_Node_Str");
}
Program: 113745
Project: 113745
Buggy source:
private void registerOperations(){
  DIROperation op;
  op=new GetGlobalTimeOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetAddressMappingOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new SetAddressMappingOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new DeleteAddressMappingOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new RegisterServiceOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new DeregisterServiceOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetServiceByUuidOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetServicesByTypeOperation(this);
  registry.put(op.getProcedureId(),op);
}

Fixed version (ground truth):
private void registerOperations(){
  DIROperation op;
  op=new GetGlobalTimeOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetAddressMappingOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new SetAddressMappingOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new DeleteAddressMappingOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new RegisterServiceOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new DeregisterServiceOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetServiceByUuidOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetServicesByTypeOperation(this);
  registry.put(op.getProcedureId(),op);
  op=new GetServiceByNameOperation(this);
  registry.put(op.getProcedureId(),op);
}
Program: 113746
Project: 113746
Buggy source:
public DIRRequestDispatcher(final DIRConfig config) throws IOException, BabuDBException {
  super("String_Node_Str");
  registry=new HashMap();
  database=BabuDBFactory.getBabuDB(config.getDbDir(),config.getDbDir(),0,1024 * 1024 * 16,60 * 5,SyncMode.FSYNC,200,500);
  initializeDatabase();
  registerOperations();
  SSLOptions sslOptions=null;
  if (config.isUsingSSL()) {
    sslOptions=new SSLOptions(new FileInputStream(config.getServiceCredsFile()),config.getServiceCredsPassphrase(),config.getServiceCredsContainer(),new FileInputStream(config.getTrustedCertsFile()),config.getTrustedCertsPassphrase(),config.getTrustedCertsContainer(),false);
  }
  queue=new LinkedBlockingQueue();
  quit=false;
  server=new RPCNIOSocketServer(config.getPort(),null,this,sslOptions);
  httpServ=HttpServer.create(new InetSocketAddress("String_Node_Str",config.getHttpPort()),0);
  httpServ.createContext("String_Node_Str",new HttpHandler(){
    public void handle(    HttpExchange httpExchange) throws IOException {
      byte[] content;
      try {
        content=StatusPage.getStatusPage(DIRRequestDispatcher.this,config).getBytes("String_Node_Str");
        httpExchange.sendResponseHeaders(200,content.length);
        httpExchange.getResponseBody().write(content);
        httpExchange.getResponseBody().close();
      }
 catch (      BabuDBException ex) {
        ex.printStackTrace();
        httpExchange.sendResponseHeaders(500,0);
      }
    }
  }
);
  httpServ.start();
  numRequests=0;
}

Fixed version (ground truth):
public DIRRequestDispatcher(final DIRConfig config) throws IOException, BabuDBException {
  super("String_Node_Str");
  registry=new HashMap();
  database=BabuDBFactory.getBabuDB(config.getDbDir(),config.getDbDir(),0,1024 * 1024 * 16,60 * 5,SyncMode.FSYNC,200,500);
  initializeDatabase();
  registerOperations();
  SSLOptions sslOptions=null;
  if (config.isUsingSSL()) {
    sslOptions=new SSLOptions(new FileInputStream(config.getServiceCredsFile()),config.getServiceCredsPassphrase(),config.getServiceCredsContainer(),new FileInputStream(config.getTrustedCertsFile()),config.getTrustedCertsPassphrase(),config.getTrustedCertsContainer(),false);
  }
  queue=new LinkedBlockingQueue();
  quit=false;
  server=new RPCNIOSocketServer(config.getPort(),null,this,sslOptions);
  httpServ=HttpServer.create(new InetSocketAddress(config.getHttpPort()),0);
  httpServ.createContext("String_Node_Str",new HttpHandler(){
    public void handle(    HttpExchange httpExchange) throws IOException {
      byte[] content;
      try {
        content=StatusPage.getStatusPage(DIRRequestDispatcher.this,config).getBytes("String_Node_Str");
        httpExchange.sendResponseHeaders(200,content.length);
        httpExchange.getResponseBody().write(content);
        httpExchange.getResponseBody().close();
      }
 catch (      BabuDBException ex) {
        ex.printStackTrace();
        httpExchange.sendResponseHeaders(500,0);
      }
    }
  }
);
  httpServ.start();
  numRequests=0;
}
Program: 113747
Project: 113747
Buggy source:
public void processRequest(ONCRPCRequest rq){
  final ONCRPCRequestHeader hdr=rq.getRequestHeader();
  if (hdr.getInterfaceVersion() != DIRInterface.getVersion()) {
    rq.sendProtocolException(new ProtocolException(ONCRPCResponseHeader.ACCEPT_STAT_PROG_MISMATCH,0,"String_Node_Str"));
    return;
  }
  DIROperation op=registry.get(hdr.getOperationNumber());
  if (op == null) {
    rq.sendProtocolException(new ProtocolException(ONCRPCResponseHeader.ACCEPT_STAT_PROC_UNAVAIL,0,"String_Node_Str"));
    return;
  }
  DIRRequest dirRq=new DIRRequest(rq);
  try {
    op.parseRPCMessage(dirRq);
  }
 catch (  Throwable ex) {
    ex.printStackTrace();
    rq.sendGarbageArgs(ex.toString());
    return;
  }
  try {
    numRequests++;
    op.startRequest(dirRq);
  }
 catch (  Throwable ex) {
    ex.printStackTrace();
    rq.sendInternalServerError(ex);
    return;
  }
}

Fixed version (ground truth):
public void processRequest(ONCRPCRequest rq){
  final ONCRPCRequestHeader hdr=rq.getRequestHeader();
  if (hdr.getInterfaceVersion() != DIRInterface.getVersion()) {
    rq.sendProtocolException(new ProtocolException(ONCRPCResponseHeader.ACCEPT_STAT_PROG_MISMATCH,ErrNo.EINVAL,"String_Node_Str"));
    return;
  }
  DIROperation op=registry.get(hdr.getOperationNumber());
  if (op == null) {
    rq.sendProtocolException(new ProtocolException(ONCRPCResponseHeader.ACCEPT_STAT_PROC_UNAVAIL,ErrNo.EINVAL,"String_Node_Str"));
    return;
  }
  DIRRequest dirRq=new DIRRequest(rq);
  try {
    op.parseRPCMessage(dirRq);
  }
 catch (  Throwable ex) {
    ex.printStackTrace();
    rq.sendGarbageArgs(ex.toString());
    return;
  }
  try {
    numRequests++;
    op.startRequest(dirRq);
  }
 catch (  Throwable ex) {
    ex.printStackTrace();
    rq.sendInternalServerError(ex);
    return;
  }
}
Program: 113749
Project: 113749
Buggy source:
@Override public void startRequest(DIRRequest rq){
  try {
    final address_mappings_getRequest request=(address_mappings_getRequest)rq.getRequestMessage();
    byte[] result=database.directLookup(DIRRequestDispatcher.DB_NAME,DIRRequestDispatcher.INDEX_ID_ADDRMAPS,request.getUuid().getBytes());
    if (result == null) {
      address_mappings_getResponse response=new address_mappings_getResponse();
      rq.sendSuccess(response);
    }
 else {
      AddressMappingSet set=new AddressMappingSet();
      set.deserialize(ReusableBuffer.wrap(result));
      address_mappings_getResponse response=new address_mappings_getResponse(set);
      rq.sendSuccess(response);
    }
  }
 catch (  BabuDBException ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,ex);
    rq.sendInternalServerError(ex);
  }
}

Fixed version (ground truth):
@Override public void startRequest(DIRRequest rq){
  try {
    final address_mappings_getRequest request=(address_mappings_getRequest)rq.getRequestMessage();
    if (request.getUuid().length() > 0) {
      byte[] result=database.directLookup(DIRRequestDispatcher.DB_NAME,DIRRequestDispatcher.INDEX_ID_ADDRMAPS,request.getUuid().getBytes());
      if (result == null) {
        address_mappings_getResponse response=new address_mappings_getResponse();
        rq.sendSuccess(response);
      }
 else {
        AddressMappingSet set=new AddressMappingSet();
        set.deserialize(ReusableBuffer.wrap(result));
        address_mappings_getResponse response=new address_mappings_getResponse(set);
        rq.sendSuccess(response);
      }
    }
 else {
      AddressMappingSet list=new AddressMappingSet();
      Iterator<Entry<byte[],byte[]>> iter=database.directPrefixLookup(DIRRequestDispatcher.DB_NAME,DIRRequestDispatcher.INDEX_ID_ADDRMAPS,new byte[0]);
      while (iter.hasNext()) {
        Entry<byte[],byte[]> e=iter.next();
        AddressMappingSet set=new AddressMappingSet();
        set.deserialize(ReusableBuffer.wrap(e.getValue()));
        for (        AddressMapping m : set)         list.add(m);
      }
      address_mappings_getResponse response=new address_mappings_getResponse(list);
      rq.sendSuccess(response);
    }
  }
 catch (  BabuDBException ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,ex);
    rq.sendInternalServerError(ex);
  }
}
Program: 113750
Project: 113750
Buggy source:
@Override public void startRequest(DIRRequest rq){
  try {
    final service_get_by_typeRequest request=(service_get_by_typeRequest)rq.getRequestMessage();
    Iterator<Entry<byte[],byte[]>> iter=database.directPrefixLookup(DIRRequestDispatcher.DB_NAME,DIRRequestDispatcher.INDEX_ID_SERVREG,new byte[0]);
    ServiceRegistrySet services=new ServiceRegistrySet();
    while (iter.hasNext()) {
      final Entry<byte[],byte[]> e=iter.next();
      final ServiceRegistry servEntry=new ServiceRegistry();
      ReusableBuffer buf=ReusableBuffer.wrap(e.getValue());
      servEntry.deserialize(buf);
      if (servEntry.getService_type() == request.getType())       services.add(servEntry);
    }
    service_get_by_typeResponse response=new service_get_by_typeResponse(services);
    Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + response);
    rq.sendSuccess(response);
  }
 catch (  BabuDBException ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,ex);
    rq.sendInternalServerError(ex);
  }
}

Fixed version (ground truth):
@Override public void startRequest(DIRRequest rq){
  try {
    final service_get_by_typeRequest request=(service_get_by_typeRequest)rq.getRequestMessage();
    Iterator<Entry<byte[],byte[]>> iter=database.directPrefixLookup(DIRRequestDispatcher.DB_NAME,DIRRequestDispatcher.INDEX_ID_SERVREG,new byte[0]);
    ServiceRegistrySet services=new ServiceRegistrySet();
    long now=System.currentTimeMillis() / 1000l;
    while (iter.hasNext()) {
      final Entry<byte[],byte[]> e=iter.next();
      final ServiceRegistry servEntry=new ServiceRegistry();
      ReusableBuffer buf=ReusableBuffer.wrap(e.getValue());
      servEntry.deserialize(buf);
      if ((request.getType() == 0) || (servEntry.getService_type() == request.getType()))       services.add(servEntry);
      long secondsSinceLastUpdate=now - servEntry.getLast_updated();
      servEntry.getData().put("String_Node_Str",Long.toString(secondsSinceLastUpdate));
    }
    service_get_by_typeResponse response=new service_get_by_typeResponse(services);
    Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + response);
    rq.sendSuccess(response);
  }
 catch (  BabuDBException ex) {
    Logging.logMessage(Logging.LEVEL_ERROR,this,ex);
    rq.sendInternalServerError(ex);
  }
}