nus-yam/ex-repair huggingface dataset:
Program: 106088
Project: 106088
Buggy source:
public void init(String[] args) throws ConfigurationException {
  File file=new File("String_Node_Str");
  if (!file.exists()) {
    file=PropertiesUtil.findConfigFile("String_Node_Str");
  }
  DOMConfigurator.configureAndWatch(file.getAbsolutePath());
  s_logger.info("String_Node_Str");
  final Class<?> c=this.getClass();
  _version=c.getPackage().getImplementationVersion();
  if (_version == null) {
    throw new CloudRuntimeException("String_Node_Str");
  }
  s_logger.info("String_Node_Str" + _version);
  loadProperties();
  parseCommand(args);
  if (s_logger.isDebugEnabled()) {
    List<String> properties=Collections.list((Enumeration<String>)_properties.propertyNames());
    for (    String property : properties) {
      s_logger.debug("String_Node_Str" + property);
    }
  }
  s_logger.info("String_Node_Str");
  _storage=new PropertiesStorage();
  _storage.configure("String_Node_Str",new HashMap<String,Object>());
  for (  Map.Entry<String,Object> cmdLineProp : getCmdLineProperties().entrySet()) {
    _properties.put(cmdLineProp.getKey(),cmdLineProp.getValue());
  }
  s_logger.info("String_Node_Str");
  _backoff=new ConstantTimeBackoff();
  _backoff.configure("String_Node_Str",new HashMap<String,Object>());
}

Fixed version (ground truth):
public void init(String[] args) throws ConfigurationException {
  File file=new File("String_Node_Str");
  if (!file.exists()) {
    file=PropertiesUtil.findConfigFile("String_Node_Str");
  }
  if (null != file) {
    DOMConfigurator.configureAndWatch(file.getAbsolutePath());
    s_logger.info("String_Node_Str");
  }
 else {
    s_logger.error("String_Node_Str");
  }
  final Class<?> c=this.getClass();
  _version=c.getPackage().getImplementationVersion();
  if (_version == null) {
    throw new CloudRuntimeException("String_Node_Str");
  }
  s_logger.info("String_Node_Str" + _version);
  loadProperties();
  parseCommand(args);
  if (s_logger.isDebugEnabled()) {
    List<String> properties=Collections.list((Enumeration<String>)_properties.propertyNames());
    for (    String property : properties) {
      s_logger.debug("String_Node_Str" + property);
    }
  }
  s_logger.info("String_Node_Str");
  _storage=new PropertiesStorage();
  _storage.configure("String_Node_Str",new HashMap<String,Object>());
  for (  Map.Entry<String,Object> cmdLineProp : getCmdLineProperties().entrySet()) {
    _properties.put(cmdLineProp.getKey(),cmdLineProp.getValue());
  }
  s_logger.info("String_Node_Str");
  _backoff=new ConstantTimeBackoff();
  _backoff.configure("String_Node_Str",new HashMap<String,Object>());
}
Program: 106089
Project: 106089
Buggy source:
/** 
 * Link the virtual machine with the service instance when recovering state from database.
 * @param controller
 * @param serviceUuid
 */
private void buildServiceInstance(ModelController controller,String serviceUuid){
  ContrailManager manager=controller.getManager();
  ApiConnector api=controller.getApiAccessor();
  _serviceUuid=serviceUuid;
  ServiceInstanceModel siModel=manager.getDatabase().lookupServiceInstance(serviceUuid);
  if (siModel == null) {
    ServiceInstance siObj;
    try {
      siObj=(ServiceInstance)api.findById(ServiceInstance.class,serviceUuid);
    }
 catch (    IOException ex) {
      s_logger.warn("String_Node_Str",ex);
      throw new CloudRuntimeException("String_Node_Str",ex);
    }
    if (siObj == null) {
      siModel=new ServiceInstanceModel(serviceUuid);
      siModel.build(controller,siObj);
    }
  }
  _serviceModel=siModel;
}

Fixed version (ground truth):
/** 
 * Link the virtual machine with the service instance when recovering state from database.
 * @param controller
 * @param serviceUuid
 */
private void buildServiceInstance(ModelController controller,String serviceUuid){
  ContrailManager manager=controller.getManager();
  ApiConnector api=controller.getApiAccessor();
  _serviceUuid=serviceUuid;
  ServiceInstanceModel siModel=manager.getDatabase().lookupServiceInstance(serviceUuid);
  if (siModel == null) {
    ServiceInstance siObj;
    try {
      siObj=(ServiceInstance)api.findById(ServiceInstance.class,serviceUuid);
    }
 catch (    IOException ex) {
      s_logger.warn("String_Node_Str",ex);
      throw new CloudRuntimeException("String_Node_Str",ex);
    }
    if (siObj == null) {
      siModel=new ServiceInstanceModel(serviceUuid);
      siModel.update(controller);
      siObj=siModel.getServiceInstance();
    }
  }
  _serviceModel=siModel;
}
Program: 106090
Project: 106090
Buggy source:
private String generatePassword() throws ServerApiException {
  try {
    final SecureRandom randomGen=SecureRandom.getInstance("String_Node_Str");
    final byte bytes[]=new byte[20];
    randomGen.nextBytes(bytes);
    return Base64.encode(bytes).toString();
  }
 catch (  final NoSuchAlgorithmException e) {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
private String generatePassword() throws ServerApiException {
  try {
    final SecureRandom randomGen=SecureRandom.getInstance("String_Node_Str");
    final byte bytes[]=new byte[20];
    randomGen.nextBytes(bytes);
    String encodedPassword=new String(Base64.encode(bytes));
    return encodedPassword;
  }
 catch (  final NoSuchAlgorithmException e) {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 106094
Project: 106094
Buggy source:
private void loadStartupProperties(){
  File propertiesFile=ConfigurationHelper.findConfigurationFile("String_Node_Str");
  properties=new Properties();
  if (propertiesFile != null) {
    try {
      properties.load(new FileInputStream(propertiesFile));
    }
 catch (    FileNotFoundException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
catch (    IOException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
    logger.info("String_Node_Str" + propertiesFile.getAbsolutePath());
  }
 else {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str");
  }
}

Fixed version (ground truth):
private void loadStartupProperties(){
  File propertiesFile=ConfigurationHelper.findConfigurationFile("String_Node_Str");
  properties=new Properties();
  if (propertiesFile != null) {
    FileInputStream startProps=null;
    try {
      startProps=new FileInputStream(propertiesFile);
      properties.load(startProps);
    }
 catch (    FileNotFoundException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
catch (    IOException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
 finally {
      IOUtils.closeQuietly(startProps);
    }
    logger.info("String_Node_Str" + propertiesFile.getAbsolutePath());
  }
 else {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str");
  }
}
Program: 106095
Project: 106095
Buggy source:
public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  initialize();
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  initialize();
  return true;
}
Program: 106096
Project: 106096
Buggy source:
public void removeDetail(long resourceId,String key){
  if (key != null) {
    SearchCriteria<R> sc=AllFieldsSearch.create();
    sc.setParameters("String_Node_Str",key);
    remove(sc);
  }
}

Fixed version (ground truth):
public void removeDetail(long resourceId,String key){
  if (key != null) {
    SearchCriteria<R> sc=AllFieldsSearch.create();
    sc.setParameters("String_Node_Str",resourceId);
    sc.setParameters("String_Node_Str",key);
    remove(sc);
  }
}
Program: 106097
Project: 106097
Buggy source:
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledViewEntity> arg0,Long arg1,boolean arg2,List<Long> arg3,ListProjectResourcesCriteria arg4){
}

Fixed version (ground truth):
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria,List<Long> grantedIds,List<Long> revokedIds){
}
Program: 106099
Project: 106099
Buggy source:
void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledViewEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria);

Fixed version (ground truth):
void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria,List<Long> grantedIds,List<Long> revokedIds);
Program: 106100
Project: 106100
Buggy source:
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledViewEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria){
  if (listProjectResourcesCriteria != null) {
    sc.setParameters("String_Node_Str",Account.ACCOUNT_TYPE_PROJECT);
  }
  if (!permittedAccounts.isEmpty()) {
    sc.setParameters("String_Node_Str",permittedAccounts.toArray());
  }
 else   if (domainId != null) {
    DomainVO domain=_domainDao.findById(domainId);
    if (isRecursive) {
      sc.setParameters("String_Node_Str",domain.getPath() + "String_Node_Str");
    }
 else {
      sc.setParameters("String_Node_Str",domainId);
    }
  }
}

Fixed version (ground truth):
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria,List<Long> grantedIds,List<Long> revokedIds){
  if (!revokedIds.isEmpty()) {
    sc.setParameters("String_Node_Str",revokedIds.toArray());
  }
  if (listProjectResourcesCriteria != null) {
    sc.setParameters("String_Node_Str",Account.ACCOUNT_TYPE_PROJECT);
  }
  if (!permittedAccounts.isEmpty()) {
    sc.setParameters("String_Node_Str",permittedAccounts.toArray());
  }
 else   if (domainId != null) {
    DomainVO domain=_domainDao.findById(domainId);
    if (isRecursive) {
      sc.setParameters("String_Node_Str",domain.getPath() + "String_Node_Str");
    }
 else {
      sc.setParameters("String_Node_Str",domainId);
    }
  }
  if (!grantedIds.isEmpty()) {
    sc.setParameters("String_Node_Str",grantedIds.toArray());
  }
}
Program: 106101
Project: 106101
Buggy source:
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledViewEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria){
}

Fixed version (ground truth):
@Override public void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledEntity> sc,Long domainId,boolean isRecursive,List<Long> permittedAccounts,ListProjectResourcesCriteria listProjectResourcesCriteria,List<Long> grantedIds,List<Long> revokedIds){
}
Program: 106102
Project: 106102
Buggy source:
@Override public ConfigKey<?>[] getConfigKeys(){
  return new ConfigKey<?>[]{ClusterDeltaSyncInterval,StartRetry,VmDestroyForcestop,VmOpCancelInterval,VmOpCleanupInterval,VmOpCleanupWait,VmOpLockStateRetry,VmOpWaitInterval};
}

Fixed version (ground truth):
@Override public ConfigKey<?>[] getConfigKeys(){
  return new ConfigKey<?>[]{ClusterDeltaSyncInterval,StartRetry,VmDestroyForcestop,VmOpCancelInterval,VmOpCleanupInterval,VmOpCleanupWait,VmOpLockStateRetry,VmOpWaitInterval,ExecuteInSequence};
}
Program: 106103
Project: 106103
Buggy source:
@Inject public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators){
  this._storagePoolAllocators=storagePoolAllocators;
}

Fixed version (ground truth):
@Inject public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators){
  _storagePoolAllocators=storagePoolAllocators;
}
Program: 106104
Project: 106104
Buggy source:
public Command cleanup(String vmName){
  return new StopCommand(vmName,getExecuteInSequence());
}

Fixed version (ground truth):
public Command cleanup(String vmName){
  return new StopCommand(vmName,ExecuteInSequence.value());
}
Program: 106107
Project: 106107
Buggy source:
protected boolean sendStop(VirtualMachineGuru guru,VirtualMachineProfile profile,boolean force){
  VirtualMachine vm=profile.getVirtualMachine();
  StopCommand stop=new StopCommand(vm,getExecuteInSequence());
  try {
    StopAnswer answer=(StopAnswer)_agentMgr.send(vm.getHostId(),stop);
    if (answer != null) {
      String hypervisortoolsversion=answer.getHypervisorToolsVersion();
      if (hypervisortoolsversion != null) {
        if (vm.getType() == VirtualMachine.Type.User) {
          UserVmVO userVm=_userVmDao.findById(vm.getId());
          _userVmDao.loadDetails(userVm);
          userVm.setDetail("String_Node_Str",hypervisortoolsversion);
          _userVmDao.saveDetails(userVm);
        }
      }
    }
    if (!answer.getResult()) {
      s_logger.debug("String_Node_Str" + answer.getDetails());
      return false;
    }
    guru.finalizeStop(profile,answer);
  }
 catch (  AgentUnavailableException e) {
    if (!force) {
      return false;
    }
  }
catch (  OperationTimedoutException e) {
    if (!force) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean sendStop(VirtualMachineGuru guru,VirtualMachineProfile profile,boolean force){
  VirtualMachine vm=profile.getVirtualMachine();
  StopCommand stop=new StopCommand(vm,ExecuteInSequence.value());
  try {
    StopAnswer answer=(StopAnswer)_agentMgr.send(vm.getHostId(),stop);
    if (answer != null) {
      String hypervisortoolsversion=answer.getHypervisorToolsVersion();
      if (hypervisortoolsversion != null) {
        if (vm.getType() == VirtualMachine.Type.User) {
          UserVmVO userVm=_userVmDao.findById(vm.getId());
          _userVmDao.loadDetails(userVm);
          userVm.setDetail("String_Node_Str",hypervisortoolsversion);
          _userVmDao.saveDetails(userVm);
        }
      }
    }
    if (!answer.getResult()) {
      s_logger.debug("String_Node_Str" + answer.getDetails());
      return false;
    }
    guru.finalizeStop(profile,answer);
  }
 catch (  AgentUnavailableException e) {
    if (!force) {
      return false;
    }
  }
catch (  OperationTimedoutException e) {
    if (!force) {
      return false;
    }
  }
  return true;
}
Program: 106108
Project: 106108
Buggy source:
@DB protected Answer createTemplateFromSnapshot(DataObject srcData,DataObject destData){
  String value=configDao.getValue(Config.CreatePrivateTemplateFromSnapshotWait.toString());
  int _createprivatetemplatefromsnapshotwait=NumbersUtil.parseInt(value,Integer.parseInt(Config.CreatePrivateTemplateFromSnapshotWait.getDefaultValue()));
  boolean needCache=false;
  if (needCacheStorage(srcData,destData)) {
    needCache=true;
    SnapshotInfo snapshot=(SnapshotInfo)srcData;
    srcData=cacheSnapshotChain(snapshot);
  }
  EndPoint ep=null;
  if (srcData.getDataStore().getRole() == DataStoreRole.Primary) {
    ep=selector.select(destData);
  }
 else {
    ep=selector.select(srcData,destData);
  }
  CopyCommand cmd=new CopyCommand(srcData.getTO(),destData.getTO(),_createprivatetemplatefromsnapshotwait,_mgmtServer.getExecuteInSequence());
  Answer answer=null;
  if (ep == null) {
    String errMsg="String_Node_Str";
    s_logger.error(errMsg);
    answer=new Answer(cmd,false,errMsg);
  }
 else {
    answer=ep.sendMessage(cmd);
  }
  if (needCache && srcData != null) {
    cacheMgr.releaseCacheObject(srcData);
  }
  return answer;
}

Fixed version (ground truth):
@DB protected Answer createTemplateFromSnapshot(DataObject srcData,DataObject destData){
  String value=configDao.getValue(Config.CreatePrivateTemplateFromSnapshotWait.toString());
  int _createprivatetemplatefromsnapshotwait=NumbersUtil.parseInt(value,Integer.parseInt(Config.CreatePrivateTemplateFromSnapshotWait.getDefaultValue()));
  boolean needCache=false;
  if (needCacheStorage(srcData,destData)) {
    needCache=true;
    SnapshotInfo snapshot=(SnapshotInfo)srcData;
    srcData=cacheSnapshotChain(snapshot);
  }
  EndPoint ep=null;
  if (srcData.getDataStore().getRole() == DataStoreRole.Primary) {
    ep=selector.select(destData);
  }
 else {
    ep=selector.select(srcData,destData);
  }
  CopyCommand cmd=new CopyCommand(srcData.getTO(),destData.getTO(),_createprivatetemplatefromsnapshotwait,VirtualMachineManager.ExecuteInSequence.value());
  Answer answer=null;
  if (ep == null) {
    String errMsg="String_Node_Str";
    s_logger.error(errMsg);
    answer=new Answer(cmd,false,errMsg);
  }
 else {
    answer=ep.sendMessage(cmd);
  }
  if (needCache && srcData != null) {
    cacheMgr.releaseCacheObject(srcData);
  }
  return answer;
}
Program: 106109
Project: 106109
Buggy source:
protected Answer copyVolumeFromSnapshot(DataObject snapObj,DataObject volObj){
  SnapshotInfo snapshot=(SnapshotInfo)snapObj;
  StoragePool pool=(StoragePool)volObj.getDataStore();
  String basicErrMsg="String_Node_Str" + snapshot.getName() + "String_Node_Str"+ pool;
  DataStore store=snapObj.getDataStore();
  DataStoreTO storTO=store.getTO();
  DataObject srcData=snapObj;
  try {
    if (!(storTO instanceof NfsTO)) {
      srcData=cacheSnapshotChain(snapshot);
    }
    String value=configDao.getValue(Config.CreateVolumeFromSnapshotWait.toString());
    int _createVolumeFromSnapshotWait=NumbersUtil.parseInt(value,Integer.parseInt(Config.CreateVolumeFromSnapshotWait.getDefaultValue()));
    EndPoint ep=null;
    if (srcData.getDataStore().getRole() == DataStoreRole.Primary) {
      ep=selector.select(volObj);
    }
 else {
      ep=selector.select(snapObj,volObj);
    }
    CopyCommand cmd=new CopyCommand(srcData.getTO(),volObj.getTO(),_createVolumeFromSnapshotWait,_mgmtServer.getExecuteInSequence());
    Answer answer=null;
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    return answer;
  }
 catch (  Exception e) {
    s_logger.error(basicErrMsg,e);
    throw new CloudRuntimeException(basicErrMsg);
  }
 finally {
    if (!(storTO instanceof NfsTO)) {
      releaseSnapshotCacheChain((SnapshotInfo)srcData);
    }
  }
}

Fixed version (ground truth):
protected Answer copyVolumeFromSnapshot(DataObject snapObj,DataObject volObj){
  SnapshotInfo snapshot=(SnapshotInfo)snapObj;
  StoragePool pool=(StoragePool)volObj.getDataStore();
  String basicErrMsg="String_Node_Str" + snapshot.getName() + "String_Node_Str"+ pool;
  DataStore store=snapObj.getDataStore();
  DataStoreTO storTO=store.getTO();
  DataObject srcData=snapObj;
  try {
    if (!(storTO instanceof NfsTO)) {
      srcData=cacheSnapshotChain(snapshot);
    }
    String value=configDao.getValue(Config.CreateVolumeFromSnapshotWait.toString());
    int _createVolumeFromSnapshotWait=NumbersUtil.parseInt(value,Integer.parseInt(Config.CreateVolumeFromSnapshotWait.getDefaultValue()));
    EndPoint ep=null;
    if (srcData.getDataStore().getRole() == DataStoreRole.Primary) {
      ep=selector.select(volObj);
    }
 else {
      ep=selector.select(snapObj,volObj);
    }
    CopyCommand cmd=new CopyCommand(srcData.getTO(),volObj.getTO(),_createVolumeFromSnapshotWait,VirtualMachineManager.ExecuteInSequence.value());
    Answer answer=null;
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    return answer;
  }
 catch (  Exception e) {
    s_logger.error(basicErrMsg,e);
    throw new CloudRuntimeException(basicErrMsg);
  }
 finally {
    if (!(storTO instanceof NfsTO)) {
      releaseSnapshotCacheChain((SnapshotInfo)srcData);
    }
  }
}
Program: 106110
Project: 106110
Buggy source:
protected Answer cloneVolume(DataObject template,DataObject volume){
  CopyCommand cmd=new CopyCommand(template.getTO(),volume.getTO(),0,_mgmtServer.getExecuteInSequence());
  try {
    EndPoint ep=selector.select(volume.getDataStore());
    Answer answer=null;
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    return answer;
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
protected Answer cloneVolume(DataObject template,DataObject volume){
  CopyCommand cmd=new CopyCommand(template.getTO(),volume.getTO(),0,VirtualMachineManager.ExecuteInSequence.value());
  try {
    EndPoint ep=selector.select(volume.getDataStore());
    Answer answer=null;
    if (ep == null) {
      String errMsg="String_Node_Str";
      s_logger.error(errMsg);
      answer=new Answer(cmd,false,errMsg);
    }
 else {
      answer=ep.sendMessage(cmd);
    }
    return answer;
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 106116
Project: 106116
Buggy source:
@Override public void execute(){
  try {
    UserVm userVm=_userVmService.moveVMToUser(this);
    if (userVm == null) {
      throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
    }
    UserVmResponse response=_responseGenerator.createUserVmResponse("String_Node_Str",userVm).get(0);
    response.setResponseName(DeployVMCmd.getResultObjectName());
    this.setResponseObject(response);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute(){
  try {
    UserVm userVm=_userVmService.moveVMToUser(this);
    if (userVm == null) {
      throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
    }
    UserVmResponse response=_responseGenerator.createUserVmResponse("String_Node_Str",userVm).get(0);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str" + e.getMessage());
  }
}
Program: 106117
Project: 106117
Buggy source:
public MonitoringServiceDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getDefault(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getProcessname(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServiceName(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServicePath(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getPidFile(),SearchCriteria.Op.EQ);
  AllFieldsSearch.done();
}

Fixed version (ground truth):
public MonitoringServiceDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().isDefaultService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getProcessname(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServiceName(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServicePath(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getPidFile(),SearchCriteria.Op.EQ);
  AllFieldsSearch.done();
}
Program: 106119
Project: 106119
Buggy source:
@Override public boolean equals(Object other){
  try {
    ModelReference rhs=(ModelReference)other;
    return compareTo(rhs) == 0;
  }
 catch (  ClassCastException ex) {
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  if (this == other)   return true;
  if (other == null)   return false;
  try {
    ModelReference rhs=(ModelReference)other;
    return compareTo(rhs) == 0;
  }
 catch (  ClassCastException ex) {
  }
  return false;
}
Program: 106120
Project: 106120
Buggy source:
@Override public boolean equals(Object rhs){
  ModelObject other;
  try {
    other=(ModelObject)rhs;
  }
 catch (  ClassCastException ex) {
    return false;
  }
  return compareTo(other) == 0;
}

Fixed version (ground truth):
@Override public boolean equals(Object rhs){
  if (this == rhs)   return true;
  if (rhs == null)   return false;
  ModelObject other;
  try {
    other=(ModelObject)rhs;
  }
 catch (  ClassCastException ex) {
    return false;
  }
  return compareTo(other) == 0;
}
Program: 106122
Project: 106122
Buggy source:
@Override public ListResponse<UserResponse> searchForUsers(ListUsersCmd cmd) throws PermissionDeniedException {
  Pair<List<UserAccountJoinVO>,Integer> result=searchForUsersInternal(cmd);
  ListResponse<UserResponse> response=new ListResponse<UserResponse>();
  List<UserResponse> userResponses=ViewResponseHelper.createUserResponse(UserContext.current().getCaller().getDomainId(),result.first().toArray(new UserAccountJoinVO[result.first().size()]));
  response.setResponses(userResponses,result.second());
  return response;
}

Fixed version (ground truth):
@Override public ListResponse<UserResponse> searchForUsers(ListUsersCmd cmd) throws PermissionDeniedException {
  Pair<List<UserAccountJoinVO>,Integer> result=searchForUsersInternal(cmd);
  ListResponse<UserResponse> response=new ListResponse<UserResponse>();
  List<UserResponse> userResponses=ViewResponseHelper.createUserResponse(CallContext.current().getCallingAccount().getDomainId(),result.first().toArray(new UserAccountJoinVO[result.first().size()]));
  response.setResponses(userResponses,result.second());
  return response;
}
Program: 106125
Project: 106125
Buggy source:
/** 
 * Establishes session with the virtual center server.
 * @throws Exception the exception
 */
public void connect(String url,String userName,String password) throws Exception {
  SVC_INST_REF.setType(SVC_INST_NAME);
  SVC_INST_REF.setValue(SVC_INST_NAME);
  vimPort=vimService.getVimPort();
  Map<String,Object> ctxt=((BindingProvider)vimPort).getRequestContext();
  ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,url);
  ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
  ctxt.put("String_Node_Str",600000);
  ctxt.put("String_Node_Str",600000);
  ServiceContent serviceContent=vimPort.retrieveServiceContent(SVC_INST_REF);
  Map<String,List<String>> headers=(Map<String,List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
  List<String> cookies=(List<String>)headers.get("String_Node_Str");
  String cookieValue=cookies.get(0);
  StringTokenizer tokenizer=new StringTokenizer(cookieValue,"String_Node_Str");
  cookieValue=tokenizer.nextToken();
  String pathData="String_Node_Str" + tokenizer.nextToken();
  serviceCookie="String_Node_Str" + cookieValue + "String_Node_Str"+ pathData;
  vimPort.login(serviceContent.getSessionManager(),userName,password,null);
  isConnected=true;
}

Fixed version (ground truth):
/** 
 * Establishes session with the virtual center server.
 * @throws Exception the exception
 */
public void connect(String url,String userName,String password) throws Exception {
  SVC_INST_REF.setType(SVC_INST_NAME);
  SVC_INST_REF.setValue(SVC_INST_NAME);
  vimService=new VimService();
  vimPort=vimService.getVimPort();
  Map<String,Object> ctxt=((BindingProvider)vimPort).getRequestContext();
  ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,url);
  ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
  ctxt.put("String_Node_Str",600000);
  ctxt.put("String_Node_Str",600000);
  ServiceContent serviceContent=vimPort.retrieveServiceContent(SVC_INST_REF);
  Map<String,List<String>> headers=(Map<String,List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
  List<String> cookies=(List<String>)headers.get("String_Node_Str");
  String cookieValue=cookies.get(0);
  StringTokenizer tokenizer=new StringTokenizer(cookieValue,"String_Node_Str");
  cookieValue=tokenizer.nextToken();
  String pathData="String_Node_Str" + tokenizer.nextToken();
  serviceCookie="String_Node_Str" + cookieValue + "String_Node_Str"+ pathData;
  vimPort.login(serviceContent.getSessionManager(),userName,password,null);
  isConnected=true;
}
Program: 106126
Project: 106126
Buggy source:
public Object AopTestMethod(ProceedingJoinPoint call) throws Throwable {
  Transaction txn=Transaction.open(call.getSignature().getName());
  Object ret=null;
  try {
    ret=call.proceed();
  }
  finally {
    txn.close();
  }
  return ret;
}

Fixed version (ground truth):
public Object AopTestMethod(ProceedingJoinPoint call) throws Throwable {
  TransactionLegacy txn=TransactionLegacy.open(call.getSignature().getName());
  Object ret=null;
  try {
    ret=call.proceed();
  }
  finally {
    txn.close();
  }
  return ret;
}
Program: 106127
Project: 106127
Buggy source:
@BeforeMethod(alwaysRun=true) protected void injectDB(Method testMethod) throws Exception {
  txn=Transaction.open(testMethod.getName());
}

Fixed version (ground truth):
@BeforeMethod(alwaysRun=true) protected void injectDB(Method testMethod) throws Exception {
  txn=TransactionLegacy.open(testMethod.getName());
}
Program: 106128
Project: 106128
Buggy source:
@Override public Priority canHandle(Map<VolumeInfo,DataStore> volumeMap,Host srcHost,Host destHost){
  return Priority.HIGHEST;
}

Fixed version (ground truth):
@Override public StrategyPriority canHandle(Map<VolumeInfo,DataStore> volumeMap,Host srcHost,Host destHost){
  return StrategyPriority.HIGHEST;
}
Program: 106129
Project: 106129
Buggy source:
@Test public void deleteSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  SnapshotInfo newSnapshot=null;
  SnapshotStrategy snapshotStrategy=StrategyPriority.pickStrategy(snapshotStrategies,snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    newSnapshot=snapshotStrategy.takeSnapshot(snapshot);
  }
  AssertJUnit.assertNotNull(newSnapshot);
  for (  SnapshotStrategy strategy : this.snapshotStrategies) {
    if (strategy.canHandle(snapshot,SnapshotOperation.DELETE) != Priority.CANT_HANDLE) {
      strategy.deleteSnapshot(newSnapshot.getId());
    }
  }
}

Fixed version (ground truth):
@Test public void deleteSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  SnapshotInfo newSnapshot=null;
  SnapshotStrategy snapshotStrategy=storageStrategyFactory.getSnapshotStrategy(snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    newSnapshot=snapshotStrategy.takeSnapshot(snapshot);
  }
  AssertJUnit.assertNotNull(newSnapshot);
  for (  SnapshotStrategy strategy : this.snapshotStrategies) {
    if (strategy.canHandle(snapshot,SnapshotOperation.DELETE) != StrategyPriority.CANT_HANDLE) {
      strategy.deleteSnapshot(newSnapshot.getId());
    }
  }
}
Program: 106130
Project: 106130
Buggy source:
@Test public void createTemplateFromSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  boolean result=false;
  SnapshotStrategy snapshotStrategy=StrategyPriority.pickStrategy(snapshotStrategies,snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    snapshot=snapshotStrategy.takeSnapshot(snapshot);
    result=true;
  }
  AssertJUnit.assertTrue(result);
  LocalHostEndpoint ep=new LocalHostEndpoint();
  ep.setResource(new MockLocalNfsSecondaryStorageResource());
  Mockito.when(epSelector.select(Matchers.any(DataObject.class),Matchers.any(DataObject.class))).thenReturn(ep);
  try {
    VMTemplateVO templateVO=createTemplateInDb();
    TemplateInfo tmpl=this.templateFactory.getTemplate(templateVO.getId(),DataStoreRole.Image);
    DataStore imageStore=this.dataStoreMgr.getImageStore(this.dcId);
    AsyncCallFuture<TemplateApiResult> templateFuture=this.imageService.createTemplateFromSnapshotAsync(snapshot,tmpl,imageStore);
    TemplateApiResult apiResult=templateFuture.get();
    Assert.assertTrue(apiResult.isSuccess());
  }
  finally {
    Mockito.when(epSelector.select(Matchers.any(DataObject.class),Matchers.any(DataObject.class))).thenReturn(remoteEp);
  }
}

Fixed version (ground truth):
@Test public void createTemplateFromSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  boolean result=false;
  SnapshotStrategy snapshotStrategy=storageStrategyFactory.getSnapshotStrategy(snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    snapshot=snapshotStrategy.takeSnapshot(snapshot);
    result=true;
  }
  AssertJUnit.assertTrue(result);
  LocalHostEndpoint ep=new LocalHostEndpoint();
  ep.setResource(new MockLocalNfsSecondaryStorageResource());
  Mockito.when(epSelector.select(Matchers.any(DataObject.class),Matchers.any(DataObject.class))).thenReturn(ep);
  try {
    VMTemplateVO templateVO=createTemplateInDb();
    TemplateInfo tmpl=this.templateFactory.getTemplate(templateVO.getId(),DataStoreRole.Image);
    DataStore imageStore=this.dataStoreMgr.getImageStore(this.dcId);
    AsyncCallFuture<TemplateApiResult> templateFuture=this.imageService.createTemplateFromSnapshotAsync(snapshot,tmpl,imageStore);
    TemplateApiResult apiResult=templateFuture.get();
    Assert.assertTrue(apiResult.isSuccess());
  }
  finally {
    Mockito.when(epSelector.select(Matchers.any(DataObject.class),Matchers.any(DataObject.class))).thenReturn(remoteEp);
  }
}
Program: 106131
Project: 106131
Buggy source:
@Test public void createVolumeFromSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  boolean result=false;
  SnapshotStrategy snapshotStrategy=StrategyPriority.pickStrategy(snapshotStrategies,snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    snapshot=snapshotStrategy.takeSnapshot(snapshot);
    result=true;
  }
  AssertJUnit.assertTrue(result);
  VolumeVO volVO=createVolume(vol.getTemplateId(),vol.getPoolId());
  VolumeInfo newVol=this.volFactory.getVolume(volVO.getId());
  AsyncCallFuture<VolumeApiResult> volFuture=this.volumeService.createVolumeFromSnapshot(newVol,newVol.getDataStore(),snapshot);
  VolumeApiResult apiResult=volFuture.get();
  Assert.assertTrue(apiResult.isSuccess());
}

Fixed version (ground truth):
@Test public void createVolumeFromSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  boolean result=false;
  SnapshotStrategy snapshotStrategy=storageStrategyFactory.getSnapshotStrategy(snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    snapshot=snapshotStrategy.takeSnapshot(snapshot);
    result=true;
  }
  AssertJUnit.assertTrue(result);
  VolumeVO volVO=createVolume(vol.getTemplateId(),vol.getPoolId());
  VolumeInfo newVol=this.volFactory.getVolume(volVO.getId());
  AsyncCallFuture<VolumeApiResult> volFuture=this.volumeService.createVolumeFromSnapshot(newVol,newVol.getDataStore(),snapshot);
  VolumeApiResult apiResult=volFuture.get();
  Assert.assertTrue(apiResult.isSuccess());
}
Program: 106132
Project: 106132
Buggy source:
@Test public void createSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  SnapshotInfo newSnapshot=null;
  SnapshotStrategy snapshotStrategy=StrategyPriority.pickStrategy(snapshotStrategies,snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    newSnapshot=snapshotStrategy.takeSnapshot(snapshot);
  }
  AssertJUnit.assertNotNull(newSnapshot);
  LocalHostEndpoint ep=new MockLocalHostEndPoint();
  ep.setResource(new MockLocalNfsSecondaryStorageResource());
  Mockito.when(epSelector.select(Matchers.any(DataStore.class))).thenReturn(ep);
  try {
    for (    SnapshotStrategy strategy : this.snapshotStrategies) {
      if (strategy.canHandle(snapshot,SnapshotOperation.DELETE) != Priority.CANT_HANDLE) {
        boolean res=strategy.deleteSnapshot(newSnapshot.getId());
        Assert.assertTrue(res);
      }
    }
  }
  finally {
    Mockito.when(epSelector.select(Matchers.any(DataStore.class))).thenReturn(remoteEp);
  }
}

Fixed version (ground truth):
@Test public void createSnapshot() throws InterruptedException, ExecutionException {
  VolumeInfo vol=createCopyBaseImage();
  SnapshotVO snapshotVO=createSnapshotInDb(vol);
  SnapshotInfo snapshot=this.snapshotFactory.getSnapshot(snapshotVO.getId(),vol.getDataStore());
  SnapshotInfo newSnapshot=null;
  SnapshotStrategy snapshotStrategy=storageStrategyFactory.getSnapshotStrategy(snapshot,SnapshotOperation.TAKE);
  if (snapshotStrategy != null) {
    newSnapshot=snapshotStrategy.takeSnapshot(snapshot);
  }
  AssertJUnit.assertNotNull(newSnapshot);
  LocalHostEndpoint ep=new MockLocalHostEndPoint();
  ep.setResource(new MockLocalNfsSecondaryStorageResource());
  Mockito.when(epSelector.select(Matchers.any(DataStore.class))).thenReturn(ep);
  try {
    for (    SnapshotStrategy strategy : this.snapshotStrategies) {
      if (strategy.canHandle(snapshot,SnapshotOperation.DELETE) != StrategyPriority.CANT_HANDLE) {
        boolean res=strategy.deleteSnapshot(newSnapshot.getId());
        Assert.assertTrue(res);
      }
    }
  }
  finally {
    Mockito.when(epSelector.select(Matchers.any(DataStore.class))).thenReturn(remoteEp);
  }
}
Program: 106133
Project: 106133
Buggy source:
@Override public List<IMethodInstance> intercept(List<IMethodInstance> methods,ITestContext context){
  for (  IMethodInstance methodIns : methods) {
    ITestNGMethod method=methodIns.getMethod();
    ConstructorOrMethod meth=method.getConstructorOrMethod();
    Method m=meth.getMethod();
    if (m != null) {
      DB db=m.getAnnotation(DB.class);
      if (db != null) {
        Transaction txn=Transaction.open(m.getName());
      }
    }
  }
  return methods;
}

Fixed version (ground truth):
@Override public List<IMethodInstance> intercept(List<IMethodInstance> methods,ITestContext context){
  for (  IMethodInstance methodIns : methods) {
    ITestNGMethod method=methodIns.getMethod();
    ConstructorOrMethod meth=method.getConstructorOrMethod();
    Method m=meth.getMethod();
    if (m != null) {
      DB db=m.getAnnotation(DB.class);
      if (db != null) {
        TransactionLegacy txn=TransactionLegacy.open(m.getName());
      }
    }
  }
  return methods;
}
Program: 106135
Project: 106135
Buggy source:
@Override public List<DomainVO> findAllChildren(String path,Long parentId){
  SearchCriteria<DomainVO> sc=FindAllChildrenSearch.create();
  sc.setParameters("String_Node_Str","String_Node_Str" + path + "String_Node_Str");
  sc.setParameters("String_Node_Str",parentId);
  return listBy(sc);
}

Fixed version (ground truth):
@Override public List<DomainVO> findAllChildren(String path,Long parentId){
  SearchCriteria<DomainVO> sc=FindAllChildrenSearch.create();
  sc.setParameters("String_Node_Str",path + "String_Node_Str");
  sc.setParameters("String_Node_Str",parentId);
  return listBy(sc);
}
Program: 106136
Project: 106136
Buggy source:
@DB @Override public boolean deleteDataStore(DataStore store){
  List<StoragePoolHostVO> hostPoolRecords=_storagePoolHostDao.listByPoolId(store.getId());
  StoragePool pool=(StoragePool)store;
  boolean deleteFlag=false;
  HypervisorType hType=null;
  if (hostPoolRecords.size() > 0) {
    hType=getHypervisorType(hostPoolRecords.get(0).getHostId());
  }
  for (  StoragePoolHostVO host : hostPoolRecords) {
    DeleteStoragePoolCommand deleteCmd=new DeleteStoragePoolCommand(pool);
    final Answer answer=agentMgr.easySend(host.getHostId(),deleteCmd);
    if (answer != null && answer.getResult()) {
      deleteFlag=true;
      if (HypervisorType.KVM != hType) {
        break;
      }
    }
 else {
      if (answer != null) {
        s_logger.debug("String_Node_Str" + answer.getResult());
      }
    }
  }
  if (!deleteFlag) {
    throw new CloudRuntimeException("String_Node_Str");
  }
  return dataStoreHelper.deletePrimaryDataStore(store);
}

Fixed version (ground truth):
@DB @Override public boolean deleteDataStore(DataStore store){
  List<StoragePoolHostVO> hostPoolRecords=_storagePoolHostDao.listByPoolId(store.getId());
  StoragePool pool=(StoragePool)store;
  boolean deleteFlag=false;
  HypervisorType hType=null;
  if (hostPoolRecords.size() > 0) {
    hType=getHypervisorType(hostPoolRecords.get(0).getHostId());
  }
 else {
    return false;
  }
  for (  StoragePoolHostVO host : hostPoolRecords) {
    DeleteStoragePoolCommand deleteCmd=new DeleteStoragePoolCommand(pool);
    final Answer answer=agentMgr.easySend(host.getHostId(),deleteCmd);
    if (answer != null && answer.getResult()) {
      deleteFlag=true;
      if (HypervisorType.KVM != hType) {
        break;
      }
    }
 else {
      if (answer != null) {
        s_logger.debug("String_Node_Str" + answer.getResult());
      }
    }
  }
  if (!deleteFlag) {
    throw new CloudRuntimeException("String_Node_Str");
  }
  return dataStoreHelper.deletePrimaryDataStore(store);
}
Program: 106141
Project: 106141
Buggy source:
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException {
  CallContext.current().setEventDetails("String_Node_Str" + getId());
  AclRole result=_aclService.grantPermissionToAclRole(id,apiList);
  if (result != null) {
    AclRoleResponse response=_responseGenerator.createAclRoleResponse(result);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str" + getId());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException {
  CallContext.current().setEventDetails("String_Node_Str" + getId());
  AclRole result=_aclService.grantApiPermissionToAclRole(id,apiList);
  if (result != null) {
    AclRoleResponse response=_responseGenerator.createAclRoleResponse(result);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str" + getId());
  }
}
Program: 106142
Project: 106142
Buggy source:
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException {
  CallContext.current().setEventDetails("String_Node_Str" + getId());
  AclRole result=_aclService.revokePermissionFromAclRole(id,apiList);
  if (result != null) {
    AclRoleResponse response=_responseGenerator.createAclRoleResponse(result);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str" + getId());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException {
  CallContext.current().setEventDetails("String_Node_Str" + getId());
  AclRole result=_aclService.revokeApiPermissionFromAclRole(id,apiList);
  if (result != null) {
    AclRoleResponse response=_responseGenerator.createAclRoleResponse(result);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str" + getId());
  }
}
Program: 106145
Project: 106145
Buggy source:
@PostConstruct public void initialize(){
  unusedTimeInterval=NumbersUtil.parseInt(configDao.getValue(Config.StorageCacheReplacementLRUTimeInterval.key()),30);
}

Fixed version (ground truth):
@PostConstruct public void initialize(){
}
Program: 106146
Project: 106146
Buggy source:
protected KVMPhysicalDisk templateToPrimaryDownload(String templateUrl,KVMStoragePool primaryPool){
  int index=templateUrl.lastIndexOf("String_Node_Str");
  String mountpoint=templateUrl.substring(0,index);
  String templateName=null;
  if (index < templateUrl.length() - 1) {
    templateName=templateUrl.substring(index + 1);
  }
  KVMPhysicalDisk templateVol=null;
  KVMStoragePool secondaryPool=null;
  try {
    secondaryPool=_storagePoolMgr.getStoragePoolByURI(mountpoint);
    if (templateName == null) {
      secondaryPool.refresh();
      List<KVMPhysicalDisk> disks=secondaryPool.listPhysicalDisks();
      if (disks == null || disks.isEmpty()) {
        s_logger.error("String_Node_Str" + secondaryPool.getUuid());
        return null;
      }
      for (      KVMPhysicalDisk disk : disks) {
        if (disk.getName().endsWith("String_Node_Str")) {
          templateVol=disk;
          break;
        }
      }
      if (templateVol == null) {
        s_logger.error("String_Node_Str" + secondaryPool.getUuid());
        return null;
      }
    }
 else {
      templateVol=secondaryPool.getPhysicalDisk(templateName);
    }
    KVMPhysicalDisk primaryVol=_storagePoolMgr.copyPhysicalDisk(templateVol,UUID.randomUUID().toString(),primaryPool);
    return primaryVol;
  }
 catch (  CloudRuntimeException e) {
    s_logger.error("String_Node_Str",e);
    return null;
  }
 finally {
    if (secondaryPool != null) {
      _storagePoolMgr.deleteStoragePool(secondaryPool.getType(),secondaryPool.getUuid());
    }
  }
}

Fixed version (ground truth):
protected KVMPhysicalDisk templateToPrimaryDownload(String templateUrl,KVMStoragePool primaryPool){
  int index=templateUrl.lastIndexOf("String_Node_Str");
  String mountpoint=templateUrl.substring(0,index);
  String templateName=null;
  if (index < templateUrl.length() - 1) {
    templateName=templateUrl.substring(index + 1);
  }
  KVMPhysicalDisk templateVol=null;
  KVMStoragePool secondaryPool=null;
  try {
    secondaryPool=_storagePoolMgr.getStoragePoolByURI(mountpoint);
    if (templateName == null) {
      secondaryPool.refresh();
      List<KVMPhysicalDisk> disks=secondaryPool.listPhysicalDisks();
      if (disks == null || disks.isEmpty()) {
        s_logger.error("String_Node_Str" + secondaryPool.getUuid());
        return null;
      }
      for (      KVMPhysicalDisk disk : disks) {
        if (disk.getName().endsWith("String_Node_Str")) {
          templateVol=disk;
          break;
        }
      }
      if (templateVol == null) {
        s_logger.error("String_Node_Str" + secondaryPool.getUuid());
        return null;
      }
    }
 else {
      templateVol=secondaryPool.getPhysicalDisk(templateName);
    }
    KVMPhysicalDisk primaryVol=_storagePoolMgr.copyPhysicalDisk(templateVol,UUID.randomUUID().toString(),primaryPool,0);
    return primaryVol;
  }
 catch (  CloudRuntimeException e) {
    s_logger.error("String_Node_Str",e);
    return null;
  }
 finally {
    if (secondaryPool != null) {
      _storagePoolMgr.deleteStoragePool(secondaryPool.getType(),secondaryPool.getUuid());
    }
  }
}