nus-yam/ex-repair huggingface dataset:
Program: 105182
Project: 105182
Buggy source:
protected Answer copyFromS3ToNfs(CopyCommand cmd,DataTO srcData,S3TO s3,DataTO destData,NfsTO destImageStore){
  final String storagePath=destImageStore.getUrl();
  final String destPath=destData.getPath();
  try {
    String downloadPath=determineStorageTemplatePath(storagePath,destPath,_nfsVersion);
    final File downloadDirectory=_storage.getFile(downloadPath);
    if (downloadDirectory.exists()) {
      s_logger.debug("String_Node_Str" + downloadPath + "String_Node_Str");
    }
 else {
      if (!downloadDirectory.mkdirs()) {
        final String errMsg="String_Node_Str" + downloadPath + "String_Node_Str";
        s_logger.error(errMsg);
        return new CopyCmdAnswer(errMsg);
      }
    }
    File destFile=new File(downloadDirectory,substringAfterLast(srcData.getPath(),S3Utils.SEPARATOR));
    S3Utils.getFile(s3,s3.getBucketName(),srcData.getPath(),destFile).waitForCompletion();
    if (destFile == null) {
      return new CopyCmdAnswer("String_Node_Str");
    }
    return postProcessing(destFile,downloadPath,destPath,srcData,destData);
  }
 catch (  Exception e) {
    final String errMsg=format("String_Node_Str" + "String_Node_Str",e.getMessage());
    s_logger.error(errMsg,e);
    return new CopyCmdAnswer(errMsg);
  }
}

Fixed version (ground truth):
protected Answer copyFromS3ToNfs(CopyCommand cmd,DataTO srcData,S3TO s3,DataTO destData,NfsTO destImageStore){
  final String storagePath=destImageStore.getUrl();
  final String destPath=destData.getPath();
  try {
    String downloadPath=determineStorageTemplatePath(storagePath,destPath,_nfsVersion);
    final File downloadDirectory=_storage.getFile(downloadPath);
    if (downloadDirectory.exists()) {
      s_logger.debug("String_Node_Str" + downloadPath + "String_Node_Str");
    }
 else {
      if (!downloadDirectory.mkdirs()) {
        final String errMsg="String_Node_Str" + downloadPath + "String_Node_Str";
        s_logger.error(errMsg);
        return new CopyCmdAnswer(errMsg);
      }
    }
    File destFile=new File(downloadDirectory,substringAfterLast(srcData.getPath(),S3Utils.SEPARATOR));
    S3Utils.getFile(s3,s3.getBucketName(),srcData.getPath(),destFile).waitForCompletion();
    return postProcessing(destFile,downloadPath,destPath,srcData,destData);
  }
 catch (  Exception e) {
    final String errMsg=format("String_Node_Str" + "String_Node_Str",e.getMessage());
    s_logger.error(errMsg,e);
    return new CopyCmdAnswer(errMsg);
  }
}
Program: 105183
Project: 105183
Buggy source:
/** 
 * Mount remote device named on local file system on subfolder of _parent field. <p> Supported schemes are "nfs" and "cifs". <p> CIFS parameters are documented with mount.cifs at http://linux.die.net/man/8/mount.cifs For simplicity, when a URI is used to specify a CIFS share, options such as domain,user,password are passed as query parameters.
 * @param uri crresponding to the remote device. Will throw for unsupported scheme.
 * @param imgStoreId
 * @return name of folder in _parent that device was mounted.
 * @throws UnknownHostException
 */
protected String mountUri(URI uri,String nfsVersion) throws UnknownHostException {
  String uriHostIp=getUriHostIp(uri);
  String nfsPath=uriHostIp + "String_Node_Str" + uri.getPath();
  String dir=UUID.nameUUIDFromBytes(nfsPath.getBytes()).toString();
  String localRootPath=_parent + "String_Node_Str" + dir;
  String remoteDevice;
  if (uri.getScheme().equals("String_Node_Str")) {
    remoteDevice="String_Node_Str" + uriHostIp + uri.getPath();
    s_logger.debug("String_Node_Str" + remoteDevice);
  }
 else {
    remoteDevice=nfsPath;
    s_logger.debug("String_Node_Str" + remoteDevice);
  }
  mount(localRootPath,remoteDevice,uri,nfsVersion);
  return dir;
}

Fixed version (ground truth):
/** 
 * Mount remote device named on local file system on subfolder of _parent field. <p> Supported schemes are "nfs" and "cifs". <p> CIFS parameters are documented with mount.cifs at http://linux.die.net/man/8/mount.cifs For simplicity, when a URI is used to specify a CIFS share, options such as domain,user,password are passed as query parameters.
 * @param uri crresponding to the remote device. Will throw for unsupported scheme.
 * @param imgStoreId
 * @return name of folder in _parent that device was mounted.
 * @throws UnknownHostException
 */
protected String mountUri(URI uri,String nfsVersion) throws UnknownHostException {
  String uriHostIp=getUriHostIp(uri);
  String nfsPath=uriHostIp + "String_Node_Str" + uri.getPath();
  String dir=UUID.nameUUIDFromBytes(nfsPath.getBytes(com.cloud.utils.StringUtils.getPreferredCharset())).toString();
  String localRootPath=_parent + "String_Node_Str" + dir;
  String remoteDevice;
  if (uri.getScheme().equals("String_Node_Str")) {
    remoteDevice="String_Node_Str" + uriHostIp + uri.getPath();
    s_logger.debug("String_Node_Str" + remoteDevice);
  }
 else {
    remoteDevice=nfsPath;
    s_logger.debug("String_Node_Str" + remoteDevice);
  }
  mount(localRootPath,remoteDevice,uri,nfsVersion);
  return dir;
}
Program: 105184
Project: 105184
Buggy source:
@SuppressWarnings("String_Node_Str") protected String determineS3TemplateDirectory(final Long accountId,final Long templateId,final String templateUniqueName){
  return join(asList(TEMPLATE_ROOT_DIR,accountId,templateId,templateUniqueName),S3Utils.SEPARATOR);
}

Fixed version (ground truth):
protected String determineS3TemplateDirectory(final Long accountId,final Long templateId,final String templateUniqueName){
  return join(asList(TEMPLATE_ROOT_DIR,accountId,templateId,templateUniqueName),S3Utils.SEPARATOR);
}
Program: 105185
Project: 105185
Buggy source:
@SuppressWarnings("String_Node_Str") protected String determineS3VolumeDirectory(final Long accountId,final Long volId){
  return join(asList(VOLUME_ROOT_DIR,accountId,volId),S3Utils.SEPARATOR);
}

Fixed version (ground truth):
protected String determineS3VolumeDirectory(final Long accountId,final Long volId){
  return join(asList(VOLUME_ROOT_DIR,accountId,volId),S3Utils.SEPARATOR);
}
Program: 105186
Project: 105186
Buggy source:
protected Answer copyFromS3ToNfs(CopyCommand cmd,DataTO srcData,S3TO s3,DataTO destData,NfsTO destImageStore){
  final String storagePath=destImageStore.getUrl();
  final String destPath=destData.getPath();
  try {
    String downloadPath=determineStorageTemplatePath(storagePath,destPath,_nfsVersion);
    final File downloadDirectory=_storage.getFile(downloadPath);
    if (downloadDirectory.exists()) {
      s_logger.debug("String_Node_Str" + downloadPath + "String_Node_Str");
    }
 else {
      if (!downloadDirectory.mkdirs()) {
        final String errMsg="String_Node_Str" + downloadPath + "String_Node_Str";
        s_logger.error(errMsg);
        return new CopyCmdAnswer(errMsg);
      }
    }
    File destFile=new File(downloadDirectory,substringAfterLast(srcData.getPath(),S3Utils.SEPARATOR));
    S3Utils.getFile(s3,s3.getBucketName(),srcData.getPath(),destFile).waitForCompletion();
    if (destFile == null) {
      return new CopyCmdAnswer("String_Node_Str");
    }
    return postProcessing(destFile,downloadPath,destPath,srcData,destData);
  }
 catch (  Exception e) {
    final String errMsg=format("String_Node_Str" + "String_Node_Str",e.getMessage());
    s_logger.error(errMsg,e);
    return new CopyCmdAnswer(errMsg);
  }
}

Fixed version (ground truth):
protected Answer copyFromS3ToNfs(CopyCommand cmd,DataTO srcData,S3TO s3,DataTO destData,NfsTO destImageStore){
  final String storagePath=destImageStore.getUrl();
  final String destPath=destData.getPath();
  try {
    String downloadPath=determineStorageTemplatePath(storagePath,destPath,_nfsVersion);
    final File downloadDirectory=_storage.getFile(downloadPath);
    if (downloadDirectory.exists()) {
      s_logger.debug("String_Node_Str" + downloadPath + "String_Node_Str");
    }
 else {
      if (!downloadDirectory.mkdirs()) {
        final String errMsg="String_Node_Str" + downloadPath + "String_Node_Str";
        s_logger.error(errMsg);
        return new CopyCmdAnswer(errMsg);
      }
    }
    File destFile=new File(downloadDirectory,substringAfterLast(srcData.getPath(),S3Utils.SEPARATOR));
    S3Utils.getFile(s3,s3.getBucketName(),srcData.getPath(),destFile).waitForCompletion();
    return postProcessing(destFile,downloadPath,destPath,srcData,destData);
  }
 catch (  Exception e) {
    final String errMsg=format("String_Node_Str" + "String_Node_Str",e.getMessage());
    s_logger.error(errMsg,e);
    return new CopyCmdAnswer(errMsg);
  }
}
Program: 105187
Project: 105187
Buggy source:
public Map<String,String> getDetails(){
  return details;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  Map<String,String> customparameterMap=new HashMap<String,String>();
  if (details != null && details.size() != 0) {
    Collection parameterCollection=details.values();
    Iterator iter=parameterCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> value=(HashMap<String,String>)iter.next();
      for (      String key : value.keySet()) {
        customparameterMap.put(key,value.get(key));
      }
    }
  }
  return customparameterMap;
}
Program: 105188
Project: 105188
Buggy source:
public Map<String,String> getDetails(){
  return details;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  Map<String,String> customparameterMap=new HashMap<String,String>();
  if (details != null && details.size() != 0) {
    Collection parameterCollection=details.values();
    Iterator iter=parameterCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> value=(HashMap<String,String>)iter.next();
      for (      String key : value.keySet()) {
        customparameterMap.put(key,value.get(key));
      }
    }
  }
  return customparameterMap;
}
Program: 105189
Project: 105189
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  Map<String,String> configs=_configDao.getConfiguration(params);
  if (params != null) {
    mergeConfigs(configs,params);
  }
  String period_str=configs.get(QuotaConfig.QuotaStatementPeriod.key());
  int period=period_str == null ? 1 : Integer.valueOf(period_str);
  STATEMENT_PERIODS _period=STATEMENT_PERIODS.values()[period];
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  Map<String,String> configs=_configDao.getConfiguration(params);
  if (params != null) {
    mergeConfigs(configs,params);
  }
  String period_str=configs.get(QuotaConfig.QuotaStatementPeriod.key());
  int period=period_str == null ? 1 : Integer.parseInt(period_str);
  STATEMENT_PERIODS _period=STATEMENT_PERIODS.values()[period];
  return true;
}
Program: 105190
Project: 105190
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details.get(name);
}
Program: 105192
Project: 105192
Buggy source:
private QuotaTariffVO makeTariffTestData(){
  QuotaTariffVO tariffVO=new QuotaTariffVO();
  tariffVO.setUsageType(QuotaTypes.IP_ADDRESS);
  tariffVO.setUsageName("String_Node_Str");
  tariffVO.setUsageUnit("String_Node_Str");
  tariffVO.setCurrencyValue(new BigDecimal(100.19));
  tariffVO.setEffectiveOn(new Date());
  tariffVO.setUsageDiscriminator("String_Node_Str");
  return tariffVO;
}

Fixed version (ground truth):
private QuotaTariffVO makeTariffTestData(){
  QuotaTariffVO tariffVO=new QuotaTariffVO();
  tariffVO.setUsageType(QuotaTypes.IP_ADDRESS);
  tariffVO.setUsageName("String_Node_Str");
  tariffVO.setUsageUnit("String_Node_Str");
  tariffVO.setCurrencyValue(BigDecimal.valueOf(100.19));
  tariffVO.setEffectiveOn(new Date());
  tariffVO.setUsageDiscriminator("String_Node_Str");
  return tariffVO;
}
Program: 105197
Project: 105197
Buggy source:
protected boolean isUserDisabled(SearchResult result) throws NamingException {
  boolean isDisabledUser=false;
  String userAccountControl=LdapUtils.getAttributeValue(result.getAttributes(),_ldapConfiguration.getUserAccountControlAttribute());
  if (userAccountControl != null) {
    int control=Integer.valueOf(userAccountControl);
    if ((control & 2) > 0) {
      isDisabledUser=true;
    }
  }
  return isDisabledUser;
}

Fixed version (ground truth):
protected boolean isUserDisabled(SearchResult result) throws NamingException {
  boolean isDisabledUser=false;
  String userAccountControl=LdapUtils.getAttributeValue(result.getAttributes(),_ldapConfiguration.getUserAccountControlAttribute());
  if (userAccountControl != null) {
    int control=Integer.parseInt(userAccountControl);
    if ((control & 2) > 0) {
      isDisabledUser=true;
    }
  }
  return isDisabledUser;
}
Program: 105198
Project: 105198
Buggy source:
@Override public List<Long> orderHostsByFreeCapacity(Long clusterId,short capacityTypeForOrdering){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  List<Long> result=new ArrayList<Long>();
  StringBuilder sql=new StringBuilder(ORDER_HOSTS_BY_FREE_CAPACITY);
  try {
    pstmt=txn.prepareAutoCloseStatement(sql.toString());
    pstmt.setLong(1,clusterId);
    pstmt.setShort(2,capacityTypeForOrdering);
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      result.add(rs.getLong(1));
    }
    return result;
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + sql,e);
  }
catch (  Throwable e) {
    throw new CloudRuntimeException("String_Node_Str" + sql,e);
  }
}

Fixed version (ground truth):
@Override public List<Long> orderHostsByFreeCapacity(Long clusterId,short capacityTypeForOrdering){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  List<Long> result=new ArrayList<Long>();
  StringBuilder sql=new StringBuilder(ORDER_HOSTS_BY_FREE_CAPACITY_PART1);
  if (clusterId != null) {
    sql.append("String_Node_Str");
  }
  sql.append(ORDER_HOSTS_BY_FREE_CAPACITY_PART2);
  try {
    pstmt=txn.prepareAutoCloseStatement(sql.toString());
    pstmt.setShort(1,capacityTypeForOrdering);
    if (clusterId != null) {
      pstmt.setLong(2,clusterId);
    }
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      result.add(rs.getLong(1));
    }
    return result;
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + sql,e);
  }
catch (  Throwable e) {
    throw new CloudRuntimeException("String_Node_Str" + sql,e);
  }
}
Program: 105202
Project: 105202
Buggy source:
@Override public ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag,boolean keyValueOnly){
  ResourceTagJoinVO rto=ApiDBUtils.newResourceTagView(resourceTag);
  return ApiDBUtils.newResourceTagResponse(rto,keyValueOnly);
}

Fixed version (ground truth):
@Override public ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag,boolean keyValueOnly){
  ResourceTagJoinVO rto=ApiDBUtils.newResourceTagView(resourceTag);
  if (rto == null)   return null;
  return ApiDBUtils.newResourceTagResponse(rto,keyValueOnly);
}
Program: 105209
Project: 105209
Buggy source:
@Override public StaticRouteResponse createStaticRouteResponse(StaticRoute result){
  StaticRouteResponse response=new StaticRouteResponse();
  response.setId(result.getUuid());
  if (result.getVpcId() != null) {
    Vpc vpc=ApiDBUtils.findVpcById(result.getVpcId());
    if (vpc != null) {
      response.setVpcId(vpc.getUuid());
    }
  }
  response.setCidr(result.getCidr());
  StaticRoute.State state=result.getState();
  if (state.equals(StaticRoute.State.Revoke)) {
    state=StaticRoute.State.Deleting;
  }
  response.setState(state.toString());
  populateAccount(response,result.getAccountId());
  populateDomain(response,result.getDomainId());
  List<? extends ResourceTag> tags=ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.StaticRoute,result.getId());
  List<ResourceTagResponse> tagResponses=new ArrayList<ResourceTagResponse>();
  for (  ResourceTag tag : tags) {
    ResourceTagResponse tagResponse=createResourceTagResponse(tag,true);
    tagResponses.add(tagResponse);
  }
  response.setTags(tagResponses);
  response.setObjectName("String_Node_Str");
  return response;
}

Fixed version (ground truth):
@Override public StaticRouteResponse createStaticRouteResponse(StaticRoute result){
  StaticRouteResponse response=new StaticRouteResponse();
  response.setId(result.getUuid());
  if (result.getVpcId() != null) {
    Vpc vpc=ApiDBUtils.findVpcById(result.getVpcId());
    if (vpc != null) {
      response.setVpcId(vpc.getUuid());
    }
  }
  response.setCidr(result.getCidr());
  StaticRoute.State state=result.getState();
  if (state.equals(StaticRoute.State.Revoke)) {
    state=StaticRoute.State.Deleting;
  }
  response.setState(state.toString());
  populateAccount(response,result.getAccountId());
  populateDomain(response,result.getDomainId());
  List<? extends ResourceTag> tags=ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.StaticRoute,result.getId());
  List<ResourceTagResponse> tagResponses=new ArrayList<ResourceTagResponse>();
  for (  ResourceTag tag : tags) {
    ResourceTagResponse tagResponse=createResourceTagResponse(tag,true);
    CollectionUtils.addIgnoreNull(tagResponses,tagResponse);
  }
  response.setTags(tagResponses);
  response.setObjectName("String_Node_Str");
  return response;
}
Program: 105210
Project: 105210
Buggy source:
@Test public void testRevertToVMSnapshotCommand(){
  final Connection conn=Mockito.mock(Connection.class);
  final VMSnapshotTO snapshotTO=Mockito.mock(VMSnapshotTO.class);
  final List<VolumeObjectTO> volumeTOs=new ArrayList<VolumeObjectTO>();
  final RevertToVMSnapshotCommand vmSnapshot=new RevertToVMSnapshotCommand("String_Node_Str",snapshotTO,volumeTOs,"String_Node_Str");
  final CitrixRequestWrapper wrapper=CitrixRequestWrapper.getInstance();
  assertNotNull(wrapper);
  when(citrixResourceBase.getConnection()).thenReturn(conn);
  final Answer answer=wrapper.execute(vmSnapshot,citrixResourceBase);
  verify(citrixResourceBase,times(1)).getConnection();
  assertFalse(answer.getResult());
}

Fixed version (ground truth):
@Test public void testRevertToVMSnapshotCommand(){
  final Connection conn=Mockito.mock(Connection.class);
  final VMSnapshotTO snapshotTO=Mockito.mock(VMSnapshotTO.class);
  final List<VolumeObjectTO> volumeTOs=new ArrayList<VolumeObjectTO>();
  final RevertToVMSnapshotCommand vmSnapshot=new RevertToVMSnapshotCommand("String_Node_Str","String_Node_Str",snapshotTO,volumeTOs,"String_Node_Str");
  final CitrixRequestWrapper wrapper=CitrixRequestWrapper.getInstance();
  assertNotNull(wrapper);
  when(citrixResourceBase.getConnection()).thenReturn(conn);
  final Answer answer=wrapper.execute(vmSnapshot,citrixResourceBase);
  verify(citrixResourceBase,times(1)).getConnection();
  assertFalse(answer.getResult());
}
Program: 105211
Project: 105211
Buggy source:
@Test public void testCreateVMSnapshotCommand(){
  final Connection conn=Mockito.mock(Connection.class);
  final VMSnapshotTO snapshotTO=Mockito.mock(VMSnapshotTO.class);
  final List<VolumeObjectTO> volumeTOs=new ArrayList<VolumeObjectTO>();
  final CreateVMSnapshotCommand vmSnapshot=new CreateVMSnapshotCommand("String_Node_Str",snapshotTO,volumeTOs,"String_Node_Str");
  final CitrixRequestWrapper wrapper=CitrixRequestWrapper.getInstance();
  assertNotNull(wrapper);
  when(citrixResourceBase.getConnection()).thenReturn(conn);
  final Answer answer=wrapper.execute(vmSnapshot,citrixResourceBase);
  verify(citrixResourceBase,times(1)).getConnection();
  assertTrue(answer.getResult());
}

Fixed version (ground truth):
@Test public void testCreateVMSnapshotCommand(){
  final Connection conn=Mockito.mock(Connection.class);
  final VMSnapshotTO snapshotTO=Mockito.mock(VMSnapshotTO.class);
  final List<VolumeObjectTO> volumeTOs=new ArrayList<VolumeObjectTO>();
  final CreateVMSnapshotCommand vmSnapshot=new CreateVMSnapshotCommand("String_Node_Str","String_Node_Str",snapshotTO,volumeTOs,"String_Node_Str");
  final CitrixRequestWrapper wrapper=CitrixRequestWrapper.getInstance();
  assertNotNull(wrapper);
  when(citrixResourceBase.getConnection()).thenReturn(conn);
  final Answer answer=wrapper.execute(vmSnapshot,citrixResourceBase);
  verify(citrixResourceBase,times(1)).getConnection();
  assertTrue(answer.getResult());
}
Program: 105217
Project: 105217
Buggy source:
private static List<S3ObjectSummary> listDirectory(final String bucketName,final String directory,final AmazonS3 client){
  List<S3ObjectSummary> objects=new ArrayList<S3ObjectSummary>();
  ListObjectsRequest listObjectsRequest=new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
  ObjectListing ol=client.listObjects(listObjectsRequest);
  while (ol != null && ol.isTruncated()) {
    objects.addAll(ol.getObjectSummaries());
    listObjectsRequest.setMarker(ol.getNextMarker());
    ol=client.listObjects(listObjectsRequest);
  }
  if (objects.isEmpty()) {
    return emptyList();
  }
  return unmodifiableList(objects);
}

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

Fixed version (ground truth):
private static List<S3ObjectSummary> listDirectory(final String bucketName,final String directory,final AmazonS3 client){
  List<S3ObjectSummary> objects=new ArrayList<S3ObjectSummary>();
  ListObjectsRequest listObjectsRequest=new ListObjectsRequest().withBucketName(bucketName).withPrefix(directory + SEPARATOR);
  ObjectListing ol=client.listObjects(listObjectsRequest);
  if (ol.isTruncated()) {
    do {
      objects.addAll(ol.getObjectSummaries());
      listObjectsRequest.setMarker(ol.getNextMarker());
      ol=client.listObjects(listObjectsRequest);
    }
 while (ol.isTruncated());
  }
 else {
    objects.addAll(ol.getObjectSummaries());
  }
  if (objects.isEmpty()) {
    return emptyList();
  }
  return unmodifiableList(objects);
}
Program: 105220
Project: 105220
Buggy source:
@Override public boolean start(){
  if (isSAMLPluginEnabled()) {
    setup();
    s_logger.info("String_Node_Str");
  }
 else {
    s_logger.info("String_Node_Str");
  }
  return super.start();
}

Fixed version (ground truth):
@Override public boolean start(){
  if (isSAMLPluginEnabled()) {
    s_logger.info("String_Node_Str");
    return setup();
  }
 else {
    s_logger.info("String_Node_Str");
    return super.start();
  }
}
Program: 105221
Project: 105221
Buggy source:
private boolean setup(){
  if (!initSP()) {
    s_logger.error("String_Node_Str");
    return false;
  }
  _timer=new Timer();
  final HttpClient client=new HttpClient();
  final String idpMetaDataUrl=SAMLIdentityProviderMetadataURL.value();
  if (SAMLTimeout.value() != null && SAMLTimeout.value() > SAMLPluginConstants.SAML_REFRESH_INTERVAL) {
    _refreshInterval=SAMLTimeout.value();
  }
  try {
    DefaultBootstrap.bootstrap();
    if (idpMetaDataUrl.startsWith("String_Node_Str")) {
      _idpMetaDataProvider=new HTTPMetadataProvider(_timer,client,idpMetaDataUrl);
    }
 else {
      File metadataFile=PropertiesUtil.findConfigFile(idpMetaDataUrl);
      s_logger.debug("String_Node_Str" + metadataFile.getAbsolutePath());
      _idpMetaDataProvider=new FilesystemMetadataProvider(_timer,metadataFile);
    }
    _idpMetaDataProvider.setRequireValidMetadata(true);
    _idpMetaDataProvider.setParserPool(new BasicParserPool());
    _idpMetaDataProvider.initialize();
    _timer.scheduleAtFixedRate(new MetadataRefreshTask(),0,_refreshInterval * 1000);
  }
 catch (  MetadataProviderException e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    s_logger.error("String_Node_Str");
  }
catch (  ConfigurationException|FactoryConfigurationError e) {
    s_logger.error("String_Node_Str" + e.getMessage());
  }
catch (  NullPointerException e) {
    s_logger.error("String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  return true;
}

Fixed version (ground truth):
private boolean setup(){
  if (!initSP()) {
    s_logger.error("String_Node_Str");
    return false;
  }
  _timer=new Timer();
  final HttpClient client=new HttpClient();
  final String idpMetaDataUrl=getSAMLIdentityProviderMetadataURL();
  if (SAMLTimeout.value() != null && SAMLTimeout.value() > SAMLPluginConstants.SAML_REFRESH_INTERVAL) {
    _refreshInterval=SAMLTimeout.value();
  }
  try {
    DefaultBootstrap.bootstrap();
    if (idpMetaDataUrl.startsWith("String_Node_Str")) {
      _idpMetaDataProvider=new HTTPMetadataProvider(_timer,client,idpMetaDataUrl);
    }
 else {
      File metadataFile=PropertiesUtil.findConfigFile(idpMetaDataUrl);
      if (metadataFile == null) {
        s_logger.error("String_Node_Str" + idpMetaDataUrl);
        return false;
      }
 else {
        s_logger.debug("String_Node_Str" + metadataFile.getAbsolutePath());
        _idpMetaDataProvider=new FilesystemMetadataProvider(_timer,metadataFile);
      }
    }
    _idpMetaDataProvider.setRequireValidMetadata(true);
    _idpMetaDataProvider.setParserPool(new BasicParserPool());
    _idpMetaDataProvider.initialize();
    _timer.scheduleAtFixedRate(new MetadataRefreshTask(),0,_refreshInterval * 1000);
  }
 catch (  MetadataProviderException e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    s_logger.error("String_Node_Str");
    return false;
  }
catch (  ConfigurationException|FactoryConfigurationError e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    return false;
  }
catch (  NullPointerException e) {
    s_logger.error("String_Node_Str" + "String_Node_Str" + e.getMessage());
    return false;
  }
  return true;
}
Program: 105223
Project: 105223
Buggy source:
public Map<String,List<String>> getServiceProviders(){
  Map<String,List<String>> serviceProviderMap=null;
  if (serviceProviderList != null && !serviceProviderList.isEmpty()) {
    serviceProviderMap=new HashMap<String,List<String>>();
    Collection servicesCollection=serviceProviderList.values();
    Iterator iter=servicesCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> services=(HashMap<String,String>)iter.next();
      String service=services.get("String_Node_Str");
      String provider=services.get("String_Node_Str");
      List<String> providerList=null;
      if (serviceProviderMap.containsKey(service)) {
        providerList=serviceProviderMap.get(service);
      }
 else {
        providerList=new ArrayList<String>();
      }
      providerList.add(provider);
      serviceProviderMap.put(service,providerList);
    }
  }
  return serviceProviderMap;
}

Fixed version (ground truth):
public Map<String,List<String>> getServiceProviders(){
  Map<String,List<String>> serviceProviderMap=null;
  if (serviceProviderList != null && !serviceProviderList.isEmpty()) {
    serviceProviderMap=new HashMap<String,List<String>>();
    Collection<? extends Map<String,String>> servicesCollection=serviceProviderList.values();
    Iterator<? extends Map<String,String>> iter=servicesCollection.iterator();
    while (iter.hasNext()) {
      Map<String,String> obj=iter.next();
      if (s_logger.isTraceEnabled()) {
        s_logger.trace("String_Node_Str" + obj);
      }
      HashMap<String,String> services=(HashMap<String,String>)obj;
      String service=services.get("String_Node_Str");
      String provider=services.get("String_Node_Str");
      List<String> providerList=null;
      if (serviceProviderMap.containsKey(service)) {
        providerList=serviceProviderMap.get(service);
      }
 else {
        providerList=new ArrayList<String>();
      }
      providerList.add(provider);
      serviceProviderMap.put(service,providerList);
    }
  }
  return serviceProviderMap;
}
Program: 105224
Project: 105224
Buggy source:
private boolean doUpdateHostPassword(final long hostId){
  if (_agentMgr.isAgentAttached(hostId)) {
    return false;
  }
  DetailVO nv=_hostDetailsDao.findDetail(hostId,ApiConstants.USERNAME);
  final String username=nv.getValue();
  nv=_hostDetailsDao.findDetail(hostId,ApiConstants.PASSWORD);
  final String password=nv.getValue();
  final UpdateHostPasswordCommand cmd=new UpdateHostPasswordCommand(username,password);
  final Answer answer=_agentMgr.easySend(hostId,cmd);
  return answer != null;
}

Fixed version (ground truth):
private boolean doUpdateHostPassword(final long hostId){
  if (!_agentMgr.isAgentAttached(hostId)) {
    return false;
  }
  DetailVO nv=_hostDetailsDao.findDetail(hostId,ApiConstants.USERNAME);
  final String username=nv.getValue();
  nv=_hostDetailsDao.findDetail(hostId,ApiConstants.PASSWORD);
  final String password=nv.getValue();
  final UpdateHostPasswordCommand cmd=new UpdateHostPasswordCommand(username,password);
  final Answer answer=_agentMgr.easySend(hostId,cmd);
  return answer != null;
}
Program: 105226
Project: 105226
Buggy source:
public static UpdateTsmStorageCmdResponse updateElastistorTsmStorage(String capacityBytes,String uuid) throws Throwable {
  Long size=(Long.parseLong(capacityBytes) / (1024 * 1024 * 1024));
  String quotasize=null;
  if (size > 1024) {
    quotasize=(String.valueOf(Long.valueOf(capacityBytes) / (1024)) + "String_Node_Str");
  }
 else {
    quotasize=String.valueOf(quotasize) + "String_Node_Str";
  }
  s_logger.info("String_Node_Str" + quotasize);
  UpdateTsmStorageCmd updateTsmStorageCmd=new UpdateTsmStorageCmd();
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",uuid);
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",quotasize);
  UpdateTsmStorageCmdResponse updateTsmStorageCmdResponse=(UpdateTsmStorageCmdResponse)getElastistorRestClient().executeCommand(updateTsmStorageCmd);
  return updateTsmStorageCmdResponse;
}

Fixed version (ground truth):
public static UpdateTsmStorageCmdResponse updateElastistorTsmStorage(String capacityBytes,String uuid) throws Throwable {
  Long size=(Long.parseLong(capacityBytes) / (1024 * 1024 * 1024));
  String quotasize=null;
  if (size > 1024) {
    quotasize=(String.valueOf(Long.parseLong(capacityBytes) / (1024)) + "String_Node_Str");
  }
 else {
    quotasize=String.valueOf(quotasize) + "String_Node_Str";
  }
  s_logger.info("String_Node_Str" + quotasize);
  UpdateTsmStorageCmd updateTsmStorageCmd=new UpdateTsmStorageCmd();
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",uuid);
  updateTsmStorageCmd.putCommandParameter("String_Node_Str",quotasize);
  UpdateTsmStorageCmdResponse updateTsmStorageCmdResponse=(UpdateTsmStorageCmdResponse)getElastistorRestClient().executeCommand(updateTsmStorageCmd);
  return updateTsmStorageCmdResponse;
}
Program: 105229
Project: 105229
Buggy source:
private void verifyMinAndMaxIops(String minIops,String maxIops){
  if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMinIops;
  try {
    if (minIops != null) {
      lMinIops=Long.parseLong(minIops);
    }
 else {
      lMinIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMaxIops;
  try {
    if (maxIops != null) {
      lMaxIops=Long.valueOf(maxIops);
    }
 else {
      lMaxIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (lMinIops > lMaxIops) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void verifyMinAndMaxIops(String minIops,String maxIops){
  if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMinIops;
  try {
    if (minIops != null) {
      lMinIops=Long.parseLong(minIops);
    }
 else {
      lMinIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  long lMaxIops;
  try {
    if (maxIops != null) {
      lMaxIops=Long.parseLong(maxIops);
    }
 else {
      lMaxIops=0;
    }
  }
 catch (  NumberFormatException ex) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (lMinIops > lMaxIops) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
}
Program: 105233
Project: 105233
Buggy source:
@DB protected void saveConfiguration(String name,String value,String category){
  String instance="String_Node_Str";
  String description=s_configurationDescriptions.get(name);
  String component=s_configurationComponents.get(name);
  if (category == null) {
    category="String_Node_Str";
  }
  String instanceNameError="String_Node_Str";
  if (name.equals("String_Node_Str")) {
    if (value == null || value.isEmpty() || !value.matches("String_Node_Str")) {
      printError(instanceNameError + "String_Node_Str");
    }
  }
  if (name.equals("String_Node_Str")) {
    if (value != null && !value.isEmpty()) {
      _networkThrottlingRate=value;
    }
  }
  if (name.equals("String_Node_Str")) {
    if (value != null && !value.isEmpty()) {
      _multicastThrottlingRate=value;
    }
  }
  String insertSql="String_Node_Str" + "String_Node_Str" + instance + "String_Node_Str"+ component+ "String_Node_Str"+ name+ "String_Node_Str"+ value+ "String_Node_Str"+ description+ "String_Node_Str"+ category+ "String_Node_Str";
  String selectSql="String_Node_Str" + name + "String_Node_Str";
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  try {
    PreparedStatement stmt=txn.prepareAutoCloseStatement(selectSql);
    ResultSet result=stmt.executeQuery();
    Boolean hasRow=result.next();
    if (!hasRow) {
      stmt=txn.prepareAutoCloseStatement(insertSql);
      stmt.executeUpdate();
    }
  }
 catch (  SQLException ex) {
    s_logger.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
@DB protected void saveConfiguration(String name,String value,String category){
  String instance="String_Node_Str";
  String description=s_configurationDescriptions.get(name);
  String component=s_configurationComponents.get(name);
  if (category == null) {
    category="String_Node_Str";
  }
  String instanceNameError="String_Node_Str";
  if (name.equals("String_Node_Str")) {
    if (value == null || value.isEmpty() || !value.matches("String_Node_Str")) {
      printError(instanceNameError + "String_Node_Str");
    }
  }
  if (name.equals("String_Node_Str")) {
    if (value != null && !value.isEmpty()) {
      _networkThrottlingRate=value;
    }
  }
  if (name.equals("String_Node_Str")) {
    if (value != null && !value.isEmpty()) {
      _multicastThrottlingRate=value;
    }
  }
  String insertSql="String_Node_Str" + "String_Node_Str" + instance + "String_Node_Str"+ component+ "String_Node_Str"+ name+ "String_Node_Str"+ value+ "String_Node_Str"+ description+ "String_Node_Str"+ category+ "String_Node_Str";
  String selectSql="String_Node_Str";
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  try {
    PreparedStatement stmt=txn.prepareAutoCloseStatement(selectSql);
    stmt.setString(1,name);
    ResultSet result=stmt.executeQuery();
    Boolean hasRow=result.next();
    if (!hasRow) {
      stmt=txn.prepareAutoCloseStatement(insertSql);
      stmt.executeUpdate();
    }
  }
 catch (  SQLException ex) {
    s_logger.error("String_Node_Str",ex);
  }
}
Program: 105236
Project: 105236
Buggy source:
@DB protected void updateSystemvmPassword(){
  String userid=System.getProperty("String_Node_Str");
  if (!userid.startsWith("String_Node_Str")) {
    return;
  }
  if (!Boolean.valueOf(_configDao.getValue("String_Node_Str"))) {
    return;
  }
  String already=_configDao.getValue("String_Node_Str");
  if (already == null) {
    TransactionLegacy txn=TransactionLegacy.currentTxn();
    try {
      String rpassword=PasswordGenerator.generatePresharedKey(8);
      String wSql="String_Node_Str" + "String_Node_Str" + DBEncryptionUtil.encrypt(rpassword) + "String_Node_Str";
      PreparedStatement stmt=txn.prepareAutoCloseStatement(wSql);
      stmt.executeUpdate(wSql);
      s_logger.info("String_Node_Str");
    }
 catch (    SQLException e) {
      s_logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@DB protected void updateSystemvmPassword(){
  String userid=System.getProperty("String_Node_Str");
  if (!userid.startsWith("String_Node_Str")) {
    return;
  }
  if (!Boolean.valueOf(_configDao.getValue("String_Node_Str"))) {
    return;
  }
  String already=_configDao.getValue("String_Node_Str");
  if (already == null) {
    TransactionLegacy txn=TransactionLegacy.currentTxn();
    try {
      String rpassword=PasswordGenerator.generatePresharedKey(8);
      String wSql="String_Node_Str" + "String_Node_Str";
      PreparedStatement stmt=txn.prepareAutoCloseStatement(wSql);
      stmt.setString(1,DBEncryptionUtil.encrypt(rpassword));
      stmt.executeUpdate();
      s_logger.info("String_Node_Str");
    }
 catch (    SQLException e) {
      s_logger.error("String_Node_Str",e);
    }
  }
}
Program: 105237
Project: 105237
Buggy source:
@Override public ExecutionResult createFileInVR(String routerIp,String filePath,String fileName,String content){
  VmwareManager mgr=getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
  File keyFile=mgr.getSystemVMKeyFile();
  try {
    SshHelper.scpTo(routerIp,3922,"String_Node_Str",keyFile,null,filePath,content.getBytes(),fileName,null);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + filePath + fileName+ "String_Node_Str"+ routerIp,e);
    return new ExecutionResult(false,e.getMessage());
  }
  return new ExecutionResult(true,null);
}

Fixed version (ground truth):
@Override public ExecutionResult createFileInVR(String routerIp,String filePath,String fileName,String content){
  VmwareManager mgr=getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
  File keyFile=mgr.getSystemVMKeyFile();
  try {
    SshHelper.scpTo(routerIp,3922,"String_Node_Str",keyFile,null,filePath,content.getBytes("String_Node_Str"),fileName,null);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + filePath + fileName+ "String_Node_Str"+ routerIp,e);
    return new ExecutionResult(false,e.getMessage());
  }
  return new ExecutionResult(true,null);
}
Program: 105238
Project: 105238
Buggy source:
@Override @DB public void resetJobProcess(long msid,int jobResultCode,String jobResultMessage){
  String sql="String_Node_Str" + JobInfo.Status.FAILED.ordinal() + "String_Node_Str"+ jobResultCode+ "String_Node_Str"+ jobResultMessage+ "String_Node_Str"+ JobInfo.Status.IN_PROGRESS.ordinal()+ "String_Node_Str";
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement(sql);
    pstmt.setLong(1,msid);
    pstmt.setLong(2,msid);
    pstmt.execute();
  }
 catch (  SQLException e) {
    s_logger.warn("String_Node_Str" + msid,e);
  }
catch (  Throwable e) {
    s_logger.warn("String_Node_Str" + msid,e);
  }
}

Fixed version (ground truth):
@Override @DB public void resetJobProcess(long msid,int jobResultCode,String jobResultMessage){
  String sql="String_Node_Str";
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement(sql);
    pstmt.setInt(1,JobInfo.Status.FAILED.ordinal());
    pstmt.setInt(2,jobResultCode);
    pstmt.setString(3,jobResultMessage);
    pstmt.setInt(4,JobInfo.Status.IN_PROGRESS.ordinal());
    pstmt.setLong(5,msid);
    pstmt.setLong(6,msid);
    pstmt.execute();
  }
 catch (  SQLException e) {
    s_logger.warn("String_Node_Str" + msid,e);
  }
catch (  Throwable e) {
    s_logger.warn("String_Node_Str" + msid,e);
  }
}
Program: 105239
Project: 105239
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105240
Project: 105240
Buggy source:
@Override public List<Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>> getVmsDetailByNames(Set<String> vmNames,String detail){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  List<Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>> vmsDetailByNames=new ArrayList<Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>>();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareStatement(VMS_DETAIL_BY_NAME + detail + VMS_DETAIL_BY_NAME2+ getQueryBatchAppender(vmNames.size()));
    int i=1;
    for (    String name : vmNames) {
      pstmt.setString(i,name);
      i++;
    }
    try {
      ResultSet rs=pstmt.executeQuery();
      while (rs.next()) {
        vmsDetailByNames.add(new Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>(new Pair<String,VirtualMachine.Type>(rs.getString("String_Node_Str"),VirtualMachine.Type.valueOf(rs.getString("String_Node_Str"))),new Pair<Long,String>(rs.getLong("String_Node_Str"),rs.getString("String_Node_Str"))));
      }
      rs.close();
    }
 catch (    Exception e) {
      s_logger.error("String_Node_Str" + e.getMessage());
      throw new CloudRuntimeException("String_Node_Str" + e.getMessage());
    }
    if (pstmt != null) {
      pstmt.close();
    }
  }
 catch (  Exception e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    throw new CloudRuntimeException("String_Node_Str" + e.getMessage());
  }
  return vmsDetailByNames;
}

Fixed version (ground truth):
@Override public List<Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>> getVmsDetailByNames(Set<String> vmNames,String detail){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  List<Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>> vmsDetailByNames=new ArrayList<Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>>();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareStatement(VMS_DETAIL_BY_NAME + getQueryBatchAppender(vmNames.size()));
    pstmt.setString(1,detail);
    int i=2;
    for (    String name : vmNames) {
      pstmt.setString(i,name);
      i++;
    }
    try {
      ResultSet rs=pstmt.executeQuery();
      while (rs.next()) {
        vmsDetailByNames.add(new Pair<Pair<String,VirtualMachine.Type>,Pair<Long,String>>(new Pair<String,VirtualMachine.Type>(rs.getString("String_Node_Str"),VirtualMachine.Type.valueOf(rs.getString("String_Node_Str"))),new Pair<Long,String>(rs.getLong("String_Node_Str"),rs.getString("String_Node_Str"))));
      }
      rs.close();
    }
 catch (    Exception e) {
      s_logger.error("String_Node_Str" + e.getMessage());
      throw new CloudRuntimeException("String_Node_Str" + e.getMessage());
    }
    if (pstmt != null) {
      pstmt.close();
    }
  }
 catch (  Exception e) {
    s_logger.error("String_Node_Str" + e.getMessage());
    throw new CloudRuntimeException("String_Node_Str" + e.getMessage());
  }
  return vmsDetailByNames;
}
Program: 105242
Project: 105242
Buggy source:
@Override @DB public boolean disassociatePublicIpAddress(long addrId,long userId,Account caller){
}

Fixed version (ground truth):
@Override @DB public boolean disassociatePublicIpAddress(long addrId,long userId,Account caller){
  boolean success=true;
  if (!cleanupIpResources(addrId,userId,caller)) {
    success=false;
    s_logger.warn("String_Node_Str" + addrId);
  }
  IPAddressVO ip=markIpAsUnavailable(addrId);
  if (ip == null) {
    return true;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + addrId + "String_Node_Str"+ ip.isSourceNat());
  }
  if (ip.getAssociatedWithNetworkId() != null) {
    Network network=_networksDao.findById(ip.getAssociatedWithNetworkId());
    try {
      if (!applyIpAssociations(network,true)) {
        s_logger.warn("String_Node_Str" + network);
        success=false;
      }
    }
 catch (    ResourceUnavailableException e) {
      throw new CloudRuntimeException("String_Node_Str",e);
    }
  }
 else {
    if (ip.getState() == IpAddress.State.Releasing) {
      _ipAddressDao.unassignIpAddress(ip.getId());
    }
  }
  if (success) {
    if (ip.isPortable()) {
      releasePortableIpAddress(addrId);
    }
    s_logger.debug("String_Node_Str" + addrId);
  }
  return success;
}
Program: 105243
Project: 105243
Buggy source:
private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost,String storeIdentifier,String templateName){
  String templateUuid=UUID.nameUUIDFromBytes((templateName + "String_Node_Str" + storeIdentifier+ "String_Node_Str"+ hyperHost.getMor().getValue()).getBytes()).toString();
  templateUuid=templateUuid.replaceAll("String_Node_Str","String_Node_Str");
  return templateUuid;
}

Fixed version (ground truth):
private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost,String storeIdentifier,String templateName){
  String templateUuid=UUID.nameUUIDFromBytes((templateName + "String_Node_Str" + storeIdentifier+ "String_Node_Str"+ hyperHost.getMor().getValue()).getBytes("String_Node_Str")).toString();
  templateUuid=templateUuid.replaceAll("String_Node_Str","String_Node_Str");
  return templateUuid;
}
Program: 105244
Project: 105244
Buggy source:
@Override public String getDetail(String name){
}

Fixed version (ground truth):
@Override public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105245
Project: 105245
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105247
Project: 105247
Buggy source:
public String getDetail(String name){
}

Fixed version (ground truth):
public String getDetail(String name){
  return details != null ? details.get(name) : null;
}
Program: 105248
Project: 105248
Buggy source:
private boolean openSocket(){
  try {
    Socket s=new Socket(_ip,3221);
    s.setKeepAlive(true);
    s.setSoTimeout(_timeoutInSeconds * 1000);
    _toSrx=new PrintWriter(s.getOutputStream(),true);
    _fromSrx=new BufferedReader(new InputStreamReader(s.getInputStream()));
    return true;
  }
 catch (  IOException e) {
    s_logger.error(e);
    return false;
  }
}

Fixed version (ground truth):
private boolean openSocket(){
  try {
    Socket s=new Socket(_ip,3221);
    s.setKeepAlive(true);
    s.setSoTimeout(_timeoutInSeconds * 1000);
    _toSrx=new BufferedWriter(new OutputStreamWriter(s.getOutputStream(),"String_Node_Str"));
    _fromSrx=new BufferedReader(new InputStreamReader(s.getInputStream(),"String_Node_Str"));
    return true;
  }
 catch (  IOException e) {
    s_logger.error(e);
    return false;
  }
}