nus-yam/ex-repair huggingface dataset:
Program: 25748
Project: 25748
Buggy source:
@Override public void validate(Object object,Errors errors){
  Survey survey=(Survey)object;
  if (StringUtils.isBlank(survey.getName())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getIdentifier())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getStudyIdentifier())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getGuid())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  Set<String> foundIdentifiers=Sets.newHashSet();
  for (int i=0; i < survey.getElements().size(); i++) {
    SurveyElement element=survey.getElements().get(i);
    errors.pushNestedPath("String_Node_Str" + i);
    if (SURVEY_QUESTION_TYPE.equals(element.getType())) {
      doValidateQuestion((SurveyQuestion)element,errors);
    }
 else     if (SURVEY_INFO_SCREEN_TYPE.equals(element.getType())) {
      doValidateInfoScreen((SurveyInfoScreen)element,errors);
    }
    if (foundIdentifiers.contains(element.getIdentifier())) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
    foundIdentifiers.add(element.getIdentifier());
    errors.popNestedPath();
  }
  if (!errors.hasErrors()) {
    List<SurveyQuestion> questions=survey.getUnmodifiableQuestionList();
    validateRules(errors,questions);
  }
}

Fixed version (ground truth):
@Override public void validate(Object object,Errors errors){
  Survey survey=(Survey)object;
  if (StringUtils.isBlank(survey.getName())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getIdentifier())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getStudyIdentifier())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getGuid())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  Set<String> foundIdentifiers=Sets.newHashSet();
  for (int i=0; i < survey.getElements().size(); i++) {
    SurveyElement element=survey.getElements().get(i);
    errors.pushNestedPath("String_Node_Str" + i + "String_Node_Str");
    if (SURVEY_QUESTION_TYPE.equals(element.getType())) {
      doValidateQuestion((SurveyQuestion)element,errors);
    }
 else     if (SURVEY_INFO_SCREEN_TYPE.equals(element.getType())) {
      doValidateInfoScreen((SurveyInfoScreen)element,errors);
    }
    if (foundIdentifiers.contains(element.getIdentifier())) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
    foundIdentifiers.add(element.getIdentifier());
    errors.popNestedPath();
  }
  if (!errors.hasErrors()) {
    List<SurveyQuestion> questions=survey.getUnmodifiableQuestionList();
    validateRules(errors,questions);
  }
}
Program: 25750
Project: 25750
Buggy source:
private String getRedisURL(final BridgeConfig config){
  String url=System.getenv("String_Node_Str");
  if (url != null) {
    url=System.getenv("String_Node_Str");
  }
  if (url != null) {
    url=config.getProperty("String_Node_Str");
  }
  return url;
}

Fixed version (ground truth):
private String getRedisURL(final BridgeConfig config){
  String url=System.getenv("String_Node_Str");
  if (url == null) {
    url=System.getenv("String_Node_Str");
  }
  if (url == null) {
    url=config.getProperty("String_Node_Str");
  }
  return url;
}
Program: 25751
Project: 25751
Buggy source:
@Resource(name="String_Node_Str") public void setDdbMapper(DynamoDBMapper mapper){
  this.mapper=mapper;
}

Fixed version (ground truth):
@Resource(name="String_Node_Str") public final void setDdbMapper(DynamoDBMapper mapper){
  this.mapper=mapper;
}
Program: 25752
Project: 25752
Buggy source:
@Override public void publishEvent(ActivityEvent event){
  checkNotNull(event);
  DynamoActivityEvent hashKey=new DynamoActivityEvent();
  hashKey.setHealthCode(event.getHealthCode());
  hashKey.setEventId(event.getEventId());
  ActivityEvent savedEvent=mapper.load(hashKey);
  if (savedEvent == null || event.getTimestamp() > savedEvent.getTimestamp()) {
    mapper.save(event);
  }
}

Fixed version (ground truth):
@Override public void publishEvent(ActivityEvent event){
  checkNotNull(event);
  DynamoActivityEvent hashKey=new DynamoActivityEvent();
  hashKey.setHealthCode(event.getHealthCode());
  hashKey.setEventId(event.getEventId());
  ActivityEvent savedEvent=mapper.load(hashKey);
  if (isLaterNonEnrollmentEvent(savedEvent,event)) {
    mapper.save(event);
  }
}
Program: 25753
Project: 25753
Buggy source:
@Test public void canWithdrawConsent() throws Exception {
  String json="String_Node_Str";
  Context context=TestUtils.mockPlayContextWithJson(json);
  Http.Context.current.set(context);
  ArgumentCaptor<Withdrawal> captor=ArgumentCaptor.forClass(Withdrawal.class);
  Result result=controller.withdrawConsent();
  String response=Helpers.contentAsString(result);
  JsonNode node=BridgeObjectMapper.get().readTree(response);
  assertEquals("String_Node_Str",node.get("String_Node_Str").asText());
  verify(consentService).withdrawConsent(any(Study.class),any(User.class),captor.capture(),any(Long.class));
  assertEquals("String_Node_Str",captor.getValue().getReason());
}

Fixed version (ground truth):
@Test public void canWithdrawConsent() throws Exception {
  CacheProvider cacheProvider=mock(CacheProvider.class);
  controller.setCacheProvider(cacheProvider);
  String json="String_Node_Str";
  Context context=TestUtils.mockPlayContextWithJson(json);
  Http.Context.current.set(context);
  ArgumentCaptor<Withdrawal> captor=ArgumentCaptor.forClass(Withdrawal.class);
  Result result=controller.withdrawConsent();
  String response=Helpers.contentAsString(result);
  JsonNode node=BridgeObjectMapper.get().readTree(response);
  assertEquals("String_Node_Str",node.get("String_Node_Str").asText());
  verify(consentService).withdrawConsent(any(Study.class),any(User.class),captor.capture(),any(Long.class));
  assertEquals("String_Node_Str",captor.getValue().getReason());
  ArgumentCaptor<UserSession> sessionCaptor=ArgumentCaptor.forClass(UserSession.class);
  verify(cacheProvider).setUserSession(sessionCaptor.capture());
  assertFalse(sessionCaptor.getValue().getUser().doesConsent());
}
Program: 25754
Project: 25754
Buggy source:
@Before public void before(){
  Study study=new DynamoStudy();
  study.setTaskIdentifiers(Sets.newHashSet("String_Node_Str"));
  Schedule schedule=new Schedule();
  schedule.setLabel("String_Node_Str");
  schedule.setScheduleType(ScheduleType.RECURRING);
  schedule.setInterval("String_Node_Str");
  schedule.setExpires("String_Node_Str");
  schedule.addTimes("String_Node_Str","String_Node_Str");
  schedule.addActivity(TestConstants.TEST_3_ACTIVITY);
  SimpleScheduleStrategy strategy=new SimpleScheduleStrategy();
  strategy.setSchedule(schedule);
  plan=new DynamoSchedulePlan();
  plan.setLabel("String_Node_Str");
  plan.setStudyKey(TEST_STUDY_IDENTIFIER);
  plan.setStrategy(strategy);
  plan=schedulePlanService.createSchedulePlan(study,plan);
  String healthCode=BridgeUtils.generateGuid();
  UserConsent consent=mock(DynamoUserConsent3.class);
  when(consent.getSignedOn()).thenReturn(new DateTime().minusDays(2).getMillis());
  user=new User();
  user.setHealthCode(healthCode);
  user.setStudyKey(TEST_STUDY_IDENTIFIER);
}

Fixed version (ground truth):
@Before public void before(){
  Study study=new DynamoStudy();
  study.setIdentifier(TEST_STUDY_IDENTIFIER);
  study.setTaskIdentifiers(Sets.newHashSet("String_Node_Str"));
  Schedule schedule=new Schedule();
  schedule.setLabel("String_Node_Str");
  schedule.setScheduleType(ScheduleType.RECURRING);
  schedule.setInterval("String_Node_Str");
  schedule.setExpires("String_Node_Str");
  schedule.addTimes("String_Node_Str","String_Node_Str");
  schedule.addActivity(TestConstants.TEST_3_ACTIVITY);
  SimpleScheduleStrategy strategy=new SimpleScheduleStrategy();
  strategy.setSchedule(schedule);
  plan=new DynamoSchedulePlan();
  plan.setLabel("String_Node_Str");
  plan.setStudyKey(TEST_STUDY_IDENTIFIER);
  plan.setStrategy(strategy);
  plan=schedulePlanService.createSchedulePlan(study,plan);
  String healthCode=BridgeUtils.generateGuid();
  UserConsent consent=mock(DynamoUserConsent3.class);
  when(consent.getSignedOn()).thenReturn(new DateTime().minusDays(2).getMillis());
  user=new User();
  user.setHealthCode(healthCode);
  user.setStudyKey(TEST_STUDY_IDENTIFIER);
}
Program: 25755
Project: 25755
Buggy source:
@Before public void before(){
  study=new DynamoStudy();
  study.setTaskIdentifiers(Sets.newHashSet("String_Node_Str"));
  service=new SchedulePlanServiceImpl();
  schedulePlanDao=mock(SchedulePlanDao.class);
  surveyService=mock(SurveyService.class);
  activityService=mock(ScheduledActivityService.class);
  service.setSchedulePlanDao(schedulePlanDao);
  service.setSurveyService(surveyService);
  service.setScheduledActivityService(activityService);
}

Fixed version (ground truth):
@Before public void before(){
  study=new DynamoStudy();
  study.setIdentifier(TEST_STUDY_IDENTIFIER);
  study.setTaskIdentifiers(Sets.newHashSet("String_Node_Str"));
  service=new SchedulePlanServiceImpl();
  schedulePlanDao=mock(SchedulePlanDao.class);
  surveyService=mock(SurveyService.class);
  activityService=mock(ScheduledActivityService.class);
  service.setSchedulePlanDao(schedulePlanDao);
  service.setSurveyService(surveyService);
  service.setScheduledActivityService(activityService);
}
Program: 25756
Project: 25756
Buggy source:
@Before public void before(){
  study=new DynamoStudy();
  study.setTaskIdentifiers(Sets.newHashSet("String_Node_Str","String_Node_Str"));
  mockSchedulePlanDao=mock(SchedulePlanDao.class);
  mockSurveyService=mock(SurveyService.class);
  mockActivityService=mock(ScheduledActivityService.class);
  service=new SchedulePlanServiceImpl();
  service.setSchedulePlanDao(mockSchedulePlanDao);
  service.setSurveyService(mockSurveyService);
  service.setScheduledActivityService(mockActivityService);
  Survey survey1=TestUtils.getSurvey(false);
  survey1.setIdentifier("String_Node_Str");
  Survey survey2=TestUtils.getSurvey(false);
  survey2.setIdentifier("String_Node_Str");
  when(mockSurveyService.getSurveyMostRecentlyPublishedVersion(any(),any())).thenReturn(survey1);
  when(mockSurveyService.getSurvey(any())).thenReturn(survey2);
  surveyGuid1=survey1.getGuid();
  surveyGuid2=survey2.getGuid();
}

Fixed version (ground truth):
@Before public void before(){
  study=new DynamoStudy();
  study.setIdentifier(TEST_STUDY_IDENTIFIER);
  study.setTaskIdentifiers(Sets.newHashSet("String_Node_Str","String_Node_Str"));
  mockSchedulePlanDao=mock(SchedulePlanDao.class);
  mockSurveyService=mock(SurveyService.class);
  mockActivityService=mock(ScheduledActivityService.class);
  service=new SchedulePlanServiceImpl();
  service.setSchedulePlanDao(mockSchedulePlanDao);
  service.setSurveyService(mockSurveyService);
  service.setScheduledActivityService(mockActivityService);
  Survey survey1=TestUtils.getSurvey(false);
  survey1.setIdentifier("String_Node_Str");
  Survey survey2=TestUtils.getSurvey(false);
  survey2.setIdentifier("String_Node_Str");
  when(mockSurveyService.getSurveyMostRecentlyPublishedVersion(any(),any())).thenReturn(survey1);
  when(mockSurveyService.getSurvey(any())).thenReturn(survey2);
  surveyGuid1=survey1.getGuid();
  surveyGuid2=survey2.getGuid();
}
Program: 25757
Project: 25757
Buggy source:
<T>Result okResult(List<T> list,String typeName){
  JsonNode node=mapper.valueToTree(new ResourceList<T>(list));
  ArrayNode items=(ArrayNode)node.get("String_Node_Str");
  for (int i=0; i < items.size(); i++) {
    ((ObjectNode)items.get(0)).put("String_Node_Str",typeName);
  }
  return ok(node);
}

Fixed version (ground truth):
<T>Result okResult(List<T> list,String typeName){
  JsonNode node=mapper.valueToTree(new ResourceList<T>(list));
  ArrayNode items=(ArrayNode)node.get("String_Node_Str");
  for (int i=0; i < items.size(); i++) {
    ((ObjectNode)items.get(i)).put("String_Node_Str",typeName);
  }
  return ok(node);
}
Program: 25758
Project: 25758
Buggy source:
@SuppressWarnings("String_Node_Str") private void assertTask(String dateString,String ref,Task task){
  if ("String_Node_Str".equals(dateString)) {
    assertEquals(ref,task.getActivity().getRef());
    return;
  }
  DateTime date=DateTime.parse(dateString);
  assertTrue(date.isEqual(task.getScheduledOn()));
  assertEquals(ref,task.getActivity().getRef());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void assertTask(String dateString,String ref,Task task){
  if ("String_Node_Str".equals(dateString)) {
    assertEquals(ref,task.getActivity().getRef());
    return;
  }
  DateTime date=ISODateTimeFormat.dateOptionalTimeParser().withZone(PACIFIC_TIME_ZONE).parseDateTime(dateString);
  assertTrue(date.isEqual(task.getScheduledOn()));
  assertEquals(ref,task.getActivity().getRef());
}
Program: 25759
Project: 25759
Buggy source:
private void assertTask(String dateString,String ref,Task task){
  if ("String_Node_Str".equals(dateString)) {
    assertEquals(ref,task.getActivity().getRef());
    return;
  }
  DateTime date=DateTime.parse(dateString);
  assertEquals((long)date.getMillis(),(long)task.getScheduledOn());
  assertEquals(ref,task.getActivity().getRef());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void assertTask(String dateString,String ref,Task task){
  if ("String_Node_Str".equals(dateString)) {
    assertEquals(ref,task.getActivity().getRef());
    return;
  }
  DateTime date=DateTime.parse(dateString);
  assertEquals((long)date.getMillis(),(long)task.getScheduledOn());
  assertEquals(ref,task.getActivity().getRef());
}
Program: 25761
Project: 25761
Buggy source:
@Test public void taskIsComplete(){
  Schedule schedule=new Schedule();
  schedule.setScheduleType(ScheduleType.ONCE);
  schedule.setLabel("String_Node_Str");
  schedule.addActivity(TestConstants.TEST_ACTIVITY);
  schedule.setExpires("String_Node_Str");
  tasks=SchedulerFactory.getScheduler("String_Node_Str",schedule).getTasks(events,NOW.plusWeeks(1));
  Task task=tasks.get(0);
  assertEquals("String_Node_Str",task.getSchedulePlanGuid());
  assertNotNull(task.getGuid());
  assertEquals("String_Node_Str",task.getActivity().getLabel());
  assertEquals("String_Node_Str",task.getActivity().getRef());
  assertNotNull(task.getScheduledOn());
  assertNotNull(task.getExpiresOn());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void taskIsComplete(){
  Schedule schedule=new Schedule();
  schedule.setScheduleType(ScheduleType.ONCE);
  schedule.setLabel("String_Node_Str");
  schedule.addActivity(TestConstants.TEST_ACTIVITY);
  schedule.setExpires("String_Node_Str");
  tasks=SchedulerFactory.getScheduler("String_Node_Str",schedule).getTasks(events,NOW.plusWeeks(1));
  Task task=tasks.get(0);
  assertEquals("String_Node_Str",task.getSchedulePlanGuid());
  assertNotNull(task.getGuid());
  assertEquals("String_Node_Str",task.getActivity().getLabel());
  assertEquals("String_Node_Str",task.getActivity().getRef());
  assertNotNull(task.getScheduledOn());
  assertNotNull(task.getExpiresOn());
}
Program: 25762
Project: 25762
Buggy source:
@Test public void olderPublishedActivitiesCanBeDeserialized() throws Exception {
  String oldJson="String_Node_Str";
  BridgeObjectMapper mapper=BridgeObjectMapper.get();
  Activity activity=mapper.readValue(oldJson,Activity.class);
  assertEquals("String_Node_Str",activity.getLabel());
  assertTrue(activity.getRef().matches("String_Node_Str"));
  assertEquals(ActivityType.SURVEY,activity.getActivityType());
  SurveyReference ref=activity.getSurvey();
  assertNull("String_Node_Str",ref.getIdentifier());
  assertNull("String_Node_Str",ref.getCreatedOn());
  assertEquals("String_Node_Str","String_Node_Str",ref.getGuid());
  assertTrue(ref.getHref().matches("String_Node_Str"));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void olderPublishedActivitiesCanBeDeserialized() throws Exception {
  String oldJson="String_Node_Str";
  BridgeObjectMapper mapper=BridgeObjectMapper.get();
  Activity activity=mapper.readValue(oldJson,Activity.class);
  assertEquals("String_Node_Str",activity.getLabel());
  assertTrue(activity.getRef().matches("String_Node_Str"));
  assertEquals(ActivityType.SURVEY,activity.getActivityType());
  SurveyReference ref=activity.getSurvey();
  assertNull("String_Node_Str",ref.getIdentifier());
  assertNull("String_Node_Str",ref.getCreatedOn());
  assertEquals("String_Node_Str","String_Node_Str",ref.getGuid());
  assertTrue(ref.getHref().matches("String_Node_Str"));
}
Program: 25763
Project: 25763
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void changePublishedAndAbsoluteSurveyActivity(){
  service.getTasks(user,endsOn.plusDays(2));
  ArgumentCaptor<List> argument=ArgumentCaptor.forClass(List.class);
  verify(taskDao).saveTasks(anyString(),argument.capture());
  boolean foundTask3=false;
  for (  Task task : (List<Task>)argument.getValue()) {
    if (!"String_Node_Str".equals(task.getActivity().getRef())) {
      String ref=task.getActivity().getSurveyResponse().getHref();
      assertTrue("String_Node_Str",ref.contains("String_Node_Str"));
    }
 else {
      foundTask3=true;
    }
  }
  assertTrue("String_Node_Str",foundTask3);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void changePublishedAndAbsoluteSurveyActivity(){
  service.getTasks(user,endsOn.plusDays(2));
  ArgumentCaptor<List> argument=ArgumentCaptor.forClass(List.class);
  verify(taskDao).saveTasks(anyString(),argument.capture());
  boolean foundTask3=false;
  for (  Task task : (List<Task>)argument.getValue()) {
    if (!"String_Node_Str".equals(task.getActivity().getRef())) {
      String ref=task.getActivity().getSurveyResponse().getHref();
      assertTrue("String_Node_Str",ref.contains("String_Node_Str"));
    }
 else {
      foundTask3=true;
    }
  }
  assertTrue("String_Node_Str",foundTask3);
}
Program: 25764
Project: 25764
Buggy source:
MimeTypeEmail(String subject,String senderAddress,List<String> recipientAddresses,List<MimeBodyPart> messageParts){
  checkArgument(isNotBlank(senderAddress));
  checkArgument(isNotBlank(subject));
  checkArgument(isNotBlank(senderAddress));
  checkArgument(recipientAddresses != null && !recipientAddresses.isEmpty());
  checkArgument(messageParts != null && !messageParts.isEmpty());
  this.subject=subject;
  this.senderAddress=senderAddress;
  this.recipientAddresses=recipientAddresses;
  this.messageParts=ImmutableList.copyOf(messageParts);
}

Fixed version (ground truth):
MimeTypeEmail(String subject,String senderAddress,List<String> recipientAddresses,List<MimeBodyPart> messageParts){
  checkArgument(isNotBlank(senderAddress));
  checkArgument(isNotBlank(subject));
  checkArgument(isNotBlank(senderAddress));
  checkArgument(recipientAddresses != null && !recipientAddresses.isEmpty());
  checkArgument(messageParts != null && !messageParts.isEmpty());
  this.subject=subject;
  this.senderAddress=escapeEmailAddress(senderAddress);
  this.recipientAddresses=Lists.transform(recipientAddresses,new Function<String,String>(){
    @Override public String apply(    String address){
      return escapeEmailAddress(address);
    }
  }
);
  this.messageParts=ImmutableList.copyOf(messageParts);
}
Program: 25765
Project: 25765
Buggy source:
@Value("String_Node_Str") public void setDefaultEmailVerificationTemplate(org.springframework.core.io.Resource resource){
  this.defaultEmailVerificationTemplate=BridgeUtils.toStringQuietly(resource);
}

Fixed version (ground truth):
@Value("String_Node_Str") void setDefaultEmailVerificationTemplate(org.springframework.core.io.Resource resource){
  this.defaultEmailVerificationTemplate=BridgeUtils.toStringQuietly(resource);
}
Program: 25766
Project: 25766
Buggy source:
@Value("String_Node_Str") public void setDefaultConsentDocument(org.springframework.core.io.Resource resource){
  this.defaultConsentDocument=new StudyConsentForm(BridgeUtils.toStringQuietly(resource));
}

Fixed version (ground truth):
@Value("String_Node_Str") void setDefaultConsentDocument(org.springframework.core.io.Resource resource){
  this.defaultConsentDocument=new StudyConsentForm(BridgeUtils.toStringQuietly(resource));
}
Program: 25767
Project: 25767
Buggy source:
@Value("String_Node_Str") public void setDefaultPasswordTemplate(org.springframework.core.io.Resource resource){
  this.defaultResetPasswordTemplate=BridgeUtils.toStringQuietly(resource);
}

Fixed version (ground truth):
@Value("String_Node_Str") void setDefaultPasswordTemplate(org.springframework.core.io.Resource resource){
  this.defaultResetPasswordTemplate=BridgeUtils.toStringQuietly(resource);
}
Program: 25768
Project: 25768
Buggy source:
@Value("String_Node_Str") public void setDefaultEmailVerificationTemplateSubject(org.springframework.core.io.Resource resource){
  this.defaultEmailVerificationTemplateSubject=BridgeUtils.toStringQuietly(resource);
}

Fixed version (ground truth):
@Value("String_Node_Str") void setDefaultEmailVerificationTemplateSubject(org.springframework.core.io.Resource resource){
  this.defaultEmailVerificationTemplateSubject=BridgeUtils.toStringQuietly(resource);
}
Program: 25769
Project: 25769
Buggy source:
@Override public Study createStudy(Study study){
  checkNotNull(study,Validate.CANNOT_BE_NULL,"String_Node_Str");
  checkNewEntity(study,study.getVersion(),"String_Node_Str");
  setDefaultsIfAbsent(study);
  Validate.entityThrowingException(validator,study);
  String id=study.getIdentifier();
  String lockId=null;
  try {
    lockId=lockDao.acquireLock(Study.class,id);
    if (studyDao.doesIdentifierExist(study.getIdentifier())) {
      throw new EntityAlreadyExistsException(study);
    }
    StudyConsentView view=studyConsentService.addConsent(study.getStudyIdentifier(),defaultConsentDocument);
    studyConsentService.activateConsent(study.getStudyIdentifier(),view.getCreatedOn());
    study.setResearcherRole(study.getIdentifier() + "String_Node_Str");
    String directory=directoryDao.createDirectoryForStudy(study);
    study.setStormpathHref(directory);
    uploadCertService.createCmsKeyPair(study.getIdentifier());
    study=studyDao.createStudy(study);
    cacheProvider.setStudy(study);
  }
  finally {
    lockDao.releaseLock(Study.class,id,lockId);
  }
  return study;
}

Fixed version (ground truth):
@Override public Study createStudy(Study study){
  checkNotNull(study,Validate.CANNOT_BE_NULL,"String_Node_Str");
  checkNewEntity(study,study.getVersion(),"String_Node_Str");
  setDefaultsIfAbsent(study);
  Validate.entityThrowingException(validator,study);
  String id=study.getIdentifier();
  String lockId=null;
  try {
    lockId=lockDao.acquireLock(Study.class,id);
    if (studyDao.doesIdentifierExist(study.getIdentifier())) {
      throw new EntityAlreadyExistsException(study);
    }
    StudyConsentView view=studyConsentService.addConsent(study.getStudyIdentifier(),defaultConsentDocument);
    studyConsentService.activateConsent(study.getStudyIdentifier(),view.getCreatedOn());
    study.setActive(true);
    study.setResearcherRole(study.getIdentifier() + "String_Node_Str");
    String directory=directoryDao.createDirectoryForStudy(study);
    study.setStormpathHref(directory);
    uploadCertService.createCmsKeyPair(study.getIdentifier());
    study=studyDao.createStudy(study);
    cacheProvider.setStudy(study);
  }
  finally {
    lockDao.releaseLock(Study.class,id,lockId);
  }
  return study;
}
Program: 25770
Project: 25770
Buggy source:
/** 
 * When certain aspects of as study are excluded on a save, they revert to defaults.
 * @param study
 */
private void setDefaultsIfAbsent(Study study){
  if (study.getPasswordPolicy() == null) {
    study.setPasswordPolicy(PasswordPolicy.DEFAULT_PASSWORD_POLICY);
  }
  study.setVerifyEmailTemplate(fillOutTemplate(study.getVerifyEmailTemplate(),defaultEmailVerificationTemplateSubject,defaultEmailVerificationTemplate));
  study.setResetPasswordTemplate(fillOutTemplate(study.getResetPasswordTemplate(),defaultResetPasswordTemplateSubject,defaultResetPasswordTemplate));
}

Fixed version (ground truth):
/** 
 * When certain aspects of as study are excluded on a save, they revert to defaults. 
 * @param study
 */
private void setDefaultsIfAbsent(Study study){
  if (study.getPasswordPolicy() == null) {
    study.setPasswordPolicy(PasswordPolicy.DEFAULT_PASSWORD_POLICY);
  }
  study.setVerifyEmailTemplate(fillOutTemplate(study.getVerifyEmailTemplate(),defaultEmailVerificationTemplateSubject,defaultEmailVerificationTemplate));
  study.setResetPasswordTemplate(fillOutTemplate(study.getResetPasswordTemplate(),defaultResetPasswordTemplateSubject,defaultResetPasswordTemplate));
}
Program: 25771
Project: 25771
Buggy source:
@Autowired public void setStudyDao(StudyDao studyDao){
  this.studyDao=studyDao;
}

Fixed version (ground truth):
@Autowired void setStudyDao(StudyDao studyDao){
  this.studyDao=studyDao;
}
Program: 25772
Project: 25772
Buggy source:
@Autowired public void setCacheProvider(CacheProvider cacheProvider){
  this.cacheProvider=cacheProvider;
}

Fixed version (ground truth):
@Autowired void setCacheProvider(CacheProvider cacheProvider){
  this.cacheProvider=cacheProvider;
}
Program: 25773
Project: 25773
Buggy source:
@Override public Study updateStudy(Study study){
  checkNotNull(study,Validate.CANNOT_BE_NULL,"String_Node_Str");
  setDefaultsIfAbsent(study);
  Validate.entityThrowingException(validator,study);
  Study originalStudy=studyDao.getStudy(study.getIdentifier());
  study.setStormpathHref(originalStudy.getStormpathHref());
  study.setResearcherRole(originalStudy.getResearcherRole());
  cacheProvider.removeStudy(study.getIdentifier());
  if (studyDirectoryHasChanged(originalStudy,study)) {
    directoryDao.updateDirectoryForStudy(study);
  }
  Study updatedStudy=studyDao.updateStudy(study);
  cacheProvider.setStudy(updatedStudy);
  return updatedStudy;
}

Fixed version (ground truth):
@Override public Study updateStudy(Study study){
  checkNotNull(study,Validate.CANNOT_BE_NULL,"String_Node_Str");
  setDefaultsIfAbsent(study);
  Validate.entityThrowingException(validator,study);
  Study originalStudy=studyDao.getStudy(study.getIdentifier());
  study.setStormpathHref(originalStudy.getStormpathHref());
  study.setResearcherRole(originalStudy.getResearcherRole());
  study.setActive(originalStudy.isActive());
  cacheProvider.removeStudy(study.getIdentifier());
  if (studyDirectoryHasChanged(originalStudy,study)) {
    directoryDao.updateDirectoryForStudy(study);
  }
  Study updatedStudy=studyDao.updateStudy(study);
  cacheProvider.setStudy(updatedStudy);
  return updatedStudy;
}
Program: 25774
Project: 25774
Buggy source:
@Autowired public void setValidator(StudyValidator validator){
  this.validator=validator;
}

Fixed version (ground truth):
@Autowired void setValidator(StudyValidator validator){
  this.validator=validator;
}
Program: 25775
Project: 25775
Buggy source:
@Value("String_Node_Str") public void setDefaultPasswordTemplateSubject(org.springframework.core.io.Resource resource){
  this.defaultResetPasswordTemplateSubject=BridgeUtils.toStringQuietly(resource);
}

Fixed version (ground truth):
@Value("String_Node_Str") void setDefaultPasswordTemplateSubject(org.springframework.core.io.Resource resource){
  this.defaultResetPasswordTemplateSubject=BridgeUtils.toStringQuietly(resource);
}
Program: 25776
Project: 25776
Buggy source:
@Resource(name="String_Node_Str") public void setUploadCertificateService(UploadCertificateService uploadCertService){
  this.uploadCertService=uploadCertService;
}

Fixed version (ground truth):
@Resource(name="String_Node_Str") void setUploadCertificateService(UploadCertificateService uploadCertService){
  this.uploadCertService=uploadCertService;
}
Program: 25777
Project: 25777
Buggy source:
@Autowired public void setDistributedLockDao(DistributedLockDao lockDao){
  this.lockDao=lockDao;
}

Fixed version (ground truth):
@Autowired void setDistributedLockDao(DistributedLockDao lockDao){
  this.lockDao=lockDao;
}
Program: 25778
Project: 25778
Buggy source:
@Autowired public void setDirectoryDao(DirectoryDao directoryDao){
  this.directoryDao=directoryDao;
}

Fixed version (ground truth):
@Autowired void setDirectoryDao(DirectoryDao directoryDao){
  this.directoryDao=directoryDao;
}
Program: 25779
Project: 25779
Buggy source:
@Override public List<Study> getStudies(){
  return Lists.transform(studyDao.getStudies(),new Function<Study,Study>(){
    @Override public Study apply(    Study study){
      setLegacyFieldsIfAbsent(study);
      return study;
    }
  }
);
}

Fixed version (ground truth):
@Override public List<Study> getStudies(){
  return studyDao.getStudies();
}
Program: 25780
Project: 25780
Buggy source:
@Autowired public void setStudyConsentService(StudyConsentService studyConsentService){
  this.studyConsentService=studyConsentService;
}

Fixed version (ground truth):
@Autowired void setStudyConsentService(StudyConsentService studyConsentService){
  this.studyConsentService=studyConsentService;
}
Program: 25781
Project: 25781
Buggy source:
private static ObjectNode getGet(HttpClient client,String url) throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  HttpGet get=new HttpGet(url);
  get.setHeader("String_Node_Str","String_Node_Str");
  HttpResponse response=client.execute(get);
  ObjectNode object=(ObjectNode)mapper.readTree(EntityUtils.toString(response.getEntity(),"String_Node_Str"));
  System.out.println("String_Node_Str" + url + "String_Node_Str"+ mapper.writeValueAsString(object));
  return object;
}

Fixed version (ground truth):
private ObjectNode getGet(HttpClient client,String url) throws Exception {
  HttpGet get=new HttpGet(url);
  get.setHeader("String_Node_Str","String_Node_Str");
  HttpResponse response=client.execute(get);
  ObjectNode object=(ObjectNode)MAPPER.readTree(EntityUtils.toString(response.getEntity(),"String_Node_Str"));
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + url + "String_Node_Str"+ MAPPER.writeValueAsString(object));
  }
  return object;
}
Program: 25782
Project: 25782
Buggy source:
private void adjustVerifyEmailPolicies(Study study,Directory directory){
}

Fixed version (ground truth):
/** 
 * There is a pull request pending to add this to the Stormpath Java SDK. So this code should be temporary.
 * @param study
 * @param directory
 */
private void adjustVerifyEmailPolicies(Study study,Directory directory){
  logger.info("String_Node_Str");
  try {
    EmailTemplate ve=study.getVerifyEmailTemplate();
    BridgeConfig config=BridgeConfigFactory.getConfig();
    CredentialsProvider provider=new BasicCredentialsProvider();
    UsernamePasswordCredentials credentials=new UsernamePasswordCredentials(config.getStormpathId(),config.getStormpathSecret());
    provider.setCredentials(AuthScope.ANY,credentials);
    HttpClient client=HttpClientBuilder.create().setDefaultCredentialsProvider(provider).build();
    ObjectNode directoryNode=getGet(client,directory.getHref());
    String accountCreationUrl=directoryNode.get("String_Node_Str").get("String_Node_Str").asText();
    ObjectNode accountPolicyNode=getGet(client,accountCreationUrl);
    String verificationEmailTemplatesUrl=accountPolicyNode.get("String_Node_Str").get("String_Node_Str").asText();
    accountPolicyNode.put("String_Node_Str","String_Node_Str");
    accountPolicyNode.put("String_Node_Str","String_Node_Str");
    accountPolicyNode.put("String_Node_Str","String_Node_Str");
    getPost(client,accountCreationUrl,accountPolicyNode);
    ObjectNode templateNode=getGet(client,verificationEmailTemplatesUrl);
    String templateUrl=templateNode.get("String_Node_Str").get(0).get("String_Node_Str").asText();
    ObjectNode template=getGet(client,templateUrl);
    template.put("String_Node_Str",study.getSponsorName());
    template.put("String_Node_Str",String.format("String_Node_Str",study.getSponsorName(),study.getSupportEmail()));
    String subject=partiallyResolveTemplate(ve.getSubject(),study);
    template.put("String_Node_Str",subject);
    String body=partiallyResolveTemplate(ve.getBody(),study);
    template.put("String_Node_Str",body);
    template.remove("String_Node_Str");
    template.put("String_Node_Str",ve.getMimeType() == MimeType.HTML ? "String_Node_Str" : "String_Node_Str");
    String link=String.format("String_Node_Str",BridgeConfigFactory.getConfig().getBaseURL(),study.getIdentifier());
    ((ObjectNode)template.get("String_Node_Str")).put("String_Node_Str",link);
    getPost(client,templateUrl,template);
  }
 catch (  Throwable throwable) {
    throw new BridgeServiceException(throwable);
  }
}
Program: 25783
Project: 25783
Buggy source:
private static ObjectNode getPost(HttpClient client,String url,ObjectNode node) throws Exception {
  ObjectMapper mapper=new ObjectMapper();
  HttpPost post=new HttpPost(url);
  post.setHeader("String_Node_Str","String_Node_Str");
  post.setHeader("String_Node_Str","String_Node_Str");
  post.setEntity(new StringEntity(mapper.writeValueAsString(mapper.writeValueAsString(node)),"String_Node_Str"));
  HttpResponse response=client.execute(post);
  ObjectNode object=(ObjectNode)mapper.readTree(EntityUtils.toString(response.getEntity(),"String_Node_Str"));
  System.out.println("String_Node_Str" + url + "String_Node_Str"+ mapper.writeValueAsString(node)+ "String_Node_Str"+ mapper.writeValueAsString(object));
  return object;
}

Fixed version (ground truth):
private ObjectNode getPost(HttpClient client,String url,ObjectNode node) throws Exception {
  HttpPost post=new HttpPost(url);
  post.setHeader("String_Node_Str","String_Node_Str");
  post.setHeader("String_Node_Str","String_Node_Str");
  post.setEntity(new StringEntity(MAPPER.writeValueAsString(node),"String_Node_Str"));
  HttpResponse response=client.execute(post);
  ObjectNode object=(ObjectNode)MAPPER.readTree(EntityUtils.toString(response.getEntity(),"String_Node_Str"));
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + url + "String_Node_Str"+ MAPPER.writeValueAsString(node)+ "String_Node_Str"+ MAPPER.writeValueAsString(object));
  }
  return object;
}
Program: 25784
Project: 25784
Buggy source:
public DynamoTaskEvent build(){
  DynamoTaskEvent event=new DynamoTaskEvent();
  event.setHealthCode(healthCode);
  event.setTimestamp((timestamp == null) ? null : timestamp);
  event.setEventId(getEventId());
  Validate.entityThrowingException(TaskEventValidator.INSTANCE,event);
  return event;
}

Fixed version (ground truth):
public DynamoTaskEvent build(){
  DynamoTaskEvent event=new DynamoTaskEvent();
  event.setHealthCode(healthCode);
  event.setTimestamp((timestamp == null) ? null : timestamp);
  event.setEventId(getEventId());
  event.setAnswerValue(answerValue);
  Validate.entityThrowingException(TaskEventValidator.INSTANCE,event);
  return event;
}
Program: 25785
Project: 25785
Buggy source:
private String getEventId(){
  if (type == null) {
    return null;
  }
  String typeName=type.name().toLowerCase();
  if (objectId != null && eventType != null && value != null) {
    return String.format("String_Node_Str",typeName,objectId,eventType.name().toLowerCase(),value);
  }
 else   if (objectId != null && eventType != null) {
    return String.format("String_Node_Str",typeName,objectId,eventType.name().toLowerCase());
  }
 else   if (objectId != null) {
    return String.format("String_Node_Str",typeName,objectId);
  }
  return typeName;
}

Fixed version (ground truth):
private String getEventId(){
  if (type == null) {
    return null;
  }
  if (type == TaskEventObjectType.ENROLLMENT) {
    return type.name().toLowerCase();
  }
  String typeName=type.name().toLowerCase();
  if (objectId != null && eventType != null) {
    return String.format("String_Node_Str",typeName,objectId,eventType.name().toLowerCase());
  }
 else   if (objectId != null) {
    return String.format("String_Node_Str",typeName,objectId);
  }
  return typeName;
}
Program: 25786
Project: 25786
Buggy source:
@Override public Map<String,DateTime> getTaskEventMap(String healthCode){
  checkNotNull(healthCode);
  DynamoTaskEvent hashKey=new DynamoTaskEvent();
  hashKey.setHealthCode(healthCode);
  DynamoDBQueryExpression<DynamoTaskEvent> query=new DynamoDBQueryExpression<DynamoTaskEvent>().withHashKeyValues(hashKey);
  PaginatedQueryList<DynamoTaskEvent> queryResults=mapper.query(DynamoTaskEvent.class,query);
  Builder<String,DateTime> builder=ImmutableMap.<String,DateTime>builder();
  for (  DynamoTaskEvent event : queryResults) {
    builder.put(event.getEventId(),new DateTime(event.getTimestamp()));
  }
  return builder.build();
}

Fixed version (ground truth):
@Override public Map<String,DateTime> getTaskEventMap(String healthCode){
  checkNotNull(healthCode);
  DynamoTaskEvent hashKey=new DynamoTaskEvent();
  hashKey.setHealthCode(healthCode);
  DynamoDBQueryExpression<DynamoTaskEvent> query=new DynamoDBQueryExpression<DynamoTaskEvent>().withHashKeyValues(hashKey);
  PaginatedQueryList<DynamoTaskEvent> queryResults=mapper.query(DynamoTaskEvent.class,query);
  Builder<String,DateTime> builder=ImmutableMap.<String,DateTime>builder();
  for (  DynamoTaskEvent event : queryResults) {
    builder.put(getEventMapKey(event),new DateTime(event.getTimestamp()));
  }
  return builder.build();
}
Program: 25787
Project: 25787
Buggy source:
@Override public void validate(Object object,Errors errors){
  DynamoTaskEvent event=(DynamoTaskEvent)object;
  if (isBlank(event.getHealthCode())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (event.getTimestamp() == null) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (event.getEventId() == null) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void validate(Object object,Errors errors){
  DynamoTaskEvent event=(DynamoTaskEvent)object;
  if (isBlank(event.getHealthCode())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (event.getTimestamp() == null) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (event.getEventId() == null) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
 else   if (event.getEventId().endsWith("String_Node_Str") && isBlank(event.getAnswerValue())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
}
Program: 25788
Project: 25788
Buggy source:
@Test public void canCrudEvent(){
  DateTime time1=DateTime.now();
  DateTime time2=time1.plusDays(1);
  DateTime time3=time2.plusDays(1);
  TaskEvent event=new DynamoTaskEvent.Builder().withHealthCode("String_Node_Str").withObjectType(TaskEventObjectType.ENROLLMENT).withTimestamp(time1).build();
  taskEventDao.publishEvent(event);
  event=new DynamoTaskEvent.Builder().withHealthCode("String_Node_Str").withObjectType(TaskEventObjectType.SURVEY).withEventType(TaskEventType.FINISHED).withTimestamp(time3).withObjectId("String_Node_Str").build();
  taskEventDao.publishEvent(event);
  Map<String,DateTime> map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(2,map.size());
  assertEquals(time1,map.get("String_Node_Str"));
  assertEquals(time3,map.get("String_Node_Str"));
  event=new DynamoTaskEvent.Builder().withHealthCode("String_Node_Str").withObjectType(TaskEventObjectType.ENROLLMENT).withTimestamp(time2).build();
  taskEventDao.publishEvent(event);
  map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(time2,map.get("String_Node_Str"));
  taskEventDao.deleteTaskEvents("String_Node_Str");
  map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(0,map.size());
}

Fixed version (ground truth):
@Test public void canCrudEvent(){
  DateTime time1=DateTime.now();
  DateTime time2=time1.plusDays(1);
  DateTime time3=time1.plusDays(2);
  DateTime time4=time1.plusDays(3);
  DateTime time5=time1.plusDays(4);
  TaskEvent event=getEnrollmentEvent(time1);
  taskEventDao.publishEvent(event);
  event=getSurveyFinishedEvent(time2);
  taskEventDao.publishEvent(event);
  event=getQuestionAnsweredEvent(time3,"String_Node_Str");
  taskEventDao.publishEvent(event);
  Map<String,DateTime> map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(3,map.size());
  assertEquals(time1,map.get("String_Node_Str"));
  assertEquals(time2,map.get("String_Node_Str"));
  assertEquals(time3,map.get("String_Node_Str"));
  event=getQuestionAnsweredEvent(time4,"String_Node_Str");
  taskEventDao.publishEvent(event);
  map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(time4,map.get("String_Node_Str"));
  event=getQuestionAnsweredEvent(time5,"String_Node_Str");
  taskEventDao.publishEvent(event);
  map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(time5,map.get("String_Node_Str"));
  assertNull(map.get("String_Node_Str"));
  taskEventDao.deleteTaskEvents("String_Node_Str");
  map=taskEventDao.getTaskEventMap("String_Node_Str");
  assertEquals(0,map.size());
}
Program: 25789
Project: 25789
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void run(){
  Stopwatch stopwatch=Stopwatch.createUnstarted();
  for (  UploadValidationHandler oneHandler : handlerList) {
    String handlerName=oneHandler.getClass().getName();
    stopwatch.start();
    try {
      oneHandler.handle(context);
    }
 catch (    RuntimeException|UploadValidationException ex) {
      context.setSuccess(false);
      context.addMessage(String.format("String_Node_Str",handlerName,ex.getClass().getName(),ex.getMessage()));
      logger.info(String.format("String_Node_Str" + "String_Node_Str",handlerName,context.getStudy().getIdentifier(),context.getUpload().getUploadId(),context.getUpload().getFilename(),ex.getClass().getName(),ex.getMessage()),ex);
      break;
    }
catch (    Throwable t) {
      logger.error(String.format("String_Node_Str" + "String_Node_Str",handlerName,context.getStudy().getIdentifier(),context.getUpload().getUploadId(),context.getUpload().getFilename(),t.getClass().getName(),t.getMessage()),t);
      break;
    }
 finally {
      long elapsedMillis=stopwatch.elapsed(TimeUnit.MILLISECONDS);
      stopwatch.reset();
      logger.info(String.format("String_Node_Str",handlerName,elapsedMillis));
    }
  }
  UploadStatus status=context.getSuccess() ? UploadStatus.SUCCEEDED : UploadStatus.VALIDATION_FAILED;
  uploadDao.writeValidationStatus(context.getUpload(),status,context.getMessageList());
  logger.info(String.format("String_Node_Str",context.getStudy().getIdentifier(),context.getUpload().getUploadId(),status));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void run(){
  Stopwatch stopwatch=Stopwatch.createUnstarted();
  for (  UploadValidationHandler oneHandler : handlerList) {
    String handlerName=oneHandler.getClass().getName();
    stopwatch.start();
    try {
      oneHandler.handle(context);
    }
 catch (    Throwable ex) {
      context.setSuccess(false);
      context.addMessage(String.format("String_Node_Str",handlerName,ex.getClass().getName(),ex.getMessage()));
      if (ex instanceof Error) {
        logger.error(String.format("String_Node_Str" + "String_Node_Str",handlerName,context.getStudy().getIdentifier(),context.getUpload().getUploadId(),context.getUpload().getFilename(),ex.getClass().getName(),ex.getMessage()),ex);
      }
 else {
        logger.info(String.format("String_Node_Str" + "String_Node_Str",handlerName,context.getStudy().getIdentifier(),context.getUpload().getUploadId(),context.getUpload().getFilename(),ex.getClass().getName(),ex.getMessage()),ex);
      }
      break;
    }
 finally {
      long elapsedMillis=stopwatch.elapsed(TimeUnit.MILLISECONDS);
      stopwatch.reset();
      logger.info(String.format("String_Node_Str",handlerName,elapsedMillis));
    }
  }
  UploadStatus status=context.getSuccess() ? UploadStatus.SUCCEEDED : UploadStatus.VALIDATION_FAILED;
  uploadDao.writeValidationStatus(context.getUpload(),status,context.getMessageList());
  logger.info(String.format("String_Node_Str",context.getStudy().getIdentifier(),context.getUpload().getUploadId(),status));
}
Program: 25790
Project: 25790
Buggy source:
@Test public void happyCase(){
  List<UploadValidationHandler> handlerList=ImmutableList.<UploadValidationHandler>of(new MessageHandler("String_Node_Str"),new MessageHandler("String_Node_Str"),new MessageHandler("String_Node_Str"));
  UploadValidationContext ctx=testHelper(handlerList,UploadStatus.SUCCEEDED);
  List<String> messageList=ctx.getMessageList();
  assertEquals(3,messageList.size());
  assertEquals("String_Node_Str",messageList.get(0));
  assertEquals("String_Node_Str",messageList.get(1));
  assertEquals("String_Node_Str",messageList.get(2));
}

Fixed version (ground truth):
@Test public void happyCase(){
  List<UploadValidationHandler> handlerList=ImmutableList.<UploadValidationHandler>of(new MessageHandler("String_Node_Str"),new MessageHandler("String_Node_Str"),new MessageHandler("String_Node_Str"));
  UploadValidationContext ctx=testHelper(handlerList,UploadStatus.SUCCEEDED);
  assertTrue(ctx.getSuccess());
  List<String> messageList=ctx.getMessageList();
  assertEquals(3,messageList.size());
  assertEquals("String_Node_Str",messageList.get(0));
  assertEquals("String_Node_Str",messageList.get(1));
  assertEquals("String_Node_Str",messageList.get(2));
}
Program: 25791
Project: 25791
Buggy source:
private static void testExceptionHelper(Class<? extends Exception> exClass) throws Exception {
  UploadValidationHandler fooHandler=new MessageHandler("String_Node_Str");
  UploadValidationHandler barHandler=mock(UploadValidationHandler.class);
  doThrow(exClass).when(barHandler).handle(notNull(UploadValidationContext.class));
  UploadValidationHandler bazHandler=mock(UploadValidationHandler.class);
  verifyZeroInteractions(bazHandler);
  List<UploadValidationHandler> handlerList=ImmutableList.of(fooHandler,barHandler,bazHandler);
  UploadValidationContext ctx=testHelper(handlerList,UploadStatus.VALIDATION_FAILED);
  List<String> messageList=ctx.getMessageList();
  assertEquals(2,messageList.size());
  assertEquals("String_Node_Str",messageList.get(0));
  assertFalse(Strings.isNullOrEmpty(messageList.get(1)));
}

Fixed version (ground truth):
private static void testExceptionHelper(Class<? extends Throwable> exClass) throws Exception {
  UploadValidationHandler fooHandler=new MessageHandler("String_Node_Str");
  UploadValidationHandler barHandler=mock(UploadValidationHandler.class);
  doThrow(exClass).when(barHandler).handle(notNull(UploadValidationContext.class));
  UploadValidationHandler bazHandler=mock(UploadValidationHandler.class);
  verifyZeroInteractions(bazHandler);
  List<UploadValidationHandler> handlerList=ImmutableList.of(fooHandler,barHandler,bazHandler);
  UploadValidationContext ctx=testHelper(handlerList,UploadStatus.VALIDATION_FAILED);
  assertFalse(ctx.getSuccess());
  List<String> messageList=ctx.getMessageList();
  assertEquals(2,messageList.size());
  assertEquals("String_Node_Str",messageList.get(0));
  assertFalse(Strings.isNullOrEmpty(messageList.get(1)));
}
Program: 25792
Project: 25792
Buggy source:
@Override public Account getAccount(Study study,String email){
  checkNotNull(study);
  checkArgument(isNotBlank(email));
  Directory directory=client.getResource(study.getStormpathHref(),Directory.class);
  AccountList accounts=directory.getAccounts(Accounts.where(Accounts.email().eqIgnoreCase(email)).withGroups().withGroupMemberships());
  if (accounts.iterator().hasNext()) {
    com.stormpath.sdk.account.Account acct=accounts.iterator().next();
    return new StormpathAccount(study.getStudyIdentifier(),acct,encryptors);
  }
  return null;
}

Fixed version (ground truth):
@Override public Account getAccount(Study study,String email){
  checkNotNull(study);
  checkArgument(isNotBlank(email));
  Directory directory=client.getResource(study.getStormpathHref(),Directory.class);
  AccountList accounts=directory.getAccounts(Accounts.where(Accounts.email().eqIgnoreCase(email)).withCustomData().withGroups().withGroupMemberships());
  if (accounts.iterator().hasNext()) {
    com.stormpath.sdk.account.Account acct=accounts.iterator().next();
    return new StormpathAccount(study.getStudyIdentifier(),acct,encryptors);
  }
  return null;
}
Program: 25793
Project: 25793
Buggy source:
public String getStormpathSecret(){
  return getProperty(STORMPATH_SECRET);
}

Fixed version (ground truth):
public String getStormpathSecret(){
  return getProperty(ENTERPRISE_STORMPATH_SECRET);
}