nus-yam/ex-repair huggingface dataset:
Program: 106037
Project: 106037
Buggy source:
private static DiskTO[] sortVolumesByDeviceId(DiskTO[] volumes){
  List<DiskTO> listForSort=new ArrayList<DiskTO>();
  for (  DiskTO vol : volumes) {
    listForSort.add(vol);
  }
  Collections.sort(listForSort,new Comparator<DiskTO>(){
    @Override public int compare(    DiskTO arg0,    DiskTO arg1){
      if (arg0.getDiskSeq() < arg1.getDiskSeq()) {
        return -1;
      }
 else       if (arg0.getDiskSeq() == arg1.getDiskSeq()) {
        return 0;
      }
      return 1;
    }
  }
);
  return listForSort.toArray(new DiskTO[0]);
}

Fixed version (ground truth):
private static DiskTO[] sortVolumesByDeviceId(DiskTO[] volumes){
  List<DiskTO> listForSort=new ArrayList<DiskTO>();
  for (  DiskTO vol : volumes) {
    listForSort.add(vol);
  }
  Collections.sort(listForSort,new Comparator<DiskTO>(){
    @Override public int compare(    DiskTO arg0,    DiskTO arg1){
      if (arg0.getDiskSeq() < arg1.getDiskSeq()) {
        return -1;
      }
 else       if (arg0.getDiskSeq().equals(arg1.getDiskSeq())) {
        return 0;
      }
      return 1;
    }
  }
);
  return listForSort.toArray(new DiskTO[0]);
}
Program: 106038
Project: 106038
Buggy source:
@Override public Void copyAsync(Map<VolumeInfo,DataStore> volumeMap,VirtualMachineTO vmTo,Host srcHost,Host destHost,AsyncCompletionCallback<CopyCommandResult> callback){
  Answer answer=null;
  String errMsg=null;
  try {
    VMInstanceVO instance=instanceDao.findById(vmTo.getId());
    if (instance != null) {
      if (srcHost.getClusterId() == destHost.getClusterId()) {
        answer=migrateVmWithVolumesWithinCluster(instance,vmTo,srcHost,destHost,volumeMap);
      }
 else {
        answer=migrateVmWithVolumesAcrossCluster(instance,vmTo,srcHost,destHost,volumeMap);
      }
    }
 else {
      throw new CloudRuntimeException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    s_logger.error("String_Node_Str",e);
    errMsg=e.toString();
  }
  CopyCommandResult result=new CopyCommandResult(null,answer);
  result.setResult(errMsg);
  callback.complete(result);
  return null;
}

Fixed version (ground truth):
@Override public Void copyAsync(Map<VolumeInfo,DataStore> volumeMap,VirtualMachineTO vmTo,Host srcHost,Host destHost,AsyncCompletionCallback<CopyCommandResult> callback){
  Answer answer=null;
  String errMsg=null;
  try {
    VMInstanceVO instance=instanceDao.findById(vmTo.getId());
    if (instance != null) {
      if (srcHost.getClusterId().equals(destHost.getClusterId())) {
        answer=migrateVmWithVolumesWithinCluster(instance,vmTo,srcHost,destHost,volumeMap);
      }
 else {
        answer=migrateVmWithVolumesAcrossCluster(instance,vmTo,srcHost,destHost,volumeMap);
      }
    }
 else {
      throw new CloudRuntimeException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    s_logger.error("String_Node_Str",e);
    errMsg=e.toString();
  }
  CopyCommandResult result=new CopyCommandResult(null,answer);
  result.setResult(errMsg);
  callback.complete(result);
  return null;
}
Program: 106042
Project: 106042
Buggy source:
private void handlePowerOffReportWithNoPendingJobsOnVM(VMInstanceVO vm){
switch (vm.getState()) {
case Starting:
case Stopping:
case Stopped:
case Migrating:
    try {
      stateTransitTo(vm,VirtualMachine.Event.FollowAgentPowerOffReport,vm.getPowerHostId());
    }
 catch (    NoTransitionException e) {
      s_logger.warn("String_Node_Str",e);
    }
  _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_SYNC,vm.getDataCenterId(),vm.getPodIdToDeployIn(),VM_SYNC_ALERT_SUBJECT,"String_Node_Str" + vm.getHostName() + "String_Node_Str"+ vm.getInstanceName()+ "String_Node_Str"+ vm.getState()+ "String_Node_Str");
break;
case Running:
case Destroyed:
case Expunging:
break;
case Error:
default :
break;
}
}

Fixed version (ground truth):
private void handlePowerOffReportWithNoPendingJobsOnVM(VMInstanceVO vm){
switch (vm.getState()) {
case Starting:
case Stopping:
case Running:
case Stopped:
case Migrating:
    try {
      stateTransitTo(vm,VirtualMachine.Event.FollowAgentPowerOffReport,vm.getPowerHostId());
    }
 catch (    NoTransitionException e) {
      s_logger.warn("String_Node_Str",e);
    }
  _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_SYNC,vm.getDataCenterId(),vm.getPodIdToDeployIn(),VM_SYNC_ALERT_SUBJECT,"String_Node_Str" + vm.getHostName() + "String_Node_Str"+ vm.getInstanceName()+ "String_Node_Str"+ vm.getState()+ "String_Node_Str");
break;
case Destroyed:
case Expunging:
break;
case Error:
default :
break;
}
}
Program: 106043
Project: 106043
Buggy source:
@Override public boolean configure(String name,Map<String,Object> xmlParams) throws ConfigurationException {
  ReservationContextImpl.init(_entityMgr);
  VirtualMachineProfileImpl.init(_entityMgr);
  _executor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  _nodeId=ManagementServerNode.getManagementServerId();
  _agentMgr.registerForHostEvents(this,true,true,true);
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> xmlParams) throws ConfigurationException {
  ReservationContextImpl.init(_entityMgr);
  VirtualMachineProfileImpl.init(_entityMgr);
  _executor=Executors.newScheduledThreadPool(1,new NamedThreadFactory("String_Node_Str"));
  _nodeId=ManagementServerNode.getManagementServerId();
  _agentMgr.registerForHostEvents(this,true,true,true);
  if (VmJobEnabled.value()) {
    _messageBus.subscribe(VirtualMachineManager.Topics.VM_POWER_STATE,MessageDispatcher.getDispatcher(this));
  }
  return true;
}
Program: 106044
Project: 106044
Buggy source:
@Override public void processHostVmStatePingReport(long hostId,Map<String,HostVmStateReportEntry> report){
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + hostId);
  Map<Long,VirtualMachine.PowerState> translatedInfo=convertToInfos(report);
  processReport(hostId,translatedInfo);
}

Fixed version (ground truth):
@Override public void processHostVmStatePingReport(long hostId,Map<String,HostVmStateReportEntry> report){
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + hostId);
  Map<Long,VirtualMachine.PowerState> translatedInfo=convertVmStateReport(report);
  processReport(hostId,translatedInfo);
}
Program: 106045
Project: 106045
Buggy source:
private void processReport(long hostId,Map<Long,VirtualMachine.PowerState> translatedInfo){
  for (  Map.Entry<Long,VirtualMachine.PowerState> entry : translatedInfo.entrySet()) {
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + hostId + "String_Node_Str"+ entry.getKey()+ "String_Node_Str"+ entry.getValue());
    if (_instanceDao.updatePowerState(entry.getKey(),hostId,entry.getValue())) {
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + hostId + "String_Node_Str"+ entry.getKey()+ "String_Node_Str"+ entry.getValue());
      _messageBus.publish(null,VirtualMachineManager.Topics.VM_POWER_STATE,PublishScope.GLOBAL,entry.getKey());
    }
  }
}

Fixed version (ground truth):
private void processReport(long hostId,Map<Long,VirtualMachine.PowerState> translatedInfo){
  for (  Map.Entry<Long,VirtualMachine.PowerState> entry : translatedInfo.entrySet()) {
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + hostId + "String_Node_Str"+ entry.getKey()+ "String_Node_Str"+ entry.getValue());
    if (_instanceDao.updatePowerState(entry.getKey(),hostId,entry.getValue())) {
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + hostId + "String_Node_Str"+ entry.getKey()+ "String_Node_Str"+ entry.getValue());
      _messageBus.publish(null,VirtualMachineManager.Topics.VM_POWER_STATE,PublishScope.GLOBAL,entry.getKey());
    }
 else {
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + entry.getKey());
    }
  }
}
Program: 106046
Project: 106046
Buggy source:
@Override public void processHostVmStateReport(long hostId,Map<String,HostVmStateReportEntry> report){
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + hostId);
  Map<Long,VirtualMachine.PowerState> translatedInfo=convertToInfos(report);
  processReport(hostId,translatedInfo);
}

Fixed version (ground truth):
@Override public void processHostVmStateReport(long hostId,Map<String,HostVmStateReportEntry> report){
  if (s_logger.isDebugEnabled())   s_logger.debug("String_Node_Str" + hostId);
  Map<Long,VirtualMachine.PowerState> translatedInfo=convertVmStateReport(report);
  processReport(hostId,translatedInfo);
}
Program: 106047
Project: 106047
Buggy source:
@Override @DB public void resetHostPowerStateTracking(long hostId){
  SearchCriteria<VMInstanceVO> sc=createSearchCriteria();
  sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,hostId);
  VMInstanceVO instance=this.createForUpdate();
  instance.setPowerStateUpdateCount(0);
  instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
  this.update(instance,sc);
}

Fixed version (ground truth):
@Override @DB public void resetHostPowerStateTracking(final long hostId){
  Transaction.execute(new TransactionCallbackNoReturn(){
    @Override public void doInTransactionWithoutResult(    TransactionStatus status){
      SearchCriteria<VMInstanceVO> sc=createSearchCriteria();
      sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,hostId);
      VMInstanceVO instance=createForUpdate();
      instance.setPowerStateUpdateCount(0);
      instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
      update(instance,sc);
    }
  }
);
}
Program: 106048
Project: 106048
Buggy source:
@Override public void resetVmPowerStateTracking(long instanceId){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  txn.start();
  VMInstanceVO instance=findById(instanceId);
  if (instance != null) {
    instance.setPowerStateUpdateCount(0);
    instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
    update(instanceId,instance);
  }
  txn.commit();
}

Fixed version (ground truth):
@Override public void resetVmPowerStateTracking(final long instanceId){
  Transaction.execute(new TransactionCallbackNoReturn(){
    @Override public void doInTransactionWithoutResult(    TransactionStatus status){
      VMInstanceVO instance=findById(instanceId);
      if (instance != null) {
        instance.setPowerStateUpdateCount(0);
        instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
        update(instanceId,instance);
      }
    }
  }
);
}
Program: 106049
Project: 106049
Buggy source:
@Override public boolean updatePowerState(long instanceId,long powerHostId,VirtualMachine.PowerState powerState){
  boolean needToUpdate=false;
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  txn.start();
  VMInstanceVO instance=findById(instanceId);
  if (instance != null) {
    Long savedPowerHostId=instance.getPowerHostId();
    if (instance.getPowerState() != powerState || savedPowerHostId == null || savedPowerHostId.longValue() != powerHostId) {
      instance.setPowerState(powerState);
      instance.setPowerHostId(powerHostId);
      instance.setPowerStateUpdateCount(1);
      instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
      needToUpdate=true;
      update(instanceId,instance);
    }
 else {
      if (instance.getPowerStateUpdateCount() < MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT) {
        instance.setPowerStateUpdateCount(instance.getPowerStateUpdateCount() + 1);
        instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
        needToUpdate=true;
        update(instanceId,instance);
      }
    }
  }
  txn.commit();
  return needToUpdate;
}

Fixed version (ground truth):
@Override public boolean updatePowerState(final long instanceId,final long powerHostId,final VirtualMachine.PowerState powerState){
  return Transaction.execute(new TransactionCallback<Boolean>(){
    @Override public Boolean doInTransaction(    TransactionStatus status){
      boolean needToUpdate=false;
      VMInstanceVO instance=findById(instanceId);
      if (instance != null) {
        Long savedPowerHostId=instance.getPowerHostId();
        if (instance.getPowerState() != powerState || savedPowerHostId == null || savedPowerHostId.longValue() != powerHostId) {
          instance.setPowerState(powerState);
          instance.setPowerHostId(powerHostId);
          instance.setPowerStateUpdateCount(1);
          instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
          needToUpdate=true;
          update(instanceId,instance);
        }
 else {
          if (instance.getPowerStateUpdateCount() < MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT) {
            instance.setPowerStateUpdateCount(instance.getPowerStateUpdateCount() + 1);
            instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());
            needToUpdate=true;
            update(instanceId,instance);
          }
        }
      }
      return needToUpdate;
    }
  }
);
}
Program: 106050
Project: 106050
Buggy source:
@Override public void deleteController(DeleteOpenDaylightControllerCmd cmd) throws InvalidParameterValueException {
  OpenDaylightControllerVO controller=openDaylightControllerMappingDao.findById(cmd.getId());
  if (controller == null) {
    throw new InvalidParameterValueException("String_Node_Str" + cmd.getId());
  }
  Long physicalNetworkId=controller.getPhysicalNetworkId();
  PhysicalNetworkVO physicalNetwork=physicalNetworkDao.findById(physicalNetworkId);
  if (physicalNetwork != null) {
    List<NetworkVO> networkList=networkDao.listByPhysicalNetwork(physicalNetworkId);
    for (    NetworkVO network : networkList) {
      if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.OpenDaylight) {
        if ((network.getState() != Network.State.Shutdown) && (network.getState() != Network.State.Destroy)) {
          throw new CloudRuntimeException("String_Node_Str");
        }
      }
    }
  }
  HostVO host=hostDao.findById(controller.getHostId());
  Long hostId=host.getId();
  host.setResourceState(ResourceState.Maintenance);
  hostDao.update(hostId,host);
  resourceManager.deleteHost(hostId,false,false);
  openDaylightControllerMappingDao.remove(cmd.getId());
}

Fixed version (ground truth):
@Override public void deleteController(DeleteOpenDaylightControllerCmd cmd) throws InvalidParameterValueException {
  OpenDaylightControllerVO controller=openDaylightControllerMappingDao.findById(cmd.getId());
  if (controller == null) {
    throw new InvalidParameterValueException("String_Node_Str" + cmd.getId());
  }
  Long physicalNetworkId=controller.getPhysicalNetworkId();
  PhysicalNetworkVO physicalNetwork=physicalNetworkDao.findById(physicalNetworkId);
  if (physicalNetwork != null) {
    List<NetworkVO> networkList=networkDao.listByPhysicalNetwork(physicalNetworkId);
    if (networkList != null) {
      for (      NetworkVO network : networkList) {
        if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.OpenDaylight) {
          if ((network.getState() != Network.State.Shutdown) && (network.getState() != Network.State.Destroy)) {
            throw new CloudRuntimeException("String_Node_Str");
          }
        }
      }
    }
  }
  HostVO host=hostDao.findById(controller.getHostId());
  Long hostId=host.getId();
  host.setResourceState(ResourceState.Maintenance);
  hostDao.update(hostId,host);
  resourceManager.deleteHost(hostId,false,false);
  openDaylightControllerMappingDao.remove(cmd.getId());
}
Program: 106052
Project: 106052
Buggy source:
@Override public boolean deleteNiciraNvpDevice(DeleteNiciraNvpDeviceCmd cmd){
  Long niciraDeviceId=cmd.getNiciraNvpDeviceId();
  NiciraNvpDeviceVO niciraNvpDevice=niciraNvpDao.findById(niciraDeviceId);
  if (niciraNvpDevice == null) {
    throw new InvalidParameterValueException("String_Node_Str" + niciraDeviceId);
  }
  Long physicalNetworkId=niciraNvpDevice.getPhysicalNetworkId();
  PhysicalNetworkVO physicalNetwork=physicalNetworkDao.findById(physicalNetworkId);
  if (physicalNetwork != null) {
    List<NetworkVO> networkList=networkDao.listByPhysicalNetwork(physicalNetworkId);
    for (    NetworkVO network : networkList) {
      if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.Lswitch) {
        if ((network.getState() != Network.State.Shutdown) && (network.getState() != Network.State.Destroy)) {
          throw new CloudRuntimeException("String_Node_Str");
        }
      }
    }
  }
  HostVO niciraHost=hostDao.findById(niciraNvpDevice.getHostId());
  Long hostId=niciraHost.getId();
  niciraHost.setResourceState(ResourceState.Maintenance);
  hostDao.update(hostId,niciraHost);
  resourceMgr.deleteHost(hostId,false,false);
  niciraNvpDao.remove(niciraDeviceId);
  return true;
}

Fixed version (ground truth):
@Override public boolean deleteNiciraNvpDevice(DeleteNiciraNvpDeviceCmd cmd){
  Long niciraDeviceId=cmd.getNiciraNvpDeviceId();
  NiciraNvpDeviceVO niciraNvpDevice=niciraNvpDao.findById(niciraDeviceId);
  if (niciraNvpDevice == null) {
    throw new InvalidParameterValueException("String_Node_Str" + niciraDeviceId);
  }
  Long physicalNetworkId=niciraNvpDevice.getPhysicalNetworkId();
  PhysicalNetworkVO physicalNetwork=physicalNetworkDao.findById(physicalNetworkId);
  if (physicalNetwork != null) {
    List<NetworkVO> networkList=networkDao.listByPhysicalNetwork(physicalNetworkId);
    if (networkList != null) {
      for (      NetworkVO network : networkList) {
        if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.Lswitch) {
          if ((network.getState() != Network.State.Shutdown) && (network.getState() != Network.State.Destroy)) {
            throw new CloudRuntimeException("String_Node_Str");
          }
        }
      }
    }
  }
  HostVO niciraHost=hostDao.findById(niciraNvpDevice.getHostId());
  Long hostId=niciraHost.getId();
  niciraHost.setResourceState(ResourceState.Maintenance);
  hostDao.update(hostId,niciraHost);
  resourceMgr.deleteHost(hostId,false,false);
  niciraNvpDao.remove(niciraDeviceId);
  return true;
}
Program: 106054
Project: 106054
Buggy source:
@Override public List<? extends Network> listNiciraNvpDeviceNetworks(ListNiciraNvpDeviceNetworksCmd cmd){
  Long niciraDeviceId=cmd.getNiciraNvpDeviceId();
  NiciraNvpDeviceVO niciraNvpDevice=niciraNvpDao.findById(niciraDeviceId);
  if (niciraNvpDevice == null) {
    throw new InvalidParameterValueException("String_Node_Str" + niciraDeviceId);
  }
  Long physicalNetworkId=niciraNvpDevice.getPhysicalNetworkId();
  PhysicalNetworkVO physicalNetwork=physicalNetworkDao.findById(physicalNetworkId);
  if (physicalNetwork == null) {
    return Collections.emptyList();
  }
  List<NetworkVO> networkList=networkDao.listByPhysicalNetwork(physicalNetworkId);
  List<NetworkVO> responseList=new ArrayList<NetworkVO>();
  for (  NetworkVO network : networkList) {
    if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.Lswitch) {
      responseList.add(network);
    }
  }
  return responseList;
}

Fixed version (ground truth):
@Override public List<? extends Network> listNiciraNvpDeviceNetworks(ListNiciraNvpDeviceNetworksCmd cmd){
  Long niciraDeviceId=cmd.getNiciraNvpDeviceId();
  NiciraNvpDeviceVO niciraNvpDevice=niciraNvpDao.findById(niciraDeviceId);
  if (niciraNvpDevice == null) {
    throw new InvalidParameterValueException("String_Node_Str" + niciraDeviceId);
  }
  Long physicalNetworkId=niciraNvpDevice.getPhysicalNetworkId();
  PhysicalNetworkVO physicalNetwork=physicalNetworkDao.findById(physicalNetworkId);
  if (physicalNetwork == null) {
    return Collections.emptyList();
  }
  List<NetworkVO> networkList=networkDao.listByPhysicalNetwork(physicalNetworkId);
  if (networkList == null) {
    return Collections.emptyList();
  }
  List<NetworkVO> responseList=new ArrayList<NetworkVO>();
  for (  NetworkVO network : networkList) {
    if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.Lswitch) {
      responseList.add(network);
    }
  }
  return responseList;
}
Program: 106055
Project: 106055
Buggy source:
public NiciraNvpApi(){
  client=createHttpClient();
  client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
  try {
    Protocol.registerProtocol("String_Node_Str",new Protocol("String_Node_Str",(ProtocolSocketFactory)new TrustingProtocolSocketFactory(),HTTPS_PORT));
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str",e);
  }
  gson=new GsonBuilder().registerTypeAdapter(NatRule.class,new NatRuleAdapter()).setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
  buildTypeSpecificStructures();
}

Fixed version (ground truth):
public NiciraNvpApi(){
  client=createHttpClient();
  client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
  try {
    Protocol.registerProtocol("String_Node_Str",new Protocol("String_Node_Str",(ProtocolSocketFactory)new TrustingProtocolSocketFactory(),HTTPS_PORT));
  }
 catch (  final IOException e) {
    s_logger.warn("String_Node_Str",e);
  }
  gson=new GsonBuilder().registerTypeAdapter(NatRule.class,new NatRuleAdapter()).setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
}
Program: 106058
Project: 106058
Buggy source:
private Pair<JobInfo.Status,String> orchestrateRemoveNicFromVm(VmWorkRemoveNicFromVm work) throws Exception {
  VMInstanceVO vm=_entityMgr.findById(VMInstanceVO.class,work.getVmId());
  if (vm == null) {
    s_logger.info("String_Node_Str" + work.getVmId());
  }
  assert(vm != null);
  boolean result=orchestrateRemoveNicFromVm(vm,work.getNic());
  return new Pair<JobInfo.Status,String>(JobInfo.Status.SUCCEEDED,_jobMgr.marshallResultObject(new Boolean(result)));
}

Fixed version (ground truth):
private Pair<JobInfo.Status,String> orchestrateRemoveNicFromVm(VmWorkRemoveNicFromVm work) throws Exception {
  VMInstanceVO vm=_entityMgr.findById(VMInstanceVO.class,work.getVmId());
  if (vm == null) {
    s_logger.info("String_Node_Str" + work.getVmId());
  }
  assert(vm != null);
  NicVO nic=_entityMgr.findById(NicVO.class,work.getNicId());
  boolean result=orchestrateRemoveNicFromVm(vm,nic);
  return new Pair<JobInfo.Status,String>(JobInfo.Status.SUCCEEDED,_jobMgr.marshallResultObject(new Boolean(result)));
}
Program: 106059
Project: 106059
Buggy source:
@Override public boolean removeNicFromVm(VirtualMachine vm,Nic nic) throws ConcurrentOperationException, ResourceUnavailableException {
  AsyncJobExecutionContext jobContext=AsyncJobExecutionContext.getCurrentExecutionContext();
  if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
    return orchestrateRemoveNicFromVm(vm,nic);
  }
 else {
    Outcome<VirtualMachine> outcome=removeNicFromVmThroughJobQueue(vm,nic);
    try {
      outcome.get();
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    java.util.concurrent.ExecutionException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    AsyncJobVO jobVo=_entityMgr.findById(AsyncJobVO.class,outcome.getJob().getId());
    if (jobVo.getResultCode() == JobInfo.Status.SUCCEEDED.ordinal()) {
      Boolean result=(Boolean)JobSerializerHelper.fromObjectSerializedString(jobVo.getResult());
      return result;
    }
 else {
      Object jobResult=_jobMgr.unmarshallResultObject(outcome.getJob());
      if (jobResult != null) {
        if (jobResult instanceof ResourceUnavailableException)         throw (ResourceUnavailableException)jobResult;
 else         if (jobResult instanceof ConcurrentOperationException)         throw (ConcurrentOperationException)jobResult;
 else         if (jobResult instanceof RuntimeException)         throw (RuntimeException)jobResult;
      }
      throw new RuntimeException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public boolean removeNicFromVm(VirtualMachine vm,Nic nic) throws ConcurrentOperationException, ResourceUnavailableException {
  AsyncJobExecutionContext jobContext=AsyncJobExecutionContext.getCurrentExecutionContext();
  if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
    return orchestrateRemoveNicFromVm(vm,nic);
  }
 else {
    Outcome<VirtualMachine> outcome=removeNicFromVmThroughJobQueue(vm,nic);
    try {
      outcome.get();
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    java.util.concurrent.ExecutionException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    Object jobResult=_jobMgr.unmarshallResultObject(outcome.getJob());
    if (jobResult != null) {
      if (jobResult instanceof ResourceUnavailableException)       throw (ResourceUnavailableException)jobResult;
 else       if (jobResult instanceof ConcurrentOperationException)       throw (ConcurrentOperationException)jobResult;
 else       if (jobResult instanceof RuntimeException)       throw (RuntimeException)jobResult;
 else       if (jobResult instanceof Boolean)       return (Boolean)jobResult;
    }
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 106060
Project: 106060
Buggy source:
private Pair<JobInfo.Status,String> orchestrateAddVmToNetwork(VmWorkAddVmToNetwork work) throws Exception {
  VMInstanceVO vm=_entityMgr.findById(VMInstanceVO.class,work.getVmId());
  if (vm == null) {
    s_logger.info("String_Node_Str" + work.getVmId());
  }
  assert(vm != null);
  NicProfile nic=orchestrateAddVmToNetwork(vm,work.getNetwork(),work.getRequestedNicProfile());
  return new Pair<JobInfo.Status,String>(JobInfo.Status.SUCCEEDED,_jobMgr.marshallResultObject(nic));
}

Fixed version (ground truth):
private Pair<JobInfo.Status,String> orchestrateAddVmToNetwork(VmWorkAddVmToNetwork work) throws Exception {
  VMInstanceVO vm=_entityMgr.findById(VMInstanceVO.class,work.getVmId());
  if (vm == null) {
    s_logger.info("String_Node_Str" + work.getVmId());
  }
  assert(vm != null);
  Network network=_networkDao.findById(work.getNetworkId());
  NicProfile nic=orchestrateAddVmToNetwork(vm,network,work.getRequestedNicProfile());
  return new Pair<JobInfo.Status,String>(JobInfo.Status.SUCCEEDED,_jobMgr.marshallResultObject(new Long(nic.getId())));
}
Program: 106062
Project: 106062
Buggy source:
public VmWorkAddVmToNetwork(long userId,long accountId,long vmId,String handlerName,Network network,NicProfile requested){
  super(userId,accountId,vmId,handlerName);
  this.network=network;
  requstedNicProfile=requested;
}

Fixed version (ground truth):
public VmWorkAddVmToNetwork(long userId,long accountId,long vmId,String handlerName,Long networkId,NicProfile requested){
  super(userId,accountId,vmId,handlerName);
  this.networkId=networkId;
  requstedNicProfile=requested;
}
Program: 106063
Project: 106063
Buggy source:
public VmWorkRemoveNicFromVm(long userId,long accountId,long vmId,String handlerName,Nic nic){
  super(userId,accountId,vmId,handlerName);
  this.nic=nic;
}

Fixed version (ground truth):
public VmWorkRemoveNicFromVm(long userId,long accountId,long vmId,String handlerName,Long nicId){
  super(userId,accountId,vmId,handlerName);
  this.nicId=nicId;
}
Program: 106065
Project: 106065
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Pair<JobInfo.Status,String> handleVmWorkJob(VmWork work) throws Exception {
  Method method=getHandlerMethod(work.getClass());
  if (method != null) {
    try {
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
      Object obj=method.invoke(_target,work);
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
      assert(obj instanceof Pair);
      return (Pair<JobInfo.Status,String>)obj;
    }
 catch (    InvocationTargetException e) {
      s_logger.error("String_Node_Str" + e.getCause());
      if (e.getCause() != null && e.getCause() instanceof Exception) {
        s_logger.info("String_Node_Str" + e.getCause());
        throw (Exception)e.getCause();
      }
      throw e;
    }
  }
 else {
    s_logger.error("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    RuntimeException ex=new RuntimeException("String_Node_Str" + work.getClass().getName());
    return new Pair<JobInfo.Status,String>(JobInfo.Status.FAILED,JobSerializerHelper.toObjectSerializedString(ex));
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Pair<JobInfo.Status,String> handleVmWorkJob(VmWork work) throws Exception {
  Method method=getHandlerMethod(work.getClass());
  if (method != null) {
    try {
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
      Object obj=method.invoke(_target,work);
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
      assert(obj instanceof Pair);
      return (Pair<JobInfo.Status,String>)obj;
    }
 catch (    InvocationTargetException e) {
      s_logger.error("String_Node_Str" + e.getCause());
      if (e.getCause() != null && e.getCause() instanceof Exception)       throw (Exception)e.getCause();
      throw e;
    }
  }
 else {
    s_logger.error("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    RuntimeException ex=new RuntimeException("String_Node_Str" + work.getClass().getName());
    return new Pair<JobInfo.Status,String>(JobInfo.Status.FAILED,JobSerializerHelper.toObjectSerializedString(ex));
  }
}
Program: 106066
Project: 106066
Buggy source:
private Pair<JobInfo.Status,String> orchestrateDetachVolumeFromVM(VmWorkAttachVolume work) throws Exception {
  orchestrateDetachVolumeFromVM(work.getVmId(),work.getVolumeId());
  return new Pair<JobInfo.Status,String>(JobInfo.Status.SUCCEEDED,null);
}

Fixed version (ground truth):
private Pair<JobInfo.Status,String> orchestrateDetachVolumeFromVM(VmWorkDetachVolume work) throws Exception {
  orchestrateDetachVolumeFromVM(work.getVmId(),work.getVolumeId());
  return new Pair<JobInfo.Status,String>(JobInfo.Status.SUCCEEDED,null);
}
Program: 106067
Project: 106067
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Pair<JobInfo.Status,String> handleVmWorkJob(VmWork work) throws Exception {
  Method method=getHandlerMethod(work.getClass());
  if (method != null) {
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    Object obj=method.invoke(_target,work);
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    assert(obj instanceof Pair);
    return (Pair<JobInfo.Status,String>)obj;
  }
 else {
    s_logger.error("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    RuntimeException e=new RuntimeException("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    String exceptionJson=JobSerializerHelper.toSerializedString(e);
    s_logger.error("String_Node_Str" + exceptionJson);
    return new Pair<JobInfo.Status,String>(JobInfo.Status.FAILED,exceptionJson);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Pair<JobInfo.Status,String> handleVmWorkJob(VmWork work) throws Exception {
  Method method=getHandlerMethod(work.getClass());
  if (method != null) {
    try {
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
      Object obj=method.invoke(_target,work);
      if (s_logger.isDebugEnabled())       s_logger.debug("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
      assert(obj instanceof Pair);
      return (Pair<JobInfo.Status,String>)obj;
    }
 catch (    InvocationTargetException e) {
      s_logger.error("String_Node_Str" + e.getCause());
      if (e.getCause() != null && e.getCause() instanceof Exception) {
        s_logger.info("String_Node_Str" + e.getCause());
        throw (Exception)e.getCause();
      }
      throw e;
    }
  }
 else {
    s_logger.error("String_Node_Str" + work.getClass().getName() + _gsonLogger.toJson(work));
    RuntimeException ex=new RuntimeException("String_Node_Str" + work.getClass().getName());
    return new Pair<JobInfo.Status,String>(JobInfo.Status.FAILED,JobSerializerHelper.toObjectSerializedString(ex));
  }
}
Program: 106071
Project: 106071
Buggy source:
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledEntity> sc,SearchCriteria<? extends ControlledEntity> aclSc,boolean isRecursive,List<Long> permittedDomains,List<Long> permittedAccounts,List<Long> permittedResources,ListProjectResourcesCriteria listProjectResourcesCriteria){
  if (listProjectResourcesCriteria != null) {
    sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,Account.ACCOUNT_TYPE_PROJECT);
  }
  if (!permittedDomains.isEmpty()) {
    if (isRecursive) {
      for (int i=0; i < permittedDomains.size(); i++) {
        Domain domain=_domainDao.findById(permittedDomains.get(i));
        aclSc.addOr("String_Node_Str",SearchCriteria.Op.LIKE,domain.getPath() + "String_Node_Str");
      }
    }
 else {
      aclSc.addOr("String_Node_Str",SearchCriteria.Op.IN,permittedDomains.toArray());
    }
  }
  if (!permittedAccounts.isEmpty()) {
    aclSc.addOr("String_Node_Str",SearchCriteria.Op.IN,permittedAccounts.toArray());
  }
  if (!permittedResources.isEmpty()) {
    aclSc.addOr("String_Node_Str",SearchCriteria.Op.IN,permittedResources.toArray());
  }
  sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,aclSc);
}

Fixed version (ground truth):
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledEntity> sc,SearchCriteria<? extends ControlledEntity> aclSc,boolean isRecursive,List<Long> permittedDomains,List<Long> permittedAccounts,List<Long> permittedResources,ListProjectResourcesCriteria listProjectResourcesCriteria){
  if (listProjectResourcesCriteria != null) {
    if (listProjectResourcesCriteria == ListProjectResourcesCriteria.SkipProjectResources) {
      sc.addAnd("String_Node_Str",SearchCriteria.Op.NEQ,Account.ACCOUNT_TYPE_PROJECT);
    }
 else     if (listProjectResourcesCriteria == ListProjectResourcesCriteria.ListProjectResourcesOnly) {
      sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,Account.ACCOUNT_TYPE_PROJECT);
    }
  }
  if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() && permittedResources.isEmpty())   return;
  if (!permittedDomains.isEmpty()) {
    if (isRecursive) {
      for (int i=0; i < permittedDomains.size(); i++) {
        Domain domain=_domainDao.findById(permittedDomains.get(i));
        aclSc.addOr("String_Node_Str",SearchCriteria.Op.LIKE,domain.getPath() + "String_Node_Str");
      }
    }
 else {
      aclSc.addOr("String_Node_Str",SearchCriteria.Op.IN,permittedDomains.toArray());
    }
  }
  if (!permittedAccounts.isEmpty()) {
    aclSc.addOr("String_Node_Str",SearchCriteria.Op.IN,permittedAccounts.toArray());
  }
  if (!permittedResources.isEmpty()) {
    aclSc.addOr("String_Node_Str",SearchCriteria.Op.IN,permittedResources.toArray());
  }
  sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,aclSc);
}
Program: 106072
Project: 106072
Buggy source:
@Override public boolean finalizeDeployment(Commands cmds,VirtualMachineProfile profile,DeployDestination dest,ReservationContext context){
  UserVmVO userVm=_vmDao.findById(profile.getId());
  List<NicVO> nics=_nicDao.listByVmId(userVm.getId());
  for (  NicVO nic : nics) {
    NetworkVO network=_networkDao.findById(nic.getNetworkId());
    if (network.getTrafficType() == TrafficType.Guest || network.getTrafficType() == TrafficType.Public) {
      userVm.setPrivateIpAddress(nic.getIp4Address());
      userVm.setPrivateMacAddress(nic.getMacAddress());
    }
  }
  List<VolumeVO> volumes=_volsDao.findByInstance(userVm.getId());
  VmDiskStatisticsVO diskstats=null;
  for (  VolumeVO volume : volumes) {
    diskstats=_vmDiskStatsDao.findBy(userVm.getAccountId(),userVm.getDataCenterId(),userVm.getId(),volume.getId());
    if (diskstats == null) {
      diskstats=new VmDiskStatisticsVO(userVm.getAccountId(),userVm.getDataCenterId(),userVm.getId(),volume.getId());
      _vmDiskStatsDao.persist(diskstats);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean finalizeDeployment(Commands cmds,VirtualMachineProfile profile,DeployDestination dest,ReservationContext context){
  UserVmVO userVm=_vmDao.findById(profile.getId());
  List<NicVO> nics=_nicDao.listByVmId(userVm.getId());
  for (  NicVO nic : nics) {
    NetworkVO network=_networkDao.findById(nic.getNetworkId());
    if (network.getTrafficType() == TrafficType.Guest || network.getTrafficType() == TrafficType.Public) {
      userVm.setPrivateIpAddress(nic.getIp4Address());
      userVm.setPrivateMacAddress(nic.getMacAddress());
      _vmDao.update(userVm.getId(),userVm);
    }
  }
  List<VolumeVO> volumes=_volsDao.findByInstance(userVm.getId());
  VmDiskStatisticsVO diskstats=null;
  for (  VolumeVO volume : volumes) {
    diskstats=_vmDiskStatsDao.findBy(userVm.getAccountId(),userVm.getDataCenterId(),userVm.getId(),volume.getId());
    if (diskstats == null) {
      diskstats=new VmDiskStatisticsVO(userVm.getAccountId(),userVm.getDataCenterId(),userVm.getId(),volume.getId());
      _vmDiskStatsDao.persist(diskstats);
    }
  }
  return true;
}
Program: 106078
Project: 106078
Buggy source:
@Override public boolean applyNetworkACL(long aclId) throws ResourceUnavailableException {
  boolean handled=true;
  boolean aclApplyStatus=true;
  List<NetworkACLItemVO> rules=_networkACLItemDao.listByACL(aclId);
  List<NetworkVO> networks=_networkDao.listByAclId(aclId);
  for (  NetworkVO network : networks) {
    if (!applyACLItemsToNetwork(network.getId(),rules)) {
      handled=false;
      break;
    }
  }
  List<VpcGatewayVO> vpcGateways=_vpcGatewayDao.listByAclIdAndType(aclId,VpcGateway.Type.Private);
  for (  VpcGatewayVO vpcGateway : vpcGateways) {
    PrivateGateway privateGateway=_entityMgr.findById(PrivateGateway.class,vpcGateway.getId());
    if (!applyACLToPrivateGw(privateGateway)) {
      aclApplyStatus=false;
      s_logger.debug("String_Node_Str" + privateGateway.getId() + "String_Node_Str"+ aclId);
      break;
    }
  }
  if (handled && aclApplyStatus) {
    for (    NetworkACLItem rule : rules) {
      if (rule.getState() == NetworkACLItem.State.Revoke) {
        removeRule(rule);
      }
 else       if (rule.getState() == NetworkACLItem.State.Add) {
        NetworkACLItemVO ruleVO=_networkACLItemDao.findById(rule.getId());
        ruleVO.setState(NetworkACLItem.State.Active);
        _networkACLItemDao.update(ruleVO.getId(),ruleVO);
      }
    }
  }
  return handled && aclApplyStatus;
}

Fixed version (ground truth):
@Override public boolean applyNetworkACL(long aclId) throws ResourceUnavailableException {
  boolean handled=true;
  boolean aclApplyStatus=true;
  List<NetworkACLItemVO> rules=_networkACLItemDao.listByACL(aclId);
  List<NetworkVO> networks=_networkDao.listByAclId(aclId);
  for (  NetworkVO network : networks) {
    if (!applyACLItemsToNetwork(network.getId(),rules)) {
      handled=false;
      break;
    }
  }
  List<VpcGatewayVO> vpcGateways=_vpcGatewayDao.listByAclIdAndType(aclId,VpcGateway.Type.Private);
  for (  VpcGatewayVO vpcGateway : vpcGateways) {
    PrivateGateway privateGateway=_vpcSvc.getVpcPrivateGateway(vpcGateway.getId());
    if (!applyACLToPrivateGw(privateGateway)) {
      aclApplyStatus=false;
      s_logger.debug("String_Node_Str" + privateGateway.getId() + "String_Node_Str"+ aclId);
      break;
    }
  }
  if (handled && aclApplyStatus) {
    for (    NetworkACLItem rule : rules) {
      if (rule.getState() == NetworkACLItem.State.Revoke) {
        removeRule(rule);
      }
 else       if (rule.getState() == NetworkACLItem.State.Add) {
        NetworkACLItemVO ruleVO=_networkACLItemDao.findById(rule.getId());
        ruleVO.setState(NetworkACLItem.State.Active);
        _networkACLItemDao.update(ruleVO.getId(),ruleVO);
      }
    }
  }
  return handled && aclApplyStatus;
}
Program: 106079
Project: 106079
Buggy source:
@Override public boolean replaceNetworkACLonPrivateGw(long aclId,long privateGatewayId) throws ResourceUnavailableException {
  Account caller=CallContext.current().getCallingAccount();
  VpcGateway gateway=_vpcGatewayDao.findById(privateGatewayId);
  if (gateway == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  VpcGatewayVO vo=_vpcGatewayDao.findById(privateGatewayId);
  if (vo.getState() != VpcGateway.State.Ready) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  NetworkACL acl=_networkACLDao.findById(aclId);
  if (acl == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (gateway.getVpcId() == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (aclId != NetworkACL.DEFAULT_DENY && aclId != NetworkACL.DEFAULT_ALLOW) {
    Vpc vpc=_entityMgr.findById(Vpc.class,acl.getVpcId());
    if (vpc == null) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    _accountMgr.checkAccess(caller,null,true,vpc);
    if (!gateway.getVpcId().equals(acl.getVpcId())) {
      throw new InvalidParameterValueException("String_Node_Str" + privateGatewayId + "String_Node_Str"+ aclId+ "String_Node_Str");
    }
  }
  PrivateGateway privateGateway=_entityMgr.findById(PrivateGateway.class,privateGatewayId);
  _accountMgr.checkAccess(caller,null,true,privateGateway);
  return _networkAclMgr.replaceNetworkACLForPrivateGw(acl,privateGateway);
}

Fixed version (ground truth):
@Override public boolean replaceNetworkACLonPrivateGw(long aclId,long privateGatewayId) throws ResourceUnavailableException {
  Account caller=CallContext.current().getCallingAccount();
  VpcGateway gateway=_vpcGatewayDao.findById(privateGatewayId);
  if (gateway == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  VpcGatewayVO vo=_vpcGatewayDao.findById(privateGatewayId);
  if (vo.getState() != VpcGateway.State.Ready) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  NetworkACL acl=_networkACLDao.findById(aclId);
  if (acl == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (gateway.getVpcId() == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (aclId != NetworkACL.DEFAULT_DENY && aclId != NetworkACL.DEFAULT_ALLOW) {
    Vpc vpc=_entityMgr.findById(Vpc.class,acl.getVpcId());
    if (vpc == null) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    _accountMgr.checkAccess(caller,null,true,vpc);
    if (!gateway.getVpcId().equals(acl.getVpcId())) {
      throw new InvalidParameterValueException("String_Node_Str" + privateGatewayId + "String_Node_Str"+ aclId+ "String_Node_Str");
    }
  }
  PrivateGateway privateGateway=_vpcSvc.getVpcPrivateGateway(gateway.getId());
  _accountMgr.checkAccess(caller,null,true,privateGateway);
  return _networkAclMgr.replaceNetworkACLForPrivateGw(acl,privateGateway);
}
Program: 106080
Project: 106080
Buggy source:
/** 
 * Delete an acl group.
 * @param aclGroupId
 */
boolean deleteAclGroup(Long aclGroupId);

Fixed version (ground truth):
boolean deleteAclGroup(Long aclGroupId);
Program: 106081
Project: 106081
Buggy source:
/** 
 * Creates an acl group for the given domain.
 * @param domainId
 * @param name
 * @param description
 * @return AclGroup
 */
AclGroup createAclGroup(Long domainId,String aclGroupName,String description);

Fixed version (ground truth):
AclGroup createAclGroup(Account caller,String aclGroupName,String description);
Program: 106082
Project: 106082
Buggy source:
private String getBroadcastUriFromBridge(String brName){
  String pif=matchPifFileInDirectory(brName);
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(pif);
  if (matcher.find()) {
    if (brName.startsWith("String_Node_Str")) {
      return BroadcastDomainType.Vxlan.toUri(matcher.group(2)).toString();
    }
 else {
      return BroadcastDomainType.Vlan.toUri(matcher.group(2)).toString();
    }
  }
 else {
    s_logger.debug("String_Node_Str" + brName + "String_Node_Str"+ pif);
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private String getBroadcastUriFromBridge(String brName){
  String pif=matchPifFileInDirectory(brName);
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(pif);
  if (matcher.find()) {
    if (brName.startsWith("String_Node_Str")) {
      return BroadcastDomainType.Vxlan.toUri(matcher.group(2)).toString();
    }
 else {
      return BroadcastDomainType.Vlan.toUri(matcher.group(4)).toString();
    }
  }
 else {
    s_logger.debug("String_Node_Str" + brName + "String_Node_Str"+ pif);
    return "String_Node_Str";
  }
}
Program: 106085
Project: 106085
Buggy source:
static Set<Class<?>> getFromJARFile(String jar,String packageName) throws IOException, ClassNotFoundException {
  Set<Class<?>> classes=new HashSet<Class<?>>();
  JarInputStream jarFile=new JarInputStream(new FileInputStream(jar));
  JarEntry jarEntry;
  do {
    jarEntry=jarFile.getNextJarEntry();
    if (jarEntry != null) {
      String className=jarEntry.getName();
      if (className.endsWith("String_Node_Str")) {
        className=stripFilenameExtension(className);
        if (className.startsWith(packageName)) {
          try {
            Class<?> clz=Class.forName(className.replace('/','.'));
            classes.add(clz);
          }
 catch (          ClassNotFoundException e) {
          }
catch (          NoClassDefFoundError e) {
          }
        }
      }
    }
  }
 while (jarEntry != null);
  return classes;
}

Fixed version (ground truth):
static Set<Class<?>> getFromJARFile(String jar,String packageName) throws IOException, ClassNotFoundException {
  Set<Class<?>> classes=new HashSet<Class<?>>();
  JarInputStream jarFile=new JarInputStream(new FileInputStream(jar));
  JarEntry jarEntry;
  do {
    jarEntry=jarFile.getNextJarEntry();
    if (jarEntry != null) {
      String className=jarEntry.getName();
      if (className.endsWith("String_Node_Str")) {
        className=stripFilenameExtension(className);
        if (className.startsWith(packageName)) {
          try {
            Class<?> clz=Class.forName(className.replace('/','.'));
            classes.add(clz);
          }
 catch (          ClassNotFoundException e) {
          }
catch (          NoClassDefFoundError e) {
          }
        }
      }
      IOUtils.closeQuietly(jarFile);
    }
  }
 while (jarEntry != null);
  IOUtils.closeQuietly(jarFile);
  return classes;
}
Program: 106087
Project: 106087
Buggy source:
void loadProperties() throws ConfigurationException {
  final File file=PropertiesUtil.findConfigFile("String_Node_Str");
  if (file == null) {
    throw new ConfigurationException("String_Node_Str");
  }
  s_logger.info("String_Node_Str" + file.getAbsolutePath());
  InputStream propertiesStream=null;
  try {
    propertiesStream=new FileInputStream(file);
    _properties.load(propertiesStream);
  }
 catch (  final FileNotFoundException ex) {
    throw new CloudRuntimeException("String_Node_Str" + file.getAbsolutePath(),ex);
  }
catch (  final IOException ex) {
    throw new CloudRuntimeException("String_Node_Str" + file.getAbsolutePath(),ex);
  }
 finally {
    IOUtils.closeQuietly(propertiesStream);
  }
}

Fixed version (ground truth):
void loadProperties() throws ConfigurationException {
  final File file=PropertiesUtil.findConfigFile("String_Node_Str");
  if (null == file) {
    throw new ConfigurationException("String_Node_Str");
  }
  s_logger.info("String_Node_Str" + file.getAbsolutePath());
  InputStream propertiesStream=null;
  try {
    propertiesStream=new FileInputStream(file);
    _properties.load(propertiesStream);
  }
 catch (  final FileNotFoundException ex) {
    throw new CloudRuntimeException("String_Node_Str" + file.getAbsolutePath(),ex);
  }
catch (  final IOException ex) {
    throw new CloudRuntimeException("String_Node_Str" + file.getAbsolutePath(),ex);
  }
 finally {
    IOUtils.closeQuietly(propertiesStream);
  }
}