nus-yam/ex-repair huggingface dataset:
Program: 189256
Project: 189256
Buggy source:
@Transactional @ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse deleteSubmission(@ApiCredentials Credentials credentials,@ApiVariable Long submissionId){
  Submission submissionToDelete=submissionRepo.findOne(submissionId);
  ApiResponse response=new ApiResponse(SUCCESS);
  if (!submissionToDelete.getSubmitter().getEmail().equals(credentials.getEmail()) || AppRole.valueOf(credentials.getRole()).ordinal() < AppRole.MANAGER.ordinal()) {
    response=new ApiResponse(ERROR,"String_Node_Str");
  }
 else {
    submissionRepo.delete(submissionId);
  }
  return response;
}

Fixed version (ground truth):
@Transactional @ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse deleteSubmission(@ApiCredentials Credentials credentials,@ApiVariable Long submissionId){
  Submission submissionToDelete=submissionRepo.findOne(submissionId);
  ApiResponse response=new ApiResponse(SUCCESS);
  if (!submissionToDelete.getSubmitter().getEmail().equals(credentials.getEmail())) {
    response=new ApiResponse(ERROR,"String_Node_Str");
  }
 else {
    submissionRepo.delete(submissionId);
  }
  return response;
}
Program: 189257
Project: 189257
Buggy source:
@ApiMapping(value="String_Node_Str") @Auth(role="String_Node_Str") public void submissionFile(HttpServletResponse response,@ApiCredentials Credentials credentials,@ApiData Map<String,String> requestData) throws IOException {
  response.addHeader("String_Node_Str","String_Node_Str");
  String uri=requestData.get("String_Node_Str");
  Path path=fileIOUtility.getAbsolutePath(uri);
  Files.copy(path,response.getOutputStream());
  response.getOutputStream().flush();
}

Fixed version (ground truth):
@ApiMapping(value="String_Node_Str") public void submissionFile(HttpServletResponse response,@ApiData Map<String,String> requestData) throws IOException {
  response.addHeader("String_Node_Str","String_Node_Str");
  String uri=requestData.get("String_Node_Str");
  Path path=fileIOUtility.getAbsolutePath(uri);
  Files.copy(path,response.getOutputStream());
  response.getOutputStream().flush();
}
Program: 189259
Project: 189259
Buggy source:
@ApiMapping(value="String_Node_Str") public ApiResponse submissionFileInfo(@ApiCredentials Credentials credentials,@ApiData Map<String,String> requestData) throws IOException {
  return new ApiResponse(SUCCESS,fileIOUtility.getFileInfo(requestData.get("String_Node_Str")));
}

Fixed version (ground truth):
@ApiMapping(value="String_Node_Str") public ApiResponse submissionFileInfo(@ApiData Map<String,String> requestData) throws IOException {
  return new ApiResponse(SUCCESS,fileIOUtility.getFileInfo(requestData.get("String_Node_Str")));
}
Program: 189260
Project: 189260
Buggy source:
public ActionLog(SubmissionState submissionState,User user,Calendar actionDate,String entry,boolean privateFlag){
  this();
  this.submissionState=submissionState;
  this.user=user;
  this.actionDate=actionDate;
  this.entry=entry;
  this.privateFlag=privateFlag;
}

Fixed version (ground truth):
public ActionLog(SubmissionState submissionState,Calendar actionDate,String entry,boolean privateFlag){
  this();
  this.submissionState=submissionState;
  this.actionDate=actionDate;
  this.entry=entry;
  this.privateFlag=privateFlag;
}
Program: 189261
Project: 189261
Buggy source:
public ActionLog create(Submission submission,User user,Calendar actionDate,String entry,boolean privateFlag);

Fixed version (ground truth):
public ActionLog create(Submission submission,Calendar actionDate,String entry,boolean privateFlag);
Program: 189262
Project: 189262
Buggy source:
@Override public ActionLog create(Submission submission,User user,Calendar actionDate,String entry,boolean privateFlag){
  ActionLog log=actionLogRepo.save(new ActionLog(submission.getSubmissionState(),user,actionDate,entry,privateFlag));
  submission.addActionLog(log);
  submissionRepo.save(submission);
  simpMessagingTemplate.convertAndSend("String_Node_Str" + submission.getId() + "String_Node_Str",new ApiResponse(SUCCESS,log));
  return log;
}

Fixed version (ground truth):
@Override public ActionLog create(Submission submission,Calendar actionDate,String entry,boolean privateFlag){
  ActionLog log=actionLogRepo.save(new ActionLog(submission.getSubmissionState(),actionDate,entry,privateFlag));
  submission.addActionLog(log);
  submissionRepo.save(submission);
  simpMessagingTemplate.convertAndSend("String_Node_Str" + submission.getId() + "String_Node_Str",new ApiResponse(SUCCESS,log));
  return log;
}
Program: 189264
Project: 189264
Buggy source:
public void clearApproveApplication(){
  this.approveApplicationDate=null;
  this.approveApplication=null;
}

Fixed version (ground truth):
public void clearApproveApplication(){
  this.approveApplicationDate=null;
  this.approveApplication=false;
}
Program: 189265
Project: 189265
Buggy source:
public void clearApproveEmbargo(){
  this.approveEmbargoDate=null;
  this.approveEmbargo=null;
}

Fixed version (ground truth):
public void clearApproveEmbargo(){
  this.approveEmbargoDate=null;
  this.approveEmbargo=false;
}
Program: 189266
Project: 189266
Buggy source:
@Override @Transactional public SubmissionFieldProfile create(FieldProfile fieldProfile){
  SubmissionFieldProfile submissionfieldProfile=submissionFieldProfileRepo.findByFieldPredicateAndInputTypeAndRepeatableAndOptionalAndUsageAndHelp(fieldProfile.getFieldPredicate(),fieldProfile.getInputType(),fieldProfile.getRepeatable(),fieldProfile.getOptional(),fieldProfile.getUsage(),fieldProfile.getHelp());
  if (submissionfieldProfile == null) {
    submissionfieldProfile=new SubmissionFieldProfile();
    submissionfieldProfile.setFieldPredicate(fieldProfile.getFieldPredicate());
    submissionfieldProfile.setControlledVocabularies(new ArrayList<ControlledVocabulary>(fieldProfile.getControlledVocabularies()));
    submissionfieldProfile.setFieldGlosses(new ArrayList<FieldGloss>(fieldProfile.getFieldGlosses()));
    submissionfieldProfile.setHelp(fieldProfile.getHelp());
    submissionfieldProfile.setInputType(fieldProfile.getInputType());
    submissionfieldProfile.setOptional(fieldProfile.getOptional());
    submissionfieldProfile.setRepeatable(fieldProfile.getRepeatable());
    submissionfieldProfile.setUsage(fieldProfile.getUsage());
    submissionfieldProfile.setMappedShibAttribute(fieldProfile.getMappedShibAttribute());
    submissionfieldProfile=submissionFieldProfileRepo.save(submissionfieldProfile);
  }
  return submissionfieldProfile;
}

Fixed version (ground truth):
@Override @Transactional public SubmissionFieldProfile create(FieldProfile fieldProfile){
  SubmissionFieldProfile submissionfieldProfile=submissionFieldProfileRepo.findByFieldPredicateAndInputTypeAndRepeatableAndOptionalAndUsageAndHelpAndMappedShibAttribute(fieldProfile.getFieldPredicate(),fieldProfile.getInputType(),fieldProfile.getRepeatable(),fieldProfile.getOptional(),fieldProfile.getUsage(),fieldProfile.getHelp(),fieldProfile.getMappedShibAttribute());
  if (submissionfieldProfile == null) {
    submissionfieldProfile=new SubmissionFieldProfile();
    submissionfieldProfile.setFieldPredicate(fieldProfile.getFieldPredicate());
    submissionfieldProfile.setControlledVocabularies(new ArrayList<ControlledVocabulary>(fieldProfile.getControlledVocabularies()));
    submissionfieldProfile.setFieldGlosses(new ArrayList<FieldGloss>(fieldProfile.getFieldGlosses()));
    submissionfieldProfile.setHelp(fieldProfile.getHelp());
    submissionfieldProfile.setInputType(fieldProfile.getInputType());
    submissionfieldProfile.setOptional(fieldProfile.getOptional());
    submissionfieldProfile.setRepeatable(fieldProfile.getRepeatable());
    submissionfieldProfile.setUsage(fieldProfile.getUsage());
    submissionfieldProfile.setMappedShibAttribute(fieldProfile.getMappedShibAttribute());
    submissionfieldProfile=submissionFieldProfileRepo.save(submissionfieldProfile);
  }
  return submissionfieldProfile;
}
Program: 189267
Project: 189267
Buggy source:
public void writeImage(InputStream stream,String filePath) throws IOException {
  String inputData=IOUtils.toString(stream,"String_Node_Str");
  String[] imageData=inputData.split("String_Node_Str");
  String[] encodedData=imageData[1].split("String_Node_Str");
  String[] mimeData=imageData[0].split("String_Node_Str");
  String fileExtension=mimeData[1].split("String_Node_Str")[1];
  BufferedImage image=ImageIO.read(new ByteArrayInputStream(Base64.getDecoder().decode(encodedData[1])));
  ImageIO.write(image,fileExtension,Files.newOutputStream(Paths.get(Application.BASE_PATH + filePath)));
}

Fixed version (ground truth):
public void writeImage(InputStream stream,String relativePath) throws IOException {
  String inputData=IOUtils.toString(stream,"String_Node_Str");
  String[] imageData=inputData.split("String_Node_Str");
  String[] encodedData=imageData[1].split("String_Node_Str");
  String[] mimeData=imageData[0].split("String_Node_Str");
  String fileExtension=mimeData[1].split("String_Node_Str")[1];
  BufferedImage image=ImageIO.read(new ByteArrayInputStream(Base64.getDecoder().decode(encodedData[1])));
  Path path=Paths.get(getPath(relativePath));
  Path parentDir=path.getParent();
  if (!Files.exists(parentDir)) {
    Files.createDirectories(parentDir);
  }
  ImageIO.write(image,fileExtension,Files.newOutputStream(path));
}
Program: 189268
Project: 189268
Buggy source:
public void write(InputStream is,String filePath) throws IOException {
  byte[] bytes=IOUtils.toByteArray(is);
  write(bytes,filePath);
}

Fixed version (ground truth):
public void write(InputStream is,String path) throws IOException {
  byte[] bytes=IOUtils.toByteArray(is);
  write(bytes,path);
}
Program: 189269
Project: 189269
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @ApiValidation(business={@ApiValidation.Business(value=UPDATE),@ApiValidation.Business(value=NONEXISTS)}) public ApiResponse updateRole(@ApiValidatedModel User user){
  User persistedUser=userRepo.findOne(user.getId());
  if (persistedUser != null) {
    user.setPassword(persistedUser.getPassword());
  }
  logger.info("String_Node_Str" + user.getEmail());
  user=userRepo.save(user);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,userRepo.findAll()));
  return new ApiResponse(SUCCESS,user);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @ApiValidation(business={@ApiValidation.Business(value=UPDATE),@ApiValidation.Business(value=NONEXISTS)}) public ApiResponse updateRole(@ApiValidatedModel User user){
  User persistedUser=userRepo.findOne(user.getId());
  if (persistedUser != null) {
    user.setPassword(persistedUser.getPassword());
    user.setActiveFilter(persistedUser.getActiveFilter());
  }
  logger.info("String_Node_Str" + user.getEmail());
  user=userRepo.save(user);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,userRepo.findAll()));
  return new ApiResponse(SUCCESS,user);
}
Program: 189270
Project: 189270
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse setActiveFilter(@ApiCredentials Credentials credentials,@ApiValidatedModel NamedSearchFilter filter){
  User user=userRepo.findByEmail(credentials.getEmail());
  List<Long> ids=new ArrayList<Long>();
  user.getActiveFilter().getFilterCriteria().forEach(filterCriterion -> {
    ids.add(filterCriterion.getId());
  }
);
  user.getActiveFilter().getFilterCriteria().clear();
  user=userRepo.save(user);
  ids.forEach(id -> {
    filterCriterionRepo.delete(id);
  }
);
  NamedSearchFilter activeFilter=user.getActiveFilter();
  activeFilter=namedSearchFilterRepo.clone(activeFilter,filter);
  user=userRepo.save(user);
  simpMessagingTemplate.convertAndSend("String_Node_Str" + user.getActiveFilter().getId(),new ApiResponse(SUCCESS,user.getActiveFilter()));
  return new ApiResponse(SUCCESS);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse setActiveFilter(@ApiCredentials Credentials credentials,@ApiValidatedModel NamedSearchFilter filter){
  User user=userRepo.findByEmail(credentials.getEmail());
  List<Long> ids=new ArrayList<Long>();
  user.getActiveFilter().getFilterCriteria().forEach(filterCriterion -> {
    ids.add(filterCriterion.getId());
  }
);
  user.getActiveFilter().getFilterCriteria().clear();
  user=userRepo.save(user);
  ids.forEach(id -> {
    filterCriterionRepo.delete(id);
  }
);
  NamedSearchFilter activeFilter=user.getActiveFilter();
  activeFilter=namedSearchFilterRepo.clone(activeFilter,filter);
  if (activeFilter.getColumnsFlag()) {
    user.getSubmissionViewColumns().clear();
    user.getSubmissionViewColumns().addAll(user.getActiveFilter().getSavedColumns());
  }
  user=userRepo.save(user);
  simpMessagingTemplate.convertAndSend("String_Node_Str" + user.getActiveFilter().getId(),new ApiResponse(SUCCESS,user.getActiveFilter()));
  return new ApiResponse(SUCCESS);
}
Program: 189271
Project: 189271
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse saveFilterCriteria(@ApiCredentials Credentials credentials,@ApiValidatedModel NamedSearchFilter namedSearchFilter){
  User user=userRepo.findByEmail(credentials.getEmail());
  NamedSearchFilter existingFilter=namedSearchFilterRepo.findByNameAndPublicFlagTrue(namedSearchFilter.getName());
  if (existingFilter != null) {
    existingFilter=namedSearchFilterRepo.clone(existingFilter,namedSearchFilter);
    user=userRepo.findByEmail(credentials.getEmail());
  }
 else {
    boolean foundFilter=false;
    for (    NamedSearchFilter filter : user.getSavedFilters()) {
      if (filter.getName().equals(namedSearchFilter.getName())) {
        filter.getFilterCriteria().clear();
        filter=namedSearchFilterRepo.clone(filter,namedSearchFilter);
        foundFilter=true;
        break;
      }
    }
    if (!foundFilter) {
      System.out.println("String_Node_Str");
      user.getSavedFilters().add(namedSearchFilterRepo.createFromFilter(namedSearchFilter));
    }
  }
  userRepo.save(user);
  return new ApiResponse(SUCCESS);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse saveFilterCriteria(@ApiCredentials Credentials credentials,@ApiValidatedModel NamedSearchFilter namedSearchFilter){
  User user=userRepo.findByEmail(credentials.getEmail());
  NamedSearchFilter existingFilter=namedSearchFilterRepo.findByNameAndPublicFlagTrue(namedSearchFilter.getName());
  if (existingFilter != null) {
    existingFilter=namedSearchFilterRepo.clone(existingFilter,namedSearchFilter);
    user=userRepo.findByEmail(credentials.getEmail());
  }
 else {
    boolean foundFilter=false;
    for (    NamedSearchFilter filter : user.getSavedFilters()) {
      if (filter.getName().equals(namedSearchFilter.getName())) {
        filter.getFilterCriteria().clear();
        filter=namedSearchFilterRepo.clone(filter,namedSearchFilter);
        foundFilter=true;
        break;
      }
    }
    if (!foundFilter) {
      user.getSavedFilters().add(namedSearchFilterRepo.createFromFilter(namedSearchFilter));
    }
  }
  userRepo.save(user);
  return new ApiResponse(SUCCESS);
}
Program: 189272
Project: 189272
Buggy source:
public NamedSearchFilter clone(NamedSearchFilter newNamedSearchFilter,NamedSearchFilter namedSearchFilter){
  newNamedSearchFilter.setPublicFlag(namedSearchFilter.getPublicFlag());
  newNamedSearchFilter.setUmiRelease(namedSearchFilter.getUmiRelease());
  newNamedSearchFilter.setColumnsFlag(namedSearchFilter.getColumnsFlag());
  namedSearchFilter.getFilterCriteria().forEach(filterCriterion -> {
    newNamedSearchFilter.addFilterCriterion(filterCriterionRepo.cloneFilterCriterion(filterCriterion));
  }
);
  namedSearchFilter.getSavedColumns().forEach(column -> {
    newNamedSearchFilter.addSavedColumn(column);
  }
);
  return newNamedSearchFilter;
}

Fixed version (ground truth):
public NamedSearchFilter clone(NamedSearchFilter newNamedSearchFilter,NamedSearchFilter namedSearchFilter){
  newNamedSearchFilter.setPublicFlag(namedSearchFilter.getPublicFlag());
  newNamedSearchFilter.setUmiRelease(namedSearchFilter.getUmiRelease());
  newNamedSearchFilter.setColumnsFlag(namedSearchFilter.getColumnsFlag());
  namedSearchFilter.getFilterCriteria().forEach(filterCriterion -> {
    newNamedSearchFilter.addFilterCriterion(filterCriterionRepo.cloneFilterCriterion(filterCriterion));
  }
);
  if (newNamedSearchFilter.getColumnsFlag()) {
    namedSearchFilter.getSavedColumns().forEach(column -> {
      newNamedSearchFilter.addSavedColumn(column);
    }
);
  }
  return newNamedSearchFilter;
}
Program: 189273
Project: 189273
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse updateSubmission(@ApiVariable("String_Node_Str") Long submissionId,@ApiModel FieldValue fieldValue){
  Submission submission=submissionRepo.findOne(submissionId);
  if (fieldValue.getId() == null) {
    submission.addFieldValue(fieldValue);
    submission=submissionRepo.save(submission);
    fieldValue.getPredicate();
    fieldValue=submission.getFieldValueByValueAndPredicate(fieldValue.getValue(),fieldValue.getPredicate());
  }
 else {
    fieldValue=fieldValueRepo.save(fieldValue);
    submission=submissionRepo.findOne(submissionId);
  }
  return new ApiResponse(SUCCESS,fieldValue);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse updateSubmission(@ApiVariable("String_Node_Str") Long submissionId,@ApiModel FieldValue fieldValue){
  Submission submission=submissionRepo.findOne(submissionId);
  if (fieldValue.getId() == null) {
    submission.addFieldValue(fieldValue);
    submission=submissionRepo.save(submission);
    System.out.println("String_Node_Str" + fieldValue.getValue() + "String_Node_Str");
    System.out.println("String_Node_Str" + fieldValue.getValue().equals("String_Node_Str") + "String_Node_Str");
    System.out.println("String_Node_Str" + fieldValue.getPredicate() + "String_Node_Str");
    fieldValue=submission.getFieldValueByValueAndPredicate(fieldValue.getValue().equals("String_Node_Str") ? "String_Node_Str" : fieldValue.getValue(),fieldValue.getPredicate());
  }
 else {
    fieldValue=fieldValueRepo.save(fieldValue);
    submission=submissionRepo.findOne(submissionId);
  }
  return new ApiResponse(SUCCESS,fieldValue);
}
Program: 189275
Project: 189275
Buggy source:
public SubmissionNote(WorkflowStep originatingWorkflowStep,String name,String text){
  this(name,text);
  setOriginatingWorkflowStep(originatingWorkflowStep);
}

Fixed version (ground truth):
public SubmissionNote(String name,String text){
  setName(name);
  setText(text);
}
Program: 189276
Project: 189276
Buggy source:
@Override public void testCreate(){
  SubmissionWorkflowStep sws=submissionWorkflowStepRepo.findOrCreate(organization,workflowStep);
  assertEquals("String_Node_Str",1,submissionWorkflowStepRepo.count());
  assertFalse("String_Node_Str",fieldProfile.equals(sws.getAggregateFieldProfiles().get(0)));
  assertEquals("String_Node_Str",fieldProfile.getPredicate(),sws.getAggregateFieldProfiles().get(0).getPredicate());
  assertEquals("String_Node_Str",fieldProfile.getInputType(),sws.getAggregateFieldProfiles().get(0).getInputType());
}

Fixed version (ground truth):
@Override public void testCreate(){
}
Program: 189277
Project: 189277
Buggy source:
@Override public void testDuplication(){
  SubmissionWorkflowStep sws=submissionWorkflowStepRepo.findOrCreate(organization,workflowStep);
  SubmissionWorkflowStep sws2=submissionWorkflowStepRepo.findOrCreate(organization,workflowStep);
  assertEquals("String_Node_Str",sws.getId(),sws2.getId());
}

Fixed version (ground truth):
@Override public void testDuplication(){
}
Program: 189284
Project: 189284
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse createOrganization(@Data String data){
  JsonNode dataNode=null;
  try {
    dataNode=objectMapper.readTree(data);
  }
 catch (  IOException e) {
    return new ApiResponse(ERROR,"String_Node_Str" + e.getMessage() + "String_Node_Str");
  }
  OrganizationCategory newOrganizationCategory=organizationCategoryRepo.findOne(dataNode.get("String_Node_Str").get("String_Node_Str").asLong());
  Organization newOrganizationParent=organizationRepo.findOne(dataNode.get("String_Node_Str").asLong());
  organizationRepo.create(dataNode.get("String_Node_Str").asText(),newOrganizationParent,newOrganizationCategory);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,getAll()));
  return new ApiResponse(SUCCESS);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse createOrganization(@Data String data){
  JsonNode dataNode=null;
  try {
    dataNode=objectMapper.readTree(data);
  }
 catch (  IOException e) {
    return new ApiResponse(ERROR,"String_Node_Str" + e.getMessage() + "String_Node_Str");
  }
  OrganizationCategory newOrganizationCategory=organizationCategoryRepo.findOne(dataNode.get("String_Node_Str").get("String_Node_Str").asLong());
  Organization newOrganizationParent=organizationRepo.findOne(dataNode.get("String_Node_Str").asLong());
  organizationRepo.create(dataNode.get("String_Node_Str").asText(),newOrganizationParent,newOrganizationCategory);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,getAll()));
  return new ApiResponse(SUCCESS);
}
Program: 189286
Project: 189286
Buggy source:
@Override public void delete(WorkflowStep workflowStep){
  if (workflowStep == null)   return;
  Organization originatingOrganization=workflowStep.getOriginatingOrganization();
  if (originatingOrganization != null) {
    originatingOrganization.removeWorkflowStep(workflowStep);
  }
  for (  Organization organization : workflowStep.getContainedByOrganizations()) {
    organization.removeWorkflowStepOrder(workflowStep.getId());
    organization.removeWorkflowStep(workflowStep);
  }
  workflowStep.setContainedByOrganizations(null);
  List<FieldProfile> fieldProfilesToRemove=new ArrayList<FieldProfile>();
  List<FieldProfile> fieldProfilesToDelete=new ArrayList<FieldProfile>();
  for (  FieldProfile fieldProfile : workflowStep.getFieldProfiles()) {
    fieldProfilesToRemove.add(fieldProfile);
    WorkflowStep originatingWorkflowStep=fieldProfile.getOriginatingWorkflowStep();
    if (originatingWorkflowStep.getId().equals(workflowStep.getId())) {
      fieldProfilesToDelete.add(fieldProfile);
    }
  }
  for (  FieldProfile fieldProfile : fieldProfilesToRemove) {
    workflowStep.removeFieldProfile(fieldProfile);
  }
  for (  FieldProfile fieldProfile : fieldProfilesToDelete) {
    recursivelyRemoveFieldProfile(originatingOrganization,fieldProfile);
    fieldProfileRepo.delete(fieldProfile);
  }
  workflowStepRepo.delete(workflowStep.getId());
}

Fixed version (ground truth):
@Override public void delete(WorkflowStep workflowStep){
  if (workflowStep == null)   return;
  Organization originatingOrganization=workflowStep.getOriginatingOrganization();
  if (originatingOrganization != null) {
    originatingOrganization.removeWorkflowStep(workflowStep);
    organizationRepo.save(originatingOrganization);
  }
  for (  Organization organization : workflowStep.getContainedByOrganizations()) {
    organization.removeWorkflowStepOrder(workflowStep.getId());
    organization.removeWorkflowStep(workflowStep);
    organizationRepo.save(organization);
  }
  workflowStep.setContainedByOrganizations(null);
  List<FieldProfile> fieldProfilesToRemove=new ArrayList<FieldProfile>();
  List<FieldProfile> fieldProfilesToDelete=new ArrayList<FieldProfile>();
  for (  FieldProfile fieldProfile : workflowStep.getFieldProfiles()) {
    fieldProfilesToRemove.add(fieldProfile);
    WorkflowStep originatingWorkflowStep=fieldProfile.getOriginatingWorkflowStep();
    if (originatingWorkflowStep.getId().equals(workflowStep.getId())) {
      fieldProfilesToDelete.add(fieldProfile);
    }
  }
  for (  FieldProfile fieldProfile : fieldProfilesToRemove) {
    workflowStep.removeFieldProfile(fieldProfile);
  }
  for (  FieldProfile fieldProfile : fieldProfilesToDelete) {
    recursivelyRemoveFieldProfile(originatingOrganization,fieldProfile);
    fieldProfileRepo.delete(fieldProfile);
  }
  workflowStepRepo.delete(workflowStep.getId());
}
Program: 189287
Project: 189287
Buggy source:
@Override public Configuration validateUpdate(Configuration configuration){
  if (!configuration.getBindingResult().hasErrors()) {
    Configuration configurationToUpdate=configurationRepo.getByName(configuration.getName());
    if (configuration.getType().equals("String_Node_Str") && configuration.getName().contains("String_Node_Str")) {
      if (!configuration.getValue().matches("String_Node_Str")) {
        configuration.getBindingResult().addError(new ObjectError("String_Node_Str","String_Node_Str"));
      }
    }
 else     if (configurationToUpdate != null && configurationToUpdate.isSystemRequired()) {
      ModelBindingResult bindingResult=configuration.getBindingResult();
      configuration=configurationRepo.create(configuration.getName(),configuration.getValue(),configuration.getType());
      configuration.setBindingResult(bindingResult);
    }
 else     if (configurationToUpdate != null && !configurationToUpdate.isSystemRequired()) {
      configurationToUpdate.setValue(configuration.getValue());
      configurationToUpdate.setBindingResult(configuration.getBindingResult());
      configuration=configurationToUpdate;
    }
 else {
      configuration.getBindingResult().addError(new ObjectError("String_Node_Str","String_Node_Str"));
    }
  }
  return configuration;
}

Fixed version (ground truth):
@Override public Configuration validateUpdate(Configuration configuration){
  if (!configuration.getBindingResult().hasErrors()) {
    Configuration configurationToUpdate=configurationRepo.getByName(configuration.getName());
    if (configuration.getType().equals("String_Node_Str") && configuration.getName().contains("String_Node_Str")) {
      if (!configuration.getValue().matches("String_Node_Str")) {
        configuration.getBindingResult().addError(new ObjectError("String_Node_Str","String_Node_Str"));
      }
    }
    if (configurationToUpdate != null && configurationToUpdate.isSystemRequired()) {
      ModelBindingResult bindingResult=configuration.getBindingResult();
      configuration=configurationRepo.create(configuration.getName(),configuration.getValue(),configuration.getType());
      configuration.setBindingResult(bindingResult);
    }
 else     if (configurationToUpdate != null && !configurationToUpdate.isSystemRequired()) {
      configurationToUpdate.setValue(configuration.getValue());
      configurationToUpdate.setBindingResult(configuration.getBindingResult());
      configuration=configurationToUpdate;
    }
 else {
      configuration.getBindingResult().addError(new ObjectError("String_Node_Str","String_Node_Str"));
    }
  }
  return configuration;
}
Program: 189288
Project: 189288
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse updateRole(@ApiValidatedModel User user){
  User possiblyExistingUser=userRepo.findByEmail(user.getEmail());
  if (possiblyExistingUser == null) {
    user.getBindingResult().addError(new ObjectError("String_Node_Str","String_Node_Str"));
  }
  if (user.getBindingResult().hasErrors()) {
    return new ApiResponse(ApiResponseType.VALIDATION_ERROR,user.getBindingResult().getAll());
  }
  possiblyExistingUser.setUserRole(user.getUserRole());
  this.simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,allUsersHelper()));
  return new ApiResponse(SUCCESS,user);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse updateRole(@ApiValidatedModel User user){
  User possiblyExistingUser=userRepo.findByEmail(user.getEmail());
  if (possiblyExistingUser == null) {
    user.getBindingResult().addError(new ObjectError("String_Node_Str","String_Node_Str"));
  }
  if (user.getBindingResult().hasErrors()) {
    return new ApiResponse(ApiResponseType.VALIDATION_ERROR,user.getBindingResult().getAll());
  }
  possiblyExistingUser.setUserRole(user.getUserRole());
  userRepo.save(possiblyExistingUser);
  Map<String,Object> retMap=new HashMap<String,Object>();
  retMap.put("String_Node_Str",userRepo.findAll());
  retMap.put("String_Node_Str",possiblyExistingUser.getEmail());
  this.simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,retMap));
  return new ApiResponse(SUCCESS,user);
}
Program: 189289
Project: 189289
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void printBanner(Environment environment,Class<?> sourceClass,PrintStream out){
  for (  String line : BANNER) {
    out.println(line);
  }
  String version=this.getClass().getPackage().getImplementationVersion();
  version=environment.getProperty("String_Node_Str");
  if (version == null) {
    Manifest manifest=getManifest(this.getClass());
    version=manifest.getMainAttributes().getValue("String_Node_Str");
  }
  version=(version == null ? "String_Node_Str" : "String_Node_Str" + version + "String_Node_Str");
  String padding="String_Node_Str";
  while (padding.length() < STRAP_LINE_SIZE - (version.length() + VIREO_BOOT.length())) {
    padding+="String_Node_Str";
  }
  out.println(AnsiOutput.toString(AnsiElement.GREEN,VIREO_BOOT,AnsiElement.DEFAULT,padding,AnsiElement.FAINT,version));
  out.println();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void printBanner(Environment environment,Class<?> sourceClass,PrintStream out){
  for (  String line : BANNER) {
    out.println(line);
  }
  String version=this.getClass().getPackage().getImplementationVersion();
  version=environment.getProperty("String_Node_Str");
  if (version == null || version.equals("String_Node_Str")) {
    Manifest manifest=getManifest(this.getClass());
    version=manifest.getMainAttributes().getValue("String_Node_Str");
  }
  version=(version == null ? "String_Node_Str" : "String_Node_Str" + version + "String_Node_Str");
  String padding="String_Node_Str";
  while (padding.length() < STRAP_LINE_SIZE - (version.length() + VIREO_BOOT.length())) {
    padding+="String_Node_Str";
  }
  out.println(AnsiOutput.toString(AnsiElement.GREEN,VIREO_BOOT,AnsiElement.DEFAULT,padding,AnsiElement.FAINT,version));
  out.println();
}
Program: 189290
Project: 189290
Buggy source:
/** 
 * @param bindingResult the bindingResult to set
 */
public void setBindingResult(ModelBindingResult bindingResult){
  this.bindingResult=bindingResult;
}

Fixed version (ground truth):
/** 
 * @param bindingResult the bindingResult to set
 */
@JsonIgnore public void setBindingResult(ModelBindingResult bindingResult){
  this.bindingResult=bindingResult;
}
Program: 189291
Project: 189291
Buggy source:
/** 
 * @return the bindingResult
 */
public ModelBindingResult getBindingResult(){
  return bindingResult;
}

Fixed version (ground truth):
/** 
 * @return the bindingResult
 */
@JsonIgnore public ModelBindingResult getBindingResult(){
  return bindingResult;
}
Program: 189292
Project: 189292
Buggy source:
/** 
 * @param isSystemRequired the isSystemRequired to set
 */
public void isSystemRequired(Boolean isSystemRequired){
  this.isSystemRequired=isSystemRequired;
}

Fixed version (ground truth):
/** 
 * @param isSystemRequired the isSystemRequired to set
 */
@JsonIgnore public void isSystemRequired(Boolean isSystemRequired){
  this.isSystemRequired=isSystemRequired;
}
Program: 189293
Project: 189293
Buggy source:
@Override public boolean equals(Object obj){
  if (obj.getClass().equals(this.getClass())) {
    return ((BaseEntity)obj).getId().equals(this.getId());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj != null && obj.getClass().equals(this.getClass())) {
    Long objId=((BaseEntity)obj).getId();
    if (objId != null) {
      return objId.equals(this.getId());
    }
  }
  return false;
}
Program: 189294
Project: 189294
Buggy source:
/** 
 * Assumes that the incoming Object embargo is @Valid
 * @param obj
 * @return
 */
@Override public boolean equals(Object obj){
  if (super.equals(obj)) {
    Embargo embargo=(Embargo)obj;
    if (embargo.getBindingResult() != null && !embargo.getBindingResult().hasErrors() && embargo.getName().equals(this.getName()) && embargo.getDescription().equals(this.getDescription()) && embargo.getGuarantor().equals(this.getGuarantor())) {
      Integer tempDuration=embargo.getDuration();
      if (tempDuration != null) {
        return tempDuration.equals(this.getDuration());
      }
 else {
        return tempDuration == this.getDuration();
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Assumes that the incoming Object embargo is @Valid
 * @param obj
 * @return
 */
@Override public boolean equals(Object obj){
  Boolean equalsFromBase=super.equals(obj);
  if (equalsFromBase) {
    Embargo embargo=(Embargo)obj;
    if (embargo.getBindingResult() != null && !embargo.getBindingResult().hasErrors() && embargo.getName().equals(this.getName()) && embargo.getDescription().equals(this.getDescription()) && embargo.getGuarantor().equals(this.getGuarantor())) {
      Integer tempDuration=embargo.getDuration();
      if (tempDuration != null) {
        return tempDuration.equals(this.getDuration());
      }
 else {
        return tempDuration == this.getDuration();
      }
    }
 else {
      return equalsFromBase;
    }
  }
  return false;
}
Program: 189295
Project: 189295
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse sortEmbargoes(@ApiVariable String column,@ApiVariable String where){
  EmbargoGuarantor guarantor=EmbargoGuarantor.fromString(where);
  if (guarantor != null) {
    embargoRepo.sort(column,guarantor);
    simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,getAll()));
    return new ApiResponse(SUCCESS);
  }
  return new ApiResponse(ERROR);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse sortEmbargoes(@ApiVariable String guarantorString,@ApiVariable String column){
  EmbargoGuarantor guarantor=EmbargoGuarantor.fromString(guarantorString);
  if (guarantor != null) {
    embargoRepo.sort(column,guarantor);
    simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,getAll()));
    return new ApiResponse(SUCCESS);
  }
  return new ApiResponse(ERROR);
}
Program: 189296
Project: 189296
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse reorderEmbargoes(@ApiVariable String src,@ApiVariable String dest){
  Long intSrc=Long.parseLong(src);
  Long intDest=Long.parseLong(dest);
  embargoRepo.reorder(intSrc,intDest);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,getAll()));
  return new ApiResponse(SUCCESS);
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") @Transactional public ApiResponse reorderEmbargoes(@ApiVariable String guarantorString,@ApiVariable String src,@ApiVariable String dest){
  EmbargoGuarantor guarantor=EmbargoGuarantor.fromString(guarantorString);
  if (guarantor != null) {
    Long intSrc=Long.parseLong(src);
    Long intDest=Long.parseLong(dest);
    embargoRepo.reorder(intSrc,intDest,guarantor);
    simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,getAll()));
    return new ApiResponse(SUCCESS);
  }
  return new ApiResponse(ERROR);
}
Program: 189297
Project: 189297
Buggy source:
public void reorder(Long src,Long dest);

Fixed version (ground truth):
public void reorder(Long src,Long dest,EmbargoGuarantor guarantor);
Program: 189298
Project: 189298
Buggy source:
@Override public void reorder(Long src,Long dest){
  orderedEntityService.reorder(Embargo.class,src,dest);
}

Fixed version (ground truth):
@Override public void reorder(Long src,Long dest,EmbargoGuarantor guarantor){
  orderedEntityService.reorder(Embargo.class,src,dest,"String_Node_Str",guarantor);
}
Program: 189299
Project: 189299
Buggy source:
@SuppressWarnings("String_Node_Str") private void swap(Class<?> clazz,Long here,Long there){
  CriteriaBuilder cb=entityManager.getCriteriaBuilder();
  CriteriaUpdate<Object> update=(CriteriaUpdate<Object>)cb.createCriteriaUpdate(clazz);
  Root<?> e=update.from((Class<Object>)clazz);
  Path<Long> path=e.get(POSITION_COLUMN_NAME);
  update.set(path,there);
  update.where(cb.equal(e.get(POSITION_COLUMN_NAME),here));
  entityManager.createQuery(update).executeUpdate();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void swap(Class<?> clazz,Long here,Long there,String whereProp,Object whereVal){
  CriteriaBuilder cb=entityManager.getCriteriaBuilder();
  CriteriaUpdate<Object> update=(CriteriaUpdate<Object>)cb.createCriteriaUpdate(clazz);
  Root<?> e=update.from((Class<Object>)clazz);
  Path<Long> path=e.get(POSITION_COLUMN_NAME);
  update.set(path,there);
  List<Predicate> predicates=new ArrayList<Predicate>();
  predicates.add(cb.equal(e.get(POSITION_COLUMN_NAME),here));
  if (whereProp != null && whereVal != null) {
    predicates.add(cb.equal(e.get(whereProp),whereVal));
  }
  update.where(predicates.toArray(new Predicate[]{}));
  entityManager.createQuery(update).executeUpdate();
}
Program: 189300
Project: 189300
Buggy source:
/** 
 * TODO: THIS NEEDS TO findbyid not findbyposition!
 * @param clazz
 * @param src
 * @param dest
 */
@SuppressWarnings("String_Node_Str") public synchronized void reorder(Class<?> clazz,Long src,Long dest){
  swap(clazz,src,Long.MAX_VALUE);
{
    CriteriaBuilder cb=entityManager.getCriteriaBuilder();
    CriteriaUpdate<Object> update=(CriteriaUpdate<Object>)cb.createCriteriaUpdate(clazz);
    Root<?> e=update.from((Class<Object>)clazz);
    Path<Long> path=e.get(POSITION_COLUMN_NAME);
    if (src > dest) {
      update.set(path,cb.sum(path,one));
      List<Predicate> predicates=new ArrayList<Predicate>();
      predicates.add(cb.greaterThanOrEqualTo(path,dest));
      predicates.add(cb.lessThan(path,src));
      update.where(predicates.toArray(new Predicate[]{}));
      entityManager.createQuery(update).executeUpdate();
    }
 else     if (src < dest) {
      update.set(path,cb.sum(path,-one));
      List<Predicate> predicates=new ArrayList<Predicate>();
      predicates.add(cb.greaterThan(path,src));
      predicates.add(cb.lessThanOrEqualTo(path,dest));
      update.where(predicates.toArray(new Predicate[]{}));
      entityManager.createQuery(update).executeUpdate();
    }
 else {
    }
  }
  swap(clazz,Long.MAX_VALUE,dest);
}

Fixed version (ground truth):
/** 
 * @param clazz
 * @param src
 * @param dest
 */
@SuppressWarnings("String_Node_Str") public synchronized void reorder(Class<?> clazz,Long src,Long dest,String whereProp,Object whereVal){
  swap(clazz,src,Long.MAX_VALUE,whereProp,whereVal);
{
    CriteriaBuilder cb=entityManager.getCriteriaBuilder();
    CriteriaUpdate<Object> update=(CriteriaUpdate<Object>)cb.createCriteriaUpdate(clazz);
    Root<?> e=update.from((Class<Object>)clazz);
    Path<Long> path=e.get(POSITION_COLUMN_NAME);
    if (src > dest) {
      update.set(path,cb.sum(path,one));
      List<Predicate> predicates=new ArrayList<Predicate>();
      predicates.add(cb.greaterThanOrEqualTo(path,dest));
      predicates.add(cb.lessThan(path,src));
      if (whereProp != null && whereVal != null) {
        predicates.add(cb.equal(e.get(whereProp),whereVal));
      }
      update.where(predicates.toArray(new Predicate[]{}));
      entityManager.createQuery(update).executeUpdate();
    }
 else     if (src < dest) {
      update.set(path,cb.sum(path,-one));
      List<Predicate> predicates=new ArrayList<Predicate>();
      predicates.add(cb.greaterThan(path,src));
      predicates.add(cb.lessThanOrEqualTo(path,dest));
      if (whereProp != null && whereVal != null) {
        predicates.add(cb.equal(e.get(whereProp),whereVal));
      }
      update.where(predicates.toArray(new Predicate[]{}));
      entityManager.createQuery(update).executeUpdate();
    }
 else {
    }
  }
  swap(clazz,Long.MAX_VALUE,dest,whereProp,whereVal);
}
Program: 189301
Project: 189301
Buggy source:
/** 
 * Turns a List&lt;Configuration&gt; into a Map&lt;Configuration.type(), Map&lt;Configuration.name(), Configuration.value()&gt;&gt; Assumes that the List&lt;Configuration&gt; that is passed in is pre-sorted by configuration.type
 * @param configurations
 * @return
 */
private Map<String,Map<String,String>> toConfigPairsMap(List<Configuration> configurations){
  Map<String,Map<String,String>> typesToConfigPairs=new HashMap<String,Map<String,String>>();
  Map<String,String> items=new HashMap<String,String>();
  String lastType="String_Node_Str";
  for (  Configuration configuration : configurations) {
    if (!lastType.equals(configuration.getType())) {
      typesToConfigPairs.put(lastType,items);
      items=new HashMap<String,String>();
      lastType=configuration.getType();
    }
    items.put(configuration.getName(),configuration.getValue());
  }
  return typesToConfigPairs;
}

Fixed version (ground truth):
/** 
 * Turns a List&lt;Configuration&gt; into a Map&lt;Configuration.type(), Map&lt;Configuration.name(), Configuration.value()&gt;&gt; Assumes that the List&lt;Configuration&gt; that is passed in is pre-sorted by configuration.type
 * @param configurations
 * @return
 */
private Map<String,Map<String,String>> toConfigPairsMap(List<Configuration> configurations){
  Map<String,Map<String,String>> typesToConfigPairs=new HashMap<String,Map<String,String>>();
  Map<String,String> items=new HashMap<String,String>();
  String lastType="String_Node_Str";
  for (  Configuration configuration : configurations) {
    if (!lastType.equals(configuration.getType())) {
      typesToConfigPairs.put(lastType,items);
      items=new HashMap<String,String>();
      lastType=configuration.getType();
    }
    items.put(configuration.getName(),configuration.getValue());
  }
  if (!items.isEmpty()) {
    typesToConfigPairs.put(lastType,items);
  }
  return typesToConfigPairs;
}
Program: 189302
Project: 189302
Buggy source:
/** 
 * @param childrenOrganizations the childrenOrganizations to set
 */
public void setChildrenOrganizations(Set<Organization> childrenOrganizations){
  childrenOrganizations.stream().forEach(childOrganization -> {
    childOrganization.addParentOrganization(this);
  }
);
  this.childrenOrganizations=childrenOrganizations;
}

Fixed version (ground truth):
/** 
 * @param childrenOrganizations the childrenOrganizations to set
 */
public void setChildrenOrganizations(Set<Organization> childrenOrganizations){
  if (childrenOrganizations != null) {
    childrenOrganizations.stream().forEach(childOrganization -> {
      childOrganization.addParentOrganization(this);
    }
);
    this.childrenOrganizations=childrenOrganizations;
  }
}
Program: 189305
Project: 189305
Buggy source:
public void doJob(){
  try {
    context.turnOffAuthorization();
    List<EmbargoType> embargoTypes=settingRepo.findAllEmbargoTypes();
    for (    EmbargoArray embargoDefinition : EMBARGO_DEFINTITIONS) {
      boolean found=false;
      for (      EmbargoType installedEmbargo : embargoTypes) {
        if (installedEmbargo.getName().equals(embargoDefinition.name)) {
          found=true;
          installedEmbargo.setSystemRequired(true);
          installedEmbargo.save();
        }
      }
      if (!found) {
        EmbargoType newembargo=settingRepo.createEmbargoType(embargoDefinition.name,embargoDefinition.description,embargoDefinition.duration,embargoDefinition.active,embargoDefinition.guarantor);
        newembargo.setSystemRequired(true);
        newembargo.save();
      }
    }
  }
 catch (  RuntimeException re) {
    Logger.error(re,"String_Node_Str");
  }
 finally {
    context.restoreAuthorization();
  }
}

Fixed version (ground truth):
public void doJob(){
  try {
    context.turnOffAuthorization();
    List<EmbargoType> embargoTypes=settingRepo.findAllEmbargoTypes();
    for (    EmbargoArray embargoDefinition : EMBARGO_DEFINTITIONS) {
      boolean found=false;
      for (      EmbargoType installedEmbargo : embargoTypes) {
        if (installedEmbargo.getName().equals(embargoDefinition.name) && installedEmbargo.getGuarantor().toString().equals(embargoDefinition.guarantor.toString())) {
          found=true;
          installedEmbargo.setDescription(embargoDefinition.description);
          installedEmbargo.setDuration(embargoDefinition.duration);
          installedEmbargo.setSystemRequired(embargoDefinition.isSystem);
          installedEmbargo.save();
        }
      }
      if (!found) {
        EmbargoType newembargo=settingRepo.createEmbargoType(embargoDefinition.name,embargoDefinition.description,embargoDefinition.duration,embargoDefinition.active,embargoDefinition.guarantor);
        newembargo.setSystemRequired(embargoDefinition.isSystem);
        newembargo.save();
      }
    }
  }
 catch (  RuntimeException re) {
    Logger.error(re,"String_Node_Str");
  }
 finally {
    context.restoreAuthorization();
  }
}
Program: 189306
Project: 189306
Buggy source:
EmbargoArray(String name,String description,Integer duration,boolean active,EmbargoGuarantor guarantor){
  this.name=name;
  this.description=description;
  this.duration=duration;
  this.active=active;
  this.guarantor=guarantor;
}

Fixed version (ground truth):
EmbargoArray(String name,String description,Integer duration,boolean active,boolean isSystem,EmbargoGuarantor guarantor){
  this.name=name;
  this.description=description;
  this.duration=duration;
  this.active=active;
  this.isSystem=isSystem;
  this.guarantor=guarantor;
}
Program: 189309
Project: 189309
Buggy source:
EmbargoArray(String name,String description,Integer duration,boolean active,EmbargoGuarantor guarantor){
  this.name=name;
  this.description=description;
  this.duration=duration;
  this.active=active;
  this.guarantor=guarantor;
}

Fixed version (ground truth):
EmbargoArray(String name,String description,Integer duration,boolean active,boolean isSystem,EmbargoGuarantor guarantor){
  this.name=name;
  this.description=description;
  this.duration=duration;
  this.active=active;
  this.isSystem=isSystem;
  this.guarantor=guarantor;
}
Program: 189310
Project: 189310
Buggy source:
public void doJob(){
  SettingsRepository settingRepo=Spring.getBeanOfType(SettingsRepository.class);
  try {
    context.turnOffAuthorization();
    List<EmbargoType> embargoTypes=settingRepo.findAllEmbargoTypes();
    for (    EmbargoArray embargoDefinition : EMBARGO_DEFINTITIONS) {
      boolean found=false;
      for (      EmbargoType installedEmbargo : embargoTypes) {
        if (installedEmbargo.getName().equals(embargoDefinition.name)) {
          found=true;
          installedEmbargo.setSystemRequired(true);
          installedEmbargo.save();
        }
      }
      if (!found) {
        EmbargoType newembargo=settingRepo.createEmbargoType(embargoDefinition.name,embargoDefinition.description,embargoDefinition.duration,embargoDefinition.active,embargoDefinition.guarantor);
        newembargo.setSystemRequired(true);
        newembargo.save();
      }
    }
  }
 catch (  RuntimeException re) {
    Logger.error(re,"String_Node_Str");
  }
 finally {
    context.restoreAuthorization();
  }
}

Fixed version (ground truth):
public void doJob(){
  try {
    context.turnOffAuthorization();
    List<EmbargoType> embargoTypes=settingRepo.findAllEmbargoTypes();
    for (    EmbargoArray embargoDefinition : EMBARGO_DEFINTITIONS) {
      boolean found=false;
      for (      EmbargoType installedEmbargo : embargoTypes) {
        if (installedEmbargo.getName().equals(embargoDefinition.name)) {
          found=true;
          installedEmbargo.setSystemRequired(true);
          installedEmbargo.save();
        }
      }
      if (!found) {
        EmbargoType newembargo=settingRepo.createEmbargoType(embargoDefinition.name,embargoDefinition.description,embargoDefinition.duration,embargoDefinition.active,embargoDefinition.guarantor);
        newembargo.setSystemRequired(true);
        newembargo.save();
      }
    }
  }
 catch (  RuntimeException re) {
    Logger.error(re,"String_Node_Str");
  }
 finally {
    context.restoreAuthorization();
  }
}