nus-yam/ex-repair huggingface dataset:
Program: 89668
Project: 89668
Buggy source:
@Override public void reserve(NicProfile nic,Network network,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException {
  if (nic.getIp4Address() == null) {
    getIp(nic,dest.getDataCenter(),vm,network);
  }
}

Fixed version (ground truth):
@Override public void reserve(NicProfile nic,Network network,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException {
  if (nic.getIp4Address() == null) {
    getIp(nic,dest.getDataCenter(),vm,network);
    nic.setStrategy(ReservationStrategy.Create);
  }
}
Program: 89672
Project: 89672
Buggy source:
private UsageEventVO convertSnapshotEvent(EventVO event,Connection conn) throws IOException, SQLException {
  Properties snapEventParams=new Properties();
  long snapId=-1L;
  long snapSize=-1L;
  Long zoneId=null;
  UsageEventVO usageEvent=null;
  snapEventParams.load(new StringReader(event.getParameters()));
  snapId=Long.parseLong(snapEventParams.getProperty("String_Node_Str"));
  String snapshotName=snapEventParams.getProperty("String_Node_Str");
  String size=snapEventParams.getProperty("String_Node_Str");
  if (size != null) {
    snapSize=Long.parseLong(size);
  }
  String zoneString=snapEventParams.getProperty("String_Node_Str");
  if (zoneString != null) {
    zoneId=Long.parseLong(zoneString);
  }
  Long accountId=event.getAccountId();
  if (accountId.longValue() == 0L || zoneId == null) {
    PreparedStatement pstmt=conn.prepareStatement("String_Node_Str");
    pstmt.setLong(1,snapId);
    s_logger.debug("String_Node_Str" + pstmt);
    ResultSet rs=pstmt.executeQuery();
    if (rs.next()) {
      zoneId=rs.getLong(1);
      accountId=rs.getLong(2);
    }
    rs.close();
    pstmt.close();
  }
  if (EventTypes.EVENT_SNAPSHOT_CREATE.equals(event.getType())) {
    usageEvent=new UsageEventVO(EventTypes.EVENT_SNAPSHOT_CREATE,accountId,zoneId,snapId,snapshotName,null,null,snapSize);
  }
 else   if (EventTypes.EVENT_SNAPSHOT_DELETE.equals(event.getType())) {
    usageEvent=new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE,accountId,zoneId,snapId,snapshotName,null,null,0L);
  }
  return usageEvent;
}

Fixed version (ground truth):
private UsageEventVO convertSnapshotEvent(EventVO event,Connection conn) throws IOException, SQLException {
  Properties snapEventParams=new Properties();
  long snapId=-1L;
  long snapSize=-1L;
  Long zoneId=0L;
  UsageEventVO usageEvent=null;
  snapEventParams.load(new StringReader(event.getParameters()));
  snapId=Long.parseLong(snapEventParams.getProperty("String_Node_Str"));
  String snapshotName=snapEventParams.getProperty("String_Node_Str");
  String size=snapEventParams.getProperty("String_Node_Str");
  if (size != null) {
    snapSize=Long.parseLong(size);
  }
  String zoneString=snapEventParams.getProperty("String_Node_Str");
  if (zoneString != null) {
    zoneId=Long.parseLong(zoneString);
  }
  Long accountId=event.getAccountId();
  if (accountId.longValue() == 0L || zoneId.longValue() == 0L) {
    PreparedStatement pstmt=conn.prepareStatement("String_Node_Str");
    pstmt.setLong(1,snapId);
    s_logger.debug("String_Node_Str" + pstmt);
    ResultSet rs=pstmt.executeQuery();
    if (rs.next()) {
      zoneId=rs.getLong(1);
      accountId=rs.getLong(2);
    }
    rs.close();
    pstmt.close();
  }
  if (EventTypes.EVENT_SNAPSHOT_CREATE.equals(event.getType())) {
    usageEvent=new UsageEventVO(EventTypes.EVENT_SNAPSHOT_CREATE,accountId,zoneId,snapId,snapshotName,null,null,snapSize);
  }
 else   if (EventTypes.EVENT_SNAPSHOT_DELETE.equals(event.getType())) {
    usageEvent=new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE,accountId,zoneId,snapId,snapshotName,null,null,0L);
  }
  return usageEvent;
}
Program: 89674
Project: 89674
Buggy source:
public DatabaseUpgradeChecker(){
  _dao=ComponentLocator.inject(VersionDaoImpl.class);
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade217to218(),new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade221to222(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade222to224()});
}

Fixed version (ground truth):
public DatabaseUpgradeChecker(){
  _dao=ComponentLocator.inject(VersionDaoImpl.class);
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade217to218(),new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to224(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to224(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to224(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade221to222(),new UpgradeSnapshot223to224(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new UpgradeSnapshot223to224(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new UpgradeSnapshot223to224(),new Upgrade222to224()});
}
Program: 89675
Project: 89675
Buggy source:
@Override public Pair<AfterScanAction,Object> scanPool(Long pool){
  long dataCenterId=pool.longValue();
  ConsoleProxyLoadInfo proxyInfo=this._zoneProxyCountMap.get(dataCenterId);
  if (proxyInfo == null)   return new Pair<AfterScanAction,Object>(AfterScanAction.nop,null);
  ConsoleProxyLoadInfo vmInfo=this._zoneVmCountMap.get(dataCenterId);
  if (vmInfo == null)   vmInfo=new ConsoleProxyLoadInfo();
  if (!checkCapacity(proxyInfo,vmInfo)) {
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + proxyInfo.getName());
    return new Pair<AfterScanAction,Object>(AfterScanAction.expand,null);
  }
  return new Pair<AfterScanAction,Object>(AfterScanAction.nop,null);
}

Fixed version (ground truth):
@Override public Pair<AfterScanAction,Object> scanPool(Long pool){
  long dataCenterId=pool.longValue();
  ConsoleProxyLoadInfo proxyInfo=this._zoneProxyCountMap.get(dataCenterId);
  if (proxyInfo == null) {
    return new Pair<AfterScanAction,Object>(AfterScanAction.nop,null);
  }
  ConsoleProxyLoadInfo vmInfo=this._zoneVmCountMap.get(dataCenterId);
  if (vmInfo == null) {
    vmInfo=new ConsoleProxyLoadInfo();
  }
  if (!checkCapacity(proxyInfo,vmInfo)) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + proxyInfo.getName());
    }
    return new Pair<AfterScanAction,Object>(AfterScanAction.expand,null);
  }
  return new Pair<AfterScanAction,Object>(AfterScanAction.nop,null);
}
Program: 89676
Project: 89676
Buggy source:
@Override public boolean isPoolReadyForScan(Long pool){
  long dataCenterId=pool.longValue();
  if (!isZoneReady(_zoneHostInfoMap,dataCenterId)) {
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + dataCenterId + "String_Node_Str");
    return false;
  }
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + dataCenterId + "String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean isPoolReadyForScan(Long pool){
  long dataCenterId=pool.longValue();
  if (!isZoneReady(_zoneHostInfoMap,dataCenterId)) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + dataCenterId + "String_Node_Str");
    }
    return false;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + dataCenterId + "String_Node_Str");
  }
  return true;
}
Program: 89677
Project: 89677
Buggy source:
private boolean reserveStandbyCapacity(){
  ConsoleProxyManagementState state=getManagementState();
  if (state == null || state != ConsoleProxyManagementState.Auto)   return false;
  return true;
}

Fixed version (ground truth):
private boolean reserveStandbyCapacity(){
  ConsoleProxyManagementState state=getManagementState();
  if (state == null || state != ConsoleProxyManagementState.Auto) {
    return false;
  }
  return true;
}
Program: 89678
Project: 89678
Buggy source:
@Override @DB public String uploadCertificate(UploadCustomCertificateCmd cmd){
  if (!_ksMgr.validateCertificate(cmd.getCertificate(),cmd.getPrivateKey(),cmd.getDomainSuffix()))   throw new InvalidParameterValueException("String_Node_Str");
  _ksMgr.saveCertificate(ConsoleProxyManager.CERTIFICATE_NAME,cmd.getCertificate(),cmd.getPrivateKey(),cmd.getDomainSuffix());
  _consoleProxyMgr.setManagementState(ConsoleProxyManagementState.ResetSuspending);
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override @DB public String uploadCertificate(UploadCustomCertificateCmd cmd){
  if (!_ksMgr.validateCertificate(cmd.getCertificate(),cmd.getPrivateKey(),cmd.getDomainSuffix())) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  _ksMgr.saveCertificate(ConsoleProxyManager.CERTIFICATE_NAME,cmd.getCertificate(),cmd.getPrivateKey(),cmd.getDomainSuffix());
  _consoleProxyMgr.setManagementState(ConsoleProxyManagementState.ResetSuspending);
  return "String_Node_Str";
}
Program: 89681
Project: 89681
Buggy source:
public StoragePoolMonitor(StorageManager mgr,HostDao hostDao,StoragePoolDao poolDao){
  this._storageManager=mgr;
  this._hostDao=hostDao;
  this._poolDao=poolDao;
}

Fixed version (ground truth):
public StoragePoolMonitor(StorageManagerImpl mgr,StoragePoolDao poolDao){
  this._storageManager=mgr;
  this._poolDao=poolDao;
}
Program: 89682
Project: 89682
Buggy source:
@Override public void processConnect(HostVO host,StartupCommand cmd) throws ConnectionException {
  if (cmd instanceof StartupRoutingCommand) {
    StartupRoutingCommand scCmd=(StartupRoutingCommand)cmd;
    if (scCmd.getHypervisorType() == HypervisorType.XenServer || scCmd.getHypervisorType() == HypervisorType.KVM || scCmd.getHypervisorType() == HypervisorType.VMware) {
      List<StoragePoolVO> pools=_poolDao.listBy(host.getDataCenterId(),host.getPodId(),host.getClusterId());
      for (      StoragePoolVO pool : pools) {
        Long hostId=host.getId();
        s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
        try {
          _storageManager.addPoolToHost(hostId,pool);
          _storageManager.createCapacityEntry(pool);
        }
 catch (        Exception e) {
          throw new ConnectionException(true,"String_Node_Str" + pool,e);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void processConnect(HostVO host,StartupCommand cmd) throws ConnectionException {
  if (cmd instanceof StartupRoutingCommand) {
    StartupRoutingCommand scCmd=(StartupRoutingCommand)cmd;
    if (scCmd.getHypervisorType() == HypervisorType.XenServer || scCmd.getHypervisorType() == HypervisorType.KVM || scCmd.getHypervisorType() == HypervisorType.VMware) {
      List<StoragePoolVO> pools=_poolDao.listBy(host.getDataCenterId(),host.getPodId(),host.getClusterId());
      for (      StoragePoolVO pool : pools) {
        if (!pool.getPoolType().isShared()) {
          continue;
        }
        Long hostId=host.getId();
        s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
        try {
          _storageManager.connectHostToSharedPool(hostId,pool);
          _storageManager.createCapacityEntry(pool);
        }
 catch (        Exception e) {
          throw new ConnectionException(true,"String_Node_Str" + pool,e);
        }
      }
    }
  }
}
Program: 89686
Project: 89686
Buggy source:
VolumeVO allocateDuplicateVolume(VolumeVO oldVol,Long templateId){
  VolumeVO newVol=new VolumeVO(oldVol.getVolumeType(),oldVol.getName(),oldVol.getDataCenterId(),oldVol.getDomainId(),oldVol.getAccountId(),oldVol.getDiskOfferingId(),oldVol.getSize());
  if (templateId != null) {
    newVol.setTemplateId(templateId);
  }
 else {
    newVol.setTemplateId(oldVol.getTemplateId());
  }
  newVol.setDeviceId(oldVol.getDeviceId());
  newVol.setInstanceId(oldVol.getInstanceId());
  return _volsDao.persist(newVol);
}

Fixed version (ground truth):
VolumeVO allocateDuplicateVolume(VolumeVO oldVol,Long templateId){
  VolumeVO newVol=new VolumeVO(oldVol.getVolumeType(),oldVol.getName(),oldVol.getDataCenterId(),oldVol.getDomainId(),oldVol.getAccountId(),oldVol.getDiskOfferingId(),oldVol.getSize());
  if (templateId != null) {
    newVol.setTemplateId(templateId);
  }
 else {
    newVol.setTemplateId(oldVol.getTemplateId());
  }
  newVol.setDeviceId(oldVol.getDeviceId());
  newVol.setInstanceId(oldVol.getInstanceId());
  newVol.setRecreatable(oldVol.isRecreatable());
  return _volsDao.persist(newVol);
}
Program: 89687
Project: 89687
Buggy source:
public DatabaseUpgradeChecker(){
  _dao=ComponentLocator.inject(VersionDaoImpl.class);
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade217to218(),new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade222to224()});
}

Fixed version (ground truth):
public DatabaseUpgradeChecker(){
  _dao=ComponentLocator.inject(VersionDaoImpl.class);
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade217to218(),new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade218to22(),new Upgrade221to222(),new UpgradeSnapshot217to223(),new Upgrade222to224(),new Upgrade218to224DomainVlans()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade221to222(),new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade222to224()});
  _upgradeMap.put("String_Node_Str",new DbUpgrade[]{new Upgrade222to224()});
}
Program: 89688
Project: 89688
Buggy source:
@Override public void performDataMigration(Connection conn){
  updateClusterIdInOpHostCapacity(conn);
  updateGuestOsType(conn);
  updateNicsWithMode(conn);
  updateUserStatsWithNetwork(conn);
  dropIndexIfExists(conn);
  fixBasicZoneNicCount(conn);
  updateTotalCPUInOpHostCapacity(conn);
  upgradeGuestOs(conn);
  upgradeAccountVlanMap(conn);
}

Fixed version (ground truth):
@Override public void performDataMigration(Connection conn){
  try {
    updateClusterIdInOpHostCapacity(conn);
    updateGuestOsType(conn);
    updateNicsWithMode(conn);
    updateUserStatsWithNetwork(conn);
    dropIndexIfExists(conn);
    fixBasicZoneNicCount(conn);
    updateTotalCPUInOpHostCapacity(conn);
    upgradeGuestOs(conn);
    upgradeAccountVlanMap(conn);
    fixRecreatableVolumesProblem(conn);
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 89689
Project: 89689
Buggy source:
@Override public void performDataMigration(Connection conn){
  updateClusterIdInOpHostCapacity(conn);
  updateGuestOsType(conn);
  updateNicsWithMode(conn);
  updateUserStatsWithNetwork(conn);
  dropIndexIfExists(conn);
  fixBasicZoneNicCount(conn);
  updateTotalCPUInOpHostCapacity(conn);
}

Fixed version (ground truth):
@Override public void performDataMigration(Connection conn){
  updateClusterIdInOpHostCapacity(conn);
  updateGuestOsType(conn);
  updateNicsWithMode(conn);
  updateUserStatsWithNetwork(conn);
  dropIndexIfExists(conn);
  fixBasicZoneNicCount(conn);
  updateTotalCPUInOpHostCapacity(conn);
  upgradeGuestOs(conn);
  upgradeAccountVlanMap(conn);
}
Program: 89694
Project: 89694
Buggy source:
@Override public void performDataMigration(Connection conn){
  updateClusterIdInOpHostCapacity(conn);
  updateGuestOsType(conn);
  updateNicsWithMode(conn);
  updateUserStatsWithNetwork(conn);
  dropIndexIfExists(conn);
}

Fixed version (ground truth):
@Override public void performDataMigration(Connection conn){
  updateClusterIdInOpHostCapacity(conn);
  updateGuestOsType(conn);
  updateNicsWithMode(conn);
  updateUserStatsWithNetwork(conn);
  dropIndexIfExists(conn);
  fixBasicZoneNicCount(conn);
}
Program: 89698
Project: 89698
Buggy source:
@Override @DB public void destroyVolume(VolumeVO volume) throws ConcurrentOperationException {
  Transaction txn=Transaction.currentTxn();
  txn.start();
  _volsDao.update(volume,Volume.Event.Destroy);
  long volumeId=volume.getId();
  _snapshotMgr.deletePoliciesForVolume(volumeId);
  VMInstanceVO vmInstance=_vmInstanceDao.findById(volume.getInstanceId());
  if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
    _accountMgr.decrementResourceCount(volume.getAccountId(),ResourceType.volume);
  }
  txn.commit();
}

Fixed version (ground truth):
@Override @DB public void destroyVolume(VolumeVO volume) throws ConcurrentOperationException {
  Transaction txn=Transaction.currentTxn();
  txn.start();
  _volsDao.update(volume,Volume.Event.Destroy);
  long volumeId=volume.getId();
  _snapshotMgr.deletePoliciesForVolume(volumeId);
  Long instanceId=volume.getInstanceId();
  VMInstanceVO vmInstance=null;
  if (instanceId != null) {
    vmInstance=_vmInstanceDao.findById(instanceId);
  }
  if (instanceId == null || (vmInstance.getType().equals(VirtualMachine.Type.User))) {
    _accountMgr.decrementResourceCount(volume.getAccountId(),ResourceType.volume);
  }
  txn.commit();
}
Program: 89699
Project: 89699
Buggy source:
@Override public boolean applyIpAssociations(Network network,boolean continueOnError) throws ResourceUnavailableException {
  List<IPAddressVO> userIps=_ipAddressDao.listByAssociatedNetwork(network.getId(),null);
  List<PublicIp> publicIps=new ArrayList<PublicIp>();
  if (userIps != null && !userIps.isEmpty()) {
    for (    IPAddressVO userIp : userIps) {
      PublicIp publicIp=new PublicIp(userIp,_vlanDao.findById(userIp.getVlanId()),userIp.getMacAddress());
      publicIps.add(publicIp);
    }
  }
  boolean success=true;
  for (  NetworkElement element : _networkElements) {
    try {
      element.applyIps(network,publicIps);
    }
 catch (    ResourceUnavailableException e) {
      success=false;
      if (!continueOnError) {
        throw e;
      }
 else {
        s_logger.debug("String_Node_Str" + element.getName(),e);
      }
    }
  }
  if (success) {
    for (    IPAddressVO addr : userIps) {
      if (addr.getState() == IpAddress.State.Allocating) {
        addr.setAssociatedWithNetworkId(network.getId());
        markPublicIpAsAllocated(addr);
      }
 else       if (addr.getState() == IpAddress.State.Releasing) {
        if (cleanupIpResources(addr.getId(),Account.ACCOUNT_ID_SYSTEM,_accountMgr.getSystemAccount())) {
          _ipAddressDao.unassignIpAddress(addr.getId());
        }
 else {
          success=false;
          s_logger.warn("String_Node_Str" + addr.getId());
        }
      }
    }
  }
  return success;
}

Fixed version (ground truth):
@Override public boolean applyIpAssociations(Network network,boolean continueOnError) throws ResourceUnavailableException {
  List<IPAddressVO> userIps=_ipAddressDao.listByAssociatedNetwork(network.getId(),null);
  List<PublicIp> publicIps=new ArrayList<PublicIp>();
  if (userIps != null && !userIps.isEmpty()) {
    for (    IPAddressVO userIp : userIps) {
      PublicIp publicIp=new PublicIp(userIp,_vlanDao.findById(userIp.getVlanId()),NetUtils.createSequenceBasedMacAddress(userIp.getMacAddress()));
      publicIps.add(publicIp);
    }
  }
  boolean success=true;
  for (  NetworkElement element : _networkElements) {
    try {
      element.applyIps(network,publicIps);
    }
 catch (    ResourceUnavailableException e) {
      success=false;
      if (!continueOnError) {
        throw e;
      }
 else {
        s_logger.debug("String_Node_Str" + element.getName(),e);
      }
    }
  }
  if (success) {
    for (    IPAddressVO addr : userIps) {
      if (addr.getState() == IpAddress.State.Allocating) {
        addr.setAssociatedWithNetworkId(network.getId());
        markPublicIpAsAllocated(addr);
      }
 else       if (addr.getState() == IpAddress.State.Releasing) {
        if (cleanupIpResources(addr.getId(),Account.ACCOUNT_ID_SYSTEM,_accountMgr.getSystemAccount())) {
          _ipAddressDao.unassignIpAddress(addr.getId());
        }
 else {
          success=false;
          s_logger.warn("String_Node_Str" + addr.getId());
        }
      }
    }
  }
  return success;
}
Program: 89701
Project: 89701
Buggy source:
@Override public boolean isVmSecurityGroupEnabled(Long vmId){
  VirtualMachine vm=_vmDao.findById(vmId);
  List<NicProfile> nics=_networkMgr.getNicProfiles(vm);
  for (  NicProfile nic : nics) {
    if (nic.isSecurityGroupEnabled() && vm.getHypervisorType() != HypervisorType.VMware) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isVmSecurityGroupEnabled(Long vmId){
  VirtualMachine vm=_vmDao.findByIdIncludingRemoved(vmId);
  List<NicProfile> nics=_networkMgr.getNicProfiles(vm);
  for (  NicProfile nic : nics) {
    if (nic.isSecurityGroupEnabled() && vm.getHypervisorType() != HypervisorType.VMware) {
      return true;
    }
  }
  return false;
}
Program: 89702
Project: 89702
Buggy source:
@Override public boolean isVmSecurityGroupEnabled(Long vmId){
  VirtualMachine vm=_vmDao.findById(vmId);
  List<NicProfile> nics=_networkMgr.getNicProfiles(vm);
  for (  NicProfile nic : nics) {
    if (nic.isSecurityGroupEnabled() && vm.getHypervisorType() != HypervisorType.VMware) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isVmSecurityGroupEnabled(Long vmId){
  VirtualMachine vm=_vmDao.findByIdIncludingRemoved(vmId);
  List<NicProfile> nics=_networkMgr.getNicProfiles(vm);
  for (  NicProfile nic : nics) {
    if (nic.isSecurityGroupEnabled() && vm.getHypervisorType() != HypervisorType.VMware) {
      return true;
    }
  }
  return false;
}
Program: 89703
Project: 89703
Buggy source:
@Override public boolean applyIpAssociations(Network network,boolean continueOnError) throws ResourceUnavailableException {
  List<IPAddressVO> userIps=_ipAddressDao.listByAssociatedNetwork(network.getId(),null);
  List<PublicIp> publicIps=new ArrayList<PublicIp>();
  if (userIps != null && !userIps.isEmpty()) {
    for (    IPAddressVO userIp : userIps) {
      PublicIp publicIp=new PublicIp(userIp,_vlanDao.findById(userIp.getVlanId()),userIp.getMacAddress());
      publicIps.add(publicIp);
    }
  }
  boolean success=true;
  for (  NetworkElement element : _networkElements) {
    try {
      element.applyIps(network,publicIps);
    }
 catch (    ResourceUnavailableException e) {
      success=false;
      if (!continueOnError) {
        throw e;
      }
 else {
        s_logger.debug("String_Node_Str" + element.getName(),e);
      }
    }
  }
  if (success) {
    for (    IPAddressVO addr : userIps) {
      if (addr.getState() == IpAddress.State.Allocating) {
        addr.setAssociatedWithNetworkId(network.getId());
        markPublicIpAsAllocated(addr);
      }
 else       if (addr.getState() == IpAddress.State.Releasing) {
        if (cleanupIpResources(addr.getId(),Account.ACCOUNT_ID_SYSTEM,_accountMgr.getSystemAccount())) {
          _ipAddressDao.unassignIpAddress(addr.getId());
        }
 else {
          success=false;
          s_logger.warn("String_Node_Str" + addr.getId());
        }
      }
    }
  }
  return success;
}

Fixed version (ground truth):
@Override public boolean applyIpAssociations(Network network,boolean continueOnError) throws ResourceUnavailableException {
  List<IPAddressVO> userIps=_ipAddressDao.listByAssociatedNetwork(network.getId(),null);
  List<PublicIp> publicIps=new ArrayList<PublicIp>();
  if (userIps != null && !userIps.isEmpty()) {
    for (    IPAddressVO userIp : userIps) {
      PublicIp publicIp=new PublicIp(userIp,_vlanDao.findById(userIp.getVlanId()),NetUtils.createSequenceBasedMacAddress(userIp.getMacAddress()));
      publicIps.add(publicIp);
    }
  }
  boolean success=true;
  for (  NetworkElement element : _networkElements) {
    try {
      element.applyIps(network,publicIps);
    }
 catch (    ResourceUnavailableException e) {
      success=false;
      if (!continueOnError) {
        throw e;
      }
 else {
        s_logger.debug("String_Node_Str" + element.getName(),e);
      }
    }
  }
  if (success) {
    for (    IPAddressVO addr : userIps) {
      if (addr.getState() == IpAddress.State.Allocating) {
        addr.setAssociatedWithNetworkId(network.getId());
        markPublicIpAsAllocated(addr);
      }
 else       if (addr.getState() == IpAddress.State.Releasing) {
        if (cleanupIpResources(addr.getId(),Account.ACCOUNT_ID_SYSTEM,_accountMgr.getSystemAccount())) {
          _ipAddressDao.unassignIpAddress(addr.getId());
        }
 else {
          success=false;
          s_logger.warn("String_Node_Str" + addr.getId());
        }
      }
    }
  }
  return success;
}
Program: 89705
Project: 89705
Buggy source:
protected AgentAttache(final long id,boolean maintenance){
  _id=id;
  _waitForList=new ConcurrentHashMap<Long,Listener>();
  _currentSequence=null;
  _maintenance=maintenance;
  _requests=new LinkedList<Request>();
}

Fixed version (ground truth):
protected AgentAttache(AgentManager agentMgr,final long id,boolean maintenance){
  _id=id;
  _waitForList=new ConcurrentHashMap<Long,Listener>();
  _currentSequence=null;
  _maintenance=maintenance;
  _requests=new LinkedList<Request>();
  _agentMgr=agentMgr;
}
Program: 89706
Project: 89706
Buggy source:
public boolean processAnswers(final long seq,final Response resp){
  resp.log(_id,"String_Node_Str");
  final Answer[] answers=resp.getAnswers();
  boolean processed=false;
  Listener monitor=getListener(seq);
  if (monitor == null) {
    if (answers[0] != null && answers[0].getResult()) {
      processed=true;
    }
    if (s_logger.isDebugEnabled()) {
      s_logger.debug(log(seq,"String_Node_Str"));
    }
  }
 else {
    processed=monitor.processAnswers(_id,seq,answers);
    if (s_logger.isTraceEnabled()) {
      s_logger.trace(log(seq,(processed ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"));
    }
    if (!monitor.isRecurring()) {
      unregisterListener(seq);
    }
  }
  if (resp.executeInSequence()) {
    sendNext(seq);
  }
  return processed;
}

Fixed version (ground truth):
public boolean processAnswers(final long seq,final Response resp){
  resp.log(_id,"String_Node_Str");
  final Answer[] answers=resp.getAnswers();
  boolean processed=false;
  Listener monitor=getListener(seq);
  if (monitor == null) {
    if (answers[0] != null && answers[0].getResult()) {
      processed=true;
    }
    if (s_logger.isDebugEnabled()) {
      s_logger.debug(log(seq,"String_Node_Str"));
    }
  }
 else {
    processed=monitor.processAnswers(_id,seq,answers);
    if (s_logger.isTraceEnabled()) {
      s_logger.trace(log(seq,(processed ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"));
    }
    if (!monitor.isRecurring()) {
      unregisterListener(seq);
    }
  }
  if (resp.executeInSequence()) {
    sendNext(seq);
  }
  _agentMgr.notifyAnswersFromAttache(_id,seq,answers);
  return processed;
}
Program: 89707
Project: 89707
Buggy source:
protected AgentAttache createAttache(long id,HostVO server,ServerResource resource){
  if (resource instanceof DummySecondaryStorageResource || resource instanceof KvmDummyResourceBase) {
    return new DummyAttache(id,false);
  }
  s_logger.debug("String_Node_Str" + id);
  final DirectAgentAttache attache=new DirectAgentAttache(id,resource,server.getStatus() == Status.Maintenance || server.getStatus() == Status.ErrorInMaintenance || server.getStatus() == Status.PrepareForMaintenance,this);
  AgentAttache old=null;
synchronized (_agents) {
    old=_agents.get(id);
    _agents.put(id,attache);
  }
  if (old != null) {
    old.disconnect(Status.Removed);
  }
  return attache;
}

Fixed version (ground truth):
protected AgentAttache createAttache(long id,HostVO server,ServerResource resource){
  if (resource instanceof DummySecondaryStorageResource || resource instanceof KvmDummyResourceBase) {
    return new DummyAttache(this,id,false);
  }
  s_logger.debug("String_Node_Str" + id);
  final DirectAgentAttache attache=new DirectAgentAttache(this,id,resource,server.getStatus() == Status.Maintenance || server.getStatus() == Status.ErrorInMaintenance || server.getStatus() == Status.PrepareForMaintenance,this);
  AgentAttache old=null;
synchronized (_agents) {
    old=_agents.get(id);
    _agents.put(id,attache);
  }
  if (old != null) {
    old.disconnect(Status.Removed);
  }
  return attache;
}
Program: 89708
Project: 89708
Buggy source:
public ClusteredAgentAttache(long id,Link link,boolean maintenance){
  super(id,link,maintenance);
  _forward=link == null;
}

Fixed version (ground truth):
public ClusteredAgentAttache(AgentManager agentMgr,long id,Link link,boolean maintenance){
  super(agentMgr,id,link,maintenance);
  _forward=link == null;
}
Program: 89709
Project: 89709
Buggy source:
@Override protected AgentAttache createAttache(long id,HostVO server,ServerResource resource){
  if (resource instanceof DummySecondaryStorageResource) {
    return new DummyAttache(id,false);
  }
  s_logger.debug("String_Node_Str" + id);
  final DirectAgentAttache attache=new ClusteredDirectAgentAttache(id,_nodeId,resource,server.getStatus() == Status.Maintenance || server.getStatus() == Status.ErrorInMaintenance || server.getStatus() == Status.PrepareForMaintenance,this);
  AgentAttache old=null;
synchronized (_agents) {
    old=_agents.get(id);
    _agents.put(id,attache);
  }
  if (old != null) {
    old.disconnect(Status.Removed);
  }
  return attache;
}

Fixed version (ground truth):
@Override protected AgentAttache createAttache(long id,HostVO server,ServerResource resource){
  if (resource instanceof DummySecondaryStorageResource) {
    return new DummyAttache(this,id,false);
  }
  s_logger.debug("String_Node_Str" + id);
  final DirectAgentAttache attache=new ClusteredDirectAgentAttache(this,id,_nodeId,resource,server.getStatus() == Status.Maintenance || server.getStatus() == Status.ErrorInMaintenance || server.getStatus() == Status.PrepareForMaintenance,this);
  AgentAttache old=null;
synchronized (_agents) {
    old=_agents.get(id);
    _agents.put(id,attache);
  }
  if (old != null) {
    old.disconnect(Status.Removed);
  }
  return attache;
}
Program: 89710
Project: 89710
Buggy source:
public ClusteredDirectAgentAttache(long id,long mgmtId,ServerResource resource,boolean maintenance,ClusteredAgentManagerImpl mgr){
  super(id,resource,maintenance,mgr);
  _mgr=mgr;
  _nodeId=mgmtId;
}

Fixed version (ground truth):
public ClusteredDirectAgentAttache(AgentManager agentMgr,long id,long mgmtId,ServerResource resource,boolean maintenance,ClusteredAgentManagerImpl mgr){
  super(agentMgr,id,resource,maintenance,mgr);
  _mgr=mgr;
  _nodeId=mgmtId;
}
Program: 89711
Project: 89711
Buggy source:
public ConnectedAgentAttache(final long id,final Link link,boolean maintenance){
  super(id,maintenance);
  _link=link;
}

Fixed version (ground truth):
public ConnectedAgentAttache(AgentManager agentMgr,final long id,final Link link,boolean maintenance){
  super(agentMgr,id,maintenance);
  _link=link;
}
Program: 89712
Project: 89712
Buggy source:
public DirectAgentAttache(long id,ServerResource resource,boolean maintenance,AgentManagerImpl mgr){
  super(id,maintenance);
  _resource=resource;
  _mgr=mgr;
}

Fixed version (ground truth):
public DirectAgentAttache(AgentManager agentMgr,long id,ServerResource resource,boolean maintenance,AgentManagerImpl mgr){
  super(agentMgr,id,maintenance);
  _resource=resource;
  _mgr=mgr;
}
Program: 89713
Project: 89713
Buggy source:
public DummyAttache(long id,boolean maintenance){
  super(id,maintenance);
}

Fixed version (ground truth):
public DummyAttache(AgentManager agentMgr,long id,boolean maintenance){
  super(agentMgr,id,maintenance);
}
Program: 89714
Project: 89714
Buggy source:
@Override public List<Long> listRunningSecStorageOrderByLoad(SecondaryStorageVm.Role role,long zoneId){
  List<Long> l=new ArrayList<Long>();
  Transaction txn=Transaction.currentTxn();
  ;
  PreparedStatement pstmt=null;
  try {
    String sql;
    if (role == null)     sql="String_Node_Str" + "String_Node_Str";
 else     sql="String_Node_Str" + "String_Node_Str";
    pstmt=txn.prepareAutoCloseStatement(sql);
    if (role == null) {
      pstmt.setLong(1,zoneId);
    }
 else {
      pstmt.setLong(1,zoneId);
      pstmt.setString(2,role.toString());
    }
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      l.add(rs.getLong(1));
    }
  }
 catch (  SQLException e) {
    s_logger.error("String_Node_Str",e);
  }
  return l;
}

Fixed version (ground truth):
@Override public List<Long> listRunningSecStorageOrderByLoad(SecondaryStorageVm.Role role,long zoneId){
  List<Long> l=new ArrayList<Long>();
  Transaction txn=Transaction.currentTxn();
  ;
  PreparedStatement pstmt=null;
  try {
    String sql;
    if (role == null)     sql="String_Node_Str";
 else     sql="String_Node_Str";
    pstmt=txn.prepareAutoCloseStatement(sql);
    if (role == null) {
      pstmt.setLong(1,zoneId);
    }
 else {
      pstmt.setLong(1,zoneId);
      pstmt.setString(2,role.toString());
    }
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      l.add(rs.getLong(1));
    }
  }
 catch (  SQLException e) {
    s_logger.error("String_Node_Str",e);
  }
  return l;
}
Program: 89715
Project: 89715
Buggy source:
@Override public ItWorkVO findByOutstandingWork(long instanceId,State state){
  SearchCriteria<ItWorkVO> sc=AllFieldsSearch.create();
  sc.setParameters("String_Node_Str",instanceId);
  sc.setParameters("String_Node_Str",state);
  sc.setParameters("String_Node_Str",Step.Done);
  return findOneBy(sc);
}

Fixed version (ground truth):
@Override public ItWorkVO findByOutstandingWork(long instanceId,State state){
  SearchCriteria<ItWorkVO> sc=OutstandingWorkSearch.create();
  sc.setParameters("String_Node_Str",instanceId);
  sc.setParameters("String_Node_Str",state);
  sc.setParameters("String_Node_Str",Step.Done);
  return findOneBy(sc);
}
Program: 89716
Project: 89716
Buggy source:
protected ItWorkDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getInstanceId(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getType(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.NEQ);
  AllFieldsSearch.done();
  CleanupSearch=createSearchBuilder();
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getType(),Op.IN);
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getUpdatedAt(),Op.LT);
  CleanupSearch.done();
  OutstandingWorkSearch=createSearchBuilder();
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getInstanceId(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getType(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getStep(),Op.NEQ);
  OutstandingWorkSearch.done();
  WorkInProgressSearch=createSearchBuilder();
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getManagementServerId(),Op.EQ);
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getStep(),Op.NIN);
  WorkInProgressSearch.done();
}

Fixed version (ground truth):
protected ItWorkDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getInstanceId(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getType(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.done();
  CleanupSearch=createSearchBuilder();
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getType(),Op.IN);
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getUpdatedAt(),Op.LT);
  CleanupSearch.done();
  OutstandingWorkSearch=createSearchBuilder();
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getInstanceId(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getType(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getStep(),Op.NEQ);
  OutstandingWorkSearch.done();
  WorkInProgressSearch=createSearchBuilder();
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getManagementServerId(),Op.EQ);
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getStep(),Op.NIN);
  WorkInProgressSearch.done();
}
Program: 89717
Project: 89717
Buggy source:
@Override public ItWorkVO findByOutstandingWork(long instanceId,State state){
  SearchCriteria<ItWorkVO> sc=AllFieldsSearch.create();
  sc.setParameters("String_Node_Str",instanceId);
  sc.setParameters("String_Node_Str",state);
  sc.setParameters("String_Node_Str",Step.Done);
  return findOneBy(sc);
}

Fixed version (ground truth):
@Override public ItWorkVO findByOutstandingWork(long instanceId,State state){
  SearchCriteria<ItWorkVO> sc=OutstandingWorkSearch.create();
  sc.setParameters("String_Node_Str",instanceId);
  sc.setParameters("String_Node_Str",state);
  sc.setParameters("String_Node_Str",Step.Done);
  return findOneBy(sc);
}
Program: 89718
Project: 89718
Buggy source:
protected ItWorkDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getInstanceId(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getType(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.NEQ);
  AllFieldsSearch.done();
  CleanupSearch=createSearchBuilder();
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getType(),Op.IN);
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getUpdatedAt(),Op.LT);
  CleanupSearch.done();
  OutstandingWorkSearch=createSearchBuilder();
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getInstanceId(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getType(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getStep(),Op.NEQ);
  OutstandingWorkSearch.done();
  WorkInProgressSearch=createSearchBuilder();
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getManagementServerId(),Op.EQ);
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getStep(),Op.NIN);
  WorkInProgressSearch.done();
}

Fixed version (ground truth):
protected ItWorkDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getInstanceId(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getType(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.done();
  CleanupSearch=createSearchBuilder();
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getType(),Op.IN);
  CleanupSearch.and("String_Node_Str",CleanupSearch.entity().getUpdatedAt(),Op.LT);
  CleanupSearch.done();
  OutstandingWorkSearch=createSearchBuilder();
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getInstanceId(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getType(),Op.EQ);
  OutstandingWorkSearch.and("String_Node_Str",OutstandingWorkSearch.entity().getStep(),Op.NEQ);
  OutstandingWorkSearch.done();
  WorkInProgressSearch=createSearchBuilder();
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getManagementServerId(),Op.EQ);
  WorkInProgressSearch.and("String_Node_Str",WorkInProgressSearch.entity().getStep(),Op.NIN);
  WorkInProgressSearch.done();
}
Program: 89719
Project: 89719
Buggy source:
/** 
 * This is added to allow calling agent control service from within the resource
 * @return
 */
public IAgentControl getAgentControl();

Fixed version (ground truth):
/** 
 * This is added to allow calling agent control service from within the resource
 * @return
 */
IAgentControl getAgentControl();
Program: 89720
Project: 89720
Buggy source:
/** 
 * disconnected() is called when the connection is down between the agent and the management server.  If there are any cleanups, this is the time to do it.
 */
public void disconnected();

Fixed version (ground truth):
/** 
 * disconnected() is called when the connection is down between the agent and the management server.  If there are any cleanups, this is the time to do it.
 */
void disconnected();
Program: 89721
Project: 89721
Buggy source:
public void setAgentControl(IAgentControl agentControl);

Fixed version (ground truth):
void setAgentControl(IAgentControl agentControl);
Program: 89722
Project: 89722
Buggy source:
/** 
 * Generate a startup command containing information regarding the resource.
 * @return StartupCommand ready to be sent to the management server.
 */
public StartupCommand[] initialize();

Fixed version (ground truth):
/** 
 * Generate a startup command containing information regarding the resource.
 * @return StartupCommand ready to be sent to the management server.
 */
StartupCommand[] initialize();
Program: 89723
Project: 89723
Buggy source:
/** 
 * @param id id of the server to put in the PingCommand
 * @return PingCommand
 */
public PingCommand getCurrentStatus(long id);

Fixed version (ground truth):
/** 
 * @param id id of the server to put in the PingCommand
 * @return PingCommand
 */
PingCommand getCurrentStatus(long id);
Program: 89724
Project: 89724
Buggy source:
/** 
 * Execute the request coming from the computing server.
 * @param cmd Command to execute.
 * @return Answer
 */
public Answer executeRequest(Command cmd);

Fixed version (ground truth):
/** 
 * Execute the request coming from the computing server.
 * @param cmd Command to execute.
 * @return Answer
 */
Answer executeRequest(Command cmd);
Program: 89725
Project: 89725
Buggy source:
/** 
 * This is added to allow calling agent control service from within the resource
 * @return
 */
public IAgentControl getAgentControl();

Fixed version (ground truth):
/** 
 * This is added to allow calling agent control service from within the resource
 * @return
 */
IAgentControl getAgentControl();
Program: 89726
Project: 89726
Buggy source:
/** 
 * disconnected() is called when the connection is down between the agent and the management server.  If there are any cleanups, this is the time to do it.
 */
public void disconnected();

Fixed version (ground truth):
/** 
 * disconnected() is called when the connection is down between the agent and the management server.  If there are any cleanups, this is the time to do it.
 */
void disconnected();
Program: 89727
Project: 89727
Buggy source:
public void setAgentControl(IAgentControl agentControl);

Fixed version (ground truth):
void setAgentControl(IAgentControl agentControl);
Program: 89728
Project: 89728
Buggy source:
/** 
 * Generate a startup command containing information regarding the resource.
 * @return StartupCommand ready to be sent to the management server.
 */
public StartupCommand[] initialize();

Fixed version (ground truth):
/** 
 * Generate a startup command containing information regarding the resource.
 * @return StartupCommand ready to be sent to the management server.
 */
StartupCommand[] initialize();
Program: 89729
Project: 89729
Buggy source:
/** 
 * @param id id of the server to put in the PingCommand
 * @return PingCommand
 */
public PingCommand getCurrentStatus(long id);

Fixed version (ground truth):
/** 
 * @param id id of the server to put in the PingCommand
 * @return PingCommand
 */
PingCommand getCurrentStatus(long id);
Program: 89730
Project: 89730
Buggy source:
/** 
 * Execute the request coming from the computing server.
 * @param cmd Command to execute.
 * @return Answer
 */
public Answer executeRequest(Command cmd);

Fixed version (ground truth):
/** 
 * Execute the request coming from the computing server.
 * @param cmd Command to execute.
 * @return Answer
 */
Answer executeRequest(Command cmd);
Program: 89738
Project: 89738
Buggy source:
protected SR getStorageRepository(Connection conn,StorageFilerTO pool){
  Set<SR> srs;
  try {
    srs=SR.getByNameLabel(conn,pool.getUuid());
  }
 catch (  XenAPIException e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ e.toString(),e);
  }
catch (  Exception e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ e.getMessage(),e);
  }
  if (srs.size() > 1) {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid());
  }
 else   if (srs.size() == 1) {
    SR sr=srs.iterator().next();
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + pool.getId());
    }
    if (checkSR(conn,sr)) {
      return sr;
    }
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ _host.uuid);
  }
 else {
    if (pool.getType() == StoragePoolType.NetworkFilesystem) {
      return getNfsSR(conn,pool);
    }
 else     if (pool.getType() == StoragePoolType.IscsiLUN) {
      return getIscsiSR(conn,pool);
    }
 else     if (pool.getType() == StoragePoolType.PreSetup) {
      throw new CloudRuntimeException("String_Node_Str" + pool.getType().name() + "String_Node_Str"+ pool.getUuid()+ "String_Node_Str");
    }
 else {
      throw new CloudRuntimeException("String_Node_Str" + pool.getType().name() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected SR getStorageRepository(Connection conn,StorageFilerTO pool){
  Set<SR> srs;
  try {
    srs=SR.getByNameLabel(conn,pool.getUuid());
  }
 catch (  XenAPIException e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ e.toString(),e);
  }
catch (  Exception e) {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ e.getMessage(),e);
  }
  if (srs.size() > 1) {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid());
  }
 else   if (srs.size() == 1) {
    SR sr=srs.iterator().next();
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + pool.getId());
    }
    if (checkSR(conn,sr)) {
      return sr;
    }
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ _host.uuid);
  }
 else {
    throw new CloudRuntimeException("String_Node_Str" + pool.getUuid() + "String_Node_Str"+ _host.uuid);
  }
}