nus-yam/ex-repair huggingface dataset:
Program: 89351
Project: 89351
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    NetworkOffering offering=_networkOfferingDao.findById(network.getNetworkOfferingId());
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),offering.getRedundantRouter());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    NetworkOffering offering=_networkOfferingDao.findById(network.getNetworkOfferingId());
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),offering.getRedundantRouter());
    if ((routers == null) || (routers.size() == 0)) {
      throw new ResourceUnavailableException("String_Node_Str",this.getClass(),0);
    }
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89352
Project: 89352
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),isRedundant);
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),isRedundant);
    if ((routers == null) || (routers.size() == 0)) {
      throw new ResourceUnavailableException("String_Node_Str",this.getClass(),0);
    }
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89354
Project: 89354
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),isRedundant);
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),isRedundant);
    if ((routers == null) || (routers.size() == 0)) {
      throw new ResourceUnavailableException("String_Node_Str",this.getClass(),0);
    }
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89355
Project: 89355
Buggy source:
public List<String> getSourceCidrList(){
  return null;
}

Fixed version (ground truth):
@Override public List<String> getSourceCidrList(){
  return null;
}
Program: 89356
Project: 89356
Buggy source:
public String[][] generateFwRules(){
  String[][] result=new String[2][];
  Set<String> toAdd=new HashSet<String>();
  for (  FirewallRuleTO fwTO : rules) {
    if (fwTO.revoked() == true)     continue;
    List<String> cidr;
    StringBuilder sb=new StringBuilder();
    sb.append(fwTO.getSrcIp()).append("String_Node_Str").append(fwTO.getProtocol()).append("String_Node_Str");
    if ("String_Node_Str".compareTo(fwTO.getProtocol()) == 0) {
      sb.append(fwTO.getIcmpType()).append("String_Node_Str").append(fwTO.getIcmpCode()).append("String_Node_Str");
    }
 else     if (fwTO.getStringSrcPortRange() == null)     sb.append("String_Node_Str").append("String_Node_Str");
 else     sb.append(fwTO.getStringSrcPortRange()).append("String_Node_Str");
    cidr=fwTO.getSourceCidrList();
    if (cidr == null || cidr.isEmpty()) {
      sb.append("String_Node_Str");
    }
 else {
      Boolean firstEntry=true;
      for (      String tag : cidr) {
        if (!firstEntry)         sb.append("String_Node_Str");
        sb.append(tag);
        firstEntry=false;
      }
    }
    sb.append("String_Node_Str");
    String fwRuleEntry=sb.toString();
    toAdd.add(fwRuleEntry);
  }
  result[0]=toAdd.toArray(new String[toAdd.size()]);
  return result;
}

Fixed version (ground truth):
public String[][] generateFwRules(){
  String[][] result=new String[2][];
  Set<String> toAdd=new HashSet<String>();
  for (  FirewallRuleTO fwTO : rules) {
    if (fwTO.revoked() == true) {
      StringBuilder sb=new StringBuilder();
      sb.append(fwTO.getSrcIp()).append("String_Node_Str");
      String fwRuleEntry=sb.toString();
      toAdd.add(fwRuleEntry);
      continue;
    }
    List<String> cidr;
    StringBuilder sb=new StringBuilder();
    sb.append(fwTO.getSrcIp()).append("String_Node_Str").append(fwTO.getProtocol()).append("String_Node_Str");
    if ("String_Node_Str".compareTo(fwTO.getProtocol()) == 0) {
      sb.append(fwTO.getIcmpType()).append("String_Node_Str").append(fwTO.getIcmpCode()).append("String_Node_Str");
    }
 else     if (fwTO.getStringSrcPortRange() == null)     sb.append("String_Node_Str").append("String_Node_Str");
 else     sb.append(fwTO.getStringSrcPortRange()).append("String_Node_Str");
    cidr=fwTO.getSourceCidrList();
    if (cidr == null || cidr.isEmpty()) {
      sb.append("String_Node_Str");
    }
 else {
      Boolean firstEntry=true;
      for (      String tag : cidr) {
        if (!firstEntry)         sb.append("String_Node_Str");
        sb.append(tag);
        firstEntry=false;
      }
    }
    sb.append("String_Node_Str");
    String fwRuleEntry=sb.toString();
    toAdd.add(fwRuleEntry);
  }
  result[0]=toAdd.toArray(new String[toAdd.size()]);
  return result;
}
Program: 89357
Project: 89357
Buggy source:
void updateNicProfile(NicProfile profile,Network network);

Fixed version (ground truth):
/** 
 * @deprecated This method should not be here in the first place. What does this really mean? Is it always persistedin the nic? When is it persisted in the nic? When is it called? No Idea.
 * @param profile
 * @param network
 */
@Deprecated void updateNicProfile(NicProfile profile,Network network);
Program: 89358
Project: 89358
Buggy source:
/** 
 * allocate a nic in this network.  This method implementation cannot take a long time as  it is meant to allocate for the DB.
 * @param network configuration to allocate the nic in.
 * @param nic user specified 
 * @param vm virtual machine the network configuraiton will be in.
 * @return NicProfile.
 * @throws InsufficientVirtualNetworkCapcityException
 * @throws InsufficientAddressCapacityException
 */
NicProfile allocate(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException ;

Fixed version (ground truth):
/** 
 * allocate a nic in this network. This method implementation cannot take a long time as it is meant to allocate for the DB.
 * @param network configuration to allocate the nic in.
 * @param nic user specified
 * @param vm virtual machine the network configuration will be in.
 * @return NicProfile.
 * @throws InsufficientVirtualNetworkCapcityException
 * @throws InsufficientAddressCapacityException
 */
NicProfile allocate(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException ;
Program: 89359
Project: 89359
Buggy source:
/** 
 * Fully implement the network configuration as specified.
 * @param network network configuration 
 * @param offering offering that the network configuration was based on.
 * @param destination where were deploying to.
 * @return a fully implemented NetworkConfiguration.
 * @throws InsufficientVirtualNetworkCapcityException TODO
 */
Network implement(Network network,NetworkOffering offering,DeployDestination destination,ReservationContext context) throws InsufficientVirtualNetworkCapcityException ;

Fixed version (ground truth):
/** 
 * Fully implement the network configuration as specified.
 * @param network network configuration
 * @param offering offering that the network configuration was based on.
 * @param destination where were deploying to.
 * @return a fully implemented NetworkConfiguration.
 * @throws InsufficientVirtualNetworkCapcityException
 */
Network implement(Network network,NetworkOffering offering,DeployDestination destination,ReservationContext context) throws InsufficientVirtualNetworkCapcityException ;
Program: 89360
Project: 89360
Buggy source:
void updateNicProfile(NicProfile profile,Network network);

Fixed version (ground truth):
/** 
 * @deprecated This method should not be here in the first place. What does this really mean? Is it always persistedin the nic? When is it persisted in the nic? When is it called? No Idea.
 * @param profile
 * @param network
 */
@Deprecated void updateNicProfile(NicProfile profile,Network network);
Program: 89361
Project: 89361
Buggy source:
/** 
 * allocate a nic in this network.  This method implementation cannot take a long time as  it is meant to allocate for the DB.
 * @param network configuration to allocate the nic in.
 * @param nic user specified 
 * @param vm virtual machine the network configuraiton will be in.
 * @return NicProfile.
 * @throws InsufficientVirtualNetworkCapcityException
 * @throws InsufficientAddressCapacityException
 */
NicProfile allocate(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException ;

Fixed version (ground truth):
/** 
 * allocate a nic in this network. This method implementation cannot take a long time as it is meant to allocate for the DB.
 * @param network configuration to allocate the nic in.
 * @param nic user specified
 * @param vm virtual machine the network configuration will be in.
 * @return NicProfile.
 * @throws InsufficientVirtualNetworkCapcityException
 * @throws InsufficientAddressCapacityException
 */
NicProfile allocate(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException ;
Program: 89362
Project: 89362
Buggy source:
/** 
 * Fully implement the network configuration as specified.
 * @param network network configuration 
 * @param offering offering that the network configuration was based on.
 * @param destination where were deploying to.
 * @return a fully implemented NetworkConfiguration.
 * @throws InsufficientVirtualNetworkCapcityException TODO
 */
Network implement(Network network,NetworkOffering offering,DeployDestination destination,ReservationContext context) throws InsufficientVirtualNetworkCapcityException ;

Fixed version (ground truth):
/** 
 * Fully implement the network configuration as specified.
 * @param network network configuration
 * @param offering offering that the network configuration was based on.
 * @param destination where were deploying to.
 * @return a fully implemented NetworkConfiguration.
 * @throws InsufficientVirtualNetworkCapcityException
 */
Network implement(Network network,NetworkOffering offering,DeployDestination destination,ReservationContext context) throws InsufficientVirtualNetworkCapcityException ;
Program: 89363
Project: 89363
Buggy source:
void updateNicProfile(NicProfile profile,Network network);

Fixed version (ground truth):
/** 
 * @deprecated This method should not be here in the first place. What does this really mean? Is it always persistedin the nic? When is it persisted in the nic? When is it called? No Idea.
 * @param profile
 * @param network
 */
@Deprecated void updateNicProfile(NicProfile profile,Network network);
Program: 89364
Project: 89364
Buggy source:
/** 
 * allocate a nic in this network.  This method implementation cannot take a long time as  it is meant to allocate for the DB.
 * @param network configuration to allocate the nic in.
 * @param nic user specified 
 * @param vm virtual machine the network configuraiton will be in.
 * @return NicProfile.
 * @throws InsufficientVirtualNetworkCapcityException
 * @throws InsufficientAddressCapacityException
 */
NicProfile allocate(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException ;

Fixed version (ground truth):
/** 
 * allocate a nic in this network. This method implementation cannot take a long time as it is meant to allocate for the DB.
 * @param network configuration to allocate the nic in.
 * @param nic user specified
 * @param vm virtual machine the network configuration will be in.
 * @return NicProfile.
 * @throws InsufficientVirtualNetworkCapcityException
 * @throws InsufficientAddressCapacityException
 */
NicProfile allocate(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException ;
Program: 89365
Project: 89365
Buggy source:
/** 
 * Fully implement the network configuration as specified.
 * @param network network configuration 
 * @param offering offering that the network configuration was based on.
 * @param destination where were deploying to.
 * @return a fully implemented NetworkConfiguration.
 * @throws InsufficientVirtualNetworkCapcityException TODO
 */
Network implement(Network network,NetworkOffering offering,DeployDestination destination,ReservationContext context) throws InsufficientVirtualNetworkCapcityException ;

Fixed version (ground truth):
/** 
 * Fully implement the network configuration as specified.
 * @param network network configuration
 * @param offering offering that the network configuration was based on.
 * @param destination where were deploying to.
 * @return a fully implemented NetworkConfiguration.
 * @throws InsufficientVirtualNetworkCapcityException
 */
Network implement(Network network,NetworkOffering offering,DeployDestination destination,ReservationContext context) throws InsufficientVirtualNetworkCapcityException ;
Program: 89366
Project: 89366
Buggy source:
@Override public void run(){
  final List<DomainRouterVO> routers=_routerDao.listVirtualUpByHostId(null);
  s_logger.debug("String_Node_Str" + routers.size() + "String_Node_Str");
  updateRoutersRedundantState(routers);
  checkDuplicateMaster(routers);
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final List<DomainRouterVO> routers=_routerDao.listVirtualUpByHostId(null);
    s_logger.debug("String_Node_Str" + routers.size() + "String_Node_Str");
    updateRoutersRedundantState(routers);
    checkDuplicateMaster(routers);
  }
 catch (  Exception ex) {
    s_logger.error("String_Node_Str",ex);
  }
}
Program: 89367
Project: 89367
Buggy source:
@Override public void run(){
  final List<DomainRouterVO> routers=_routerDao.listVirtualUpByHostId(null);
  s_logger.debug("String_Node_Str" + routers.size() + "String_Node_Str");
  updateRoutersRedundantState(routers);
  checkDuplicateMaster(routers);
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final List<DomainRouterVO> routers=_routerDao.listVirtualUpByHostId(null);
    s_logger.debug("String_Node_Str" + routers.size() + "String_Node_Str");
    updateRoutersRedundantState(routers);
    checkDuplicateMaster(routers);
  }
 catch (  Exception ex) {
    s_logger.error("String_Node_Str",ex);
  }
}
Program: 89368
Project: 89368
Buggy source:
@Override public void run(){
  final List<DomainRouterVO> routers=_routerDao.listVirtualUpByHostId(null);
  s_logger.debug("String_Node_Str" + routers.size() + "String_Node_Str");
  updateRoutersRedundantState(routers);
  checkDuplicateMaster(routers);
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final List<DomainRouterVO> routers=_routerDao.listVirtualUpByHostId(null);
    s_logger.debug("String_Node_Str" + routers.size() + "String_Node_Str");
    updateRoutersRedundantState(routers);
    checkDuplicateMaster(routers);
  }
 catch (  Exception ex) {
    s_logger.error("String_Node_Str",ex);
  }
}
Program: 89369
Project: 89369
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest,network.getTrafficType())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
    params.put(VirtualMachineProfile.Param.RestartNetwork,true);
    List<DomainRouterVO> routers=_routerMgr.deployDhcp(network,dest,uservm.getOwner(),uservm.getParameters());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest,network.getTrafficType())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
    params.put(VirtualMachineProfile.Param.RestartNetwork,true);
    List<DomainRouterVO> routers=_routerMgr.deployDhcp(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89370
Project: 89370
Buggy source:
@Override public boolean implement(Network network,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  if (!canHandle(network.getGuestType(),dest,offering.getTrafficType())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployDhcp(network,dest,context.getAccount(),params);
  return true;
}

Fixed version (ground truth):
@Override public boolean implement(Network network,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  if (!canHandle(network.getGuestType(),dest,offering.getTrafficType())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployDhcp(network,dest,_accountMgr.getAccount(network.getAccountId()),params);
  return true;
}
Program: 89371
Project: 89371
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    NetworkOffering offering=_networkOfferingDao.findById(network.getNetworkOfferingId());
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,uservm.getOwner(),uservm.getParameters(),offering.getRedundantRouter());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    NetworkOffering offering=_networkOfferingDao.findById(network.getNetworkOfferingId());
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),offering.getRedundantRouter());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89372
Project: 89372
Buggy source:
@Override public boolean implement(Network guestConfig,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  if (!canHandle(guestConfig.getGuestType(),dest.getDataCenter())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployVirtualRouter(guestConfig,dest,context.getAccount(),params,offering.getRedundantRouter());
  return true;
}

Fixed version (ground truth):
@Override public boolean implement(Network guestConfig,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  if (!canHandle(guestConfig.getGuestType(),dest.getDataCenter())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployVirtualRouter(guestConfig,dest,_accountMgr.getAccount(guestConfig.getAccountId()),params,offering.getRedundantRouter());
  return true;
}
Program: 89373
Project: 89373
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest,network.getTrafficType())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
    params.put(VirtualMachineProfile.Param.RestartNetwork,true);
    List<DomainRouterVO> routers=_routerMgr.deployDhcp(network,dest,uservm.getOwner(),uservm.getParameters());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest,network.getTrafficType())) {
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
    params.put(VirtualMachineProfile.Param.RestartNetwork,true);
    List<DomainRouterVO> routers=_routerMgr.deployDhcp(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters());
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89374
Project: 89374
Buggy source:
@Override public boolean implement(Network network,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  if (!canHandle(network.getGuestType(),dest,offering.getTrafficType())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployDhcp(network,dest,context.getAccount(),params);
  return true;
}

Fixed version (ground truth):
@Override public boolean implement(Network network,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  if (!canHandle(network.getGuestType(),dest,offering.getTrafficType())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployDhcp(network,dest,_accountMgr.getAccount(network.getAccountId()),params);
  return true;
}
Program: 89375
Project: 89375
Buggy source:
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,uservm.getOwner(),uservm.getParameters(),isRedundant);
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean prepare(Network network,NicProfile nic,VirtualMachineProfile<? extends VirtualMachine> vm,DeployDestination dest,ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
  if (canHandle(network.getGuestType(),dest.getDataCenter())) {
    boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
    if (vm.getType() != VirtualMachine.Type.User) {
      return false;
    }
    @SuppressWarnings("String_Node_Str") VirtualMachineProfile<UserVm> uservm=(VirtualMachineProfile<UserVm>)vm;
    List<DomainRouterVO> routers=_routerMgr.deployVirtualRouter(network,dest,_accountMgr.getAccount(network.getAccountId()),uservm.getParameters(),isRedundant);
    List<VirtualRouter> rets=_routerMgr.addVirtualMachineIntoNetwork(network,nic,uservm,dest,context,routers);
    return (rets != null) && (!rets.isEmpty());
  }
 else {
    return false;
  }
}
Program: 89376
Project: 89376
Buggy source:
@Override public boolean implement(Network guestConfig,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
  if (!canHandle(guestConfig.getGuestType(),dest.getDataCenter())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployVirtualRouter(guestConfig,dest,context.getAccount(),params,isRedundant);
  return true;
}

Fixed version (ground truth):
@Override public boolean implement(Network guestConfig,NetworkOffering offering,DeployDestination dest,ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
  boolean isRedundant=_configDao.getValue("String_Node_Str").equals("String_Node_Str");
  if (!canHandle(guestConfig.getGuestType(),dest.getDataCenter())) {
    return false;
  }
  Map<VirtualMachineProfile.Param,Object> params=new HashMap<VirtualMachineProfile.Param,Object>(1);
  params.put(VirtualMachineProfile.Param.RestartNetwork,true);
  _routerMgr.deployVirtualRouter(guestConfig,dest,_accountMgr.getAccount(guestConfig.getAccountId()),params,isRedundant);
  return true;
}
Program: 89377
Project: 89377
Buggy source:
@Override public Integer getIcmpCode(){
  return null;
}

Fixed version (ground truth):
public Integer getIcmpCode(){
  return null;
}
Program: 89378
Project: 89378
Buggy source:
@Override public Integer getIcmpType(){
  return null;
}

Fixed version (ground truth):
public Integer getIcmpType(){
  return null;
}
Program: 89380
Project: 89380
Buggy source:
LoadBalancer createLoadBalancer(CreateLoadBalancerRuleCmd lb) throws NetworkRuleConflictException ;

Fixed version (ground truth):
LoadBalancer createLoadBalancer(CreateLoadBalancerRuleCmd lb,boolean openFirewall) throws NetworkRuleConflictException ;
Program: 89381
Project: 89381
Buggy source:
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_LOAD_BALANCER_CREATE,eventDescription="String_Node_Str") public LoadBalancer createLoadBalancerRule(CreateLoadBalancerRuleCmd lb){
}

Fixed version (ground truth):
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_LOAD_BALANCER_CREATE,eventDescription="String_Node_Str") public LoadBalancer createLoadBalancerRule(CreateLoadBalancerRuleCmd lb,boolean openFirewall) throws NetworkRuleConflictException, InsufficientAddressCapacityException {
  UserContext caller=UserContext.current();
  int defPortStart=lb.getDefaultPortStart();
  int defPortEnd=lb.getDefaultPortEnd();
  if (!NetUtils.isValidPort(defPortEnd)) {
    throw new InvalidParameterValueException("String_Node_Str" + defPortEnd);
  }
  if (defPortStart > defPortEnd) {
    throw new InvalidParameterValueException("String_Node_Str" + defPortStart + "String_Node_Str"+ defPortEnd);
  }
  if ((lb.getAlgorithm() == null) || !NetUtils.isValidAlgorithm(lb.getAlgorithm())) {
    throw new InvalidParameterValueException("String_Node_Str" + lb.getAlgorithm());
  }
  LoadBalancer result=_elbMgr.handleCreateLoadBalancerRule(lb,caller.getCaller());
  if (result == null) {
    result=createLoadBalancer(lb,openFirewall);
  }
  return result;
}
Program: 89383
Project: 89383
Buggy source:
private static void releaseInternLock(String name){
synchronized (s_lockMap) {
    GlobalLock lock=s_lockMap.get(name);
    assert(lock != null);
    if (lock.referenceCount == 0)     s_lockMap.remove(name);
  }
}

Fixed version (ground truth):
private static void releaseInternLock(String name){
synchronized (s_lockMap) {
    GlobalLock lock=s_lockMap.get(name);
    if (lock != null) {
      if (lock.referenceCount == 0)       s_lockMap.remove(name);
    }
 else {
      s_logger.warn("String_Node_Str" + name + "String_Node_Str");
    }
  }
}
Program: 89384
Project: 89384
Buggy source:
private static void releaseInternLock(String name){
synchronized (s_lockMap) {
    GlobalLock lock=s_lockMap.get(name);
    assert(lock != null);
    if (lock.referenceCount == 0)     s_lockMap.remove(name);
  }
}

Fixed version (ground truth):
private static void releaseInternLock(String name){
synchronized (s_lockMap) {
    GlobalLock lock=s_lockMap.get(name);
    if (lock != null) {
      if (lock.referenceCount == 0)       s_lockMap.remove(name);
    }
 else {
      s_logger.warn("String_Node_Str" + name + "String_Node_Str");
    }
  }
}
Program: 89387
Project: 89387
Buggy source:
protected void fullSync(StartupRoutingCommand cmd,Connection conn){
synchronized (_vms) {
    _vms.clear();
  }
  try {
    final HashMap<String,VmState> vmStates=new HashMap<String,VmState>();
    Map<VM,VM.Record> vmRs=VM.getAllRecords(conn);
    for (    VM.Record record : vmRs.values()) {
      if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
        continue;
      }
      String vm_name=record.nameLabel;
      VmPowerState ps=record.powerState;
      final State state=convertToState(ps);
      Host host=record.residentOn;
      String host_uuid=null;
      if (host != null) {
        host_uuid=host.getUuid(conn);
        if (host_uuid.equals(_host.uuid)) {
synchronized (_vms) {
            _vms.put(vm_name,state);
          }
        }
      }
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + vm_name + "String_Node_Str"+ ps+ "String_Node_Str"+ state.toString());
      }
      VmState vm_state=cmd.new VmState(state,host_uuid);
      vmStates.put(vm_name,vm_state);
    }
    cmd.setChanges(vmStates);
  }
 catch (  final Throwable e) {
    String msg="String_Node_Str" + _host.uuid + "String_Node_Str"+ e.toString();
    s_logger.warn(msg,e);
    throw new CloudRuntimeException(msg);
  }
}

Fixed version (ground truth):
protected void fullSync(StartupRoutingCommand cmd,Connection conn){
synchronized (_vms) {
    _vms.clear();
  }
  try {
    final HashMap<String,VmState> vmStates=new HashMap<String,VmState>();
    Map<VM,VM.Record> vmRs=VM.getAllRecords(conn);
    for (    VM.Record record : vmRs.values()) {
      if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
        continue;
      }
      String vm_name=record.nameLabel;
      VmPowerState ps=record.powerState;
      final State state=convertToState(ps);
      Host host=record.residentOn;
      String host_uuid=null;
      if (host != null) {
        host_uuid=host.getUuid(conn);
        if (host_uuid.equals(_host.uuid)) {
synchronized (_vms) {
            _vms.put(vm_name,state);
          }
        }
      }
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + vm_name + "String_Node_Str"+ ps+ "String_Node_Str"+ state.toString());
      }
      VmState vm_state=new StartupRoutingCommand.VmState(state,host_uuid);
      vmStates.put(vm_name,vm_state);
    }
    cmd.setChanges(vmStates);
  }
 catch (  final Throwable e) {
    String msg="String_Node_Str" + _host.uuid + "String_Node_Str"+ e.toString();
    s_logger.warn(msg,e);
    throw new CloudRuntimeException(msg);
  }
}
Program: 89392
Project: 89392
Buggy source:
public Map<String,String> getDetails(){
  return details;
}

Fixed version (ground truth):
@Override public Map<String,String> getDetails(){
  return details;
}
Program: 89393
Project: 89393
Buggy source:
protected <T extends VirtualMachine>VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile<T> vmProfile){
  ServiceOffering offering=vmProfile.getServiceOffering();
  VirtualMachine vm=vmProfile.getVirtualMachine();
  VirtualMachineTO to=new VirtualMachineTO(vm.getId(),vm.getInstanceName(),vm.getType(),offering.getCpu(),offering.getSpeed(),offering.getRamSize() * 1024l * 1024l,offering.getRamSize() * 1024l * 1024l,null,null,vm.isHaEnabled(),vm.limitCpuUse(),vm.getVncPassword());
  to.setBootArgs(vmProfile.getBootArgs());
  List<NicProfile> nicProfiles=vmProfile.getNics();
  NicTO[] nics=new NicTO[nicProfiles.size()];
  int i=0;
  for (  NicProfile nicProfile : nicProfiles) {
    nics[i++]=toNicTO(nicProfile);
  }
  to.setNics(nics);
  to.setDisks(vmProfile.getDisks().toArray(new VolumeTO[vmProfile.getDisks().size()]));
  if (vmProfile.getTemplate().getBits() == 32) {
    to.setArch("String_Node_Str");
  }
 else {
    to.setArch("String_Node_Str");
  }
  return to;
}

Fixed version (ground truth):
protected <T extends VirtualMachine>VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile<T> vmProfile){
  ServiceOffering offering=vmProfile.getServiceOffering();
  VirtualMachine vm=vmProfile.getVirtualMachine();
  VirtualMachineTO to=new VirtualMachineTO(vm.getId(),vm.getInstanceName(),vm.getType(),offering.getCpu(),offering.getSpeed(),offering.getRamSize() * 1024l * 1024l,offering.getRamSize() * 1024l * 1024l,null,null,vm.isHaEnabled(),vm.limitCpuUse(),vm.getVncPassword());
  to.setBootArgs(vmProfile.getBootArgs());
  List<NicProfile> nicProfiles=vmProfile.getNics();
  NicTO[] nics=new NicTO[nicProfiles.size()];
  int i=0;
  for (  NicProfile nicProfile : nicProfiles) {
    nics[i++]=toNicTO(nicProfile);
  }
  to.setNics(nics);
  to.setDisks(vmProfile.getDisks().toArray(new VolumeTO[vmProfile.getDisks().size()]));
  if (vmProfile.getTemplate().getBits() == 32) {
    to.setArch("String_Node_Str");
  }
 else {
    to.setArch("String_Node_Str");
  }
  to.setDetails(vm.getDetails());
  return to;
}
Program: 89398
Project: 89398
Buggy source:
protected void fullSync(StartupRoutingCommand cmd,Connection conn){
synchronized (_vms) {
    _vms.clear();
  }
  try {
    final HashMap<String,VmState> vmStates=new HashMap<String,VmState>();
    Map<VM,VM.Record> vmRs=VM.getAllRecords(conn);
    for (    VM.Record record : vmRs.values()) {
      if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
        continue;
      }
      String vm_name=record.nameLabel;
      VmPowerState ps=record.powerState;
      final State state=convertToState(ps);
      Host host=record.residentOn;
      String host_uuid=null;
      if (host != null) {
        host_uuid=host.getUuid(conn);
        if (host_uuid.equals(_host.uuid)) {
synchronized (_vms) {
            _vms.put(vm_name,state);
          }
        }
      }
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + vm_name + "String_Node_Str"+ ps+ "String_Node_Str"+ state.toString());
      }
      VmState vm_state=cmd.new VmState(state,host_uuid);
      vmStates.put(vm_name,vm_state);
    }
    cmd.setChanges(vmStates);
  }
 catch (  final Throwable e) {
    String msg="String_Node_Str" + _host.uuid + "String_Node_Str"+ e.toString();
    s_logger.warn(msg,e);
    throw new CloudRuntimeException(msg);
  }
}

Fixed version (ground truth):
protected void fullSync(StartupRoutingCommand cmd,Connection conn){
synchronized (_vms) {
    _vms.clear();
  }
  try {
    final HashMap<String,VmState> vmStates=new HashMap<String,VmState>();
    Map<VM,VM.Record> vmRs=VM.getAllRecords(conn);
    for (    VM.Record record : vmRs.values()) {
      if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
        continue;
      }
      String vm_name=record.nameLabel;
      VmPowerState ps=record.powerState;
      final State state=convertToState(ps);
      Host host=record.residentOn;
      String host_uuid=null;
      if (host != null) {
        host_uuid=host.getUuid(conn);
        if (host_uuid.equals(_host.uuid)) {
synchronized (_vms) {
            _vms.put(vm_name,state);
          }
        }
      }
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + vm_name + "String_Node_Str"+ ps+ "String_Node_Str"+ state.toString());
      }
      VmState vm_state=new StartupRoutingCommand.VmState(state,host_uuid);
      vmStates.put(vm_name,vm_state);
    }
    cmd.setChanges(vmStates);
  }
 catch (  final Throwable e) {
    String msg="String_Node_Str" + _host.uuid + "String_Node_Str"+ e.toString();
    s_logger.warn(msg,e);
    throw new CloudRuntimeException(msg);
  }
}
Program: 89403
Project: 89403
Buggy source:
public Map<String,String> getDetails(){
  return details;
}

Fixed version (ground truth):
@Override public Map<String,String> getDetails(){
  return details;
}
Program: 89404
Project: 89404
Buggy source:
protected <T extends VirtualMachine>VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile<T> vmProfile){
  ServiceOffering offering=vmProfile.getServiceOffering();
  VirtualMachine vm=vmProfile.getVirtualMachine();
  VirtualMachineTO to=new VirtualMachineTO(vm.getId(),vm.getInstanceName(),vm.getType(),offering.getCpu(),offering.getSpeed(),offering.getRamSize() * 1024l * 1024l,offering.getRamSize() * 1024l * 1024l,null,null,vm.isHaEnabled(),vm.limitCpuUse(),vm.getVncPassword());
  to.setBootArgs(vmProfile.getBootArgs());
  List<NicProfile> nicProfiles=vmProfile.getNics();
  NicTO[] nics=new NicTO[nicProfiles.size()];
  int i=0;
  for (  NicProfile nicProfile : nicProfiles) {
    nics[i++]=toNicTO(nicProfile);
  }
  to.setNics(nics);
  to.setDisks(vmProfile.getDisks().toArray(new VolumeTO[vmProfile.getDisks().size()]));
  if (vmProfile.getTemplate().getBits() == 32) {
    to.setArch("String_Node_Str");
  }
 else {
    to.setArch("String_Node_Str");
  }
  return to;
}

Fixed version (ground truth):
protected <T extends VirtualMachine>VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile<T> vmProfile){
  ServiceOffering offering=vmProfile.getServiceOffering();
  VirtualMachine vm=vmProfile.getVirtualMachine();
  VirtualMachineTO to=new VirtualMachineTO(vm.getId(),vm.getInstanceName(),vm.getType(),offering.getCpu(),offering.getSpeed(),offering.getRamSize() * 1024l * 1024l,offering.getRamSize() * 1024l * 1024l,null,null,vm.isHaEnabled(),vm.limitCpuUse(),vm.getVncPassword());
  to.setBootArgs(vmProfile.getBootArgs());
  List<NicProfile> nicProfiles=vmProfile.getNics();
  NicTO[] nics=new NicTO[nicProfiles.size()];
  int i=0;
  for (  NicProfile nicProfile : nicProfiles) {
    nics[i++]=toNicTO(nicProfile);
  }
  to.setNics(nics);
  to.setDisks(vmProfile.getDisks().toArray(new VolumeTO[vmProfile.getDisks().size()]));
  if (vmProfile.getTemplate().getBits() == 32) {
    to.setArch("String_Node_Str");
  }
 else {
    to.setArch("String_Node_Str");
  }
  to.setDetails(vm.getDetails());
  return to;
}
Program: 89412
Project: 89412
Buggy source:
@Override public void run(){
  cleanupFinishedWork();
  cleanupUnfinishedWork();
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Transaction txn=Transaction.open("String_Node_Str");
    try {
      cleanupFinishedWork();
      cleanupUnfinishedWork();
    }
  finally {
      txn.close("String_Node_Str");
    }
  }
 catch (  Throwable th) {
    try {
      s_logger.error("String_Node_Str",th);
    }
 catch (    Throwable th2) {
    }
  }
}
Program: 89416
Project: 89416
Buggy source:
public AgentMonitor(long msId,HostDao hostDao,VMInstanceDao vmDao,DataCenterDao dcDao,HostPodDao podDao,AgentManagerImpl agentMgr,AlertManager alertMgr,long pingTimeout){
  super("String_Node_Str");
  _msId=msId;
  _pingTimeout=pingTimeout;
  _hostDao=hostDao;
  _agentMgr=agentMgr;
  _stop=false;
  _vmDao=vmDao;
  _dcDao=dcDao;
  _podDao=podDao;
  _alertMgr=alertMgr;
  Connection conn=Transaction.getStandaloneConnection();
  if (conn == null) {
    throw new CloudRuntimeException("String_Node_Str");
  }
  _concierge=new ConnectionConcierge("String_Node_Str",conn,true,true);
}

Fixed version (ground truth):
public AgentMonitor(long msId,HostDao hostDao,VMInstanceDao vmDao,DataCenterDao dcDao,HostPodDao podDao,AgentManagerImpl agentMgr,AlertManager alertMgr,long pingTimeout){
  super("String_Node_Str");
  _msId=msId;
  _pingTimeout=pingTimeout;
  _hostDao=hostDao;
  _agentMgr=agentMgr;
  _stop=false;
  _vmDao=vmDao;
  _dcDao=dcDao;
  _podDao=podDao;
  _alertMgr=alertMgr;
  try {
    Connection conn=Transaction.getStandaloneConnectionWithException();
    conn.setAutoCommit(true);
    _concierge=new ConnectionConcierge("String_Node_Str",conn,false);
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 89417
Project: 89417
Buggy source:
private Connection getHeartbeatConnection() throws SQLException {
  if (_heartbeatConnection == null) {
    Connection conn=Transaction.getStandaloneConnectionWithException();
    _heartbeatConnection=new ConnectionConcierge("String_Node_Str",conn,false,false);
  }
  return _heartbeatConnection.conn();
}

Fixed version (ground truth):
private Connection getHeartbeatConnection() throws SQLException {
  if (_heartbeatConnection == null) {
    Connection conn=Transaction.getStandaloneConnectionWithException();
    _heartbeatConnection=new ConnectionConcierge("String_Node_Str",conn,false);
  }
  return _heartbeatConnection.conn();
}