nus-yam/ex-repair huggingface dataset:
Program: 89235
Project: 89235
Buggy source:
protected HashMap<String,Pair<String,State>> fullClusterSync(Connection conn){
  XenServerPoolVms vms=new XenServerPoolVms();
  try {
    Host lhost=Host.getByUuid(conn,_host.uuid);
    Map<VM,VM.Record> vm_map=VM.getAllRecords(conn);
    for (    VM.Record record : vm_map.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 (!isRefNull(host)) {
        host_uuid=host.getUuid(conn);
        vms.put(_cluster,host_uuid,vm_name,state);
      }
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + vm_name + "String_Node_Str"+ ps+ "String_Node_Str"+ state.toString());
      }
    }
  }
 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);
  }
  return vms.getClusterVmState(_cluster);
}

Fixed version (ground truth):
protected HashMap<String,Pair<String,State>> fullClusterSync(Connection conn){
  XenServerPoolVms vms=new XenServerPoolVms();
  try {
    Map<VM,VM.Record> vm_map=VM.getAllRecords(conn);
    for (    VM.Record record : vm_map.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 (!isRefNull(host)) {
        host_uuid=host.getUuid(conn);
        vms.put(_cluster,host_uuid,vm_name,state);
      }
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + vm_name + "String_Node_Str"+ ps+ "String_Node_Str"+ state.toString());
      }
    }
  }
 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);
  }
  return vms.getClusterVmState(_cluster);
}
Program: 89238
Project: 89238
Buggy source:
public Commands fullSync(final long clusterId,Map<String,Pair<String,State>> newStates){
  Commands commands=new Commands(OnError.Continue);
  Map<Long,AgentVmInfo> infos=convertToInfos(newStates);
  long hId=0;
  final List<VMInstanceVO> vms=_vmDao.listByClusterId(clusterId);
  for (  VMInstanceVO vm : vms) {
    AgentVmInfo info=infos.remove(vm.getId());
  }
  for (  final AgentVmInfo left : infos.values()) {
    s_logger.warn("String_Node_Str" + left.name);
    commands.addCommand(cleanup(left.name));
  }
  return commands;
}

Fixed version (ground truth):
public void fullSync(final long clusterId,Map<String,Pair<String,State>> newStates){
  Map<Long,AgentVmInfo> infos=convertToInfos(newStates);
  List<VMInstanceVO> vms=_vmDao.listByClusterId(clusterId);
  for (  VMInstanceVO vm : vms) {
    if (vm.isRemoved() || vm.getState() == State.Destroyed || vm.getState() == State.Expunging)     continue;
    infos.remove(vm.getId());
  }
  vms=_vmDao.listStartingByClusterId(clusterId);
  for (  VMInstanceVO vm : vms) {
    if (vm.isRemoved() || vm.getState() == State.Destroyed || vm.getState() == State.Expunging)     continue;
    infos.remove(vm.getId());
  }
  for (  final AgentVmInfo left : infos.values()) {
    try {
      Host host=_resourceMgr.findHostByGuid(left.getHostUuid());
      if (host != null) {
        s_logger.warn("String_Node_Str" + left.name);
        Answer answer=_agentMgr.send(host.getId(),cleanup(left.name));
        if (!answer.getResult()) {
          s_logger.warn("String_Node_Str" + answer.getDetails());
        }
      }
    }
 catch (    Exception e) {
      s_logger.warn("String_Node_Str" + e.getMessage());
    }
  }
}
Program: 89239
Project: 89239
Buggy source:
public Commands deltaSync(Map<String,Pair<String,State>> newStates){
  Map<Long,AgentVmInfo> states=convertToInfos(newStates);
  Commands commands=new Commands(OnError.Continue);
  for (  Map.Entry<Long,AgentVmInfo> entry : states.entrySet()) {
    AgentVmInfo info=entry.getValue();
    VMInstanceVO vm=info.vm;
    Command command=null;
    if (vm != null) {
      String hostGuid=info.getHostUuid();
      Host host=_resourceMgr.findHostByGuid(hostGuid);
      long hId=host.getId();
      HypervisorGuru hvGuru=_hvGuruMgr.getGuru(vm.getHypervisorType());
      command=compareState(hId,vm,info,false,hvGuru.trackVmHostChange());
    }
 else {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + info.name);
      }
      command=cleanup(info.name);
    }
    if (command != null) {
      commands.addCommand(command);
    }
  }
  return commands;
}

Fixed version (ground truth):
public void deltaSync(Map<String,Pair<String,State>> newStates){
  Map<Long,AgentVmInfo> states=convertToInfos(newStates);
  for (  Map.Entry<Long,AgentVmInfo> entry : states.entrySet()) {
    AgentVmInfo info=entry.getValue();
    VMInstanceVO vm=info.vm;
    Command command=null;
    if (vm != null) {
      Host host=_resourceMgr.findHostByGuid(info.getHostUuid());
      long hId=host.getId();
      HypervisorGuru hvGuru=_hvGuruMgr.getGuru(vm.getHypervisorType());
      command=compareState(hId,vm,info,false,hvGuru.trackVmHostChange());
    }
 else {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + info.name);
      }
      command=cleanup(info.name);
    }
    if (command != null) {
      try {
        Host host=_resourceMgr.findHostByGuid(info.getHostUuid());
        if (host != null) {
          Answer answer=_agentMgr.send(host.getId(),cleanup(info.name));
          if (!answer.getResult()) {
            s_logger.warn("String_Node_Str" + answer.getDetails());
          }
        }
      }
 catch (      Exception e) {
        s_logger.warn("String_Node_Str" + e.getMessage());
      }
    }
  }
}
Program: 89240
Project: 89240
Buggy source:
@Override public boolean processAnswers(long agentId,long seq,Answer[] answers){
  for (  final Answer answer : answers) {
    if (answer instanceof ClusterSyncAnswer) {
      ClusterSyncAnswer hs=(ClusterSyncAnswer)answer;
      if (hs.isFull()) {
        deltaSync(hs.getNewStates());
        fullSync(hs.getClusterId(),hs.getAllStates());
      }
 else       if (hs.isDelta()) {
        deltaSync(hs.getNewStates());
      }
    }
 else     if (!answer.getResult()) {
      s_logger.warn("String_Node_Str" + answer.getDetails());
    }
 else {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + answer.getDetails());
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean processAnswers(long agentId,long seq,Answer[] answers){
  for (  final Answer answer : answers) {
    if (answer instanceof ClusterSyncAnswer) {
      ClusterSyncAnswer hs=(ClusterSyncAnswer)answer;
      if (!hs.isExceuted()) {
        if (hs.isFull()) {
          deltaSync(hs.getNewStates());
          fullSync(hs.getClusterId(),hs.getAllStates());
        }
 else         if (hs.isDelta()) {
          deltaSync(hs.getNewStates());
        }
        hs.setExecuted();
      }
    }
 else     if (!answer.getResult()) {
      s_logger.warn("String_Node_Str" + answer.getDetails());
    }
 else {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + answer.getDetails());
      }
    }
  }
  return true;
}
Program: 89242
Project: 89242
Buggy source:
private SearchCriteria<NetworkVO> buildNetworkSearchCriteria(SearchBuilder<NetworkVO> sb,String keyword,Long id,Boolean isSystem,Long zoneId,String guestIpType,String trafficType,Long physicalNetworkId,String aclType){
  SearchCriteria<NetworkVO> sc=sb.create();
  if (isSystem != null) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",isSystem);
  }
  if (keyword != null) {
    SearchCriteria<NetworkVO> ssc=_networksDao.createSearchCriteria();
    ssc.addOr("String_Node_Str",SearchCriteria.Op.LIKE,"String_Node_Str" + keyword + "String_Node_Str");
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,ssc);
  }
  if (id != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,id);
  }
  if (zoneId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,zoneId);
  }
  if (guestIpType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,guestIpType);
  }
  if (trafficType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,trafficType);
  }
  if (aclType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,aclType.toString());
  }
  if (physicalNetworkId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,physicalNetworkId);
  }
  return sc;
}

Fixed version (ground truth):
private SearchCriteria<NetworkVO> buildNetworkSearchCriteria(SearchBuilder<NetworkVO> sb,String keyword,Long id,Boolean isSystem,Long zoneId,String guestIpType,String trafficType,Long physicalNetworkId,String aclType,boolean skipProjectNetworks){
  SearchCriteria<NetworkVO> sc=sb.create();
  if (isSystem != null) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",isSystem);
  }
  if (keyword != null) {
    SearchCriteria<NetworkVO> ssc=_networksDao.createSearchCriteria();
    ssc.addOr("String_Node_Str",SearchCriteria.Op.LIKE,"String_Node_Str" + keyword + "String_Node_Str");
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,ssc);
  }
  if (id != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,id);
  }
  if (zoneId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,zoneId);
  }
  if (guestIpType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,guestIpType);
  }
  if (trafficType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,trafficType);
  }
  if (aclType != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,aclType.toString());
  }
  if (physicalNetworkId != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,physicalNetworkId);
  }
  if (skipProjectNetworks) {
    sc.setJoinParameters("String_Node_Str","String_Node_Str",Account.ACCOUNT_TYPE_PROJECT);
  }
  return sc;
}
Program: 89249
Project: 89249
Buggy source:
private void createDhcpEntriesCommands(DomainRouterVO router,Commands cmds){
  long networkId=router.getNetworkId();
  List<UserVmVO> vms=_userVmDao.listByNetworkIdAndStates(networkId,State.Running,State.Migrating,State.Stopping);
  DataCenterVO dc=_dcDao.findById(router.getDataCenterIdToDeployIn());
  for (  UserVmVO vm : vms) {
    boolean createDhcp=true;
    if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue() && _dnsBasicZoneUpdates.equalsIgnoreCase("String_Node_Str")) {
      createDhcp=false;
    }
    if (createDhcp) {
      NicVO nic=_nicDao.findByInstanceIdAndNetworkId(networkId,vm.getId());
      if (nic != null) {
        s_logger.debug("String_Node_Str" + vm + "String_Node_Str"+ router+ "String_Node_Str");
        DhcpEntryCommand dhcpCommand=new DhcpEntryCommand(nic.getMacAddress(),nic.getIp4Address(),vm.getHostName());
        dhcpCommand.setDefaultRouter(_nicDao.findDefaultNicForVM(vm.getId()).getGateway());
        dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_IP,router.getPrivateIpAddress());
        dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
        DataCenterVO dcVo=_dcDao.findById(router.getDataCenterIdToDeployIn());
        dhcpCommand.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
        cmds.addCommand("String_Node_Str",dhcpCommand);
      }
    }
  }
}

Fixed version (ground truth):
private void createDhcpEntriesCommands(DomainRouterVO router,Commands cmds){
  long networkId=router.getNetworkId();
  List<UserVmVO> vms=_userVmDao.listByNetworkIdAndStates(networkId,State.Running,State.Migrating,State.Stopping);
  DataCenterVO dc=_dcDao.findById(router.getDataCenterIdToDeployIn());
  for (  UserVmVO vm : vms) {
    boolean createDhcp=true;
    if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue() && _dnsBasicZoneUpdates.equalsIgnoreCase("String_Node_Str")) {
      createDhcp=false;
    }
    if (createDhcp) {
      NicVO nic=_nicDao.findByInstanceIdAndNetworkId(networkId,vm.getId());
      if (nic != null) {
        s_logger.debug("String_Node_Str" + vm + "String_Node_Str"+ router+ "String_Node_Str");
        DhcpEntryCommand dhcpCommand=new DhcpEntryCommand(nic.getMacAddress(),nic.getIp4Address(),vm.getHostName());
        dhcpCommand.setDefaultRouter(findDefaultDhcpIp(vm.getId()));
        dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_IP,router.getPrivateIpAddress());
        dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
        DataCenterVO dcVo=_dcDao.findById(router.getDataCenterIdToDeployIn());
        dhcpCommand.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
        cmds.addCommand("String_Node_Str",dhcpCommand);
      }
    }
  }
}
Program: 89250
Project: 89250
Buggy source:
@Override public String getConsoleAccessUrlRoot(long vmId){
  VMInstanceVO vm=_vmMgr.findById(vmId);
  if (vm != null) {
    ConsoleProxyInfo proxy=getConsoleProxyForUserVm(vm.getDataCenterIdToDeployIn(),vmId);
    if (proxy != null) {
      return proxy.getProxyImageUrl();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String getConsoleAccessUrlRoot(long vmId){
  VMInstanceVO vm=_vmInstanceDao.findById(vmId);
  if (vm != null) {
    ConsoleProxyInfo proxy=getConsoleProxyForVm(vm.getDataCenterIdToDeployIn(),vmId);
    if (proxy != null) {
      return proxy.getProxyImageUrl();
    }
  }
  return null;
}
Program: 89251
Project: 89251
Buggy source:
@Override public void create() throws ResourceAllocationException {
  try {
    IpAddress ip=_networkService.allocateIP(this);
    if (ip != null) {
      this.setEntityId(ip.getId());
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  ConcurrentOperationException ex) {
    s_logger.warn("String_Node_Str",ex);
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,ex.getMessage());
  }
catch (  InsufficientAddressCapacityException ex) {
    s_logger.info(ex);
    s_logger.trace(ex);
    throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void create() throws ResourceAllocationException {
  try {
    IpAddress ip=_networkService.allocateIP(getNetworkId(),_accountService.getAccount(getEntityOwnerId()));
    if (ip != null) {
      this.setEntityId(ip.getId());
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  ConcurrentOperationException ex) {
    s_logger.warn("String_Node_Str",ex);
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,ex.getMessage());
  }
catch (  InsufficientAddressCapacityException ex) {
    s_logger.info(ex);
    s_logger.trace(ex);
    throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR,ex.getMessage());
  }
}
Program: 89252
Project: 89252
Buggy source:
IpAddress allocateIP(AssociateIPAddrCmd cmd) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException ;

Fixed version (ground truth):
IpAddress allocateIP(long networkId,Account ipOwner) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException ;
Program: 89254
Project: 89254
Buggy source:
@Override public IpAddress allocateIP(AssociateIPAddrCmd cmd) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
  return null;
}

Fixed version (ground truth):
@Override public IpAddress allocateIP(long networkId,Account ipOwner) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
  return null;
}
Program: 89255
Project: 89255
Buggy source:
public Long getSourceIpAddressId(){
  return publicIpId;
}

Fixed version (ground truth):
public Long getSourceIpAddressId(){
  IpAddress ipAddr=_networkService.getIp(publicIpId);
  if (ipAddr == null || !ipAddr.readyToUse()) {
    throw new InvalidParameterValueException("String_Node_Str" + ipAddr.getId());
  }
  return publicIpId;
}
Program: 89256
Project: 89256
Buggy source:
public long getDomainId(){
  if (publicIpId != null)   return _networkService.getIp(getPublicIpId()).getDomainId();
  if (domainId != null) {
    return domainId;
  }
  return UserContext.current().getCaller().getDomainId();
}

Fixed version (ground truth):
public long getDomainId(){
  if (publicIpId != null)   return _networkService.getIp(getSourceIpAddressId()).getDomainId();
  if (domainId != null) {
    return domainId;
  }
  return UserContext.current().getCaller().getDomainId();
}
Program: 89257
Project: 89257
Buggy source:
public long getAccountId(){
  if (publicIpId != null)   return _networkService.getIp(getPublicIpId()).getAccountId();
  Account account=UserContext.current().getCaller();
  if ((account == null)) {
    if ((domainId != null) && (accountName != null)) {
      Account userAccount=_responseGenerator.findAccountByNameDomain(accountName,domainId);
      if (userAccount != null) {
        return userAccount.getId();
      }
    }
  }
  if (account != null) {
    return account.getId();
  }
  return Account.ACCOUNT_ID_SYSTEM;
}

Fixed version (ground truth):
public long getAccountId(){
  if (publicIpId != null)   return _networkService.getIp(getSourceIpAddressId()).getAccountId();
  Account account=UserContext.current().getCaller();
  if ((account == null)) {
    if ((domainId != null) && (accountName != null)) {
      Account userAccount=_responseGenerator.findAccountByNameDomain(accountName,domainId);
      if (userAccount != null) {
        return userAccount.getId();
      }
    }
  }
  if (account != null) {
    return account.getId();
  }
  return Account.ACCOUNT_ID_SYSTEM;
}
Program: 89258
Project: 89258
Buggy source:
@DB public PublicIp allocIp(CreateLoadBalancerRuleCmd lb,Account account) throws InsufficientAddressCapacityException {
  List<NetworkVO> networks=_networkDao.listByZoneAndTrafficType(lb.getZoneId(),TrafficType.Guest);
  if (networks.isEmpty()) {
    s_logger.warn("String_Node_Str" + TrafficType.Guest + "String_Node_Str"+ lb.getZoneId());
    return null;
  }
  Network frontEndNetwork=networks.get(0);
  Transaction txn=Transaction.currentTxn();
  txn.start();
  PublicIp ip=_networkMgr.assignPublicIpAddress(lb.getZoneId(),null,account,VlanType.DirectAttached,frontEndNetwork.getId(),null);
  IPAddressVO ipvo=_ipAddressDao.findById(ip.getId());
  ipvo.setAssociatedWithNetworkId(frontEndNetwork.getId());
  _ipAddressDao.update(ipvo.getId(),ipvo);
  txn.commit();
  s_logger.info("String_Node_Str" + ip);
  return ip;
}

Fixed version (ground truth):
@DB public PublicIp allocIp(CreateLoadBalancerRuleCmd lb,Account account) throws InsufficientAddressCapacityException {
  if (lb.getZoneId() == null) {
    throw new InvalidParameterValueException("String_Node_Str" + Network.Provider.ElasticLoadBalancerVm.getName());
  }
  List<NetworkVO> networks=_networkDao.listByZoneAndTrafficType(lb.getZoneId(),TrafficType.Guest);
  if (networks.isEmpty()) {
    s_logger.warn("String_Node_Str" + TrafficType.Guest + "String_Node_Str"+ lb.getZoneId());
    return null;
  }
  Network frontEndNetwork=networks.get(0);
  Transaction txn=Transaction.currentTxn();
  txn.start();
  PublicIp ip=_networkMgr.assignPublicIpAddress(lb.getZoneId(),null,account,VlanType.DirectAttached,frontEndNetwork.getId(),null);
  IPAddressVO ipvo=_ipAddressDao.findById(ip.getId());
  ipvo.setAssociatedWithNetworkId(frontEndNetwork.getId());
  _ipAddressDao.update(ipvo.getId(),ipvo);
  txn.commit();
  s_logger.info("String_Node_Str" + ip);
  return ip;
}
Program: 89259
Project: 89259
Buggy source:
public boolean listInReadyState(){
  Account account=UserContext.current().getCaller();
  boolean isAccountSpecific=(account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
  TemplateFilter templateFilter=TemplateFilter.valueOf(getIsoFilter());
  boolean onlyReady=(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)|| (templateFilter == TemplateFilter.executable && isAccountSpecific)|| (templateFilter == TemplateFilter.community);
  return onlyReady;
}

Fixed version (ground truth):
public boolean listInReadyState(){
  Account account=UserContext.current().getCaller();
  boolean isAccountSpecific=(account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
  TemplateFilter templateFilter=TemplateFilter.valueOf(getIsoFilter());
  boolean onlyReady=(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)|| (templateFilter == TemplateFilter.executable && isAccountSpecific)|| (templateFilter == TemplateFilter.community);
  if (!onlyReady) {
    if (isReady() != null && isReady().booleanValue() != onlyReady) {
      onlyReady=isReady().booleanValue();
    }
  }
  return onlyReady;
}
Program: 89260
Project: 89260
Buggy source:
@Override @DB public long addTemplateToZone(VMTemplateVO tmplt,long zoneId){
  Transaction txn=Transaction.currentTxn();
  txn.start();
  VMTemplateVO tmplt2=findById(tmplt.getId());
  if (tmplt2 == null) {
    persist(tmplt);
    if (tmplt.getDetails() != null) {
      _templateDetailsDao.persist(tmplt.getId(),tmplt.getDetails());
    }
  }
  VMTemplateZoneVO tmpltZoneVO=_templateZoneDao.findByZoneTemplate(zoneId,tmplt.getId());
  if (tmpltZoneVO == null) {
    tmpltZoneVO=new VMTemplateZoneVO(zoneId,tmplt.getId(),new Date());
    _templateZoneDao.persist(tmpltZoneVO);
  }
 else {
    tmpltZoneVO.setRemoved(null);
    tmpltZoneVO.setLastUpdated(new Date());
    _templateZoneDao.update(tmpltZoneVO.getId(),tmpltZoneVO);
  }
  txn.commit();
  return tmplt.getId();
}

Fixed version (ground truth):
@Override @DB public long addTemplateToZone(VMTemplateVO tmplt,long zoneId){
  Transaction txn=Transaction.currentTxn();
  txn.start();
  VMTemplateVO tmplt2=findById(tmplt.getId());
  if (tmplt2 == null) {
    if (persist(tmplt) == null) {
      throw new CloudRuntimeException("String_Node_Str" + tmplt);
    }
    if (tmplt.getDetails() != null) {
      _templateDetailsDao.persist(tmplt.getId(),tmplt.getDetails());
    }
  }
  VMTemplateZoneVO tmpltZoneVO=_templateZoneDao.findByZoneTemplate(zoneId,tmplt.getId());
  if (tmpltZoneVO == null) {
    tmpltZoneVO=new VMTemplateZoneVO(zoneId,tmplt.getId(),new Date());
    _templateZoneDao.persist(tmpltZoneVO);
  }
 else {
    tmpltZoneVO.setRemoved(null);
    tmpltZoneVO.setLastUpdated(new Date());
    _templateZoneDao.update(tmpltZoneVO.getId(),tmpltZoneVO);
  }
  txn.commit();
  return tmplt.getId();
}
Program: 89261
Project: 89261
Buggy source:
@Override public VMTemplateVO create(TemplateProfile profile){
  VMTemplateVO template=persistTemplate(profile);
  _downloadMonitor.downloadTemplateToStorage(template,profile.getZoneId());
  _resourceLimitMgr.incrementResourceCount(profile.getAccountId(),ResourceType.template);
  return template;
}

Fixed version (ground truth):
@Override public VMTemplateVO create(TemplateProfile profile){
  VMTemplateVO template=persistTemplate(profile);
  if (template == null) {
    throw new CloudRuntimeException("String_Node_Str" + profile.getTemplate());
  }
  _downloadMonitor.downloadTemplateToStorage(template,profile.getZoneId());
  _resourceLimitMgr.incrementResourceCount(profile.getAccountId(),ResourceType.template);
  return template;
}
Program: 89262
Project: 89262
Buggy source:
protected VMTemplateVO persistTemplate(TemplateProfile profile){
  Long zoneId=profile.getZoneId();
  VMTemplateVO template=new VMTemplateVO(profile.getTemplateId(),profile.getName(),profile.getFormat(),profile.getIsPublic(),profile.getFeatured(),profile.getIsExtractable(),TemplateType.USER,profile.getUrl(),profile.getRequiresHVM(),profile.getBits(),profile.getAccountId(),profile.getCheckSum(),profile.getDisplayText(),profile.getPasswordEnabled(),profile.getGuestOsId(),profile.getBootable(),profile.getHypervisorType(),profile.getTemplateTag(),profile.getDetails());
  if (zoneId == null || zoneId == -1) {
    List<DataCenterVO> dcs=_dcDao.listAllIncludingRemoved();
    for (    DataCenterVO dc : dcs) {
      _tmpltDao.addTemplateToZone(template,dc.getId());
    }
    template.setCrossZones(true);
  }
 else {
    _tmpltDao.addTemplateToZone(template,zoneId);
  }
  return template;
}

Fixed version (ground truth):
protected VMTemplateVO persistTemplate(TemplateProfile profile){
  Long zoneId=profile.getZoneId();
  VMTemplateVO template=new VMTemplateVO(profile.getTemplateId(),profile.getName(),profile.getFormat(),profile.getIsPublic(),profile.getFeatured(),profile.getIsExtractable(),TemplateType.USER,profile.getUrl(),profile.getRequiresHVM(),profile.getBits(),profile.getAccountId(),profile.getCheckSum(),profile.getDisplayText(),profile.getPasswordEnabled(),profile.getGuestOsId(),profile.getBootable(),profile.getHypervisorType(),profile.getTemplateTag(),profile.getDetails());
  if (zoneId == null || zoneId == -1) {
    List<DataCenterVO> dcs=_dcDao.listAll();
    if (dcs.isEmpty()) {
      throw new CloudRuntimeException("String_Node_Str");
    }
    for (    DataCenterVO dc : dcs) {
      _tmpltDao.addTemplateToZone(template,dc.getId());
    }
    template.setCrossZones(true);
  }
 else {
    _tmpltDao.addTemplateToZone(template,zoneId);
  }
  return _tmpltDao.findById(template.getId());
}
Program: 89265
Project: 89265
Buggy source:
@Override public boolean disableStaticNat(long ipId) throws ResourceUnavailableException {
  boolean success=true;
  UserContext ctx=UserContext.current();
  Account caller=ctx.getCaller();
  IPAddressVO ipAddress=_ipAddressDao.findById(ipId);
  checkIpAndUserVm(ipAddress,null,caller);
  if (!ipAddress.isOneToOneNat()) {
    throw new InvalidParameterValueException("String_Node_Str" + ipId);
  }
  try {
    s_logger.debug("String_Node_Str" + Purpose.Firewall + "String_Node_Str"+ ipId+ "String_Node_Str");
    if (!_firewallMgr.revokeFirewallRulesForIp(ipId,ctx.getCallerUserId(),caller)) {
      s_logger.warn("String_Node_Str" + ipId + "String_Node_Str");
      success=false;
    }
  }
 catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str" + ipId + "String_Node_Str",e);
    success=false;
  }
  if (!revokeAllPFAndStaticNatRulesForIp(ipId,UserContext.current().getCallerUserId(),caller)) {
    s_logger.warn("String_Node_Str" + ipAddress);
    success=false;
  }
  if (success) {
    ipAddress.setOneToOneNat(false);
    ipAddress.setAssociatedWithVmId(null);
    _ipAddressDao.update(ipAddress.getId(),ipAddress);
    return true;
  }
 else {
    s_logger.warn("String_Node_Str" + ipId);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean disableStaticNat(long ipId) throws ResourceUnavailableException {
  boolean success=true;
  UserContext ctx=UserContext.current();
  Account caller=ctx.getCaller();
  IPAddressVO ipAddress=_ipAddressDao.findById(ipId);
  checkIpAndUserVm(ipAddress,null,caller);
  if (!ipAddress.isOneToOneNat()) {
    throw new InvalidParameterValueException("String_Node_Str" + ipId);
  }
  try {
    s_logger.debug("String_Node_Str" + Purpose.Firewall + "String_Node_Str"+ ipId);
    if (!_firewallMgr.revokeFirewallRulesForIp(ipId,ctx.getCallerUserId(),caller)) {
      s_logger.warn("String_Node_Str" + ipId + "String_Node_Str");
      success=false;
    }
  }
 catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str" + ipId + "String_Node_Str",e);
    success=false;
  }
  if (!revokeAllPFAndStaticNatRulesForIp(ipId,UserContext.current().getCallerUserId(),caller)) {
    s_logger.warn("String_Node_Str" + ipAddress);
    success=false;
  }
  if (success) {
    ipAddress.setOneToOneNat(false);
    ipAddress.setAssociatedWithVmId(null);
    _ipAddressDao.update(ipAddress.getId(),ipAddress);
    return true;
  }
 else {
    s_logger.warn("String_Node_Str" + ipId);
    return false;
  }
}
Program: 89266
Project: 89266
Buggy source:
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_NET_IP_RELEASE,eventDescription="String_Node_Str",async=true) public boolean disassociateIpAddress(long ipAddressId){
  Long userId=UserContext.current().getCallerUserId();
  Account caller=UserContext.current().getCaller();
  IPAddressVO ipVO=_ipAddressDao.findById(ipAddressId);
  if (ipVO == null) {
    throw new InvalidParameterValueException("String_Node_Str" + ipAddressId);
  }
  if (ipVO.getAllocatedTime() == null) {
    s_logger.debug("String_Node_Str" + ipAddressId + "String_Node_Str");
    return true;
  }
  if (ipVO.getAllocatedToAccountId() != null) {
    _accountMgr.checkAccess(caller,null,ipVO);
  }
  Network associatedNetwork=getNetwork(ipVO.getAssociatedWithNetworkId());
  if (areServicesSupportedInNetwork(associatedNetwork.getId(),Service.SourceNat)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  VlanVO vlan=_vlanDao.findById(ipVO.getVlanId());
  if (!vlan.getVlanType().equals(VlanType.VirtualNetwork)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (_accountVlanMapDao.findAccountVlanMap(ipVO.getAccountId(),ipVO.getVlanId()) != null) {
    throw new InvalidParameterValueException("String_Node_Str" + ipAddressId + "String_Node_Str");
  }
  return releasePublicIpAddress(ipAddressId,userId,caller);
}

Fixed version (ground truth):
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_NET_IP_RELEASE,eventDescription="String_Node_Str",async=true) public boolean disassociateIpAddress(long ipAddressId){
  Long userId=UserContext.current().getCallerUserId();
  Account caller=UserContext.current().getCaller();
  IPAddressVO ipVO=_ipAddressDao.findById(ipAddressId);
  if (ipVO == null) {
    throw new InvalidParameterValueException("String_Node_Str" + ipAddressId);
  }
  if (ipVO.getAllocatedTime() == null) {
    s_logger.debug("String_Node_Str" + ipAddressId + "String_Node_Str");
    return true;
  }
  if (ipVO.getAllocatedToAccountId() != null) {
    _accountMgr.checkAccess(caller,null,ipVO);
  }
  Network associatedNetwork=getNetwork(ipVO.getAssociatedWithNetworkId());
  if (ipVO.isSourceNat() && areServicesSupportedInNetwork(associatedNetwork.getId(),Service.SourceNat)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  VlanVO vlan=_vlanDao.findById(ipVO.getVlanId());
  if (!vlan.getVlanType().equals(VlanType.VirtualNetwork)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (_accountVlanMapDao.findAccountVlanMap(ipVO.getAccountId(),ipVO.getVlanId()) != null) {
    throw new InvalidParameterValueException("String_Node_Str" + ipAddressId + "String_Node_Str");
  }
  return releasePublicIpAddress(ipAddressId,userId,caller);
}
Program: 89267
Project: 89267
Buggy source:
@Override public ExternalFirewallDeviceVO addSrxFirewall(AddSrxFirewallCmd cmd){
  String deviceName=cmd.getDeviceType();
  if (deviceName.equalsIgnoreCase(NetworkDevice.JuniperSRXFirewall.getName())) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  return addExternalFirewall(cmd.getPhysicalNetworkId(),cmd.getUrl(),cmd.getUsername(),cmd.getPassword(),deviceName,(ServerResource)new JuniperSrxResource());
}

Fixed version (ground truth):
@Override public ExternalFirewallDeviceVO addSrxFirewall(AddSrxFirewallCmd cmd){
  String deviceName=cmd.getDeviceType();
  if (!deviceName.equalsIgnoreCase(NetworkDevice.JuniperSRXFirewall.getName())) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  return addExternalFirewall(cmd.getPhysicalNetworkId(),cmd.getUrl(),cmd.getUsername(),cmd.getPassword(),deviceName,(ServerResource)new JuniperSrxResource());
}
Program: 89268
Project: 89268
Buggy source:
public RebootAnswer(RebootCommand cmd,String details){
  super(cmd,false,details);
  bytesSent=null;
  bytesReceived=null;
}

Fixed version (ground truth):
public RebootAnswer(RebootCommand cmd,Exception e){
  super(cmd,e);
}
Program: 89269
Project: 89269
Buggy source:
public Integer getVncPort(){
  return vncPort;
}

Fixed version (ground truth):
@Override public Integer getVncPort(){
  return vncPort;
}
Program: 89270
Project: 89270
Buggy source:
public StopAnswer(StopCommand cmd,String details){
  super(cmd,details);
  vncPort=null;
}

Fixed version (ground truth):
public StopAnswer(StopCommand cmd,Exception e){
  super(cmd,e);
}
Program: 89272
Project: 89272
Buggy source:
@Override public ExternalLoadBalancerDeviceVO getExternalLoadBalancerForNetwork(Network network){
  NetworkExternalLoadBalancerVO lbDeviceForNetwork=_networkExternalLBDao.findByNetworkId(network.getId());
  if (lbDeviceForNetwork != null) {
    long lbDeviceId=lbDeviceForNetwork.getExternalLBDeviceId();
    ExternalLoadBalancerDeviceVO lbDeviceVo=_externalLoadBalancerDeviceDao.findById(lbDeviceId);
    assert(lbDeviceVo != null);
  }
  return null;
}

Fixed version (ground truth):
@Override public ExternalLoadBalancerDeviceVO getExternalLoadBalancerForNetwork(Network network){
  NetworkExternalLoadBalancerVO lbDeviceForNetwork=_networkExternalLBDao.findByNetworkId(network.getId());
  if (lbDeviceForNetwork != null) {
    long lbDeviceId=lbDeviceForNetwork.getExternalLBDeviceId();
    ExternalLoadBalancerDeviceVO lbDeviceVo=_externalLoadBalancerDeviceDao.findById(lbDeviceId);
    assert(lbDeviceVo != null);
    return lbDeviceVo;
  }
  return null;
}
Program: 89273
Project: 89273
Buggy source:
private boolean canHandle(Network config){
  DataCenter zone=_configMgr.getZone(config.getDataCenterId());
  if ((zone.getNetworkType() == NetworkType.Advanced && config.getGuestType() != Network.GuestType.Isolated) || (zone.getNetworkType() == NetworkType.Basic && config.getGuestType() != Network.GuestType.Shared)) {
    s_logger.trace("String_Node_Str" + config.getGuestType());
    return false;
  }
  return _networkManager.networkIsConfiguredForExternalNetworking(zone.getId(),config.getId());
}

Fixed version (ground truth):
private boolean canHandle(Network config){
  DataCenter zone=_configMgr.getZone(config.getDataCenterId());
  if ((zone.getNetworkType() == NetworkType.Advanced && config.getGuestType() != Network.GuestType.Isolated) || (zone.getNetworkType() == NetworkType.Basic && config.getGuestType() != Network.GuestType.Shared)) {
    s_logger.trace("String_Node_Str" + config.getGuestType());
    return false;
  }
  return _networkManager.networkIsConfiguredForExternalNetworking(zone.getId(),config.getId()) && _ntwkSrvcDao.isProviderSupportedInNetwork(config.getId(),Service.Lb,Network.Provider.JuniperSRX);
}
Program: 89274
Project: 89274
Buggy source:
private List<NetworkVO> listDomainLevelNetworks(SearchCriteria<NetworkVO> sc,Filter searchFilter,long domainId){
  List<Long> networkIds=new ArrayList<Long>();
  Set<Long> allowedDomains=_domainMgr.getDomainParentIds(domainId);
  List<NetworkDomainVO> maps=_networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray());
  for (  NetworkDomainVO map : maps) {
    boolean subdomainAccess=(map.isSubdomainAccess() != null) ? map.isSubdomainAccess() : getAllowSubdomainAccessGlobal();
    if (map.getDomainId() == domainId || subdomainAccess) {
      networkIds.add(map.getNetworkId());
    }
  }
  SearchCriteria<NetworkVO> domainSC=_networksDao.createSearchCriteria();
  domainSC.addAnd("String_Node_Str",SearchCriteria.Op.IN,networkIds.toArray());
  domainSC.addAnd("String_Node_Str",SearchCriteria.Op.EQ,ACLType.Domain.toString());
  sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,domainSC);
  return _networksDao.search(sc,searchFilter);
}

Fixed version (ground truth):
private List<NetworkVO> listDomainLevelNetworks(SearchCriteria<NetworkVO> sc,Filter searchFilter,long domainId){
  List<Long> networkIds=new ArrayList<Long>();
  Set<Long> allowedDomains=_domainMgr.getDomainParentIds(domainId);
  List<NetworkDomainVO> maps=_networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray());
  for (  NetworkDomainVO map : maps) {
    boolean subdomainAccess=(map.isSubdomainAccess() != null) ? map.isSubdomainAccess() : getAllowSubdomainAccessGlobal();
    if (map.getDomainId() == domainId || subdomainAccess) {
      networkIds.add(map.getNetworkId());
    }
  }
  if (!networkIds.isEmpty()) {
    SearchCriteria<NetworkVO> domainSC=_networksDao.createSearchCriteria();
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.IN,networkIds.toArray());
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.EQ,ACLType.Domain.toString());
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,domainSC);
    return _networksDao.search(sc,searchFilter);
  }
 else {
    return new ArrayList<NetworkVO>();
  }
}
Program: 89277
Project: 89277
Buggy source:
@Override @ActionEvent(eventType=EventTypes.EVENT_PHYSICAL_NETWORK_DELETE,eventDescription="String_Node_Str",async=true) public boolean deletePhysicalNetwork(Long physicalNetworkId){
  PhysicalNetworkVO pNetwork=_physicalNetworkDao.findById(physicalNetworkId);
  if (pNetwork == null) {
    throw new InvalidParameterValueException("String_Node_Str" + physicalNetworkId + "String_Node_Str");
  }
  checkIfPhysicalNetworkIsDeletable(physicalNetworkId);
  List<VlanVO> vlans=_vlanDao.listVlansByPhysicalNetworkId(physicalNetworkId);
  for (  VlanVO vlan : vlans) {
    _vlanDao.remove(vlan.getId());
  }
  List<NetworkVO> networks=_networksDao.listByPhysicalNetworkIncludingRemoved(physicalNetworkId);
  if (networks != null && !networks.isEmpty()) {
    for (    NetworkVO network : networks) {
      _networksDao.remove(network.getId());
    }
  }
  _dcDao.deleteVnet(physicalNetworkId);
  _pNSPDao.deleteProviders(physicalNetworkId);
  boolean success=_physicalNetworkDao.remove(physicalNetworkId);
  return success;
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_PHYSICAL_NETWORK_DELETE,eventDescription="String_Node_Str",async=true) public boolean deletePhysicalNetwork(Long physicalNetworkId){
  PhysicalNetworkVO pNetwork=_physicalNetworkDao.findById(physicalNetworkId);
  if (pNetwork == null) {
    throw new InvalidParameterValueException("String_Node_Str" + physicalNetworkId + "String_Node_Str");
  }
  checkIfPhysicalNetworkIsDeletable(physicalNetworkId);
  List<VlanVO> vlans=_vlanDao.listVlansByPhysicalNetworkId(physicalNetworkId);
  for (  VlanVO vlan : vlans) {
    _vlanDao.remove(vlan.getId());
  }
  List<NetworkVO> networks=_networksDao.listByPhysicalNetwork(physicalNetworkId);
  if (networks != null && !networks.isEmpty()) {
    for (    NetworkVO network : networks) {
      _networksDao.remove(network.getId());
    }
  }
  _dcDao.deleteVnet(physicalNetworkId);
  _pNSPDao.deleteProviders(physicalNetworkId);
  boolean success=_physicalNetworkDao.remove(physicalNetworkId);
  return success;
}
Program: 89279
Project: 89279
Buggy source:
public static String getDefaultHostIp(){
  NetworkInterface nic=null;
  String pubNic=getDefaultEthDevice();
  if (pubNic == null) {
    return null;
  }
  try {
    nic=NetworkInterface.getByName(pubNic);
  }
 catch (  final SocketException e) {
    return null;
  }
  String[] info=NetUtils.getNetworkParams(nic);
  return info[0];
}

Fixed version (ground truth):
public static String getDefaultHostIp(){
  if (isWindows()) {
    Pattern pattern=Pattern.compile("String_Node_Str");
    try {
      Process result=Runtime.getRuntime().exec("String_Node_Str");
      BufferedReader output=new BufferedReader(new InputStreamReader(result.getInputStream()));
      String line=output.readLine();
      while (line != null) {
        Matcher matcher=pattern.matcher(line);
        if (matcher.find()) {
          return matcher.group(2);
        }
        line=output.readLine();
      }
    }
 catch (    Exception e) {
    }
    return null;
  }
 else {
    NetworkInterface nic=null;
    String pubNic=getDefaultEthDevice();
    if (pubNic == null) {
      return null;
    }
    try {
      nic=NetworkInterface.getByName(pubNic);
    }
 catch (    final SocketException e) {
      return null;
    }
    String[] info=NetUtils.getNetworkParams(nic);
    return info[0];
  }
}
Program: 89282
Project: 89282
Buggy source:
@DB public Long getIdentityId(String tableName,String identityString){
  assert(tableName != null);
  assert(identityString != null);
  PreparedStatement pstmt=null;
  Transaction txn=Transaction.open(Transaction.CLOUD_DB);
  try {
    try {
      pstmt=txn.prepareAutoCloseStatement(String.format("String_Node_Str",tableName));
      long id=0;
      try {
        id=Long.parseLong(identityString);
      }
 catch (      NumberFormatException e) {
      }
      pstmt.setLong(1,id);
      pstmt.setString(2,identityString);
      ResultSet rs=pstmt.executeQuery();
      if (rs.next()) {
        return rs.getLong(1);
      }
 else {
        throw new InvalidParameterValueException("String_Node_Str" + tableName + "String_Node_Str"+ identityString+ "String_Node_Str");
      }
    }
 catch (    SQLException e) {
      s_logger.error("String_Node_Str",e);
    }
  }
  finally {
    txn.close();
  }
  return null;
}

Fixed version (ground truth):
@DB public Long getIdentityId(String tableName,String identityString){
  assert(tableName != null);
  assert(identityString != null);
  PreparedStatement pstmt=null;
  Transaction txn=Transaction.open(Transaction.CLOUD_DB);
  try {
    try {
      pstmt=txn.prepareAutoCloseStatement(String.format("String_Node_Str",tableName));
      long id=0;
      try {
        id=Long.parseLong(identityString);
      }
 catch (      NumberFormatException e) {
      }
      pstmt.setLong(1,id);
      pstmt.setString(2,identityString);
      ResultSet rs=pstmt.executeQuery();
      if (rs.next()) {
        return rs.getLong(1);
      }
 else {
        if (id != 0)         return id;
        throw new InvalidParameterValueException("String_Node_Str" + tableName + "String_Node_Str"+ identityString+ "String_Node_Str");
      }
    }
 catch (    SQLException e) {
      s_logger.error("String_Node_Str",e);
    }
  }
  finally {
    txn.close();
  }
  return null;
}
Program: 89283
Project: 89283
Buggy source:
public String getResponse(long jobId,long objectId){
  CreateCmdResponse response=new CreateCmdResponse();
  response.setJobId(jobId);
  response.setId(objectId);
  response.setResponseName(getCommandName());
  return _responseGenerator.toSerializedString(response,getResponseType());
}

Fixed version (ground truth):
public String getResponse(long jobId,long objectId,String objectEntityTable){
  CreateCmdResponse response=new CreateCmdResponse();
  response.setJobId(jobId);
  response.setId(objectId);
  response.setIdEntityTable(objectEntityTable);
  response.setResponseName(getCommandName());
  return _responseGenerator.toSerializedString(response,getResponseType());
}
Program: 89284
Project: 89284
Buggy source:
public Long getId(){
  return id.getValue();
}

Fixed version (ground truth):
public Long getId(){
  return getJobId();
}
Program: 89285
Project: 89285
Buggy source:
public void setJobInstanceType(String jobInstanceType){
  this.jobInstanceType=jobInstanceType;
  if (jobInstanceType != null) {
    if (jobInstanceType.equalsIgnoreCase("String_Node_Str")) {
      this.jobInstanceIdProxy.setTableName("String_Node_Str");
    }
 else     if (jobInstanceType.equalsIgnoreCase("String_Node_Str")) {
      this.jobInstanceIdProxy.setTableName("String_Node_Str");
    }
 else     if (jobInstanceType.equalsIgnoreCase("String_Node_Str")) {
      this.jobInstanceIdProxy.setTableName("String_Node_Str");
    }
 else {
      assert(false);
    }
  }
}

Fixed version (ground truth):
public void setJobInstanceType(String jobInstanceType){
  this.jobInstanceType=jobInstanceType;
  if (jobInstanceType != null) {
    if (jobInstanceType.equalsIgnoreCase("String_Node_Str")) {
      this.jobInstanceId.setTableName("String_Node_Str");
    }
 else     if (jobInstanceType.equalsIgnoreCase("String_Node_Str")) {
      this.jobInstanceId.setTableName("String_Node_Str");
    }
 else     if (jobInstanceType.equalsIgnoreCase("String_Node_Str")) {
      this.jobInstanceId.setTableName("String_Node_Str");
    }
 else {
      assert(false);
    }
  }
}
Program: 89286
Project: 89286
Buggy source:
public void setJobInstanceId(Long jobInstanceId){
  this.jobInstanceIdProxy.setValue(jobInstanceId);
}

Fixed version (ground truth):
public void setJobInstanceId(Long jobInstanceId){
  this.jobInstanceId.setValue(jobInstanceId);
}
Program: 89287
Project: 89287
Buggy source:
public void setId(Long id){
  this.id.setValue(id);
}

Fixed version (ground truth):
public void setId(Long id){
  setJobId(id);
}
Program: 89288
Project: 89288
Buggy source:
public Long getJobInstanceId(){
  return jobInstanceIdProxy.getValue();
}

Fixed version (ground truth):
public Long getJobInstanceId(){
  return this.jobInstanceId.getValue();
}
Program: 89289
Project: 89289
Buggy source:
public void setJobId(Long jobId){
  this.jobId=jobId;
}

Fixed version (ground truth):
public void setJobId(Long jobId){
  this.jobId.setValue(jobId);
}
Program: 89290
Project: 89290
Buggy source:
public Long getJobId(){
  return jobId;
}

Fixed version (ground truth):
public Long getJobId(){
  return jobId.getValue();
}
Program: 89291
Project: 89291
Buggy source:
public void setId(Long id){
  this.id=id;
}

Fixed version (ground truth):
public void setId(Long id){
  this.id.setValue(id);
}
Program: 89292
Project: 89292
Buggy source:
public Long getId(){
  return id;
}

Fixed version (ground truth):
public Long getId(){
  return id.getValue();
}
Program: 89297
Project: 89297
Buggy source:
public SummedCapacity(){
}

Fixed version (ground truth):
public SummedCapacity(long sumUsed,long sumReserved,long sumTotal,short capacityType,Long clusterId,Long podId){
  super();
  this.sumUsed=sumUsed;
  this.sumReserved=sumReserved;
  this.sumTotal=sumTotal;
  this.capacityType=capacityType;
  this.clusterId=clusterId;
  this.podId=podId;
}