nus-yam/ex-repair huggingface dataset:
Program: 105810
Project: 105810
Buggy source:
public ServiceOfferingVO(ServiceOfferingVO offering){
  super(offering.getId(),offering.getName(),offering.getDisplayText(),false,offering.getTags(),offering.isRecreatable(),offering.getUseLocalStorage(),offering.getSystemUse(),true,offering.getDomainId());
  cpu=offering.getCpu();
  ramSize=offering.getRamSize();
  speed=offering.getSpeed();
  rateMbps=offering.getRateMbps();
  multicastRateMbps=offering.getMulticastRateMbps();
  offerHA=offering.getOfferHA();
  limitCpuUse=offering.getLimitCpuUse();
  volatileVm=offering.getVolatileVm();
  hostTag=offering.getHostTag();
  vmType=offering.getSystemVmType();
}

Fixed version (ground truth):
public ServiceOfferingVO(ServiceOfferingVO offering){
  super(offering.getId(),offering.getName(),offering.getDisplayText(),false,offering.getTags(),offering.isRecreatable(),offering.getUseLocalStorage(),offering.getSystemUse(),true,offering.isCustomizedIops(),offering.getDomainId());
  cpu=offering.getCpu();
  ramSize=offering.getRamSize();
  speed=offering.getSpeed();
  rateMbps=offering.getRateMbps();
  multicastRateMbps=offering.getMulticastRateMbps();
  offerHA=offering.getOfferHA();
  limitCpuUse=offering.getLimitCpuUse();
  volatileVm=offering.getVolatileVm();
  hostTag=offering.getHostTag();
  vmType=offering.getSystemVmType();
}
Program: 105811
Project: 105811
Buggy source:
public DiskOfferingVO(long id,String name,String displayText,boolean mirrored,String tags,boolean recreatable,boolean useLocalStorage,boolean systemUse,boolean customized,Long domainId){
  this.id=id;
  type=Type.Service;
  this.name=name;
  this.displayText=displayText;
  this.tags=tags;
  this.recreatable=recreatable;
  this.useLocalStorage=useLocalStorage;
  this.systemUse=systemUse;
  this.customized=customized;
  this.domainId=domainId;
  uuid=UUID.randomUUID().toString();
  state=State.Active;
}

Fixed version (ground truth):
public DiskOfferingVO(long id,String name,String displayText,boolean mirrored,String tags,boolean recreatable,boolean useLocalStorage,boolean systemUse,boolean customized,boolean customizedIops,Long domainId){
  this.id=id;
  type=Type.Service;
  this.name=name;
  this.displayText=displayText;
  this.tags=tags;
  this.recreatable=recreatable;
  this.useLocalStorage=useLocalStorage;
  this.systemUse=systemUse;
  this.customized=customized;
  this.customizedIops=customizedIops;
  this.domainId=domainId;
  uuid=UUID.randomUUID().toString();
  state=State.Active;
}
Program: 105812
Project: 105812
Buggy source:
ExecutionResult executeInVR(String routerIp,String script,String args);

Fixed version (ground truth):
ExecutionResult executeInVR(String routerIp,String script,String args,int timeout);
Program: 105813
Project: 105813
Buggy source:
@Override public ExecutionResult executeInVR(String routerIp,String script,String args){
  assertEquals(routerIp,ROUTERIP);
  verifyCommand(_currentCmd,script,args);
  return new ExecutionResult(true,null);
}

Fixed version (ground truth):
@Override public ExecutionResult executeInVR(String routerIp,String script,String args,int timeout){
  assertEquals(routerIp,ROUTERIP);
  verifyCommand(_currentCmd,script,args);
  return new ExecutionResult(true,null);
}
Program: 105814
Project: 105814
Buggy source:
@Override public ExecutionResult executeInVR(String routerIP,String script,String args){
  Pair<Boolean,String> result;
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + routerIP + "String_Node_Str"+ script+ "String_Node_Str"+ args);
  }
  try {
    result=SshHelper.sshExecute(routerIP,DEFAULT_DOMR_SSHPORT,"String_Node_Str",getSystemVMKeyFile(),null,"String_Node_Str" + script + "String_Node_Str"+ args);
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e;
    s_logger.error(msg);
    result=new Pair<Boolean,String>(false,msg);
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug(script + "String_Node_Str" + result.first().toString());
  }
  return new ExecutionResult(result.first(),result.second());
}

Fixed version (ground truth):
@Override public ExecutionResult executeInVR(String routerIP,String script,String args,int timeout){
  Pair<Boolean,String> result;
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + routerIP + "String_Node_Str"+ script+ "String_Node_Str"+ args);
  }
  try {
    result=SshHelper.sshExecute(routerIP,DEFAULT_DOMR_SSHPORT,"String_Node_Str",getSystemVMKeyFile(),null,"String_Node_Str" + script + "String_Node_Str"+ args,60000,60000,timeout * 1000);
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e;
    s_logger.error(msg);
    result=new Pair<Boolean,String>(false,msg);
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug(script + "String_Node_Str" + result.first().toString());
  }
  return new ExecutionResult(result.first(),result.second());
}
Program: 105815
Project: 105815
Buggy source:
@Override public ExecutionResult executeInVR(String routerIp,String script,String args){
  final Script command=new Script(_routerProxyPath,_timeout,s_logger);
  final AllLinesParser parser=new AllLinesParser();
  command.add(script);
  command.add(routerIp);
  if (args != null) {
    command.add(args);
  }
  String details=command.execute(parser);
  if (details == null) {
    details=parser.getLines();
  }
  return new ExecutionResult(command.getExitValue() == 0,details);
}

Fixed version (ground truth):
@Override public ExecutionResult executeInVR(String routerIp,String script,String args,int timeout){
  final Script command=new Script(_routerProxyPath,timeout,s_logger);
  final AllLinesParser parser=new AllLinesParser();
  command.add(script);
  command.add(routerIp);
  if (args != null) {
    command.add(args);
  }
  String details=command.execute(parser);
  if (details == null) {
    details=parser.getLines();
  }
  return new ExecutionResult(command.getExitValue() == 0,details);
}
Program: 105816
Project: 105816
Buggy source:
@Override public ExecutionResult executeInVR(String routerIP,String script,String args){
  Pair<Boolean,String> result;
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + routerIP + "String_Node_Str"+ script+ "String_Node_Str"+ args);
  }
  try {
    VmwareManager mgr=getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
    result=SshHelper.sshExecute(routerIP,DefaultDomRSshPort,"String_Node_Str",mgr.getSystemVMKeyFile(),null,"String_Node_Str" + script + "String_Node_Str"+ args);
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + VmwareHelper.getExceptionMessage(e);
    s_logger.error(msg);
    result=new Pair<Boolean,String>(false,msg);
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug(script + "String_Node_Str" + result.first().toString());
  }
  return new ExecutionResult(result.first(),result.second());
}

Fixed version (ground truth):
@Override public ExecutionResult executeInVR(String routerIP,String script,String args,int timeout){
  Pair<Boolean,String> result;
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + routerIP + "String_Node_Str"+ script+ "String_Node_Str"+ args);
  }
  try {
    VmwareManager mgr=getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
    result=SshHelper.sshExecute(routerIP,DefaultDomRSshPort,"String_Node_Str",mgr.getSystemVMKeyFile(),null,"String_Node_Str" + script + "String_Node_Str"+ args,60000,60000,timeout * 1000);
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + VmwareHelper.getExceptionMessage(e);
    s_logger.error(msg);
    result=new Pair<Boolean,String>(false,msg);
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug(script + "String_Node_Str" + result.first().toString());
  }
  return new ExecutionResult(result.first(),result.second());
}
Program: 105817
Project: 105817
Buggy source:
@Override public ExecutionResult executeInVR(String routerIP,String script,String args){
  Connection conn=getConnection();
  String rc=callHostPlugin(conn,"String_Node_Str","String_Node_Str","String_Node_Str",script + "String_Node_Str" + routerIP+ "String_Node_Str"+ args);
  return new ExecutionResult(rc.startsWith("String_Node_Str"),rc.substring(5));
}

Fixed version (ground truth):
@Override public ExecutionResult executeInVR(String routerIP,String script,String args){
  return executeInVR(routerIP,script,args,120);
}
Program: 105818
Project: 105818
Buggy source:
@Override public Boolean isVmAlive(com.cloud.vm.VirtualMachine vm,Host host){
  Status status=isAgentAlive(host);
  if (status == null) {
    return null;
  }
  return status == Status.Up ? true : null;
}

Fixed version (ground truth):
@Override public Boolean isVmAlive(com.cloud.vm.VirtualMachine vm,Host host){
  Status status=isAgentAlive(host);
  if (status == null) {
    return false;
  }
  return status == Status.Up ? true : false;
}
Program: 105820
Project: 105820
Buggy source:
/** 
 * Encapsulate GUID calculation in public method to allow access to test programs. Works by converting a string to a GUID using UUID.nameUUIDFromBytes
 * @param uuidSeed string to use to generate GUID
 * @return GUID in form of a string.
 */
public static String calcServerResourceGuid(final String uuidSeed){
  String guid=UUID.nameUUIDFromBytes(uuidSeed.getBytes()).toString();
  return guid;
}

Fixed version (ground truth):
/** 
 * Encapsulate GUID calculation in public method to allow access to test programs. Works by converting a string to a GUID using UUID.nameUUIDFromBytes
 * @param uuidSeed string to use to generate GUID
 * @return GUID in form of a string.
 */
public static String calcServerResourceGuid(final String uuidSeed){
  String guid=UUID.nameUUIDFromBytes(uuidSeed.getBytes(Charset.forName("String_Node_Str"))).toString();
  return guid;
}
Program: 105821
Project: 105821
Buggy source:
@Override public ExecutionResult createFileInVR(String routerIp,String filePath,String fileName,String content){
  File keyFile=getSystemVMKeyFile();
  try {
    SshHelper.scpTo(routerIp,3922,"String_Node_Str",keyFile,null,filePath,content.getBytes(),fileName,null);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + filePath + fileName+ "String_Node_Str"+ routerIp,e);
    return new ExecutionResult(false,e.getMessage());
  }
  return new ExecutionResult(true,null);
}

Fixed version (ground truth):
@Override public ExecutionResult createFileInVR(String routerIp,String filePath,String fileName,String content){
  File keyFile=getSystemVMKeyFile();
  try {
    SshHelper.scpTo(routerIp,3922,"String_Node_Str",keyFile,null,filePath,content.getBytes(Charset.forName("String_Node_Str")),fileName,null);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + filePath + fileName+ "String_Node_Str"+ routerIp,e);
    return new ExecutionResult(false,e.getMessage());
  }
  return new ExecutionResult(true,null);
}
Program: 105822
Project: 105822
Buggy source:
@Test public void testClusterAllocatorWithWrongTag(){
  try {
    createDb();
    StoragePoolDetailVO detailVO=new StoragePoolDetailVO(this.storagePoolId,"String_Node_Str","String_Node_Str",display);
    poolDetailsDao.persist(detailVO);
    DiskOfferingVO diskOff=this.diskOfferingDao.findById(diskOffering.getId());
    List<String> tags=new ArrayList<String>();
    tags.add("String_Node_Str");
    diskOff.setTagsArray(tags);
    diskOfferingDao.update(diskOff.getId(),diskOff);
    DiskProfile profile=new DiskProfile(volume,diskOff,HypervisorType.XenServer);
    VirtualMachineProfile vmProfile=Mockito.mock(VirtualMachineProfile.class);
    Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class),Matchers.any(StoragePool.class))).thenReturn(true);
    DeploymentPlan plan=new DataCenterDeployment(dcId,podId,clusterId,null,null,null);
    int foundAcct=0;
    for (    StoragePoolAllocator allocator : allocators) {
      List<StoragePool> pools=allocator.allocateToPool(profile,vmProfile,plan,new ExcludeList(),1);
      if (!pools.isEmpty()) {
        foundAcct++;
      }
    }
    if (foundAcct != 0) {
      Assert.fail();
    }
  }
 catch (  Exception e) {
    cleanDb();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testClusterAllocatorWithWrongTag(){
  try {
    createDb();
    StoragePoolDetailVO detailVO=new StoragePoolDetailVO(this.storagePoolId,"String_Node_Str","String_Node_Str",true);
    poolDetailsDao.persist(detailVO);
    DiskOfferingVO diskOff=this.diskOfferingDao.findById(diskOffering.getId());
    List<String> tags=new ArrayList<String>();
    tags.add("String_Node_Str");
    diskOff.setTagsArray(tags);
    diskOfferingDao.update(diskOff.getId(),diskOff);
    DiskProfile profile=new DiskProfile(volume,diskOff,HypervisorType.XenServer);
    VirtualMachineProfile vmProfile=Mockito.mock(VirtualMachineProfile.class);
    Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class),Matchers.any(StoragePool.class))).thenReturn(true);
    DeploymentPlan plan=new DataCenterDeployment(dcId,podId,clusterId,null,null,null);
    int foundAcct=0;
    for (    StoragePoolAllocator allocator : allocators) {
      List<StoragePool> pools=allocator.allocateToPool(profile,vmProfile,plan,new ExcludeList(),1);
      if (!pools.isEmpty()) {
        foundAcct++;
      }
    }
    if (foundAcct != 0) {
      Assert.fail();
    }
  }
 catch (  Exception e) {
    cleanDb();
    Assert.fail();
  }
}
Program: 105823
Project: 105823
Buggy source:
@Test public void testClusterAllocatorWithTags(){
  try {
    createDb();
    StoragePoolDetailVO detailVO=new StoragePoolDetailVO(this.storagePoolId,"String_Node_Str","String_Node_Str",display);
    poolDetailsDao.persist(detailVO);
    DiskOfferingVO diskOff=this.diskOfferingDao.findById(diskOffering.getId());
    List<String> tags=new ArrayList<String>();
    tags.add("String_Node_Str");
    diskOff.setTagsArray(tags);
    diskOfferingDao.update(diskOff.getId(),diskOff);
    DiskProfile profile=new DiskProfile(volume,diskOff,HypervisorType.XenServer);
    VirtualMachineProfile vmProfile=Mockito.mock(VirtualMachineProfile.class);
    Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class),Matchers.any(StoragePool.class))).thenReturn(true);
    DeploymentPlan plan=new DataCenterDeployment(dcId,podId,clusterId,null,null,null);
    int foundAcct=0;
    for (    StoragePoolAllocator allocator : allocators) {
      List<StoragePool> pools=allocator.allocateToPool(profile,vmProfile,plan,new ExcludeList(),1);
      if (!pools.isEmpty()) {
        Assert.assertEquals(pools.get(0).getId(),storage.getId());
        foundAcct++;
      }
    }
    if (foundAcct > 1 || foundAcct == 0) {
      Assert.fail();
    }
  }
 catch (  Exception e) {
    cleanDb();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testClusterAllocatorWithTags(){
  try {
    createDb();
    StoragePoolDetailVO detailVO=new StoragePoolDetailVO(this.storagePoolId,"String_Node_Str","String_Node_Str",true);
    poolDetailsDao.persist(detailVO);
    DiskOfferingVO diskOff=this.diskOfferingDao.findById(diskOffering.getId());
    List<String> tags=new ArrayList<String>();
    tags.add("String_Node_Str");
    diskOff.setTagsArray(tags);
    diskOfferingDao.update(diskOff.getId(),diskOff);
    DiskProfile profile=new DiskProfile(volume,diskOff,HypervisorType.XenServer);
    VirtualMachineProfile vmProfile=Mockito.mock(VirtualMachineProfile.class);
    Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class),Matchers.any(StoragePool.class))).thenReturn(true);
    DeploymentPlan plan=new DataCenterDeployment(dcId,podId,clusterId,null,null,null);
    int foundAcct=0;
    for (    StoragePoolAllocator allocator : allocators) {
      List<StoragePool> pools=allocator.allocateToPool(profile,vmProfile,plan,new ExcludeList(),1);
      if (!pools.isEmpty()) {
        Assert.assertEquals(pools.get(0).getId(),storage.getId());
        foundAcct++;
      }
    }
    if (foundAcct > 1 || foundAcct == 0) {
      Assert.fail();
    }
  }
 catch (  Exception e) {
    cleanDb();
    Assert.fail();
  }
}
Program: 105825
Project: 105825
Buggy source:
@Override public void onPublishMessage(String senderAddress,String subject,Object args){
  try {
    NetworkVO network=(NetworkVO)args;
    String bridgeName=generateBridgeNameForVpc(network.getVpcId());
    if (network.getVpcId() != null & isVpcEnabledForDistributedRouter(network.getVpcId())) {
      long vpcId=network.getVpcId();
      OvsVpcRoutingPolicyConfigCommand cmd=prepareVpcRoutingPolicyUpdate(vpcId);
      List<Long> vpcSpannedHostIds=_ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId);
      for (      Long id : vpcSpannedHostIds) {
        if (!sendVpcRoutingPolicyChangeUpdate(cmd,id,bridgeName)) {
          s_logger.debug("String_Node_Str" + id + "String_Node_Str");
        }
      }
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void onPublishMessage(String senderAddress,String subject,Object args){
  try {
    NetworkVO network=(NetworkVO)args;
    String bridgeName=generateBridgeNameForVpc(network.getVpcId());
    if (network.getVpcId() != null && isVpcEnabledForDistributedRouter(network.getVpcId())) {
      long vpcId=network.getVpcId();
      OvsVpcRoutingPolicyConfigCommand cmd=prepareVpcRoutingPolicyUpdate(vpcId);
      List<Long> vpcSpannedHostIds=_ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId);
      for (      Long id : vpcSpannedHostIds) {
        if (!sendVpcRoutingPolicyChangeUpdate(cmd,id,bridgeName)) {
          s_logger.debug("String_Node_Str" + id + "String_Node_Str");
        }
      }
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
  }
}
Program: 105826
Project: 105826
Buggy source:
@Override public List<Long> getActiveVmsInNetworkOnHost(long networkId,long hostId){
  List<Long> vmIds=new ArrayList<>();
  List<UserVmVO> vms=_userVmDao.listByNetworkIdAndStates(networkId,VirtualMachine.State.Running,VirtualMachine.State.Starting,VirtualMachine.State.Stopping,VirtualMachine.State.Unknown,VirtualMachine.State.Migrating);
  List<DomainRouterVO> routers=_routerDao.findByNetwork(networkId);
  List<VMInstanceVO> ins=new ArrayList<VMInstanceVO>();
  if (vms != null) {
    for (    UserVmVO vm : vms) {
      if (vm.getHostId() == hostId)       vmIds.add(vm.getId());
    }
  }
  if (routers.size() != 0) {
    for (    DomainRouterVO router : routers) {
      if (router.getHostId() == hostId)       vmIds.add(router.getId());
    }
  }
  return vmIds;
}

Fixed version (ground truth):
/** 
 * get the list of all Vm id's in the network that are running on the host
 */
@Override public List<Long> getActiveVmsInNetworkOnHost(long networkId,long hostId){
  List<Long> vmIds=new ArrayList<>();
  List<UserVmVO> vms=_userVmDao.listByNetworkIdAndStates(networkId,VirtualMachine.State.Running,VirtualMachine.State.Starting,VirtualMachine.State.Stopping,VirtualMachine.State.Unknown,VirtualMachine.State.Migrating);
  List<DomainRouterVO> routers=_routerDao.findByNetwork(networkId);
  if (vms != null) {
    for (    UserVmVO vm : vms) {
      if (vm.getHostId() == hostId)       vmIds.add(vm.getId());
    }
  }
  if (routers.size() != 0) {
    for (    DomainRouterVO router : routers) {
      if (router.getHostId() == hostId)       vmIds.add(router.getId());
    }
  }
  return vmIds;
}
Program: 105827
Project: 105827
Buggy source:
@Override public List<Long> getAllActiveVmsInVpc(long vpcId){
  Set<Long> vmIdsSet=new HashSet<>();
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  for (  Network network : vpcNetworks) {
    List<Long> networkVmIds=getAllActiveVmsInNetwork(network.getId());
    if (networkVmIds != null && !networkVmIds.isEmpty()) {
      vmIdsSet.addAll(networkVmIds);
    }
  }
  List<Long> vmIds=new ArrayList<>();
  vmIds.addAll(vmIdsSet);
  return vmIds;
}

Fixed version (ground truth):
/** 
 * get the list of all active Vm id's in the VPC for all ther tiers
 */
@Override public List<Long> getAllActiveVmsInVpc(long vpcId){
  Set<Long> vmIdsSet=new HashSet<>();
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  for (  Network network : vpcNetworks) {
    List<Long> networkVmIds=getAllActiveVmsInNetwork(network.getId());
    if (networkVmIds != null && !networkVmIds.isEmpty()) {
      vmIdsSet.addAll(networkVmIds);
    }
  }
  List<Long> vmIds=new ArrayList<>();
  vmIds.addAll(vmIdsSet);
  return vmIds;
}
Program: 105828
Project: 105828
Buggy source:
@Override public List<Long> getActiveVmsInVpcOnHost(long vpcId,long hostId){
  Set<Long> vmIdsSet=new HashSet<>();
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  for (  Network network : vpcNetworks) {
    List<Long> networkVmIds=getActiveVmsInNetworkOnHost(network.getId(),hostId);
    if (networkVmIds != null && !networkVmIds.isEmpty()) {
      vmIdsSet.addAll(networkVmIds);
    }
  }
  List<Long> vmIds=new ArrayList<>();
  vmIds.addAll(vmIdsSet);
  return vmIds;
}

Fixed version (ground truth):
/** 
 * get the list of all Vm id's in the VPC for all the tiers that are running on the host
 */
@Override public List<Long> getActiveVmsInVpcOnHost(long vpcId,long hostId){
  Set<Long> vmIdsSet=new HashSet<>();
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  for (  Network network : vpcNetworks) {
    List<Long> networkVmIds=getActiveVmsInNetworkOnHost(network.getId(),hostId);
    if (networkVmIds != null && !networkVmIds.isEmpty()) {
      vmIdsSet.addAll(networkVmIds);
    }
  }
  List<Long> vmIds=new ArrayList<>();
  vmIds.addAll(vmIdsSet);
  return vmIds;
}
Program: 105829
Project: 105829
Buggy source:
@Override public List<Long> getVpcIdsVmIsPartOf(long vmId){
  List<Long> vpcIds=new ArrayList<>();
  List<NicVO> nics=_nicDao.listByVmId(vmId);
  if (nics == null)   return null;
  for (  Nic nic : nics) {
    Network network=_networkDao.findById(nic.getNetworkId());
    if (network != null && network.getTrafficType() == Networks.TrafficType.Guest && network.getVpcId() != null) {
      if (!vpcIds.contains(network.getVpcId())) {
        vpcIds.add(network.getVpcId());
      }
    }
  }
  return vpcIds;
}

Fixed version (ground truth):
/** 
 * get the list of all Vpc id's in which, a VM has a nic in the network that is part of VPC
 */
@Override public List<Long> getVpcIdsVmIsPartOf(long vmId){
  List<Long> vpcIds=new ArrayList<>();
  List<NicVO> nics=_nicDao.listByVmId(vmId);
  if (nics == null)   return null;
  for (  Nic nic : nics) {
    Network network=_networkDao.findById(nic.getNetworkId());
    if (network != null && network.getTrafficType() == Networks.TrafficType.Guest && network.getVpcId() != null) {
      if (!vpcIds.contains(network.getVpcId())) {
        vpcIds.add(network.getVpcId());
      }
    }
  }
  return vpcIds;
}
Program: 105830
Project: 105830
Buggy source:
@Override public List<Long> getVpcOnHost(long hostId){
  List<Long> vpcIds=new ArrayList<>();
  List<VMInstanceVO> vmInstances=_vmInstanceDao.listByHostId(hostId);
  for (  VMInstanceVO instance : vmInstances) {
    List<NicVO> nics=_nicDao.listByVmId(instance.getId());
    for (    Nic nic : nics) {
      Network network=_networkDao.findById(nic.getNetworkId());
      if (network.getTrafficType() == Networks.TrafficType.Guest && network.getVpcId() != null) {
        if (!vpcIds.contains(network.getVpcId())) {
          vpcIds.add(network.getVpcId());
        }
      }
    }
  }
  return vpcIds;
}

Fixed version (ground truth):
/** 
 * get the list of VPC id's of the vpc's for which one or more VM's from the VPC are running on the host
 */
@Override public List<Long> getVpcOnHost(long hostId){
  List<Long> vpcIds=new ArrayList<>();
  List<VMInstanceVO> vmInstances=_vmInstanceDao.listByHostId(hostId);
  for (  VMInstanceVO instance : vmInstances) {
    List<NicVO> nics=_nicDao.listByVmId(instance.getId());
    for (    Nic nic : nics) {
      Network network=_networkDao.findById(nic.getNetworkId());
      if (network.getTrafficType() == Networks.TrafficType.Guest && network.getVpcId() != null) {
        if (!vpcIds.contains(network.getVpcId())) {
          vpcIds.add(network.getVpcId());
        }
      }
    }
  }
  return vpcIds;
}
Program: 105831
Project: 105831
Buggy source:
@Override public List<Long> getAllActiveVmsInNetwork(long networkId){
  List<Long> vmIds=new ArrayList<>();
  List<UserVmVO> vms=_userVmDao.listByNetworkIdAndStates(networkId,VirtualMachine.State.Running,VirtualMachine.State.Starting,VirtualMachine.State.Stopping,VirtualMachine.State.Unknown,VirtualMachine.State.Migrating);
  List<DomainRouterVO> routers=_routerDao.findByNetwork(networkId);
  List<VMInstanceVO> ins=new ArrayList<VMInstanceVO>();
  if (vms != null) {
    for (    UserVmVO vm : vms) {
      vmIds.add(vm.getId());
    }
  }
  if (routers.size() != 0) {
    for (    DomainRouterVO router : routers) {
      vmIds.add(router.getId());
    }
  }
  return vmIds;
}

Fixed version (ground truth):
/** 
 * get the list of all active Vm id's in a network
 */
@Override public List<Long> getAllActiveVmsInNetwork(long networkId){
  List<Long> vmIds=new ArrayList<>();
  List<UserVmVO> vms=_userVmDao.listByNetworkIdAndStates(networkId,VirtualMachine.State.Running,VirtualMachine.State.Starting,VirtualMachine.State.Stopping,VirtualMachine.State.Unknown,VirtualMachine.State.Migrating);
  List<DomainRouterVO> routers=_routerDao.findByNetwork(networkId);
  if (vms != null) {
    for (    UserVmVO vm : vms) {
      vmIds.add(vm.getId());
    }
  }
  if (routers.size() != 0) {
    for (    DomainRouterVO router : routers) {
      vmIds.add(router.getId());
    }
  }
  return vmIds;
}
Program: 105832
Project: 105832
Buggy source:
public boolean sendVpcRoutingPolicyChangeUpdate(OvsVpcRoutingPolicyConfigCommand updateCmd,long hostId,String bridgeName){
  try {
    s_logger.debug("String_Node_Str" + hostId);
    updateCmd.setHostId(hostId);
    updateCmd.setBridgeName(bridgeName);
    Answer ans=_agentMgr.send(hostId,updateCmd);
    if (ans.getResult()) {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return true;
    }
 else {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
public boolean sendVpcRoutingPolicyChangeUpdate(OvsVpcRoutingPolicyConfigCommand updateCmd,long hostId,String bridgeName){
  try {
    s_logger.debug("String_Node_Str" + hostId);
    updateCmd.setHostId(hostId);
    updateCmd.setBridgeName(bridgeName);
    Answer ans=_agentMgr.send(hostId,updateCmd);
    if (ans.getResult()) {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return true;
    }
 else {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str" + hostId + "String_Node_Str",e);
    return false;
  }
}
Program: 105833
Project: 105833
Buggy source:
public boolean sendVpcTopologyChangeUpdate(OvsVpcPhysicalTopologyConfigCommand updateCmd,long hostId,String bridgeName){
  try {
    s_logger.debug("String_Node_Str" + hostId);
    updateCmd.setHostId(hostId);
    updateCmd.setBridgeName(bridgeName);
    Answer ans=_agentMgr.send(hostId,updateCmd);
    if (ans.getResult()) {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return true;
    }
 else {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
public boolean sendVpcTopologyChangeUpdate(OvsVpcPhysicalTopologyConfigCommand updateCmd,long hostId,String bridgeName){
  try {
    s_logger.debug("String_Node_Str" + hostId);
    updateCmd.setHostId(hostId);
    updateCmd.setBridgeName(bridgeName);
    Answer ans=_agentMgr.send(hostId,updateCmd);
    if (ans.getResult()) {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return true;
    }
 else {
      s_logger.debug("String_Node_Str" + hostId + "String_Node_Str");
      return false;
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str" + hostId + "String_Node_Str",e);
    return false;
  }
}
Program: 105834
Project: 105834
Buggy source:
@Override public void onPublishMessage(String senderAddress,String subject,Object args){
  NetworkVO network=(NetworkVO)args;
  String bridgeName=generateBridgeNameForVpc(network.getVpcId());
  if (network.getVpcId() != null & isVpcEnabledForDistributedRouter(network.getVpcId())) {
    long vpcId=network.getVpcId();
    OvsVpcRoutingPolicyConfigCommand cmd=prepareVpcRoutingPolicyUpdate(vpcId);
    List<Long> vpcSpannedHostIds=_ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId);
    for (    Long id : vpcSpannedHostIds) {
      if (!sendVpcRoutingPolicyChangeUpdate(cmd,id,bridgeName)) {
        s_logger.debug("String_Node_Str" + id + "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPublishMessage(String senderAddress,String subject,Object args){
  try {
    NetworkVO network=(NetworkVO)args;
    String bridgeName=generateBridgeNameForVpc(network.getVpcId());
    if (network.getVpcId() != null & isVpcEnabledForDistributedRouter(network.getVpcId())) {
      long vpcId=network.getVpcId();
      OvsVpcRoutingPolicyConfigCommand cmd=prepareVpcRoutingPolicyUpdate(vpcId);
      List<Long> vpcSpannedHostIds=_ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId);
      for (      Long id : vpcSpannedHostIds) {
        if (!sendVpcRoutingPolicyChangeUpdate(cmd,id,bridgeName)) {
          s_logger.debug("String_Node_Str" + id + "String_Node_Str");
        }
      }
    }
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
  }
}
Program: 105836
Project: 105836
Buggy source:
@Override public boolean release(Network network,NicProfile nic,VirtualMachineProfile vm,ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException {
  if (!canHandle(network,Service.Connectivity)) {
    return false;
  }
  if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) {
    return false;
  }
  if (nic.getTrafficType() != Networks.TrafficType.Guest) {
    return false;
  }
  List<UserVmVO> userVms=_userVmDao.listByAccountIdAndHostId(vm.getVirtualMachine().getAccountId(),vm.getVirtualMachine().getHostId());
  if (vm.getType() == VirtualMachine.Type.User) {
    if (userVms.size() > 1) {
      return true;
    }
    List<DomainRouterVO> routers=_routerDao.findByNetwork(network.getId());
    for (    DomainRouterVO router : routers) {
      if (router.getHostId().equals(vm.getVirtualMachine().getHostId())) {
        return true;
      }
    }
  }
 else   if (vm.getType() == VirtualMachine.Type.DomainRouter && userVms.size() != 0) {
    return true;
  }
  HostVO host=_hostDao.findById(vm.getVirtualMachine().getHostId());
  _ovsTunnelMgr.checkAndRemoveHostFromTunnelNetwork(network,host);
  return true;
}

Fixed version (ground truth):
@Override public boolean release(Network network,NicProfile nic,VirtualMachineProfile vm,ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException {
  if (!canHandle(network,Service.Connectivity)) {
    return false;
  }
  if (nic.getBroadcastType() != Networks.BroadcastDomainType.Vswitch) {
    return false;
  }
  if (nic.getTrafficType() != Networks.TrafficType.Guest) {
    return false;
  }
  HostVO host=_hostDao.findById(vm.getVirtualMachine().getHostId());
  _ovsTunnelMgr.checkAndRemoveHostFromTunnelNetwork(network,host);
  return true;
}
Program: 105837
Project: 105837
Buggy source:
@Override public List<Long> getAllActiveVmsInVpc(long vpcId){
  return null;
}

Fixed version (ground truth):
@Override public List<Long> getAllActiveVmsInVpc(long vpcId){
  Set<Long> vmIdsSet=new HashSet<>();
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  for (  Network network : vpcNetworks) {
    List<Long> networkVmIds=getAllActiveVmsInNetwork(network.getId());
    if (networkVmIds != null && !networkVmIds.isEmpty()) {
      vmIdsSet.addAll(networkVmIds);
    }
  }
  List<Long> vmIds=new ArrayList<>();
  vmIds.addAll(vmIdsSet);
  return vmIds;
}
Program: 105838
Project: 105838
Buggy source:
@Override public List<Long> getActiveVmsInVpcOnHost(long vpcId,long hostId){
  return null;
}

Fixed version (ground truth):
@Override public List<Long> getActiveVmsInVpcOnHost(long vpcId,long hostId){
  Set<Long> vmIdsSet=new HashSet<>();
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  for (  Network network : vpcNetworks) {
    List<Long> networkVmIds=getActiveVmsInNetworkOnHost(network.getId(),hostId);
    if (networkVmIds != null && !networkVmIds.isEmpty()) {
      vmIdsSet.addAll(networkVmIds);
    }
  }
  List<Long> vmIds=new ArrayList<>();
  vmIds.addAll(vmIdsSet);
  return vmIds;
}
Program: 105839
Project: 105839
Buggy source:
@Override public List<Long> getVpcSpannedHosts(long vpId){
  return null;
}

Fixed version (ground truth):
/** 
 * get the list of hypervisor hosts on which VM's belonging to a VPC currently spans
 */
@Override public List<Long> getVpcSpannedHosts(long vpcId){
  List<? extends Network> vpcNetworks=_vpcMgr.getVpcNetworks(vpcId);
  List<Long> vpcHostIds=new ArrayList<>();
  for (  Network vpcNetwork : vpcNetworks) {
    List<Long> networkHostIds=new ArrayList<Long>();
    networkHostIds=getNetworkSpanedHosts(vpcNetwork.getId());
    if (networkHostIds != null && !networkHostIds.isEmpty()) {
      for (      Long hostId : networkHostIds) {
        if (!vpcHostIds.contains(hostId)) {
          vpcHostIds.add(hostId);
        }
      }
    }
  }
  return vpcHostIds;
}
Program: 105840
Project: 105840
Buggy source:
@Override public List<Long> getVpcOnHost(long hostId){
  return null;
}

Fixed version (ground truth):
@Override public List<Long> getVpcOnHost(long hostId){
  List<Long> vpcIds=new ArrayList<>();
  List<VMInstanceVO> vmInstances=_vmInstanceDao.listByHostId(hostId);
  for (  VMInstanceVO instance : vmInstances) {
    List<NicVO> nics=_nicDao.listByVmId(instance.getId());
    for (    Nic nic : nics) {
      Network network=_networkDao.findById(nic.getNetworkId());
      if (network.getTrafficType() == Networks.TrafficType.Guest && network.getVpcId() != null) {
        if (!vpcIds.contains(network.getVpcId())) {
          vpcIds.add(network.getVpcId());
        }
      }
    }
  }
  return vpcIds;
}
Program: 105841
Project: 105841
Buggy source:
@Override public IAMEntityType getEntityType(){
}

Fixed version (ground truth):
@Override public IAMEntityType getEntityType(){
  return IAMEntityType.Vpc;
}
Program: 105843
Project: 105843
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _executorPool=Executors.newScheduledThreadPool(10,new NamedThreadFactory("String_Node_Str"));
  _cleanupExecutor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  _messageBus.subscribe("String_Node_Str",new NetworkAclEventsSubscriber());
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _executorPool=Executors.newScheduledThreadPool(10,new NamedThreadFactory("String_Node_Str"));
  _cleanupExecutor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  _messageBus.subscribe("String_Node_Str",new NetworkAclEventsSubscriber());
  VirtualMachine.State.getStateMachine().registerListener(this);
  return true;
}
Program: 105844
Project: 105844
Buggy source:
OvsVpcRoutingPolicyConfigCommand prepareVpcRoutingPolicyUpdate(long vpcId){
}

Fixed version (ground truth):
private OvsVpcRoutingPolicyConfigCommand prepareVpcRoutingPolicyUpdate(long vpcId){
}
Program: 105845
Project: 105845
Buggy source:
@Override public boolean isPortableIpTransferableFromNetwork(long ipAddrId,long networkId){
  Network network=_networksDao.findById(networkId);
  if (network == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  IPAddressVO ip=_ipAddressDao.findById(ipAddrId);
  if (ip == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  List<PublicIpAddress> ipList=new ArrayList<PublicIpAddress>();
  PublicIp publicIp=PublicIp.createFromAddrAndVlan(ip,_vlanDao.findById(ip.getVlanId()));
  ipList.add(publicIp);
  Map<PublicIpAddress,Set<Service>> ipToServices=_networkModel.getIpToServices(ipList,false,true);
  if (ipToServices != null & !ipToServices.isEmpty()) {
    Set<Service> ipServices=ipToServices.get(publicIp);
    if (ipServices != null && !ipServices.isEmpty()) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isPortableIpTransferableFromNetwork(long ipAddrId,long networkId){
  Network network=_networksDao.findById(networkId);
  if (network == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  IPAddressVO ip=_ipAddressDao.findById(ipAddrId);
  if (ip == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  List<PublicIpAddress> ipList=new ArrayList<PublicIpAddress>();
  PublicIp publicIp=PublicIp.createFromAddrAndVlan(ip,_vlanDao.findById(ip.getVlanId()));
  ipList.add(publicIp);
  Map<PublicIpAddress,Set<Service>> ipToServices=_networkModel.getIpToServices(ipList,false,true);
  if (!ipToServices.isEmpty()) {
    Set<Service> ipServices=ipToServices.get(publicIp);
    if (ipServices != null && !ipServices.isEmpty()) {
      return false;
    }
  }
  return true;
}
Program: 105848
Project: 105848
Buggy source:
Boolean isDynamicallyScalable();

Fixed version (ground truth):
boolean isDynamicallyScalable();
Program: 105849
Project: 105849
Buggy source:
@Override public Boolean isDynamicallyScalable(){
  return dynamicallyScalable;
}

Fixed version (ground truth):
@Override public boolean isDynamicallyScalable(){
  return dynamicallyScalable;
}
Program: 105850
Project: 105850
Buggy source:
@Override public Boolean isDynamicallyScalable(){
  return Boolean.FALSE;
}

Fixed version (ground truth):
@Override public boolean isDynamicallyScalable(){
  return false;
}
Program: 105851
Project: 105851
Buggy source:
@Override public Boolean isDynamicallyScalable(){
  return null;
}

Fixed version (ground truth):
@Override public boolean isDynamicallyScalable(){
  return false;
}
Program: 105854
Project: 105854
Buggy source:
@Override public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd){
  String key=cmd.getKey();
  Boolean forDisplay=cmd.forDisplay();
  ResourceTag.ResourceObjectType resourceType=cmd.getResourceType();
  String resourceIdStr=cmd.getResourceId();
  Long resourceId=null;
  if (resourceIdStr != null) {
    resourceId=_taggedResourceMgr.getResourceId(resourceIdStr,resourceType);
  }
  List<? extends ResourceDetail> detailList=new ArrayList<ResourceDetail>();
  ResourceDetail requestedDetail=null;
  if (key == null) {
    detailList=_resourceMetaDataMgr.getDetailsList(resourceId,resourceType,forDisplay);
  }
 else {
    requestedDetail=_resourceMetaDataMgr.getDetail(resourceId,resourceType,key);
    if (forDisplay != null && requestedDetail.isDisplay() != forDisplay) {
      requestedDetail=null;
    }
  }
  List<ResourceDetailResponse> responseList=new ArrayList<ResourceDetailResponse>();
  if (requestedDetail != null) {
    ResourceDetailResponse detailResponse=createResourceDetailsResponse(requestedDetail,resourceType);
    responseList.add(detailResponse);
  }
 else {
    for (    ResourceDetail detail : detailList) {
      ResourceDetailResponse detailResponse=createResourceDetailsResponse(detail,resourceType);
      responseList.add(detailResponse);
    }
  }
  return responseList;
}

Fixed version (ground truth):
@Override public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd){
  String key=cmd.getKey();
  Boolean forDisplay=cmd.forDisplay();
  ResourceTag.ResourceObjectType resourceType=cmd.getResourceType();
  String resourceIdStr=cmd.getResourceId();
  Long resourceId=null;
  if (resourceIdStr != null) {
    resourceId=_taggedResourceMgr.getResourceId(resourceIdStr,resourceType);
  }
  if (resourceId == null) {
    throw new InvalidParameterValueException("String_Node_Str" + resourceIdStr + "String_Node_Str"+ resourceType);
  }
  List<? extends ResourceDetail> detailList=new ArrayList<ResourceDetail>();
  ResourceDetail requestedDetail=null;
  if (key == null) {
    detailList=_resourceMetaDataMgr.getDetailsList(resourceId,resourceType,forDisplay);
  }
 else {
    requestedDetail=_resourceMetaDataMgr.getDetail(resourceId,resourceType,key);
    if (forDisplay != null && requestedDetail.isDisplay() != forDisplay) {
      requestedDetail=null;
    }
  }
  List<ResourceDetailResponse> responseList=new ArrayList<ResourceDetailResponse>();
  if (requestedDetail != null) {
    ResourceDetailResponse detailResponse=createResourceDetailsResponse(requestedDetail,resourceType);
    responseList.add(detailResponse);
  }
 else {
    for (    ResourceDetail detail : detailList) {
      ResourceDetailResponse detailResponse=createResourceDetailsResponse(detail,resourceType);
      responseList.add(detailResponse);
    }
  }
  return responseList;
}
Program: 105855
Project: 105855
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  IAMPermissionResponse other=(IAMPermissionResponse)obj;
  if ((entityType == null && other.entityType != null) || !entityType.equals(other.entityType)) {
    return false;
  }
 else   if ((action == null && other.action != null) || !action.equals(other.action)) {
    return false;
  }
 else   if ((scope == null && other.scope != null) || !scope.equals(other.scope)) {
    return false;
  }
 else   if ((scopeId == null && other.scopeId != null) || !scopeId.equals(other.scopeId)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  IAMPermissionResponse other=(IAMPermissionResponse)obj;
  if ((entityType == null && other.entityType != null) || (entityType != null && !entityType.equals(other.entityType))) {
    return false;
  }
 else   if ((action == null && other.action != null) || (action != null && !action.equals(other.action))) {
    return false;
  }
 else   if ((scope == null && other.scope != null) || (scope != null && !scope.equals(other.scope))) {
    return false;
  }
 else   if ((scopeId == null && other.scopeId != null) || (scopeId != null && !scopeId.equals(other.scopeId))) {
    return false;
  }
  return true;
}
Program: 105856
Project: 105856
Buggy source:
@DB @Override @ActionEvent(eventType=EventTypes.EVENT_IAM_POLICY_GRANT,eventDescription="String_Node_Str") public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId,String entityType,PermissionScope scope,Long scopeId,String action,Permission perm,Boolean recursive){
  Class<?> cmdClass=_apiServer.getCmdClass(action);
  AccessType accessType=null;
  if (BaseListCmd.class.isAssignableFrom(cmdClass)) {
    accessType=AccessType.UseEntry;
  }
  return _iamSrv.addIAMPermissionToIAMPolicy(iamPolicyId,entityType,scope.toString(),scopeId,action,accessType.toString(),perm,recursive);
}

Fixed version (ground truth):
@DB @Override @ActionEvent(eventType=EventTypes.EVENT_IAM_POLICY_GRANT,eventDescription="String_Node_Str") public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId,String entityType,PermissionScope scope,Long scopeId,String action,Permission perm,Boolean recursive){
  Class<?> cmdClass=_apiServer.getCmdClass(action);
  AccessType accessType=null;
  if (BaseListCmd.class.isAssignableFrom(cmdClass)) {
    accessType=AccessType.UseEntry;
  }
  String accessTypeStr=(accessType != null) ? accessType.toString() : null;
  return _iamSrv.addIAMPermissionToIAMPolicy(iamPolicyId,entityType,scope.toString(),scopeId,action,accessTypeStr,perm,recursive);
}
Program: 105858
Project: 105858
Buggy source:
protected SetSourceNatCommand generateSetSourceNatCommand(){
  IpAddressTO ip=new IpAddressTO(1,"String_Node_Str",true,true,true,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",1000,false);
  SetSourceNatCommand cmd=new SetSourceNatCommand(ip,true);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTER_NAME);
  return cmd;
}

Fixed version (ground truth):
protected SetSourceNatCommand generateSetSourceNatCommand(){
  IpAddressTO ip=new IpAddressTO(1,"String_Node_Str",true,true,true,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",1000,false);
  SetSourceNatCommand cmd=new SetSourceNatCommand(ip,true);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTERNAME);
  return cmd;
}
Program: 105859
Project: 105859
Buggy source:
protected SavePasswordCommand generateSavePasswordCommand(){
  SavePasswordCommand cmd=new SavePasswordCommand("String_Node_Str","String_Node_Str","String_Node_Str",true);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTER_NAME);
  return cmd;
}

Fixed version (ground truth):
protected SavePasswordCommand generateSavePasswordCommand(){
  SavePasswordCommand cmd=new SavePasswordCommand("String_Node_Str","String_Node_Str","String_Node_Str",true);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTERNAME);
  return cmd;
}
Program: 105860
Project: 105860
Buggy source:
protected DnsMasqConfigCommand generateDnsMasqConfigCommand(){
  List<DhcpTO> dhcps=new ArrayList<>();
  dhcps.add(new DhcpTO("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  dhcps.add(new DhcpTO("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  DnsMasqConfigCommand cmd=new DnsMasqConfigCommand(dhcps);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTER_NAME);
  return cmd;
}

Fixed version (ground truth):
protected DnsMasqConfigCommand generateDnsMasqConfigCommand(){
  List<DhcpTO> dhcps=new ArrayList<>();
  dhcps.add(new DhcpTO("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  dhcps.add(new DhcpTO("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  DnsMasqConfigCommand cmd=new DnsMasqConfigCommand(dhcps);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTERNAME);
  return cmd;
}
Program: 105861
Project: 105861
Buggy source:
protected RemoteAccessVpnCfgCommand generateRemoteAccessVpnCfgCommand2(){
  RemoteAccessVpnCfgCommand cmd=new RemoteAccessVpnCfgCommand(false,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",false);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTER_NAME);
  cmd.setLocalCidr("String_Node_Str");
  return cmd;
}

Fixed version (ground truth):
protected RemoteAccessVpnCfgCommand generateRemoteAccessVpnCfgCommand2(){
  RemoteAccessVpnCfgCommand cmd=new RemoteAccessVpnCfgCommand(false,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",false);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTERNAME);
  cmd.setLocalCidr("String_Node_Str");
  return cmd;
}
Program: 105862
Project: 105862
Buggy source:
protected RemoteAccessVpnCfgCommand generateRemoteAccessVpnCfgCommand3(){
  RemoteAccessVpnCfgCommand cmd=new RemoteAccessVpnCfgCommand(true,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",true);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTER_NAME);
  cmd.setLocalCidr("String_Node_Str");
  return cmd;
}

Fixed version (ground truth):
protected RemoteAccessVpnCfgCommand generateRemoteAccessVpnCfgCommand3(){
  RemoteAccessVpnCfgCommand cmd=new RemoteAccessVpnCfgCommand(true,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",true);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,ROUTERNAME);
  cmd.setLocalCidr("String_Node_Str");
  return cmd;
}