nus-yam/ex-repair huggingface dataset:
Program: 107396
Project: 107396
Buggy source:
@Override public List<VMTemplateStoragePoolVO> getUnusedTemplatesInPool(StoragePoolVO pool){
  List<VMTemplateStoragePoolVO> unusedTemplatesInPool=new ArrayList<VMTemplateStoragePoolVO>();
  List<VMTemplateStoragePoolVO> allTemplatesInPool=_tmpltPoolDao.listByPoolId(pool.getId());
  for (  VMTemplateStoragePoolVO templatePoolVO : allTemplatesInPool) {
    VMTemplateVO template=_tmpltDao.findById(templatePoolVO.getTemplateId());
    if (template.getUniqueName().equals("String_Node_Str")) {
      continue;
    }
    if (templatePoolVO.getDownloadState() != Status.DOWNLOADED) {
      continue;
    }
    if (template.getFormat() != ImageFormat.ISO && !_volumeDao.isAnyVolumeActivelyUsingTemplateOnPool(template.getId(),pool.getId())) {
      unusedTemplatesInPool.add(templatePoolVO);
    }
  }
  return unusedTemplatesInPool;
}

Fixed version (ground truth):
@Override public List<VMTemplateStoragePoolVO> getUnusedTemplatesInPool(StoragePoolVO pool){
  List<VMTemplateStoragePoolVO> unusedTemplatesInPool=new ArrayList<VMTemplateStoragePoolVO>();
  List<VMTemplateStoragePoolVO> allTemplatesInPool=_tmpltPoolDao.listByPoolId(pool.getId());
  for (  VMTemplateStoragePoolVO templatePoolVO : allTemplatesInPool) {
    VMTemplateVO template=_tmpltDao.findByIdIncludingRemoved(templatePoolVO.getTemplateId());
    if (template.getTemplateType() == TemplateType.SYSTEM) {
      continue;
    }
    if (templatePoolVO.getDownloadState() != Status.DOWNLOADED) {
      continue;
    }
    if (template.getFormat() != ImageFormat.ISO && !_volumeDao.isAnyVolumeActivelyUsingTemplateOnPool(template.getId(),pool.getId())) {
      unusedTemplatesInPool.add(templatePoolVO);
    }
  }
  return unusedTemplatesInPool;
}
Program: 107403
Project: 107403
Buggy source:
/** 
 * Get notified of change of job status. Executed in context of uploader thread
 * @param jobId the id of the job
 * @param status the status of the job
 */
public void setUploadStatus(String jobId,Status status){
  UploadJob uj=jobs.get(jobId);
  if (uj == null) {
    s_logger.warn("String_Node_Str" + jobId + "String_Node_Str"+ status+ "String_Node_Str");
    return;
  }
  TemplateUploader tu=uj.getTemplateUploader();
  s_logger.warn("String_Node_Str" + jobId + "String_Node_Str"+ status);
  s_logger.warn("String_Node_Str" + tu.getUploadedBytes() + "String_Node_Str"+ tu.getUploadError()+ "String_Node_Str"+ tu.getUploadPercent());
switch (status) {
case ABORTED:
case NOT_STARTED:
case UNRECOVERABLE_ERROR:
    uj.cleanup();
  break;
case UNKNOWN:
return;
case IN_PROGRESS:
s_logger.info("String_Node_Str" + jobId + "String_Node_Str"+ status);
tu.setResume(true);
threadPool.execute(tu);
break;
case RECOVERABLE_ERROR:
threadPool.execute(tu);
break;
case UPLOAD_FINISHED:
tu.setUploadError("String_Node_Str");
String result=postUpload(jobId);
if (result != null) {
s_logger.error("String_Node_Str" + result);
tu.setStatus(Status.UNRECOVERABLE_ERROR);
tu.setUploadError("String_Node_Str" + result);
}
 else {
s_logger.warn("String_Node_Str" + new SimpleDateFormat().format(new Date()));
tu.setStatus(Status.POST_UPLOAD_FINISHED);
tu.setUploadError("String_Node_Str" + new SimpleDateFormat().format(new Date()));
}
uj.cleanup();
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * Get notified of change of job status. Executed in context of uploader thread
 * @param jobId the id of the job
 * @param status the status of the job
 */
public void setUploadStatus(String jobId,Status status){
  UploadJob uj=jobs.get(jobId);
  if (uj == null) {
    s_logger.warn("String_Node_Str" + jobId + "String_Node_Str"+ status+ "String_Node_Str");
    return;
  }
  TemplateUploader tu=uj.getTemplateUploader();
  s_logger.warn("String_Node_Str" + jobId + "String_Node_Str"+ status);
  s_logger.warn("String_Node_Str" + tu.getUploadedBytes() + "String_Node_Str"+ tu.getUploadError()+ "String_Node_Str"+ tu.getUploadPercent());
switch (status) {
case ABORTED:
case NOT_STARTED:
case UNRECOVERABLE_ERROR:
    if (uj.getTemplateUploader().getUploadLocalPath().indexOf("String_Node_Str") > -1) {
      uj.cleanup();
    }
  break;
case UNKNOWN:
return;
case IN_PROGRESS:
s_logger.info("String_Node_Str" + jobId + "String_Node_Str"+ status);
tu.setResume(true);
threadPool.execute(tu);
break;
case RECOVERABLE_ERROR:
threadPool.execute(tu);
break;
case UPLOAD_FINISHED:
tu.setUploadError("String_Node_Str");
String result=postUpload(jobId);
if (result != null) {
s_logger.error("String_Node_Str" + result);
tu.setStatus(Status.UNRECOVERABLE_ERROR);
tu.setUploadError("String_Node_Str" + result);
}
 else {
s_logger.warn("String_Node_Str" + new SimpleDateFormat().format(new Date()));
tu.setStatus(Status.POST_UPLOAD_FINISHED);
tu.setUploadError("String_Node_Str" + new SimpleDateFormat().format(new Date()));
}
if (uj.getTemplateUploader().getUploadLocalPath().indexOf("String_Node_Str") > -1) {
uj.cleanup();
}
break;
default :
break;
}
}
Program: 107404
Project: 107404
Buggy source:
public static String getStaticName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String getStaticName(){
  return s_name;
}
Program: 107405
Project: 107405
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ExtractResponse getResponse(){
  Long uploadId=(Long)getResponseObject();
  UploadVO uploadInfo=ApiDBUtils.findUploadById(uploadId);
  ExtractResponse response=new ExtractResponse();
  response.setResponseName(getName());
  response.setId(id);
  response.setName(ApiDBUtils.findTemplateById(id).getName());
  response.setZoneId(zoneId);
  response.setZoneName(ApiDBUtils.findZoneById(zoneId).getName());
  response.setMode(mode);
  response.setUploadId(uploadId);
  response.setState(uploadInfo.getUploadState().toString());
  response.setAccountId(getAccountId());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ExtractResponse getResponse(){
  Long uploadId=(Long)getResponseObject();
  UploadVO uploadInfo=ApiDBUtils.findUploadById(uploadId);
  ExtractResponse response=new ExtractResponse();
  response.setResponseName(getName());
  response.setId(id);
  response.setName(ApiDBUtils.findTemplateById(id).getName());
  response.setZoneId(zoneId);
  response.setZoneName(ApiDBUtils.findZoneById(zoneId).getName());
  response.setMode(mode);
  response.setUploadId(uploadId);
  response.setState(uploadInfo.getUploadState().toString());
  response.setAccountId(getAccountId());
  response.setUrl(uploadInfo.getUploadUrl().replaceAll("String_Node_Str","String_Node_Str"));
  return response;
}
Program: 107406
Project: 107406
Buggy source:
public static String getStaticName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String getStaticName(){
  return s_name;
}
Program: 107407
Project: 107407
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ExtractResponse getResponse(){
  Long uploadId=(Long)getResponseObject();
  UploadVO uploadInfo=ApiDBUtils.findUploadById(uploadId);
  ExtractResponse response=new ExtractResponse();
  response.setResponseName(getName());
  response.setId(id);
  response.setName(ApiDBUtils.findTemplateById(id).getName());
  response.setZoneId(zoneId);
  response.setZoneName(ApiDBUtils.findZoneById(zoneId).getName());
  response.setMode(mode);
  response.setUploadId(uploadId);
  response.setState(uploadInfo.getUploadState().toString());
  response.setAccountId(getAccountId());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ExtractResponse getResponse(){
  Long uploadId=(Long)getResponseObject();
  UploadVO uploadInfo=ApiDBUtils.findUploadById(uploadId);
  ExtractResponse response=new ExtractResponse();
  response.setResponseName(getName());
  response.setId(id);
  response.setName(ApiDBUtils.findTemplateById(id).getName());
  response.setZoneId(zoneId);
  response.setZoneName(ApiDBUtils.findZoneById(zoneId).getName());
  response.setMode(mode);
  response.setUploadId(uploadId);
  response.setState(uploadInfo.getUploadState().toString());
  response.setAccountId(getAccountId());
  response.setUrl(uploadInfo.getUploadUrl().replaceAll("String_Node_Str","String_Node_Str"));
  return response;
}
Program: 107408
Project: 107408
Buggy source:
public static String getStaticName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String getStaticName(){
  return s_name;
}
Program: 107409
Project: 107409
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ExtractResponse getResponse(){
  Long uploadId=(Long)getResponseObject();
  UploadVO uploadInfo=ApiDBUtils.findUploadById(uploadId);
  ExtractResponse response=new ExtractResponse();
  response.setResponseName(getName());
  response.setId(id);
  response.setName(ApiDBUtils.findVolumeById(id).getName());
  response.setZoneId(zoneId);
  response.setZoneName(ApiDBUtils.findZoneById(zoneId).getName());
  response.setMode(mode);
  response.setUploadId(uploadId);
  response.setState(uploadInfo.getUploadState().toString());
  response.setAccountId(getAccountId());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ExtractResponse getResponse(){
  Long uploadId=(Long)getResponseObject();
  UploadVO uploadInfo=ApiDBUtils.findUploadById(uploadId);
  ExtractResponse response=new ExtractResponse();
  response.setResponseName(getName());
  response.setId(id);
  response.setName(ApiDBUtils.findVolumeById(id).getName());
  response.setZoneId(zoneId);
  response.setZoneName(ApiDBUtils.findZoneById(zoneId).getName());
  response.setMode(mode);
  response.setUploadId(uploadId);
  response.setState(uploadInfo.getUploadState().toString());
  response.setAccountId(getAccountId());
  response.setUrl(uploadInfo.getUploadUrl().replaceAll("String_Node_Str","String_Node_Str"));
  return response;
}
Program: 107410
Project: 107410
Buggy source:
public ExtractResponse(Long volumeId,String volName,long accountId,String state,Long uploadId){
  this.id=volumeId;
  this.name=volName;
  this.accountId=accountId;
  this.state=state;
  this.uploadId=uploadId;
}

Fixed version (ground truth):
public ExtractResponse(Long typeId,String typeName,long accountId,String state,Long uploadId){
  this.id=typeId;
  this.name=typeName;
  this.accountId=accountId;
  this.state=state;
  this.uploadId=uploadId;
}
Program: 107412
Project: 107412
Buggy source:
public synchronized void updateDatabase(UploadAnswer answer){
  if (answer.getErrorString().startsWith("String_Node_Str")) {
    answer.setErrorString(answer.getErrorString().concat("String_Node_Str"));
  }
  resultObj.setResult_string(answer.getErrorString());
  resultObj.setState(answer.getUploadStatus().toString());
  resultObj.setUploadPercent(answer.getUploadPct());
  if (answer.getUploadStatus() == Status.UPLOAD_IN_PROGRESS) {
    asyncMgr.updateAsyncJobAttachment(asyncJobId,type.toString(),1L);
    asyncMgr.updateAsyncJobStatus(asyncJobId,AsyncJobResult.STATUS_IN_PROGRESS,resultObj);
  }
 else   if (answer.getUploadStatus() == Status.UPLOADED) {
    asyncMgr.completeAsyncJob(asyncJobId,AsyncJobResult.STATUS_SUCCEEDED,1,resultObj);
  }
 else {
    asyncMgr.completeAsyncJob(asyncJobId,AsyncJobResult.STATUS_FAILED,2,resultObj);
  }
  UploadVO updateBuilder=uploadDao.createForUpdate();
  updateBuilder.setUploadPercent(answer.getUploadPct());
  updateBuilder.setUploadState(answer.getUploadStatus());
  updateBuilder.setLastUpdated(new Date());
  updateBuilder.setErrorString(answer.getErrorString());
  updateBuilder.setJobId(answer.getJobId());
  uploadDao.update(getUploadId(),updateBuilder);
}

Fixed version (ground truth):
public synchronized void updateDatabase(UploadAnswer answer){
  if (answer.getErrorString().startsWith("String_Node_Str")) {
    answer.setErrorString(answer.getErrorString().concat("String_Node_Str"));
  }
  resultObj.setResultString(answer.getErrorString());
  resultObj.setState(answer.getUploadStatus().toString());
  resultObj.setUploadPercent(answer.getUploadPct());
  if (answer.getUploadStatus() == Status.UPLOAD_IN_PROGRESS) {
    asyncMgr.updateAsyncJobAttachment(asyncJobId,type.toString(),1L);
    asyncMgr.updateAsyncJobStatus(asyncJobId,AsyncJobResult.STATUS_IN_PROGRESS,resultObj);
  }
 else   if (answer.getUploadStatus() == Status.UPLOADED) {
    resultObj.setResultString("String_Node_Str");
    asyncMgr.completeAsyncJob(asyncJobId,AsyncJobResult.STATUS_SUCCEEDED,1,resultObj);
  }
 else {
    asyncMgr.completeAsyncJob(asyncJobId,AsyncJobResult.STATUS_FAILED,2,resultObj);
  }
  UploadVO updateBuilder=uploadDao.createForUpdate();
  updateBuilder.setUploadPercent(answer.getUploadPct());
  updateBuilder.setUploadState(answer.getUploadStatus());
  updateBuilder.setLastUpdated(new Date());
  updateBuilder.setErrorString(answer.getErrorString());
  updateBuilder.setJobId(answer.getJobId());
  uploadDao.update(getUploadId(),updateBuilder);
}
Program: 107413
Project: 107413
Buggy source:
public void extractTemplate(VMTemplateVO template,String url,VMTemplateHostVO tmpltHostRef,Long dataCenterId,long eventId,long asyncJobId,AsyncJobManager asyncMgr);

Fixed version (ground truth):
public Long extractTemplate(VMTemplateVO template,String url,VMTemplateHostVO tmpltHostRef,Long dataCenterId,long eventId,long asyncJobId,AsyncJobManager asyncMgr);
Program: 107414
Project: 107414
Buggy source:
public String getEvent(Type type){
  if (type == Type.TEMPLATE)   return EventTypes.EVENT_TEMPLATE_UPLOAD;
  if (type == Type.ISO)   return EventTypes.EVENT_ISO_UPLOAD;
  if (type == Type.VOLUME)   return EventTypes.EVENT_VOLUME_UPLOAD;
  return null;
}

Fixed version (ground truth):
public String getEvent(Type type){
  if (type == Type.TEMPLATE)   return EventTypes.EVENT_TEMPLATE_EXTRACT;
  if (type == Type.ISO)   return EventTypes.EVENT_ISO_EXTRACT;
  if (type == Type.VOLUME)   return EventTypes.EVENT_VOLUME_EXTRACT;
  return null;
}
Program: 107415
Project: 107415
Buggy source:
@Override public void extractVolume(UploadVO uploadVolumeObj,HostVO sserver,VolumeVO volume,String url,Long dataCenterId,String installPath,long eventId,long asyncJobId,AsyncJobManager asyncMgr){
  uploadVolumeObj.setUploadState(Upload.Status.NOT_UPLOADED);
  _uploadDao.update(uploadVolumeObj.getId(),uploadVolumeObj);
  start();
  UploadCommand ucmd=new UploadCommand(url,volume.getId(),volume.getSize(),installPath,Type.VOLUME);
  UploadListener ul=new UploadListener(sserver,_timer,_uploadDao,uploadVolumeObj.getId(),this,ucmd,volume.getAccountId(),volume.getName(),Type.VOLUME,eventId,asyncJobId,asyncMgr);
  _listenerMap.put(uploadVolumeObj,ul);
  long result=send(sserver.getId(),ucmd,ul);
  if (result == -1) {
    s_logger.warn("String_Node_Str" + volume.getName() + "String_Node_Str"+ sserver.getName()+ "String_Node_Str"+ url);
    ul.setDisconnected();
    ul.scheduleStatusCheck(RequestType.GET_OR_RESTART);
  }
}

Fixed version (ground truth):
@Override public void extractVolume(UploadVO uploadVolumeObj,HostVO sserver,VolumeVO volume,String url,Long dataCenterId,String installPath,long eventId,long asyncJobId,AsyncJobManager asyncMgr){
  uploadVolumeObj.setUploadState(Upload.Status.NOT_UPLOADED);
  _uploadDao.update(uploadVolumeObj.getId(),uploadVolumeObj);
  start();
  UploadCommand ucmd=new UploadCommand(url,volume.getId(),volume.getSize(),installPath,Type.VOLUME);
  UploadListener ul=new UploadListener(sserver,_timer,_uploadDao,uploadVolumeObj,this,ucmd,volume.getAccountId(),volume.getName(),Type.VOLUME,eventId,asyncJobId,asyncMgr);
  _listenerMap.put(uploadVolumeObj,ul);
  long result=send(sserver.getId(),ucmd,ul);
  if (result == -1) {
    s_logger.warn("String_Node_Str" + volume.getName() + "String_Node_Str"+ sserver.getName()+ "String_Node_Str"+ url);
    ul.setDisconnected();
    ul.scheduleStatusCheck(RequestType.GET_OR_RESTART);
  }
}
Program: 107417
Project: 107417
Buggy source:
@Override public void extractTemplate(VMTemplateVO template,String url,VMTemplateHostVO vmTemplateHost,Long dataCenterId,long eventId,long asyncJobId,AsyncJobManager asyncMgr){
  Type type=(template.getFormat() == ImageFormat.ISO) ? Type.ISO : Type.TEMPLATE;
  List<HostVO> storageServers=_serverDao.listByTypeDataCenter(Host.Type.SecondaryStorage,dataCenterId);
  HostVO sserver=storageServers.get(0);
  UploadVO uploadTemplateObj=new UploadVO(sserver.getId(),template.getId(),new Date(),Upload.Status.NOT_UPLOADED,type,url,Mode.FTP_UPLOAD);
  _uploadDao.persist(uploadTemplateObj);
  if (vmTemplateHost != null) {
    start();
    UploadCommand ucmd=new UploadCommand(template,url,vmTemplateHost);
    UploadListener ul=new UploadListener(sserver,_timer,_uploadDao,uploadTemplateObj.getId(),this,ucmd,template.getAccountId(),template.getName(),type,eventId,asyncJobId,asyncMgr);
    _listenerMap.put(uploadTemplateObj,ul);
    long result=send(sserver.getId(),ucmd,ul);
    if (result == -1) {
      s_logger.warn("String_Node_Str" + template.getUniqueName() + "String_Node_Str"+ sserver.getName()+ "String_Node_Str"+ url);
      ul.setDisconnected();
      ul.scheduleStatusCheck(RequestType.GET_OR_RESTART);
    }
  }
}

Fixed version (ground truth):
@Override public Long extractTemplate(VMTemplateVO template,String url,VMTemplateHostVO vmTemplateHost,Long dataCenterId,long eventId,long asyncJobId,AsyncJobManager asyncMgr){
  Type type=(template.getFormat() == ImageFormat.ISO) ? Type.ISO : Type.TEMPLATE;
  List<HostVO> storageServers=_serverDao.listByTypeDataCenter(Host.Type.SecondaryStorage,dataCenterId);
  HostVO sserver=storageServers.get(0);
  UploadVO uploadTemplateObj=new UploadVO(sserver.getId(),template.getId(),new Date(),Upload.Status.NOT_UPLOADED,type,url,Mode.FTP_UPLOAD);
  _uploadDao.persist(uploadTemplateObj);
  if (vmTemplateHost != null) {
    start();
    UploadCommand ucmd=new UploadCommand(template,url,vmTemplateHost);
    UploadListener ul=new UploadListener(sserver,_timer,_uploadDao,uploadTemplateObj,this,ucmd,template.getAccountId(),template.getName(),type,eventId,asyncJobId,asyncMgr);
    _listenerMap.put(uploadTemplateObj,ul);
    long result=send(sserver.getId(),ucmd,ul);
    if (result == -1) {
      s_logger.warn("String_Node_Str" + template.getUniqueName() + "String_Node_Str"+ sserver.getName()+ "String_Node_Str"+ url);
      ul.setDisconnected();
      ul.scheduleStatusCheck(RequestType.GET_OR_RESTART);
    }
    return uploadTemplateObj.getId();
  }
  return null;
}
Program: 107418
Project: 107418
Buggy source:
Long extract(ExtractTemplateCmd cmd);

Fixed version (ground truth):
/** 
 * Extracts a Template
 * @param cmd - the command specifying the mode and id of the template
 * @return extractId.
 * @throws InvalidParameterValueException , InternalErrorException, PermissionDeniedException
 */
Long extract(ExtractTemplateCmd cmd) throws InvalidParameterValueException, PermissionDeniedException, InternalErrorException ;
Program: 107419
Project: 107419
Buggy source:
@Override public DataCenterVO createZone(CreateZoneCmd cmd){
  Long userId=UserContext.current().getUserId();
  String zoneName=cmd.getZoneName();
  String dns1=cmd.getDns1();
  String dns2=cmd.getDns2();
  String internalDns1=cmd.getInternalDns1();
  String internalDns2=cmd.getInternalDns2();
  String vnetRange=cmd.getVlan();
  String guestCidr=cmd.getGuestCidrAddress();
  String domain=cmd.getDomain();
  Long domainId=cmd.getDomainId();
  DomainVO domainVO=null;
  if (userId == null) {
    userId=User.UID_SYSTEM;
  }
  if (domainId != null) {
    domainVO=_domainDao.findById(domainId);
  }
  return createZone(userId,zoneName,dns1,dns2,internalDns1,internalDns2,vnetRange,guestCidr,domain != null ? domain : domainVO.getName(),domainId);
}

Fixed version (ground truth):
@Override public DataCenterVO createZone(CreateZoneCmd cmd){
  Long userId=UserContext.current().getUserId();
  String zoneName=cmd.getZoneName();
  String dns1=cmd.getDns1();
  String dns2=cmd.getDns2();
  String internalDns1=cmd.getInternalDns1();
  String internalDns2=cmd.getInternalDns2();
  String vnetRange=cmd.getVlan();
  String guestCidr=cmd.getGuestCidrAddress();
  String domain=cmd.getDomain();
  Long domainId=cmd.getDomainId();
  DomainVO domainVO=null;
  if (userId == null) {
    userId=User.UID_SYSTEM;
  }
  if (domainId != null) {
    domainVO=_domainDao.findById(domainId);
  }
  return createZone(userId,zoneName,dns1,dns2,internalDns1,internalDns2,vnetRange,guestCidr,domainVO != null ? domainVO.getName() : null,domainId);
}
Program: 107420
Project: 107420
Buggy source:
public static String toSerializedStringOld(Object result){
  if (result != null) {
    Class<?> clz=result.getClass();
    Gson gson=GsonHelper.getBuilder().create();
    if (result instanceof ResponseObject) {
      return clz.getName() + "String_Node_Str" + ((ResponseObject)result).getResponseName()+ "String_Node_Str"+ gson.toJson(result);
    }
 else {
      return clz.getName() + "String_Node_Str" + gson.toJson(result);
    }
  }
  return null;
}

Fixed version (ground truth):
public static String toSerializedStringOld(Object result){
  if (result != null) {
    Class<?> clz=result.getClass();
    Gson gson=GsonHelper.getBuilder().create();
    if (result instanceof ResponseObject) {
      return clz.getName() + token + ((ResponseObject)result).getResponseName()+ token+ gson.toJson(result);
    }
 else {
      return clz.getName() + token + gson.toJson(result);
    }
  }
  return null;
}
Program: 107421
Project: 107421
Buggy source:
public static Object fromSerializedString(String result){
  try {
    if (result != null && !result.isEmpty()) {
      String[] serializedParts=result.split("String_Node_Str");
      if (serializedParts.length < 2) {
        return null;
      }
      String clzName=serializedParts[0];
      String nameField=null;
      String content=null;
      if (serializedParts.length == 2) {
        content=serializedParts[1];
      }
 else {
        nameField=serializedParts[1];
        content=serializedParts[2];
      }
      Class<?> clz;
      try {
        clz=Class.forName(clzName);
      }
 catch (      ClassNotFoundException e) {
        return null;
      }
      Gson gson=GsonHelper.getBuilder().create();
      Object obj=gson.fromJson(content,clz);
      if (nameField != null) {
        ((ResponseObject)obj).setResponseName(nameField);
      }
      return obj;
    }
    return null;
  }
 catch (  RuntimeException e) {
    s_logger.error("String_Node_Str" + result);
    throw e;
  }
}

Fixed version (ground truth):
public static Object fromSerializedString(String result){
  try {
    if (result != null && !result.isEmpty()) {
      String[] serializedParts=result.split(token);
      if (serializedParts.length < 2) {
        return null;
      }
      String clzName=serializedParts[0];
      String nameField=null;
      String content=null;
      if (serializedParts.length == 2) {
        content=serializedParts[1];
      }
 else {
        nameField=serializedParts[1];
        int index=result.indexOf(token + nameField + token);
        content=result.substring(index + nameField.length() + 2);
      }
      Class<?> clz;
      try {
        clz=Class.forName(clzName);
      }
 catch (      ClassNotFoundException e) {
        return null;
      }
      Gson gson=GsonHelper.getBuilder().create();
      Object obj=gson.fromJson(content,clz);
      if (nameField != null) {
        ((ResponseObject)obj).setResponseName(nameField);
      }
      return obj;
    }
    return null;
  }
 catch (  RuntimeException e) {
    s_logger.error("String_Node_Str" + result);
    throw e;
  }
}
Program: 107422
Project: 107422
Buggy source:
@Override public String getEventDescription(){
  User user=ApiDBUtils.findUserById(getId());
  return "String_Node_Str" + user.getUsername() + "String_Node_Str"+ user.getId()+ "String_Node_Str"+ user.getAccountId();
}

Fixed version (ground truth):
@Override public String getEventDescription(){
  User user=ApiDBUtils.findUserById(getId());
  return (user != null ? ("String_Node_Str" + user.getUsername() + "String_Node_Str"+ user.getId()+ "String_Node_Str"+ user.getAccountId()) : "String_Node_Str");
}
Program: 107423
Project: 107423
Buggy source:
@SuppressWarnings("String_Node_Str") public SuccessResponse getResponse(){
  SuccessResponse response=new SuccessResponse();
  DiskOfferingVO responseObject=(DiskOfferingVO)getResponseObject();
  if (responseObject != null) {
    response.setSuccess(Boolean.TRUE);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
  response.setResponseName(getName());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public DiskOfferingResponse getResponse(){
  DiskOfferingVO offering=(DiskOfferingVO)getResponseObject();
  DiskOfferingResponse response=new DiskOfferingResponse();
  response.setId(offering.getId());
  response.setName(offering.getName());
  response.setDisplayText(offering.getDisplayText());
  response.setTags(offering.getTags());
  response.setCreated(offering.getCreated());
  response.setDiskSize(offering.getDiskSize());
  if (offering.getDomainId() != null) {
    response.setDomain(ApiDBUtils.findDomainById(offering.getDomainId()).getName());
    response.setDomainId(offering.getDomainId());
  }
  response.setMirrored(offering.isMirrored());
  response.setTags(offering.getTags());
  response.setResponseName(getName());
  return response;
}
Program: 107424
Project: 107424
Buggy source:
@Override public DiskOfferingVO updateDiskOffering(UpdateDiskOfferingCmd cmd) throws InvalidParameterValueException {
  Long diskOfferingId=cmd.getId();
  String name=cmd.getName();
  String displayText=cmd.getDisplayText();
  String tags=cmd.getTags();
  DiskOfferingVO diskOffering=_diskOfferingDao.findById(diskOfferingId);
  if (diskOffering == null) {
    throw new InvalidParameterValueException("String_Node_Str" + diskOfferingId);
  }
  boolean updateNeeded=(name != null || displayText != null || tags != null);
  if (!updateNeeded) {
    return _diskOfferingDao.findById(diskOfferingId);
  }
  diskOffering=_diskOfferingDao.createForUpdate(diskOfferingId);
  if (name != null) {
    diskOffering.setName(name);
  }
  if (displayText != null) {
    diskOffering.setDisplayText(displayText);
  }
  if (tags != null) {
    if (tags.trim().isEmpty()) {
      diskOffering.setTagsArray(csvTagsToList(null));
    }
 else {
      diskOffering.setTagsArray(csvTagsToList(tags));
    }
  }
  if (_diskOfferingDao.update(diskOfferingId,diskOffering)) {
    saveConfigurationEvent(UserContext.current().getUserId(),null,EventTypes.EVENT_DISK_OFFERING_EDIT,"String_Node_Str" + diskOffering.getName() + "String_Node_Str","String_Node_Str" + diskOffering.getId(),"String_Node_Str" + diskOffering.getName(),"String_Node_Str" + diskOffering.getDisplayText(),"String_Node_Str" + diskOffering.getDiskSize(),"String_Node_Str" + diskOffering.getTags());
    return _diskOfferingDao.findById(diskOfferingId);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public DiskOfferingVO updateDiskOffering(UpdateDiskOfferingCmd cmd) throws InvalidParameterValueException {
  Long diskOfferingId=cmd.getId();
  String name=cmd.getDiskOfferingName();
  String displayText=cmd.getDisplayText();
  String tags=cmd.getTags();
  DiskOfferingVO diskOffering=_diskOfferingDao.findById(diskOfferingId);
  if (diskOffering == null) {
    throw new InvalidParameterValueException("String_Node_Str" + diskOfferingId);
  }
  boolean updateNeeded=(name != null || displayText != null || tags != null);
  if (!updateNeeded) {
    return _diskOfferingDao.findById(diskOfferingId);
  }
  diskOffering=_diskOfferingDao.createForUpdate(diskOfferingId);
  if (name != null) {
    diskOffering.setName(name);
  }
  if (displayText != null) {
    diskOffering.setDisplayText(displayText);
  }
  if (tags != null) {
    if (tags.trim().isEmpty()) {
      diskOffering.setTagsArray(csvTagsToList(null));
    }
 else {
      diskOffering.setTagsArray(csvTagsToList(tags));
    }
  }
  if (_diskOfferingDao.update(diskOfferingId,diskOffering)) {
    saveConfigurationEvent(UserContext.current().getUserId(),null,EventTypes.EVENT_DISK_OFFERING_EDIT,"String_Node_Str" + diskOffering.getName() + "String_Node_Str","String_Node_Str" + diskOffering.getId(),"String_Node_Str" + diskOffering.getName(),"String_Node_Str" + diskOffering.getDisplayText(),"String_Node_Str" + diskOffering.getDiskSize(),"String_Node_Str" + diskOffering.getTags());
    return _diskOfferingDao.findById(diskOfferingId);
  }
 else {
    return null;
  }
}
Program: 107425
Project: 107425
Buggy source:
@Override public List<DomainRouterVO> listByVlanDbId(Long vlanDbId){
  SearchCriteria<DomainRouterVO> sc=VlanDbIdSearch.create();
  sc.setParameters("String_Node_Str",vlanDbId);
  return listActiveBy(sc);
}

Fixed version (ground truth):
@Override public List<DomainRouterVO> listByVlanDbId(Long vlanDbId){
  SearchCriteria<DomainRouterVO> sc=VlanDbIdSearch.create();
  sc.setParameters("String_Node_Str",vlanDbId);
  return listBy(sc);
}
Program: 107426
Project: 107426
Buggy source:
@Override @DB public boolean completeMigration(UserVmVO vm,HostVO host) throws AgentUnavailableException, OperationTimedoutException {
  CheckVirtualMachineCommand cvm=new CheckVirtualMachineCommand(vm.getInstanceName());
  CheckVirtualMachineAnswer answer=(CheckVirtualMachineAnswer)_agentMgr.send(host.getId(),cvm);
  if (!answer.getResult()) {
    s_logger.debug("String_Node_Str" + vm.toString());
    _vmDao.updateIf(vm,Event.AgentReportStopped,null);
    return false;
  }
  State state=answer.getState();
  if (state == State.Stopped) {
    s_logger.warn("String_Node_Str" + host.toString());
    _vmDao.updateIf(vm,Event.AgentReportStopped,null);
    return false;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + answer.getVncPort() + "String_Node_Str"+ host.getId());
  }
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    _vmDao.updateIf(vm,Event.OperationSucceeded,host.getId());
    txn.commit();
    _networkGroupManager.handleVmStateTransition(vm,State.Running);
    return true;
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + vm.toString());
    return false;
  }
}

Fixed version (ground truth):
@Override @DB public boolean completeMigration(UserVmVO vm,HostVO host) throws AgentUnavailableException, OperationTimedoutException {
  CheckVirtualMachineCommand cvm=new CheckVirtualMachineCommand(vm.getInstanceName());
  CheckVirtualMachineAnswer answer=(CheckVirtualMachineAnswer)_agentMgr.send(host.getId(),cvm);
  if (!answer.getResult()) {
    s_logger.debug("String_Node_Str" + vm.toString());
    _vmDao.updateIf(vm,Event.AgentReportStopped,null);
    return false;
  }
  State state=answer.getState();
  if (state == State.Stopped) {
    s_logger.warn("String_Node_Str" + host.toString());
    _vmDao.updateIf(vm,Event.AgentReportStopped,null);
    return false;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + answer.getVncPort() + "String_Node_Str"+ host.getId());
  }
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    _vmDao.updateIf(vm,Event.OperationSucceeded,host.getId());
    txn.commit();
    _networkGroupMgr.handleVmStateTransition(vm,State.Running);
    return true;
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + vm.toString());
    return false;
  }
}
Program: 107427
Project: 107427
Buggy source:
public UpdateCertificateCommand(String certificate){
  this.certificate=certificate;
}

Fixed version (ground truth):
public UpdateCertificateCommand(String certificate,boolean forNewProxy){
  this.certificate=certificate;
  this.forNewProxy=forNewProxy;
}
Program: 107428
Project: 107428
Buggy source:
@Override public boolean applyCustomCertToNewProxy(StartupProxyCommand cmd){
  CertificateVO cert=_certDao.listAll().get(0);
  if (cert.getUpdated().equals("String_Node_Str")) {
    String certStr=cert.getCertificate();
    long proxyVmId=(cmd).getProxyVmId();
    ConsoleProxyVO consoleProxy=_consoleProxyDao.findById(proxyVmId);
    if (consoleProxy != null) {
      HostVO consoleProxyHost=_hostDao.findConsoleProxyHost(consoleProxy.getName(),Type.ConsoleProxy);
      UpdateCertificateCommand certCmd=new UpdateCertificateCommand(certStr);
      try {
        Answer updateCertAns=_agentMgr.send(consoleProxyHost.getId(),certCmd);
        if (updateCertAns.getResult() == true) {
          long eventId=saveScheduledEvent(User.UID_SYSTEM,Account.ACCOUNT_ID_SYSTEM,EventTypes.EVENT_PROXY_REBOOT,"String_Node_Str" + consoleProxy.getId());
          rebootProxy(consoleProxy.getId(),eventId);
          s_logger.info("String_Node_Str" + cmd.getProxyVmId());
          return true;
        }
      }
 catch (      AgentUnavailableException e) {
        s_logger.warn("String_Node_Str" + cmd.getProxyVmId(),e);
        return false;
      }
catch (      OperationTimedoutException e) {
        s_logger.warn("String_Node_Str" + cmd.getProxyVmId(),e);
        return false;
      }
    }
  }
 else {
    return false;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applyCustomCertToNewProxy(StartupProxyCommand cmd){
  CertificateVO cert=_certDao.listAll().get(0);
  if (cert.getUpdated().equals("String_Node_Str")) {
    String certStr=cert.getCertificate();
    long proxyVmId=(cmd).getProxyVmId();
    ConsoleProxyVO consoleProxy=_consoleProxyDao.findById(proxyVmId);
    if (consoleProxy != null) {
      HostVO consoleProxyHost=_hostDao.findConsoleProxyHost(consoleProxy.getName(),Type.ConsoleProxy);
      UpdateCertificateCommand certCmd=new UpdateCertificateCommand(certStr,true);
      try {
        Answer updateCertAns=_agentMgr.send(consoleProxyHost.getId(),certCmd);
        if (updateCertAns.getResult() == true) {
          long eventId=saveScheduledEvent(User.UID_SYSTEM,Account.ACCOUNT_ID_SYSTEM,EventTypes.EVENT_PROXY_REBOOT,"String_Node_Str" + consoleProxy.getId());
          rebootProxy(consoleProxy.getId(),eventId);
          s_logger.info("String_Node_Str" + cmd.getProxyVmId());
          return true;
        }
      }
 catch (      AgentUnavailableException e) {
        s_logger.warn("String_Node_Str" + cmd.getProxyVmId(),e);
        return false;
      }
catch (      OperationTimedoutException e) {
        s_logger.warn("String_Node_Str" + cmd.getProxyVmId(),e);
        return false;
      }
    }
  }
 else {
    return false;
  }
  return false;
}
Program: 107430
Project: 107430
Buggy source:
@Override public void markForCleanup(long accountId){
  AccountVO account=findById(accountId);
  if (!account.getNeedsCleanup()) {
    account.setNeedsCleanup(true);
    update(accountId,account);
  }
}

Fixed version (ground truth):
@Override public void markForCleanup(long accountId){
  AccountVO account=findByIdIncludingRemoved(accountId);
  if (!account.getNeedsCleanup()) {
    account.setNeedsCleanup(true);
    update(accountId,account);
  }
}
Program: 107431
Project: 107431
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ListResponse<ResourceLimitResponse> getResponse(){
  List<ResourceLimitVO> limits=(List<ResourceLimitVO>)getResponseObject();
  ListResponse<ResourceLimitResponse> response=new ListResponse<ResourceLimitResponse>();
  List<ResourceLimitResponse> limitResponses=new ArrayList<ResourceLimitResponse>();
  for (  ResourceLimitVO limit : limits) {
    ResourceLimitResponse resourceLimitResponse=new ResourceLimitResponse();
    if (limit.getDomainId() != null) {
      resourceLimitResponse.setDomainId(limit.getDomainId());
      resourceLimitResponse.setDomainName(ApiDBUtils.findDomainById(limit.getDomainId()).getName());
    }
    if (limit.getAccountId() != null) {
      Account accountTemp=ApiDBUtils.findAccountById(limit.getAccountId());
      if (accountTemp != null) {
        resourceLimitResponse.setAccountName(accountTemp.getAccountName());
        resourceLimitResponse.setDomainId(accountTemp.getDomainId());
        resourceLimitResponse.setDomainName(ApiDBUtils.findDomainById(accountTemp.getDomainId()).getName());
      }
    }
    resourceLimitResponse.setResourceType(limit.getType().ordinal());
    resourceLimitResponse.setMax(limit.getMax());
    resourceLimitResponse.setResponseName("String_Node_Str");
    limitResponses.add(resourceLimitResponse);
  }
  response.setResponses(limitResponses);
  response.setResponseName(getName());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ListResponse<ResourceLimitResponse> getResponse(){
  List<ResourceLimitVO> limits=(List<ResourceLimitVO>)getResponseObject();
  ListResponse<ResourceLimitResponse> response=new ListResponse<ResourceLimitResponse>();
  List<ResourceLimitResponse> limitResponses=new ArrayList<ResourceLimitResponse>();
  for (  ResourceLimitVO limit : limits) {
    ResourceLimitResponse resourceLimitResponse=new ResourceLimitResponse();
    if (limit.getDomainId() != null) {
      resourceLimitResponse.setDomainId(limit.getDomainId());
      resourceLimitResponse.setDomainName(ApiDBUtils.findDomainById(limit.getDomainId()).getName());
    }
    if (limit.getAccountId() != null) {
      Account accountTemp=ApiDBUtils.findAccountById(limit.getAccountId());
      if (accountTemp != null) {
        resourceLimitResponse.setAccountName(accountTemp.getAccountName());
        resourceLimitResponse.setDomainId(accountTemp.getDomainId());
        resourceLimitResponse.setDomainName(ApiDBUtils.findDomainById(accountTemp.getDomainId()).getName());
      }
    }
    resourceLimitResponse.setResourceType(Integer.valueOf(limit.getType().ordinal()).toString());
    resourceLimitResponse.setMax(limit.getMax());
    resourceLimitResponse.setResponseName("String_Node_Str");
    limitResponses.add(resourceLimitResponse);
  }
  response.setResponses(limitResponses);
  response.setResponseName(getName());
  return response;
}
Program: 107432
Project: 107432
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ResourceLimitResponse getResponse(){
  ResourceLimitVO limit=(ResourceLimitVO)getResponseObject();
  ResourceLimitResponse response=new ResourceLimitResponse();
  if (limit.getDomainId() != null) {
    response.setDomainId(limit.getDomainId());
    response.setDomainName(ApiDBUtils.findDomainById(limit.getDomainId()).getName());
  }
  if (limit.getAccountId() != null) {
    Account accountTemp=ApiDBUtils.findAccountById(limit.getAccountId());
    if (accountTemp != null) {
      response.setAccountName(accountTemp.getAccountName());
      response.setDomainId(accountTemp.getDomainId());
      response.setDomainName(ApiDBUtils.findDomainById(accountTemp.getDomainId()).getName());
    }
  }
  response.setResourceType(limit.getType().ordinal());
  response.setMax(limit.getMax());
  response.setResponseName(getName());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ResourceLimitResponse getResponse(){
  ResourceLimitVO limit=(ResourceLimitVO)getResponseObject();
  ResourceLimitResponse response=new ResourceLimitResponse();
  if (limit.getDomainId() != null) {
    response.setDomainId(limit.getDomainId());
    response.setDomainName(ApiDBUtils.findDomainById(limit.getDomainId()).getName());
  }
  if (limit.getAccountId() != null) {
    Account accountTemp=ApiDBUtils.findAccountById(limit.getAccountId());
    if (accountTemp != null) {
      response.setAccountName(accountTemp.getAccountName());
      response.setDomainId(accountTemp.getDomainId());
      response.setDomainName(ApiDBUtils.findDomainById(accountTemp.getDomainId()).getName());
    }
  }
  response.setResourceType(Integer.valueOf(limit.getType().ordinal()).toString());
  response.setMax(limit.getMax());
  response.setResponseName(getName());
  return response;
}
Program: 107433
Project: 107433
Buggy source:
public Integer getResourceType(){
  return resourceType;
}

Fixed version (ground truth):
public String getResourceType(){
  return resourceType;
}
Program: 107434
Project: 107434
Buggy source:
public void setResourceType(Integer resourceType){
  this.resourceType=resourceType;
}

Fixed version (ground truth):
public void setResourceType(String resourceType){
  this.resourceType=resourceType;
}
Program: 107436
Project: 107436
Buggy source:
@DB(txn=false) protected void addJoins(StringBuilder str,Collection<JoinBuilder<SearchCriteria<?>>> joins){
  int fromIndex=str.lastIndexOf("String_Node_Str");
  if (fromIndex == -1) {
    fromIndex=str.length();
    str.append("String_Node_Str");
  }
 else {
    str.append("String_Node_Str");
  }
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    StringBuilder onClause=new StringBuilder();
    onClause.append("String_Node_Str").append(join.getType().getName()).append("String_Node_Str").append(join.getSecondAttribute().table).append("String_Node_Str").append(join.getFirstAttribute().table).append("String_Node_Str").append(join.getFirstAttribute().columnName).append("String_Node_Str").append(join.getSecondAttribute().table).append("String_Node_Str").append(join.getSecondAttribute().columnName).append("String_Node_Str");
    str.insert(fromIndex,onClause);
    str.append("String_Node_Str").append(join.getT().getWhereClause()).append("String_Node_Str");
    fromIndex+=onClause.length();
  }
  str.delete(str.length() - 4,str.length());
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    if (join.getT().getJoins() != null) {
      addJoins(str,join.getT().getJoins());
    }
  }
}

Fixed version (ground truth):
@DB(txn=false) protected void addJoins(StringBuilder str,Collection<JoinBuilder<SearchCriteria<?>>> joins){
  int fromIndex=str.lastIndexOf("String_Node_Str");
  if (fromIndex == -1) {
    fromIndex=str.length();
    str.append("String_Node_Str");
  }
 else {
    str.append("String_Node_Str");
  }
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    StringBuilder onClause=new StringBuilder();
    onClause.append("String_Node_Str").append(join.getType().getName()).append("String_Node_Str").append(join.getSecondAttribute().table).append("String_Node_Str").append(join.getFirstAttribute().table).append("String_Node_Str").append(join.getFirstAttribute().columnName).append("String_Node_Str").append(join.getSecondAttribute().table).append("String_Node_Str").append(join.getSecondAttribute().columnName).append("String_Node_Str");
    str.insert(fromIndex,onClause);
    String whereClause=join.getT().getWhereClause();
    if ((whereClause != null) && !"String_Node_Str".equals(whereClause)) {
      str.append("String_Node_Str").append(whereClause).append("String_Node_Str");
    }
    fromIndex+=onClause.length();
  }
  str.delete(str.length() - 4,str.length());
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    if (join.getT().getJoins() != null) {
      addJoins(str,join.getT().getJoins());
    }
  }
}
Program: 107438
Project: 107438
Buggy source:
@DB(txn=false) protected int addJoinAttributes(int count,PreparedStatement pstmt,List<Ternary<SearchCriteria<?>,Attribute,Attribute>> joins) throws SQLException {
  for (  Ternary<SearchCriteria<?>,Attribute,Attribute> join : joins) {
    for (    final Pair<Attribute,Object> value : join.first().getValues()) {
      prepareAttribute(++count,pstmt,value.first(),value.second());
    }
  }
  for (  Ternary<SearchCriteria<?>,Attribute,Attribute> join : joins) {
    if (join.first().getJoins() != null) {
      count=addJoinAttributes(count,pstmt,joins);
    }
  }
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str" + pstmt.toString());
  }
  return count;
}

Fixed version (ground truth):
@DB(txn=false) protected int addJoinAttributes(int count,PreparedStatement pstmt,Collection<JoinBuilder<SearchCriteria<?>>> joins) throws SQLException {
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    for (    final Pair<Attribute,Object> value : join.getT().getValues()) {
      prepareAttribute(++count,pstmt,value.first(),value.second());
    }
  }
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    if (join.getT().getJoins() != null) {
      count=addJoinAttributes(count,pstmt,join.getT().getJoins());
    }
  }
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str" + pstmt.toString());
  }
  return count;
}
Program: 107449
Project: 107449
Buggy source:
public Long getStartIndex(){
  Long startIndex=Long.valueOf(0);
  Long pageSizeVal=getPageSizeVal();
  if (page != null) {
    int pageNum=page.intValue();
    if (pageNum > 0) {
      startIndex=Long.valueOf(pageSizeVal * (pageNum - 1));
    }
  }
  return startIndex;
}

Fixed version (ground truth):
public Long getStartIndex(){
  Long startIndex=Long.valueOf(0);
  Long pageSizeVal=getPageSizeVal();
  if (pageSizeVal == null) {
    return null;
  }
  if (page != null) {
    int pageNum=page.intValue();
    if (pageNum > 0) {
      startIndex=Long.valueOf(pageSizeVal * (pageNum - 1));
    }
  }
  return startIndex;
}
Program: 107450
Project: 107450
Buggy source:
public Long getPageSizeVal(){
  Long pageSize=DEFAULT_PAGE_SIZE;
  Integer pageSizeInt=getPageSize();
  if (pageSizeInt != null) {
    pageSize=pageSizeInt.longValue();
  }
  return pageSize;
}

Fixed version (ground truth):
public Long getPageSizeVal(){
  Long pageSize=DEFAULT_PAGE_SIZE;
  Integer pageSizeInt=getPageSize();
  if (pageSizeInt != null) {
    if (pageSizeInt.longValue() == -1) {
      pageSize=null;
    }
 else {
      pageSize=pageSizeInt.longValue();
    }
  }
  return pageSize;
}
Program: 107451
Project: 107451
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ListResponse<DomainResponse> getResponse(){
  List<DomainVO> domains=(List<DomainVO>)getResponseObject();
  ListResponse<DomainResponse> response=new ListResponse<DomainResponse>();
  List<DomainResponse> domainResponses=new ArrayList<DomainResponse>();
  for (  DomainVO domain : domains) {
    DomainResponse domainResponse=new DomainResponse();
    domainResponse.setDomainName(domain.getName());
    domainResponse.setId(domain.getId());
    domainResponse.setLevel(domain.getLevel());
    domainResponse.setParentDomainId(domain.getParent());
    if (domain.getParent() != null) {
      domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());
    }
    domainResponse.setResponseName("String_Node_Str");
    domainResponses.add(domainResponse);
  }
  response.setResponses(domainResponses);
  response.setResponseName(getName());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ListResponse<DomainResponse> getResponse(){
  List<DomainVO> domains=(List<DomainVO>)getResponseObject();
  ListResponse<DomainResponse> response=new ListResponse<DomainResponse>();
  List<DomainResponse> domainResponses=new ArrayList<DomainResponse>();
  for (  DomainVO domain : domains) {
    DomainResponse domainResponse=new DomainResponse();
    domainResponse.setDomainName(domain.getName());
    domainResponse.setId(domain.getId());
    domainResponse.setLevel(domain.getLevel());
    domainResponse.setHasChild(domain.getChildCount() > 0);
    domainResponse.setParentDomainId(domain.getParent());
    if (domain.getParent() != null) {
      domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());
    }
    domainResponse.setResponseName("String_Node_Str");
    domainResponses.add(domainResponse);
  }
  response.setResponses(domainResponses);
  response.setResponseName(getName());
  return response;
}
Program: 107452
Project: 107452
Buggy source:
private final void setRevertOnError(boolean revertOnError){
  _flags|=(revertOnError ? 1 : 0) << FLAG_REVERT_ON_ERROR;
}

Fixed version (ground truth):
private final void setRevertOnError(boolean revertOnError){
  _flags|=(revertOnError ? FLAG_REVERT_ON_ERROR : 0);
}
Program: 107453
Project: 107453
Buggy source:
private final void setFromServer(boolean fromServer){
  _flags|=(fromServer ? 1 : 0) << FLAG_FROM_SERVER;
}

Fixed version (ground truth):
private final void setFromServer(boolean fromServer){
  _flags|=(fromServer ? FLAG_FROM_SERVER : 0);
}
Program: 107454
Project: 107454
Buggy source:
public Hypervisor.Type getHypervisorType(){
  return _hypervisorType;
}

Fixed version (ground truth):
public HypervisorType getHypervisorType(){
  return _hypervisorType;
}