nus-yam/ex-repair huggingface dataset:
Program: 105355
Project: 105355
Buggy source:
public CreateBcfAttachmentCommand(String tenantId,String tenantName,String networkId,String portId,String nicId,Integer vlan,String ipv4,String mac){
  this._tenantId=tenantId;
  this._tenantName=tenantName;
  this._networkId=networkId;
  this._portId=portId;
  this._nicId=nicId;
  this._vlan=vlan;
  this._ipv4=ipv4;
  this._mac=mac;
}

Fixed version (ground truth):
public CreateBcfAttachmentCommand(final String tenantId,final String tenantName,final String networkId,final String portId,final String nicId,final Integer vlan,final String ipv4,final String mac){
  this._tenantId=tenantId;
  this._tenantName=tenantName;
  this._networkId=networkId;
  this._portId=portId;
  this._nicId=nicId;
  this._vlan=vlan;
  this._ipv4=ipv4;
  this._mac=mac;
}
Program: 105356
Project: 105356
Buggy source:
public CreateBcfRouterCommand(String tenantId){
  this._tenantId=tenantId;
}

Fixed version (ground truth):
public CreateBcfRouterCommand(final String tenantId){
  this._tenantId=tenantId;
}
Program: 105357
Project: 105357
Buggy source:
public CreateBcfRouterInterfaceCommand(String tenantId,String networkId,String cidr,String gateway,String networkName){
  this._tenantId=tenantId;
  this._networkId=networkId;
  this._networkName=networkName;
  this._cidr=cidr;
  this._gateway=gateway;
}

Fixed version (ground truth):
public CreateBcfRouterInterfaceCommand(final String tenantId,final String networkId,final String cidr,final String gateway,final String networkName){
  this._tenantId=tenantId;
  this._networkId=networkId;
  this._networkName=networkName;
  this._cidr=cidr;
  this._gateway=gateway;
}
Program: 105358
Project: 105358
Buggy source:
public CreateBcfSegmentCommand(String tenantId,String tenantName,String networkId,String networkName,Integer vlan){
  this._tenantId=tenantId;
  this._tenantName=tenantName;
  this._networkId=networkId;
  this._networkName=networkName;
  this._vlan=vlan;
}

Fixed version (ground truth):
public CreateBcfSegmentCommand(final String tenantId,final String tenantName,final String networkId,final String networkName,final Integer vlan){
  this._tenantId=tenantId;
  this._tenantName=tenantName;
  this._networkId=networkId;
  this._networkName=networkName;
  this._vlan=vlan;
}
Program: 105359
Project: 105359
Buggy source:
public CreateBcfStaticNatCommand(String tenantId,String networkId,String privateIp,String publicIp,String mac){
  this._tenantId=tenantId;
  this._networkId=networkId;
  this._privateIp=privateIp;
  this._publicIp=publicIp;
  this._mac=mac;
}

Fixed version (ground truth):
public CreateBcfStaticNatCommand(final String tenantId,final String networkId,final String privateIp,final String publicIp,final String mac){
  this._tenantId=tenantId;
  this._networkId=networkId;
  this._privateIp=privateIp;
  this._publicIp=publicIp;
  this._mac=mac;
}
Program: 105360
Project: 105360
Buggy source:
public DeleteBcfAttachmentCommand(String tenantId,String networkId,String attachmentId){
  this._tenantId=tenantId;
  this._networkId=networkId;
  this._attachmentId=attachmentId;
}

Fixed version (ground truth):
public DeleteBcfAttachmentCommand(final String tenantId,final String networkId,final String attachmentId){
  this._tenantId=tenantId;
  this._networkId=networkId;
  this._attachmentId=attachmentId;
}
Program: 105361
Project: 105361
Buggy source:
public DeleteBcfSegmentCommand(String tenantUuid,String networkUuid){
  this._tenantUuid=tenantUuid;
  this._networkUuid=networkUuid;
}

Fixed version (ground truth):
public DeleteBcfSegmentCommand(final String tenantUuid,final String networkUuid){
  this._tenantUuid=tenantUuid;
  this._networkUuid=networkUuid;
}
Program: 105362
Project: 105362
Buggy source:
public DeleteBcfStaticNatCommand(String tenantId,String publicIp){
  this._tenantId=tenantId;
  this._publicIp=publicIp;
  this._floatingIpId=publicIp.replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public DeleteBcfStaticNatCommand(final String tenantId,final String publicIp){
  this._tenantId=tenantId;
  this._publicIp=publicIp;
  this._floatingIpId=publicIp.replace("String_Node_Str","String_Node_Str");
}
Program: 105363
Project: 105363
Buggy source:
public GetControllerDataAnswer(Command command,Exception e){
  super(command,e);
  this.ipAddress=null;
  this.isMaster=false;
}

Fixed version (ground truth):
public GetControllerDataAnswer(final Command command,final Exception e){
  super(command,e);
  this._ipAddress=null;
  this._isMaster=false;
}
Program: 105364
Project: 105364
Buggy source:
public String getIpAddress(){
  return ipAddress;
}

Fixed version (ground truth):
public String getIpAddress(){
  return _ipAddress;
}
Program: 105365
Project: 105365
Buggy source:
public boolean isMaster(){
  return isMaster;
}

Fixed version (ground truth):
public boolean isMaster(){
  return _isMaster;
}
Program: 105366
Project: 105366
Buggy source:
public void setSlave(HostVO slave){
  this.slave=slave;
}

Fixed version (ground truth):
public void setSlave(final HostVO slave){
  this.slave=slave;
}
Program: 105367
Project: 105367
Buggy source:
public void setMaster(HostVO master){
  this.master=master;
}

Fixed version (ground truth):
public void setMaster(final HostVO master){
  this.master=master;
}
Program: 105368
Project: 105368
Buggy source:
public boolean isRouterIncluded(){
  return routerIncluded;
}

Fixed version (ground truth):
public boolean isRouterIncluded(){
  return _routerIncluded;
}
Program: 105369
Project: 105369
Buggy source:
public boolean isNetworkIncluded(){
  return networkIncluded;
}

Fixed version (ground truth):
public boolean isNetworkIncluded(){
  return _networkIncluded;
}
Program: 105370
Project: 105370
Buggy source:
public SyncBcfTopologyCommand(boolean networkIncluded,boolean routerIncluded){
  this.networkIncluded=networkIncluded;
  this.routerIncluded=routerIncluded;
}

Fixed version (ground truth):
public SyncBcfTopologyCommand(final boolean networkIncluded,final boolean routerIncluded){
  this._networkIncluded=networkIncluded;
  this._routerIncluded=routerIncluded;
}
Program: 105371
Project: 105371
Buggy source:
/** 
 * Returns if the vm is still alive.
 * @param vm to work on.
 */
public Boolean isVmAlive(VirtualMachine vm,Host host);

Fixed version (ground truth):
/** 
 * Returns if the vm is still alive.
 * @param vm to work on.
 */
public boolean isVmAlive(VirtualMachine vm,Host host) throws UnknownVM ;
Program: 105372
Project: 105372
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) throws UnknownVM {
  Status status=isAgentAlive(host);
  if (status == null) {
    throw new UnknownVM();
  }
  return status == Status.Up ? true : null;
}
Program: 105373
Project: 105373
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) throws UnknownVM {
  Status status=isAgentAlive(host);
  if (status == null) {
    throw new UnknownVM();
  }
  if (status == Status.Up) {
    return true;
  }
 else {
    throw new UnknownVM();
  }
}
Program: 105374
Project: 105374
Buggy source:
@Override public Boolean isVmAlive(com.cloud.vm.VirtualMachine vm,Host host){
  LOGGER.debug("String_Node_Str" + vm.getHostName() + "String_Node_Str"+ host.getName());
  if (host.getHypervisorType() != Hypervisor.HypervisorType.Ovm3) {
    return null;
  }
  Status status=isAgentAlive(host);
  if (status == null) {
    return false;
  }
  return status == Status.Up ? true : false;
}

Fixed version (ground truth):
@Override public boolean isVmAlive(com.cloud.vm.VirtualMachine vm,Host host) throws UnknownVM {
  LOGGER.debug("String_Node_Str" + vm.getHostName() + "String_Node_Str"+ host.getName());
  if (host.getHypervisorType() != Hypervisor.HypervisorType.Ovm3) {
    throw new UnknownVM();
  }
  Status status=isAgentAlive(host);
  if (status == null) {
    return false;
  }
  return status == Status.Up ? true : false;
}
Program: 105375
Project: 105375
Buggy source:
@Override public Boolean isVmAlive(VirtualMachine vm,Host host){
  CheckVirtualMachineCommand cmd=new CheckVirtualMachineCommand(vm.getInstanceName());
  try {
    Answer answer=_agentMgr.send(vm.getHostId(),cmd);
    if (!answer.getResult()) {
      s_logger.debug("String_Node_Str" + vm.toString());
      return null;
    }
    CheckVirtualMachineAnswer cvmAnswer=(CheckVirtualMachineAnswer)answer;
    s_logger.debug("String_Node_Str" + cvmAnswer.getState().toString());
    return cvmAnswer.getState() == PowerState.PowerOn;
  }
 catch (  AgentUnavailableException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    return null;
  }
catch (  OperationTimedoutException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
@Override public boolean isVmAlive(VirtualMachine vm,Host host) throws UnknownVM {
  CheckVirtualMachineCommand cmd=new CheckVirtualMachineCommand(vm.getInstanceName());
  try {
    Answer answer=_agentMgr.send(vm.getHostId(),cmd);
    if (!answer.getResult()) {
      s_logger.debug("String_Node_Str" + vm.toString());
      throw new UnknownVM();
    }
    CheckVirtualMachineAnswer cvmAnswer=(CheckVirtualMachineAnswer)answer;
    s_logger.debug("String_Node_Str" + cvmAnswer.getState().toString());
    return cvmAnswer.getState() == PowerState.PowerOn;
  }
 catch (  AgentUnavailableException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    throw new UnknownVM();
  }
catch (  OperationTimedoutException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    throw new UnknownVM();
  }
}
Program: 105376
Project: 105376
Buggy source:
@Override public Boolean isVmAlive(VirtualMachine vm,Host host){
  if (vm.getHypervisorType() == HypervisorType.VMware)   return true;
  return null;
}

Fixed version (ground truth):
@Override public boolean isVmAlive(VirtualMachine vm,Host host) throws UnknownVM {
  if (vm.getHypervisorType() == HypervisorType.VMware)   return true;
  throw new UnknownVM();
}
Program: 105377
Project: 105377
Buggy source:
@Override public Boolean isVmAlive(VirtualMachine vm,Host host){
  CheckVirtualMachineCommand cmd=new CheckVirtualMachineCommand(vm.getInstanceName());
  try {
    CheckVirtualMachineAnswer answer=(CheckVirtualMachineAnswer)_agentMgr.send(vm.getHostId(),cmd);
    if (!answer.getResult()) {
      s_logger.debug("String_Node_Str" + vm.toString());
      return null;
    }
    s_logger.debug("String_Node_Str" + answer.getState().toString());
    return answer.getState() == PowerState.PowerOn;
  }
 catch (  AgentUnavailableException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    return null;
  }
catch (  OperationTimedoutException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
@Override public boolean isVmAlive(VirtualMachine vm,Host host) throws UnknownVM {
  CheckVirtualMachineCommand cmd=new CheckVirtualMachineCommand(vm.getInstanceName());
  try {
    CheckVirtualMachineAnswer answer=(CheckVirtualMachineAnswer)_agentMgr.send(vm.getHostId(),cmd);
    if (!answer.getResult()) {
      s_logger.debug("String_Node_Str" + vm.toString());
      throw new UnknownVM();
    }
    s_logger.debug("String_Node_Str" + answer.getState().toString());
    return answer.getState() == PowerState.PowerOn;
  }
 catch (  AgentUnavailableException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    throw new UnknownVM();
  }
catch (  OperationTimedoutException e) {
    s_logger.debug("String_Node_Str" + vm.toString() + "String_Node_Str"+ e.getMessage());
    throw new UnknownVM();
  }
}
Program: 105379
Project: 105379
Buggy source:
@Override public Boolean isVmAlive(VirtualMachine vm,Host host){
  if (vm.getType() != VirtualMachine.Type.User) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
    }
    return null;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
  }
  UserVmVO userVm=_userVmDao.findById(vm.getId());
  List<? extends Nic> nics=_networkMgr.getNicsForTraffic(userVm.getId(),TrafficType.Guest);
  for (  Nic nic : nics) {
    if (nic.getIp4Address() == null) {
      continue;
    }
    List<VirtualRouter> routers=_vnaMgr.getRoutersForNetwork(nic.getNetworkId());
    if (routers == null || routers.isEmpty()) {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + nic.getNetworkId() + "String_Node_Str"+ vm);
      }
      continue;
    }
    Boolean result=null;
    for (    VirtualRouter router : routers) {
      result=testUserVM(vm,nic,router);
      if (result != null) {
        break;
      }
    }
    if (result == null) {
      continue;
    }
    return result;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + vm);
  }
  return null;
}

Fixed version (ground truth):
@Override public boolean isVmAlive(VirtualMachine vm,Host host) throws UnknownVM {
  if (vm.getType() != VirtualMachine.Type.User) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
    }
    throw new UnknownVM();
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
  }
  UserVmVO userVm=_userVmDao.findById(vm.getId());
  List<? extends Nic> nics=_networkMgr.getNicsForTraffic(userVm.getId(),TrafficType.Guest);
  for (  Nic nic : nics) {
    if (nic.getIp4Address() == null) {
      continue;
    }
    List<VirtualRouter> routers=_vnaMgr.getRoutersForNetwork(nic.getNetworkId());
    if (routers == null || routers.isEmpty()) {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + nic.getNetworkId() + "String_Node_Str"+ vm);
      }
      continue;
    }
    Boolean result=null;
    for (    VirtualRouter router : routers) {
      result=testUserVM(vm,nic,router);
      if (result != null) {
        break;
      }
    }
    if (result == null) {
      continue;
    }
    return result;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + vm);
  }
  throw new UnknownVM();
}
Program: 105380
Project: 105380
Buggy source:
@Override public Boolean isVmAlive(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(VirtualMachine vm,Host host) throws UnknownVM {
  Status status=isAgentAlive(host);
  if (status == null) {
    throw new UnknownVM();
  }
  if (status == Status.Up) {
    return true;
  }
 else {
    throw new UnknownVM();
  }
}
Program: 105382
Project: 105382
Buggy source:
public boolean isRedundant(){
  return this.guestNetwork.isRedundant();
}

Fixed version (ground truth):
public boolean isRedundant(){
  return guestNetwork.isRedundant();
}
Program: 105383
Project: 105383
Buggy source:
public Long getServiceOfferingId(){
  return this.serviceOfferingId;
}

Fixed version (ground truth):
public Long getServiceOfferingId(){
  return serviceOfferingId;
}
Program: 105384
Project: 105384
Buggy source:
protected int getNumberOfRoutersToDeploy(){
  if (routers.size() >= 5) {
    logger.error("String_Node_Str");
  }
  int routersExpected=1;
  if (this.isRedundant()) {
    routersExpected=2;
  }
  return routersExpected < routers.size() ? 0 : routersExpected - routers.size();
}

Fixed version (ground truth):
protected int getNumberOfRoutersToDeploy(){
  if (routers.size() >= 5) {
    logger.error("String_Node_Str");
  }
  int routersExpected=1;
  if (isRedundant()) {
    routersExpected=2;
  }
  return routersExpected < routers.size() ? 0 : routersExpected - routers.size();
}
Program: 105385
Project: 105385
Buggy source:
/** 
 * Executes preparation and deployment of the routers. After this method ends,   {@link this#routers} should have all of the deployed routers readyfor start, and no more.
 * @throws ConcurrentOperationException
 * @throws InsufficientCapacityException
 * @throws ResourceUnavailableException
 */
protected void executeDeployment() throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  this.setupPriorityOfRedundantRouter();
  if (this.getNumberOfRoutersToDeploy() > 0 && this.prepareDeployment()) {
    this.findVirtualProvider();
    this.findServiceOfferingId();
    this.findSourceNatIP();
    this.deployAllVirtualRouters();
  }
}

Fixed version (ground truth):
/** 
 * Executes preparation and deployment of the routers. After this method ends,   {@link this#routers} should have all of the deployed routers readyfor start, and no more.
 * @throws ConcurrentOperationException
 * @throws InsufficientCapacityException
 * @throws ResourceUnavailableException
 */
protected void executeDeployment() throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  setupPriorityOfRedundantRouter();
  if (getNumberOfRoutersToDeploy() > 0 && prepareDeployment()) {
    findVirtualProvider();
    findServiceOfferingId();
    findSourceNatIP();
    deployAllVirtualRouters();
  }
}
Program: 105386
Project: 105386
Buggy source:
@DB protected void findOrDeployVirtualRouter() throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  try {
    lock();
    checkPreconditions();
    final List<DeployDestination> destinations=findDestinations();
    for (    final DeployDestination destination : destinations) {
      dest=destination;
      generateDeploymentPlan();
      executeDeployment();
    }
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
@DB protected void findOrDeployVirtualRouter() throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  try {
    lock();
    checkPreconditions();
    final List<DeployDestination> destinations=findDestinations();
    for (    final DeployDestination destination : destinations) {
      dest=destination;
      planDeploymentRouters();
      generateDeploymentPlan();
      executeDeployment();
    }
  }
  finally {
    unlock();
  }
}
Program: 105387
Project: 105387
Buggy source:
protected void findServiceOfferingId(){
  Long networkOfferingId=networkOfferingDao.findById(guestNetwork.getNetworkOfferingId()).getServiceOfferingId();
  if (networkOfferingId != null) {
    this.serviceOfferingId=networkOfferingId;
  }
}

Fixed version (ground truth):
protected void findServiceOfferingId(){
  Long networkOfferingId=networkOfferingDao.findById(guestNetwork.getNetworkOfferingId()).getServiceOfferingId();
  if (networkOfferingId != null) {
    serviceOfferingId=networkOfferingId;
  }
}
Program: 105388
Project: 105388
Buggy source:
/** 
 * Only for redundant deployment and if any routers needed reset, we shall reset all routers priorities
 */
protected void setupPriorityOfRedundantRouter(){
  if (this.isRedundant() && this.routersNeedReset()) {
    for (    final DomainRouterVO router : this.routers) {
      router.setPriority(0);
      router.setIsPriorityBumpUp(false);
      routerDao.update(router.getId(),router);
    }
  }
}

Fixed version (ground truth):
/** 
 * Only for redundant deployment and if any routers needed reset, we shall reset all routers priorities
 */
protected void setupPriorityOfRedundantRouter(){
  if (isRedundant() && routersNeedReset()) {
    for (    final DomainRouterVO router : routers) {
      router.setPriority(0);
      router.setIsPriorityBumpUp(false);
      routerDao.update(router.getId(),router);
    }
  }
}
Program: 105389
Project: 105389
Buggy source:
/** 
 * It executes last pending tasks to prepare the deployment and checks the deployment can proceed. If it can't it return false
 * @return if the deployment can proceed
 */
protected boolean prepareDeployment(){
  setupAccountOwner();
  isPublicNetwork=networkModel.isProviderSupportServiceInNetwork(guestNetwork.getId(),Service.SourceNat,Provider.VirtualRouter);
  boolean canProceed=true;
  if (this.isRedundant() && !this.isPublicNetwork) {
    logger.error("String_Node_Str");
    routers=new ArrayList<DomainRouterVO>();
    canProceed=false;
  }
  return canProceed;
}

Fixed version (ground truth):
/** 
 * It executes last pending tasks to prepare the deployment and checks the deployment can proceed. If it can't it return false
 * @return if the deployment can proceed
 */
protected boolean prepareDeployment(){
  setupAccountOwner();
  isPublicNetwork=networkModel.isProviderSupportServiceInNetwork(guestNetwork.getId(),Service.SourceNat,Provider.VirtualRouter);
  boolean canProceed=true;
  if (isRedundant() && !isPublicNetwork) {
    logger.error("String_Node_Str");
    routers=new ArrayList<DomainRouterVO>();
    canProceed=false;
  }
  return canProceed;
}
Program: 105390
Project: 105390
Buggy source:
@Override public SetStaticRouteAnswer setStaticRoute(SetStaticRouteCommand cmd){
  String[] results=new String[cmd.getStaticRoutes().length];
  String[][] rules=cmd.generateSRouteRules();
  StringBuilder sb=new StringBuilder();
  String[] srRules=rules[0];
  for (int i=0; i < srRules.length; i++) {
    sb.append(srRules[i]).append(',');
  }
  return new SetStaticRouteAnswer(cmd,true,results);
}

Fixed version (ground truth):
@Override public SetStaticRouteAnswer setStaticRoute(SetStaticRouteCommand cmd){
  String[] results=new String[cmd.getStaticRoutes().length];
  String[] rules=cmd.generateSRouteRules();
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < rules.length; i++) {
    sb.append(rules[i]).append(',');
  }
  return new SetStaticRouteAnswer(cmd,true,results);
}
Program: 105392
Project: 105392
Buggy source:
@Override public Answer copyTemplateToPrimaryStorage(CopyCommand cmd){
  TemplateObjectTO template=new TemplateObjectTO();
  template.setPath(UUID.randomUUID().toString());
  template.setFormat(Storage.ImageFormat.RAW);
  return new CopyCmdAnswer(template);
}

Fixed version (ground truth):
@Override public Answer copyTemplateToPrimaryStorage(CopyCommand cmd){
  TemplateObjectTO template=new TemplateObjectTO();
  template.setPath(UUID.randomUUID().toString());
  template.setSize(new Long(100));
  template.setFormat(Storage.ImageFormat.RAW);
  return new CopyCmdAnswer(template);
}
Program: 105394
Project: 105394
Buggy source:
private static List<S3ObjectSummary> listDirectory(final String bucketName,final String directory,final AmazonS3 client){
  List<S3ObjectSummary> objects=new ArrayList<S3ObjectSummary>();
  ListObjectsRequest listObjectsRequest=new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
  ObjectListing objectListing;
  do {
    objectListing=client.listObjects(listObjectsRequest);
    if (objectListing != null)     objects.addAll(objectListing.getObjectSummaries());
    listObjectsRequest.setMarker(objectListing.getNextMarker());
  }
 while (objectListing.isTruncated());
  if (objects.isEmpty()) {
    return emptyList();
  }
  return unmodifiableList(objects);
}

Fixed version (ground truth):
private static List<S3ObjectSummary> listDirectory(final String bucketName,final String directory,final AmazonS3 client){
  List<S3ObjectSummary> objects=new ArrayList<S3ObjectSummary>();
  ListObjectsRequest listObjectsRequest=new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
  ObjectListing ol=client.listObjects(listObjectsRequest);
  while (ol != null && ol.isTruncated()) {
    objects.addAll(ol.getObjectSummaries());
    listObjectsRequest.setMarker(ol.getNextMarker());
    ol=client.listObjects(listObjectsRequest);
  }
  if (objects.isEmpty()) {
    return emptyList();
  }
  return unmodifiableList(objects);
}
Program: 105395
Project: 105395
Buggy source:
private static List<S3ObjectSummary> listDirectory(final String bucketName,final String directory,final AmazonS3 client){
  List<S3ObjectSummary> objects=new ArrayList<S3ObjectSummary>();
  ListObjectsRequest listObjectsRequest=new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
  ObjectListing objectListing;
  do {
    objectListing=client.listObjects(listObjectsRequest);
    if (objectListing != null)     objects.addAll(objectListing.getObjectSummaries());
    listObjectsRequest.setMarker(objectListing.getNextMarker());
  }
 while (objectListing.isTruncated());
  if (objects.isEmpty()) {
    return emptyList();
  }
  return unmodifiableList(objects);
}

Fixed version (ground truth):
private static List<S3ObjectSummary> listDirectory(final String bucketName,final String directory,final AmazonS3 client){
  List<S3ObjectSummary> objects=new ArrayList<S3ObjectSummary>();
  ListObjectsRequest listObjectsRequest=new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
  ObjectListing ol=client.listObjects(listObjectsRequest);
  while (ol != null && ol.isTruncated()) {
    objects.addAll(ol.getObjectSummaries());
    listObjectsRequest.setMarker(ol.getNextMarker());
    ol=client.listObjects(listObjectsRequest);
  }
  if (objects.isEmpty()) {
    return emptyList();
  }
  return unmodifiableList(objects);
}
Program: 105396
Project: 105396
Buggy source:
private static String encode(byte[] input){
  return new String(Base64.encode(input));
}

Fixed version (ground truth):
private static String encode(byte[] input) throws UnsupportedEncodingException {
  return new String(Base64.encode(input),"String_Node_Str");
}
Program: 105397
Project: 105397
Buggy source:
private static String encode(byte[] input){
  return new String(Base64.encode(input));
}

Fixed version (ground truth):
private static String encode(byte[] input) throws UnsupportedEncodingException {
  return new String(Base64.encode(input),"String_Node_Str");
}
Program: 105398
Project: 105398
Buggy source:
private String getResizeScriptType(KVMStoragePool pool,KVMPhysicalDisk vol){
  StoragePoolType poolType=pool.getType();
  PhysicalDiskFormat volFormat=vol.getFormat();
  if (pool.getType() == StoragePoolType.CLVM && volFormat == PhysicalDiskFormat.RAW) {
    return "String_Node_Str";
  }
 else   if ((poolType == StoragePoolType.NetworkFilesystem || poolType == StoragePoolType.SharedMountPoint || poolType == StoragePoolType.Filesystem || poolType == StoragePoolType.Gluster) && volFormat == PhysicalDiskFormat.QCOW2) {
    return "String_Node_Str";
  }
  return null;
}

Fixed version (ground truth):
private String getResizeScriptType(KVMStoragePool pool,KVMPhysicalDisk vol){
  StoragePoolType poolType=pool.getType();
  PhysicalDiskFormat volFormat=vol.getFormat();
  if (pool.getType() == StoragePoolType.CLVM && volFormat == PhysicalDiskFormat.RAW) {
    return "String_Node_Str";
  }
 else   if ((poolType == StoragePoolType.NetworkFilesystem || poolType == StoragePoolType.SharedMountPoint || poolType == StoragePoolType.Filesystem || poolType == StoragePoolType.Gluster) && volFormat == PhysicalDiskFormat.QCOW2) {
    return "String_Node_Str";
  }
  throw new CloudRuntimeException("String_Node_Str" + pool.getType());
}
Program: 105399
Project: 105399
Buggy source:
private String getResizeScriptType(KVMStoragePool pool,KVMPhysicalDisk vol){
  StoragePoolType poolType=pool.getType();
  PhysicalDiskFormat volFormat=vol.getFormat();
  if (pool.getType() == StoragePoolType.CLVM && volFormat == PhysicalDiskFormat.RAW) {
    return "String_Node_Str";
  }
 else   if ((poolType == StoragePoolType.NetworkFilesystem || poolType == StoragePoolType.SharedMountPoint || poolType == StoragePoolType.Filesystem || poolType == StoragePoolType.Gluster) && volFormat == PhysicalDiskFormat.QCOW2) {
    return "String_Node_Str";
  }
  return null;
}

Fixed version (ground truth):
private String getResizeScriptType(KVMStoragePool pool,KVMPhysicalDisk vol){
  StoragePoolType poolType=pool.getType();
  PhysicalDiskFormat volFormat=vol.getFormat();
  if (pool.getType() == StoragePoolType.CLVM && volFormat == PhysicalDiskFormat.RAW) {
    return "String_Node_Str";
  }
 else   if ((poolType == StoragePoolType.NetworkFilesystem || poolType == StoragePoolType.SharedMountPoint || poolType == StoragePoolType.Filesystem || poolType == StoragePoolType.Gluster) && volFormat == PhysicalDiskFormat.QCOW2) {
    return "String_Node_Str";
  }
  throw new CloudRuntimeException("String_Node_Str" + pool.getType());
}
Program: 105402
Project: 105402
Buggy source:
@Override public Integer getSourcePortStart(){
  if (publicStartPort != null) {
    return publicStartPort.intValue();
  }
  return null;
}

Fixed version (ground truth):
@Override public Integer getSourcePortStart(){
  if (publicStartPort != null) {
    return publicStartPort;
  }
  return null;
}
Program: 105403
Project: 105403
Buggy source:
@Override public Integer getSourcePortEnd(){
  if (publicEndPort == null) {
    if (publicStartPort != null) {
      return publicStartPort.intValue();
    }
  }
 else {
    return publicEndPort.intValue();
  }
  return null;
}

Fixed version (ground truth):
@Override public Integer getSourcePortEnd(){
  if (publicEndPort == null) {
    if (publicStartPort != null) {
      return publicStartPort;
    }
  }
 else {
    return publicEndPort;
  }
  return null;
}
Program: 105404
Project: 105404
Buggy source:
@Override public Long getSyncObjId(){
  return _firewallService.getFirewallRule(id).getNetworkId();
}

Fixed version (ground truth):
@Override public Long getSyncObjId(){
  FirewallRule fw=_firewallService.getFirewallRule(id);
  if (fw != null)   return fw.getNetworkId();
  return null;
}
Program: 105405
Project: 105405
Buggy source:
@Override @Before public void setUp(){
  addIpToVmNicCmd=new AddIpToVmNicCmd(){
  }
;
  removeIpFromVmNicCmd=new RemoveIpFromVmNicCmd();
}

Fixed version (ground truth):
@Override @Before public void setUp(){
}
Program: 105406
Project: 105406
Buggy source:
@Test public void testRemoveIpFromVmNicSuccess() throws ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  NetworkService networkService=Mockito.mock(NetworkService.class);
  RemoveIpFromVmNicCmd removeIpFromNic=Mockito.mock(RemoveIpFromVmNicCmd.class);
  Mockito.when(networkService.releaseSecondaryIpFromNic(Matchers.anyInt())).thenReturn(true);
  removeIpFromNic._networkService=networkService;
  successResponseGenerator=Mockito.mock(SuccessResponse.class);
  removeIpFromNic.execute();
}

Fixed version (ground truth):
@Test public void testRemoveIpFromVmNicSuccess() throws ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  NetworkService networkService=Mockito.mock(NetworkService.class);
  RemoveIpFromVmNicCmd removeIpFromNic=Mockito.mock(RemoveIpFromVmNicCmd.class);
  Mockito.when(networkService.releaseSecondaryIpFromNic(Matchers.anyInt())).thenReturn(true);
  removeIpFromNic._networkService=networkService;
  removeIpFromNic.execute();
}
Program: 105408
Project: 105408
Buggy source:
private String getXml(String filename){
  try {
    String xmlFilePath=Script.findScript(scriptsDir,filename);
    if (xmlFilePath == null) {
      throw new Exception("String_Node_Str" + filename);
    }
    FileReader fr=new FileReader(xmlFilePath);
    BufferedReader br=new BufferedReader(fr);
    String xml="String_Node_Str";
    String line;
    while ((line=br.readLine()) != null) {
      xml+=line.trim();
    }
    return xml;
  }
 catch (  Exception e) {
    s_logger.debug(e);
    return null;
  }
}

Fixed version (ground truth):
private String getXml(String filename){
  try {
    String xmlFilePath=Script.findScript(scriptsDir,filename);
    if (xmlFilePath == null) {
      throw new Exception("String_Node_Str" + filename);
    }
    try (FileReader fr=new FileReader(xmlFilePath);BufferedReader br=new BufferedReader(fr)){
      String xml="String_Node_Str";
      String line;
      while ((line=br.readLine()) != null) {
        xml+=line.trim();
      }
      return xml;
    }
 catch (    Exception e) {
      s_logger.debug(e);
      return null;
    }
  }
 catch (  Exception e) {
    s_logger.debug(e);
    return null;
  }
}
Program: 105412
Project: 105412
Buggy source:
public static BigInteger countIp6InRange(String ip6Range){
  if (ip6Range == null) {
    return null;
  }
  String[] ips=ip6Range.split("String_Node_Str");
  String startIp=ips[0];
  String endIp=ips[0];
  if (ips.length > 1) {
    endIp=ips[1];
  }
  IPv6Address start, end;
  try {
    start=IPv6Address.fromString(startIp);
    end=IPv6Address.fromString(endIp);
  }
 catch (  IllegalArgumentException ex) {
    return null;
  }
  BigInteger startInt=convertIPv6AddressToBigInteger(start);
  BigInteger endInt=convertIPv6AddressToBigInteger(end);
  if (endInt != null) {
    if (startInt.compareTo(endInt) > 0) {
      return null;
    }
  }
  return endInt.subtract(startInt).add(BigInteger.ONE);
}

Fixed version (ground truth):
public static BigInteger countIp6InRange(String ip6Range){
  if (ip6Range == null) {
    return null;
  }
  String[] ips=ip6Range.split("String_Node_Str");
  String startIp=ips[0];
  String endIp=ips[0];
  if (ips.length > 1) {
    endIp=ips[1];
  }
  IPv6Address start, end;
  try {
    start=IPv6Address.fromString(startIp);
    end=IPv6Address.fromString(endIp);
  }
 catch (  IllegalArgumentException ex) {
    return null;
  }
  BigInteger startInt=convertIPv6AddressToBigInteger(start);
  BigInteger endInt=convertIPv6AddressToBigInteger(end);
  if (endInt != null) {
    if (startInt != null) {
      if (startInt.compareTo(endInt) > 0) {
        return null;
      }
    }
    return endInt.subtract(startInt).add(BigInteger.ONE);
  }
  return null;
}
Program: 105414
Project: 105414
Buggy source:
@Override public void processConnect(Host agent,StartupCommand cmd,boolean forRebalance) throws ConnectionException {
  if (!(cmd instanceof StartupRoutingCommand)) {
    return;
  }
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + agent.getId());
  _syncMgr.resetHostSyncState(agent.getId());
  if (forRebalance) {
    s_logger.debug("String_Node_Str" + this + "String_Node_Str");
    return;
  }
  if (forRebalance) {
    s_logger.debug("String_Node_Str" + this + "String_Node_Str");
    return;
  }
  Long clusterId=agent.getClusterId();
  long agentId=agent.getId();
  if (agent.getHypervisorType() == HypervisorType.XenServer) {
    ClusterVMMetaDataSyncCommand syncVMMetaDataCmd=new ClusterVMMetaDataSyncCommand(ClusterVMMetaDataSyncInterval.value(),clusterId);
    try {
      long seq_no=_agentMgr.send(agentId,new Commands(syncVMMetaDataCmd),this);
      s_logger.debug("String_Node_Str" + seq_no);
    }
 catch (    AgentUnavailableException e) {
      s_logger.fatal("String_Node_Str" + clusterId + "String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void processConnect(Host agent,StartupCommand cmd,boolean forRebalance) throws ConnectionException {
  if (!(cmd instanceof StartupRoutingCommand)) {
    return;
  }
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + agent.getId());
  _syncMgr.resetHostSyncState(agent.getId());
  if (forRebalance) {
    s_logger.debug("String_Node_Str" + this + "String_Node_Str");
    return;
  }
  Long clusterId=agent.getClusterId();
  long agentId=agent.getId();
  if (agent.getHypervisorType() == HypervisorType.XenServer) {
    ClusterVMMetaDataSyncCommand syncVMMetaDataCmd=new ClusterVMMetaDataSyncCommand(ClusterVMMetaDataSyncInterval.value(),clusterId);
    try {
      long seq_no=_agentMgr.send(agentId,new Commands(syncVMMetaDataCmd),this);
      s_logger.debug("String_Node_Str" + seq_no);
    }
 catch (    AgentUnavailableException e) {
      s_logger.fatal("String_Node_Str" + clusterId + "String_Node_Str",e);
    }
  }
}
Program: 105415
Project: 105415
Buggy source:
@Override public Answer createVolume(CreateObjectCommand cmd){
  VolumeObjectTO volume=(VolumeObjectTO)cmd.getData();
  PrimaryDataStoreTO primaryStore=(PrimaryDataStoreTO)volume.getDataStore();
  KVMStoragePool primaryPool=null;
  KVMPhysicalDisk vol=null;
  long disksize;
  try {
    primaryPool=storagePoolMgr.getStoragePool(primaryStore.getPoolType(),primaryStore.getUuid());
    disksize=volume.getSize();
    PhysicalDiskFormat format;
    if (volume.getFormat() == null) {
      format=primaryPool.getDefaultFormat();
    }
 else {
      format=PhysicalDiskFormat.valueOf(volume.getFormat().toString().toUpperCase());
    }
    vol=primaryPool.createPhysicalDisk(volume.getUuid(),format,volume.getProvisioningType(),disksize);
    VolumeObjectTO newVol=new VolumeObjectTO();
    newVol.setPath(vol.getName());
    newVol.setSize(volume.getSize());
    newVol.setFormat(ImageFormat.valueOf(format.toString().toUpperCase()));
    return new CreateObjectAnswer(newVol);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    return new CreateObjectAnswer(e.toString());
  }
}

Fixed version (ground truth):
@Override public Answer createVolume(CreateObjectCommand cmd){
  VolumeObjectTO volume=(VolumeObjectTO)cmd.getData();
  PrimaryDataStoreTO primaryStore=(PrimaryDataStoreTO)volume.getDataStore();
  KVMStoragePool primaryPool=null;
  KVMPhysicalDisk vol=null;
  long disksize;
  try {
    primaryPool=storagePoolMgr.getStoragePool(primaryStore.getPoolType(),primaryStore.getUuid());
    disksize=volume.getSize();
    PhysicalDiskFormat format;
    if (volume.getFormat() == null) {
      format=primaryPool.getDefaultFormat();
    }
 else {
      format=PhysicalDiskFormat.valueOf(volume.getFormat().toString().toUpperCase());
    }
    vol=primaryPool.createPhysicalDisk(volume.getUuid(),format,volume.getProvisioningType(),disksize);
    VolumeObjectTO newVol=new VolumeObjectTO();
    if (vol != null) {
      newVol.setPath(vol.getName());
    }
    newVol.setSize(volume.getSize());
    newVol.setFormat(ImageFormat.valueOf(format.toString().toUpperCase()));
    return new CreateObjectAnswer(newVol);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    return new CreateObjectAnswer(e.toString());
  }
}
Program: 105418
Project: 105418
Buggy source:
@Override public CiscoNexusVSMDeviceVO doInTransaction(TransactionStatus status){
  CiscoNexusVSMDeviceVO vsm=null;
  if (_vsmDao.getVSMbyIpaddress(vsmIp) == null) {
    vsm=new CiscoNexusVSMDeviceVO(vsmIp,vsmUser,vsmPassword);
    vsm=_vsmDao.persist(vsm);
  }
  vsm=_vsmDao.getVSMbyIpaddress(vsmIp);
  if (vsm != null) {
    ClusterVSMMapVO connectorObj=new ClusterVSMMapVO(clusterId,vsm.getId());
    _clusterVSMDao.persist(connectorObj);
  }
  return vsm;
}

Fixed version (ground truth):
@Override public CiscoNexusVSMDeviceVO doInTransaction(TransactionStatus status){
  CiscoNexusVSMDeviceVO vsm=null;
  if (_vsmDao.getVSMbyIpaddress(vsmIp) == null) {
    vsm=new CiscoNexusVSMDeviceVO(vsmIp,vsmUser,vsmPassword);
    _vsmDao.persist(vsm);
  }
  vsm=_vsmDao.getVSMbyIpaddress(vsmIp);
  if (vsm != null) {
    ClusterVSMMapVO connectorObj=new ClusterVSMMapVO(clusterId,vsm.getId());
    _clusterVSMDao.persist(connectorObj);
  }
  return vsm;
}
Program: 105419
Project: 105419
Buggy source:
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_SNAPSHOT_CREATE,eventDescription="String_Node_Str",async=true) public Snapshot createSnapshot(Long volumeId,Long policyId,Long snapshotId,Account snapshotOwner){
  VolumeInfo volume=volFactory.getVolume(volumeId);
  if (volume == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (volume.getState() != Volume.State.Ready) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  boolean backedUp=false;
  _accountMgr.checkAccess(CallContext.current().getCallingAccount(),null,true,volume);
  SnapshotInfo snapshot=snapshotFactory.getSnapshot(snapshotId,DataStoreRole.Primary);
  try {
    postCreateSnapshot(volumeId,snapshot.getId(),policyId);
    SnapshotVO freshSnapshot=_snapshotDao.findById(snapshot.getId());
    if ((freshSnapshot != null) && backedUp) {
      UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE,snapshot.getAccountId(),snapshot.getDataCenterId(),snapshotId,snapshot.getName(),null,null,volume.getSize(),snapshot.getClass().getName(),snapshot.getUuid());
    }
    _resourceLimitMgr.incrementResourceCount(snapshotOwner.getId(),ResourceType.snapshot);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
  return snapshot;
}

Fixed version (ground truth):
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_SNAPSHOT_CREATE,eventDescription="String_Node_Str",async=true) public Snapshot createSnapshot(Long volumeId,Long policyId,Long snapshotId,Account snapshotOwner){
  VolumeInfo volume=volFactory.getVolume(volumeId);
  if (volume == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (volume.getState() != Volume.State.Ready) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  _accountMgr.checkAccess(CallContext.current().getCallingAccount(),null,true,volume);
  SnapshotInfo snapshot=snapshotFactory.getSnapshot(snapshotId,DataStoreRole.Primary);
  if (snapshot != null) {
    s_logger.debug("String_Node_Str");
    throw new CloudRuntimeException("String_Node_Str");
  }
  try {
    postCreateSnapshot(volumeId,snapshot.getId(),policyId);
    SnapshotVO freshSnapshot=_snapshotDao.findById(snapshot.getId());
    if (freshSnapshot != null) {
      UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE,snapshot.getAccountId(),snapshot.getDataCenterId(),snapshotId,snapshot.getName(),null,null,volume.getSize(),snapshot.getClass().getName(),snapshot.getUuid());
    }
    _resourceLimitMgr.incrementResourceCount(snapshotOwner.getId(),ResourceType.snapshot);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
  return snapshot;
}
Program: 105421
Project: 105421
Buggy source:
@Override public boolean upgradeVirtualMachine(Long vmId,Long newServiceOfferingId,Map<String,String> customParameters) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException {
  VMInstanceVO vmInstance=_vmInstanceDao.findById(vmId);
  if (vmInstance != null) {
    List<VMSnapshotVO> vmSnapshots=_vmSnapshotDao.findByVm(vmId);
    if (vmSnapshots.size() > 0) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
  }
  if (vmInstance.getState().equals(State.Stopped)) {
    upgradeStoppedVirtualMachine(vmId,newServiceOfferingId,customParameters);
    return true;
  }
  if (vmInstance.getState().equals(State.Running)) {
    return upgradeRunningVirtualMachine(vmId,newServiceOfferingId,customParameters);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean upgradeVirtualMachine(Long vmId,Long newServiceOfferingId,Map<String,String> customParameters) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException {
  VMInstanceVO vmInstance=_vmInstanceDao.findById(vmId);
  if (vmInstance != null) {
    List<VMSnapshotVO> vmSnapshots=_vmSnapshotDao.findByVm(vmId);
    if (vmSnapshots.size() > 0) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (vmInstance.getState().equals(State.Stopped)) {
      upgradeStoppedVirtualMachine(vmId,newServiceOfferingId,customParameters);
      return true;
    }
    if (vmInstance.getState().equals(State.Running)) {
      return upgradeRunningVirtualMachine(vmId,newServiceOfferingId,customParameters);
    }
  }
  return false;
}
Program: 105423
Project: 105423
Buggy source:
@Override public boolean destroySecStorageVm(long vmId){
  SecondaryStorageVmVO ssvm=_secStorageVmDao.findById(vmId);
  try {
    _itMgr.expunge(ssvm.getUuid());
    _secStorageVmDao.remove(ssvm.getId());
    HostVO host=_hostDao.findByTypeNameAndZoneId(ssvm.getDataCenterId(),ssvm.getHostName(),Host.Type.SecondaryStorageVM);
    if (host != null) {
      s_logger.debug("String_Node_Str" + vmId);
      _hostDao.remove(host.getId());
    }
    _tmplStoreDao.expireDnldUrlsForZone(host.getDataCenterId());
    _volumeStoreDao.expireDnldUrlsForZone(host.getDataCenterId());
    return true;
  }
 catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str" + ssvm,e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean destroySecStorageVm(long vmId){
  SecondaryStorageVmVO ssvm=_secStorageVmDao.findById(vmId);
  try {
    _itMgr.expunge(ssvm.getUuid());
    _secStorageVmDao.remove(ssvm.getId());
    HostVO host=_hostDao.findByTypeNameAndZoneId(ssvm.getDataCenterId(),ssvm.getHostName(),Host.Type.SecondaryStorageVM);
    if (host != null) {
      s_logger.debug("String_Node_Str" + vmId);
      _hostDao.remove(host.getId());
      _tmplStoreDao.expireDnldUrlsForZone(host.getDataCenterId());
      _volumeStoreDao.expireDnldUrlsForZone(host.getDataCenterId());
      return true;
    }
    return false;
  }
 catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str" + ssvm,e);
    return false;
  }
}
Program: 105429
Project: 105429
Buggy source:
@Override @ActionEvent(eventType=EventTypes.EVENT_REGISTER_SSH_KEYPAIR,eventDescription="String_Node_Str",async=true) public SSHKeyPair registerSSHKeyPair(RegisterSSHKeyPairCmd cmd){
  Account caller=CallContext.current().getCallingAccount();
  Account owner=_accountMgr.finalizeOwner(caller,cmd.getAccountName(),cmd.getDomainId(),cmd.getProjectId());
  SSHKeyPairVO s=_sshKeyPairDao.findByName(owner.getAccountId(),owner.getDomainId(),cmd.getName());
  if (s != null) {
    throw new InvalidParameterValueException("String_Node_Str" + cmd.getName() + "String_Node_Str");
  }
  String name=cmd.getName();
  String key=cmd.getPublicKey();
  try {
    if (key != null) {
      key=URLDecoder.decode(key,"String_Node_Str");
    }
  }
 catch (  UnsupportedEncodingException e) {
  }
 finally {
  }
  String publicKey=SSHKeysHelper.getPublicKeyFromKeyMaterial(key);
  if (publicKey == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  String fingerprint=SSHKeysHelper.getPublicKeyFingerprint(publicKey);
  return createAndSaveSSHKeyPair(name,fingerprint,publicKey,null,owner);
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_REGISTER_SSH_KEYPAIR,eventDescription="String_Node_Str",async=true) public SSHKeyPair registerSSHKeyPair(RegisterSSHKeyPairCmd cmd){
  Account caller=CallContext.current().getCallingAccount();
  Account owner=_accountMgr.finalizeOwner(caller,cmd.getAccountName(),cmd.getDomainId(),cmd.getProjectId());
  SSHKeyPairVO s=_sshKeyPairDao.findByName(owner.getAccountId(),owner.getDomainId(),cmd.getName());
  if (s != null) {
    throw new InvalidParameterValueException("String_Node_Str" + cmd.getName() + "String_Node_Str");
  }
  String name=cmd.getName();
  String key=cmd.getPublicKey();
  try {
    key=URLDecoder.decode(key,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
  }
  String publicKey=SSHKeysHelper.getPublicKeyFromKeyMaterial(key);
  if (publicKey == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  String fingerprint=SSHKeysHelper.getPublicKeyFingerprint(publicKey);
  return createAndSaveSSHKeyPair(name,fingerprint,publicKey,null,owner);
}
Program: 105437
Project: 105437
Buggy source:
@Override public Integer getSourcePortStart(){
  if (publicStartPort != null) {
    return publicStartPort.intValue();
  }
  return null;
}

Fixed version (ground truth):
@Override public Integer getSourcePortStart(){
  if (publicStartPort != null) {
    return publicStartPort;
  }
  return null;
}
Program: 105438
Project: 105438
Buggy source:
@Override public Integer getSourcePortEnd(){
  if (publicEndPort == null) {
    if (publicStartPort != null) {
      return publicStartPort.intValue();
    }
  }
 else {
    return publicEndPort.intValue();
  }
  return null;
}

Fixed version (ground truth):
@Override public Integer getSourcePortEnd(){
  if (publicEndPort == null) {
    if (publicStartPort != null) {
      return publicStartPort;
    }
  }
 else {
    return publicEndPort;
  }
  return null;
}