nus-yam/ex-repair huggingface dataset:
Program: 84831
Project: 84831
Buggy source:
public IVRAuthenticationStatus checkAccess(String phoneNumber,String passcode,int attemptNumber,String sid){
  Patient patient=allPatients.findByMobileNumber(phoneNumber);
  if (patient == null) {
    ivrCallAudits.add(new IVRCallAudit(phoneNumber,sid,"String_Node_Str",IVRCallAudit.State.PASSCODE_ENTRY_FAILED));
    return IVRAuthenticationStatus.notFound();
  }
  if (allPatients.findByMobileNumberAndPasscode(phoneNumber,passcode) == null) {
    ivrCallAudits.add(new IVRCallAudit(phoneNumber,sid,patient.getId(),IVRCallAudit.State.PASSCODE_ENTRY_FAILED));
    IVRAuthenticationStatus ivrAuthenticationStatus=IVRAuthenticationStatus.notAuthenticated();
    ivrAuthenticationStatus.allowRetry(StringUtils.isEmpty(passcode) || !maxNoOfAttempts.equals(attemptNumber));
    ivrAuthenticationStatus.loginAttemptNumber(StringUtils.isEmpty(passcode) ? --attemptNumber : attemptNumber);
    return ivrAuthenticationStatus;
  }
  IVRAuthenticationStatus status=IVRAuthenticationStatus.authenticated(patient.getId());
  return status.active(patient.isActive());
}

Fixed version (ground truth):
public IVRAuthenticationStatus checkAccess(String phoneNumber,String passcode,int attemptNumber,String sid){
  Patient likelyPatient=allPatients.findByMobileNumber(phoneNumber);
  if (likelyPatient == null) {
    ivrCallAudits.add(new IVRCallAudit(phoneNumber,sid,"String_Node_Str",IVRCallAudit.State.PASSCODE_ENTRY_FAILED));
    return IVRAuthenticationStatus.notFound();
  }
  Patient patient=allPatients.findByMobileNumberAndPasscode(phoneNumber,passcode);
  if (patient == null) {
    ivrCallAudits.add(new IVRCallAudit(phoneNumber,sid,likelyPatient.getId(),IVRCallAudit.State.PASSCODE_ENTRY_FAILED));
    IVRAuthenticationStatus ivrAuthenticationStatus=IVRAuthenticationStatus.notAuthenticated();
    ivrAuthenticationStatus.allowRetry(StringUtils.isEmpty(passcode) || !maxNoOfAttempts.equals(attemptNumber));
    ivrAuthenticationStatus.loginAttemptNumber(StringUtils.isEmpty(passcode) ? --attemptNumber : attemptNumber);
    return ivrAuthenticationStatus;
  }
  IVRAuthenticationStatus status=IVRAuthenticationStatus.authenticated(patient.getId());
  return status.active(patient.isActive());
}
Program: 84832
Project: 84832
Buggy source:
@Test public void currentDosageReminder() throws IOException {
  String dosageId=scheduledJobDataService.currentJobId();
  logInfo("String_Node_Str",dosageId);
  caller.replyToCall(new PillReminderCallInfo(dosageId,1));
  IVRResponse ivrResponse=caller.enter("String_Node_Str");
  asksForCollectDtmfWith(ivrResponse,PILL_REMINDER_RESPONSE_MENU,ITS_TIME_FOR_THE_PILL,PILL_FROM_THE_BOTTLE);
}

Fixed version (ground truth):
@Test public void currentDosageReminder() throws IOException {
  String dosageId=scheduledJobDataService.currentJobId();
  logInfo("String_Node_Str",dosageId);
  caller.replyToCall(new PillReminderCallInfo(dosageId,1));
  IVRResponse ivrResponse=caller.enter("String_Node_Str");
  asksForCollectDtmfWith(ivrResponse,PILL_REMINDER_RESPONSE_MENU,ITS_TIME_FOR_THE_PILL,PILL_FROM_THE_BOTTLE);
  ivrResponse=caller.enter("String_Node_Str");
  audioFilePresent(ivrResponse,DOSE_RECORDED);
}
Program: 84834
Project: 84834
Buggy source:
@Test public void shouldAddReminderLagToDosageMinutes(){
  PillRegimenRequestMapper pillRegimenRequestMapper=new PillRegimenRequestMapper(allDrugs,properties);
  TreatmentAdvice treatmentAdvice=new TreatmentAdvice();
  Drug drug=mock(Drug.class);
  String reminderTimeLag="String_Node_Str";
  when(drug.fullName(Matchers.<String>any())).thenReturn("String_Node_Str");
  propertiesExpectations(reminderTimeLag);
  treatmentAdvice.setPatientId("String_Node_Str");
  when(allDrugs.get(Matchers.<String>any())).thenReturn(drug);
  List<DrugDosage> drugDosages=new ArrayList<DrugDosage>();
  LocalDate startDateForDrug1=DateUtil.newDate(2010,10,10);
  LocalDate endDateForDrug1=DateUtil.newDate(2010,12,10);
  LocalDate startDateForDrug2=DateUtil.newDate(2011,02,10);
  LocalDate endDateForDrug2=DateUtil.newDate(2011,06,10);
  drugDosages.add(drugDosage("String_Node_Str",startDateForDrug1,endDateForDrug1,Arrays.asList("String_Node_Str","String_Node_Str")));
  drugDosages.add(drugDosage("String_Node_Str",startDateForDrug2,endDateForDrug2,Arrays.asList("String_Node_Str","String_Node_Str")));
  treatmentAdvice.setDrugDosages(drugDosages);
  PillRegimenRequest request=pillRegimenRequestMapper.map(treatmentAdvice);
  DosageRequest dosageRequest=getByStartHour(9,request.getDosageRequests());
  Assert.assertTrue(Integer.valueOf(reminderTimeLag) == dosageRequest.getStartMinute());
}

Fixed version (ground truth):
@Test public void shouldAddReminderLagToDosageMinutes(){
  PillRegimenRequestMapper pillRegimenRequestMapper=new PillRegimenRequestMapper(allDrugs,properties);
  TreatmentAdvice treatmentAdvice=new TreatmentAdvice();
  Drug drug=mock(Drug.class);
  String reminderTimeLag="String_Node_Str";
  when(drug.fullName(Matchers.<String>any())).thenReturn("String_Node_Str");
  propertiesExpectations(reminderTimeLag);
  treatmentAdvice.setPatientId("String_Node_Str");
  when(allDrugs.get(Matchers.<String>any())).thenReturn(drug);
  List<DrugDosage> drugDosages=new ArrayList<DrugDosage>();
  LocalDate startDateForDrug1=DateUtil.newDate(2010,10,10);
  LocalDate endDateForDrug1=DateUtil.newDate(2010,12,10);
  LocalDate startDateForDrug2=DateUtil.newDate(2011,02,10);
  LocalDate endDateForDrug2=DateUtil.newDate(2011,06,10);
  drugDosages.add(drugDosage("String_Node_Str",startDateForDrug1,endDateForDrug1,Arrays.asList("String_Node_Str","String_Node_Str")));
  drugDosages.add(drugDosage("String_Node_Str",startDateForDrug2,endDateForDrug2,Arrays.asList("String_Node_Str","String_Node_Str")));
  treatmentAdvice.setDrugDosages(drugDosages);
  DailyPillRegimenRequest request=pillRegimenRequestMapper.map(treatmentAdvice);
  DosageRequest dosageRequest=getByStartHour(9,request.getDosageRequests());
  Assert.assertTrue(Integer.valueOf(reminderTimeLag) == dosageRequest.getStartMinute());
}
Program: 84835
Project: 84835
Buggy source:
@Test public void shouldCreatePillRegimenRequest(){
  TreatmentAdvice treatmentAdvice=new TreatmentAdvice();
  treatmentAdvice.setPatientId("String_Node_Str");
  controller.create(treatmentAdvice,uiModel);
  verify(requestMapper).map(treatmentAdvice);
  verify(pillReminderService).createNew(any(PillRegimenRequest.class));
}

Fixed version (ground truth):
@Test public void shouldCreatePillRegimenRequest(){
  TreatmentAdvice treatmentAdvice=new TreatmentAdvice();
  treatmentAdvice.setPatientId("String_Node_Str");
  controller.create(treatmentAdvice,uiModel);
  verify(requestMapper).map(treatmentAdvice);
  verify(pillReminderService).createNew(any(DailyPillRegimenRequest.class));
}
Program: 84836
Project: 84836
Buggy source:
@Test public void changeRegimenShouldEndCurrentRegimenAndCreateANewRegimen(){
  String existingTreatmentAdviceId="String_Node_Str";
  String treatmentAdviceId="String_Node_Str";
  String discontinuationReason="String_Node_Str";
  TreatmentAdvice existingTreatmentAdvice=TreatmentAdviceBuilder.startRecording().withId(existingTreatmentAdviceId).build();
  TreatmentAdvice newTreatmentAdvice=TreatmentAdviceBuilder.startRecording().withId(treatmentAdviceId).build();
  when(allTreatmentAdvices.get(existingTreatmentAdviceId)).thenReturn(existingTreatmentAdvice);
  String redirectURL=controller.changeRegimen(existingTreatmentAdviceId,discontinuationReason,newTreatmentAdvice,uiModel,request);
  assertThat(redirectURL,is("String_Node_Str"));
  assertThat(existingTreatmentAdvice.getReasonForDiscontinuing(),is(discontinuationReason));
  verify(allTreatmentAdvices).update(existingTreatmentAdvice);
  verify(allTreatmentAdvices).add(newTreatmentAdvice);
  verify(pillReminderService).renew(any(PillRegimenRequest.class));
}

Fixed version (ground truth):
@Test public void changeRegimenShouldEndCurrentRegimenAndCreateANewRegimen(){
  String existingTreatmentAdviceId="String_Node_Str";
  String treatmentAdviceId="String_Node_Str";
  String discontinuationReason="String_Node_Str";
  TreatmentAdvice existingTreatmentAdvice=TreatmentAdviceBuilder.startRecording().withId(existingTreatmentAdviceId).build();
  TreatmentAdvice newTreatmentAdvice=TreatmentAdviceBuilder.startRecording().withId(treatmentAdviceId).build();
  when(allTreatmentAdvices.get(existingTreatmentAdviceId)).thenReturn(existingTreatmentAdvice);
  String redirectURL=controller.changeRegimen(existingTreatmentAdviceId,discontinuationReason,newTreatmentAdvice,uiModel,request);
  assertThat(redirectURL,is("String_Node_Str"));
  assertThat(existingTreatmentAdvice.getReasonForDiscontinuing(),is(discontinuationReason));
  verify(allTreatmentAdvices).update(existingTreatmentAdvice);
  verify(allTreatmentAdvices).add(newTreatmentAdvice);
  verify(pillReminderService).renew(any(DailyPillRegimenRequest.class));
}
Program: 84837
Project: 84837
Buggy source:
public List<String> getMessageForNextDosage(DateTime nextDosageDateTime){
  List<String> messages=new ArrayList<String>();
  if (nextDosageDateTime.getHourOfDay() == 0 || nextDosageDateTime.getHourOfDay() == 12) {
    messages.add(iVRMessage.getNumberFilename(12));
  }
 else {
    messages.add(iVRMessage.getNumberFilename(nextDosageDateTime.getHourOfDay() % 12));
  }
  messages.add(iVRMessage.getNumberFilename(nextDosageDateTime.getMinuteOfHour()));
  messages.add(nextDosageDateTime.getHourOfDay() < 12 ? IVRMessage.IN_THE_MORNING : IVRMessage.IN_THE_EVENING);
  messages.add(nextDosageDateTime.toLocalDate().equals(DateUtil.today()) ? IVRMessage.TODAY : IVRMessage.TOMORROW);
  return messages;
}

Fixed version (ground truth):
public List<String> getMessageForNextDosage(DateTime nextDosageDateTime){
  List<String> messages=new ArrayList<String>();
  if (nextDosageDateTime.getHourOfDay() == 0 || nextDosageDateTime.getHourOfDay() == 12) {
    messages.add(iVRMessage.getNumberFilename(12));
  }
 else {
    messages.add(iVRMessage.getNumberFilename(nextDosageDateTime.getHourOfDay() % 12));
  }
  if (nextDosageDateTime.getMinuteOfHour() != 0) {
    messages.add(iVRMessage.getNumberFilename(nextDosageDateTime.getMinuteOfHour()));
  }
  messages.add(nextDosageDateTime.getHourOfDay() < 12 ? IVRMessage.IN_THE_MORNING : IVRMessage.IN_THE_EVENING);
  messages.add(nextDosageDateTime.toLocalDate().equals(DateUtil.today()) ? IVRMessage.TODAY : IVRMessage.TOMORROW);
  return messages;
}
Program: 84838
Project: 84838
Buggy source:
protected void waitForDojoElementToLoad(final String id,final String dojoClass){
  wait.until(new ExpectedCondition<Boolean>(){
    @Override public Boolean apply(    WebDriver webDriver){
      WebElement element=webDriver.findElement(By.id(id));
      return element != null && isNotBlank(element.getAttribute("String_Node_Str")) && element.getAttribute("String_Node_Str").contains(dojoClass);
    }
  }
);
}

Fixed version (ground truth):
protected void waitForDojoElementToLoad(final String id,final String dojoClass){
  wait.until(new ExpectedCondition<Boolean>(){
    @Override public Boolean apply(    WebDriver webDriver){
      try {
        WebElement element=webDriver.findElement(By.id(id));
        return element != null && isNotBlank(element.getAttribute("String_Node_Str")) && element.getAttribute("String_Node_Str").contains(dojoClass);
      }
 catch (      StaleElementReferenceException ex) {
        return false;
      }
    }
  }
);
}
Program: 84839
Project: 84839
Buggy source:
private boolean hasNoTreatmentAdvice(Patient patient){
  return allTreatmentAdvices.findByPatientId(patient.getId()) != null;
}

Fixed version (ground truth):
private boolean hasNoTreatmentAdvice(Patient patient){
  return allTreatmentAdvices.findByPatientId(patient.getId()) == null;
}
Program: 84840
Project: 84840
Buggy source:
private int withHours(){
  return ampm.equals("String_Node_Str") ? hours : hours + 12;
}

Fixed version (ground truth):
private int withHours(){
  return ampm.equals("String_Node_Str") || hours == 12 ? hours : hours + 12;
}
Program: 84841
Project: 84841
Buggy source:
@Override public void update(Clinician entity){
  entity.setEncryptedPassword(encryptor.encrypt(entity.getPassword()));
  super.update(entity);
}

Fixed version (ground truth):
@Override public void update(Clinician clinician){
  Clinician dbClinician=get(clinician.getId());
  clinician.setRevision(dbClinician.getRevision());
  clinician.setEncryptedPassword(dbClinician.getEncryptedPassword());
  super.update(clinician);
}
Program: 84842
Project: 84842
Buggy source:
@RequestMapping(method=RequestMethod.PUT) public String update(@Valid Clinician clinician,BindingResult bindingResult,Model uiModel,HttpServletRequest httpServletRequest){
  if (bindingResult.hasErrors()) {
    uiModel.addAttribute("String_Node_Str",clinician);
    return "String_Node_Str";
  }
  uiModel.asMap().clear();
  Clinician dbClinician=clinicians.get(clinician.getId());
  clinician.setRevision(dbClinician.getRevision());
  clinician.setEncryptedPassword(dbClinician.getEncryptedPassword());
  clinicians.update(clinician);
  return "String_Node_Str" + encodeUrlPathSegment(clinician.getId().toString(),httpServletRequest);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.PUT) public String update(@Valid Clinician clinician,BindingResult bindingResult,Model uiModel,HttpServletRequest httpServletRequest){
  if (bindingResult.hasErrors()) {
    uiModel.addAttribute("String_Node_Str",clinician);
    return "String_Node_Str";
  }
  uiModel.asMap().clear();
  clinicians.update(clinician);
  return "String_Node_Str" + encodeUrlPathSegment(clinician.getId().toString(),httpServletRequest);
}
Program: 84843
Project: 84843
Buggy source:
@Override public String handle(IVRRequest ivrRequest,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession(false);
  Integer attempt=getAttempt(session);
  if (isLast(attempt)) {
    session.invalidate();
    return userNotAuthorisedAction.handle(ivrRequest,request,response);
  }
  if (ivrRequest.hasNoData())   return dtmfResponseWith(ivrRequest,IVRMessage.TAMA_IVR_REMIND_FOR_PIN);
  session.setAttribute(IVR.Attributes.NUMBER_OF_ATTEMPTS,++attempt);
  String playText=messages.get(IVRMessage.TAMA_IVR_ASK_FOR_PIN_AFTER_FAILURE);
  String playAudio=messages.get(IVRMessage.TAMA_SIGNATURE_MUSIC_URL);
  CollectDtmf collectDtmf=new IVRDtmfBuilder().withPlayText(playText).withPlayAudio(playAudio).create();
  Response ivrResponse=new IVRResponseBuilder().withSid(ivrRequest.getSid()).withCollectDtmf(collectDtmf).create();
  return ivrResponse.getXML();
}

Fixed version (ground truth):
@Override public String handle(IVRRequest ivrRequest,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession(false);
  Integer attempt=getAttempt(session);
  if (isLast(attempt))   return userNotAuthorisedAction.handle(ivrRequest,request,response);
  if (ivrRequest.hasNoData())   return dtmfResponseWith(ivrRequest,IVRMessage.TAMA_IVR_REMIND_FOR_PIN);
  session.setAttribute(IVR.Attributes.NUMBER_OF_ATTEMPTS,++attempt);
  String playText=messages.get(IVRMessage.TAMA_IVR_ASK_FOR_PIN_AFTER_FAILURE);
  String playAudio=messages.get(IVRMessage.TAMA_SIGNATURE_MUSIC_URL);
  CollectDtmf collectDtmf=new IVRDtmfBuilder().withPlayText(playText).withPlayAudio(playAudio).create();
  Response ivrResponse=new IVRResponseBuilder().withSid(ivrRequest.getSid()).withCollectDtmf(collectDtmf).create();
  return ivrResponse.getXML();
}
Program: 84844
Project: 84844
Buggy source:
@Override public String handle(IVRRequest ivrRequest,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession(false);
  String id=(String)session.getAttribute(IVR.Attributes.PATIENT_DOCUMENT_ID);
  audits.add(new IVRCallAudit(ivrRequest.getCid(),ivrRequest.getSid(),id,IVRCallAudit.State.PASSCODE_ENTRY_FAILED));
  return hangUpResponseWith(ivrRequest,IVRMessage.TAMA_IVR_REPORT_USER_NOT_AUTHORISED);
}

Fixed version (ground truth):
@Override public String handle(IVRRequest ivrRequest,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession(false);
  String id=(String)session.getAttribute(IVR.Attributes.PATIENT_DOCUMENT_ID);
  audits.add(new IVRCallAudit(ivrRequest.getCid(),ivrRequest.getSid(),id,IVRCallAudit.State.PASSCODE_ENTRY_FAILED));
  session.invalidate();
  return hangUpResponseWith(ivrRequest,IVRMessage.TAMA_IVR_REPORT_USER_NOT_AUTHORISED);
}
Program: 84845
Project: 84845
Buggy source:
@Test public void shouldGoToUserNotAuthorisedActionIfItIsTheLastAttempt(){
  IVRRequest ivrRequest=new IVRRequest("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  when(request.getSession(false)).thenReturn(session);
  when(session.getAttribute(IVR.Attributes.NUMBER_OF_ATTEMPTS)).thenReturn(new Integer(4));
  when(userNotAuthorisedAction.handle(ivrRequest,request,response)).thenReturn("String_Node_Str");
  String handle=retryAction.handle(ivrRequest,request,response);
  verify(session).invalidate();
  verify(userNotAuthorisedAction).handle(ivrRequest,request,response);
  assertEquals("String_Node_Str",handle);
}

Fixed version (ground truth):
@Test public void shouldGoToUserNotAuthorisedActionIfItIsTheLastAttempt(){
  IVRRequest ivrRequest=new IVRRequest("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  when(request.getSession(false)).thenReturn(session);
  when(session.getAttribute(IVR.Attributes.NUMBER_OF_ATTEMPTS)).thenReturn(new Integer(4));
  when(userNotAuthorisedAction.handle(ivrRequest,request,response)).thenReturn("String_Node_Str");
  String handle=retryAction.handle(ivrRequest,request,response);
  verify(userNotAuthorisedAction).handle(ivrRequest,request,response);
  assertEquals("String_Node_Str",handle);
}
Program: 84846
Project: 84846
Buggy source:
@Test public void shouldReturnUserNptAuthorisedResponse(){
  IVRRequest ivrRequest=new IVRRequest("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  when(request.getSession(false)).thenReturn(session);
  when(messages.get(IVRMessage.TAMA_IVR_REPORT_USER_NOT_AUTHORISED)).thenReturn("String_Node_Str");
  when(session.getAttribute(IVR.Attributes.PATIENT_DOCUMENT_ID)).thenReturn("String_Node_Str");
  String handle=userNotAuthorisedAction.handle(ivrRequest,request,response);
  IVRAuditMatcher matcher=new IVRAuditMatcher(ivrRequest.getSid(),ivrRequest.getCid(),"String_Node_Str",IVRCallAudit.State.PASSCODE_ENTRY_FAILED);
  verify(audits).add(argThat(matcher));
  assertEquals("String_Node_Str",StringUtils.replace(handle,"String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldReturnUserNptAuthorisedResponse(){
  IVRRequest ivrRequest=new IVRRequest("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  when(request.getSession(false)).thenReturn(session);
  when(messages.get(IVRMessage.TAMA_IVR_REPORT_USER_NOT_AUTHORISED)).thenReturn("String_Node_Str");
  when(session.getAttribute(IVR.Attributes.PATIENT_DOCUMENT_ID)).thenReturn("String_Node_Str");
  String handle=userNotAuthorisedAction.handle(ivrRequest,request,response);
  IVRAuditMatcher matcher=new IVRAuditMatcher(ivrRequest.getSid(),ivrRequest.getCid(),"String_Node_Str",IVRCallAudit.State.PASSCODE_ENTRY_FAILED);
  verify(audits).add(argThat(matcher));
  verify(session).invalidate();
  assertEquals("String_Node_Str",StringUtils.replace(handle,"String_Node_Str","String_Node_Str"));
}
Program: 84847
Project: 84847
Buggy source:
public Gender(String type){
  this.type=type;
}

Fixed version (ground truth):
public Gender(String id){
  this.setId(id);
}
Program: 84848
Project: 84848
Buggy source:
@GenerateView public Clinician findByUsername(String username){
  List<Clinician> clinicians=queryView("String_Node_Str",username);
  if (clinicians != null && !clinicians.isEmpty()) {
    Clinician clinician=clinicians.get(0);
    Clinic clinic=clinics.get(clinician.getClinicId());
    clinician.setClinic(clinic);
    clinician.setPassword(encryptor.decrypt(clinician.getEncryptedPassword()));
    return clinician;
  }
  return null;
}

Fixed version (ground truth):
@GenerateView public Clinician findByUsername(String username){
  List<Clinician> clinicians=queryView("String_Node_Str",username);
  if (clinicians != null && !clinicians.isEmpty()) {
    Clinician clinician=clinicians.get(0);
    loadDependencies(clinician);
    clinician.setPassword(encryptor.decrypt(clinician.getEncryptedPassword()));
    return clinician;
  }
  return null;
}
Program: 84849
Project: 84849
Buggy source:
@Override public Clinician get(String id){
  Clinician clinician=super.get(id);
  clinician.setPassword(encryptor.decrypt(clinician.getPassword()));
  return clinician;
}

Fixed version (ground truth):
@Override public Clinician get(String id){
  Clinician clinician=super.get(id);
  loadDependencies(clinician);
  clinician.setPassword(encryptor.decrypt(clinician.getPassword()));
  return clinician;
}
Program: 84850
Project: 84850
Buggy source:
@Override public void load(){
  genders.add(new Gender("String_Node_Str"));
  genders.add(new Gender("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void load(){
  genders.add(Gender.newGender("String_Node_Str"));
  genders.add(Gender.newGender("String_Node_Str"));
}
Program: 84851
Project: 84851
Buggy source:
@Before public void before(){
  super.before();
  gender=new Gender("String_Node_Str");
  genders.add(gender);
  ivrLanguage=new IVRLanguage("String_Node_Str");
  ivrLanguages.add(ivrLanguage);
}

Fixed version (ground truth):
@Before public void before(){
  super.before();
  gender=Gender.newGender("String_Node_Str");
  genders.add(gender);
  ivrLanguage=new IVRLanguage("String_Node_Str");
  ivrLanguages.add(ivrLanguage);
}
Program: 84852
Project: 84852
Buggy source:
@After public void after(){
  super.after();
  markForDeletion(gender);
  markForDeletion(ivrLanguage);
}

Fixed version (ground truth):
@After public void after(){
  markForDeletion(gender);
  markForDeletion(ivrLanguage);
  super.after();
}
Program: 84853
Project: 84853
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public String findByPatientId(@RequestParam String patientId,Model uiModel,HttpServletRequest httpServletRequest){
  List<Patient> patientList=patients.findByPatientId(patientId);
  if (patientList == null || patientList.isEmpty()) {
    uiModel.addAttribute(PATIENT_ID_NOT_FOUND,patientId);
    String referer=httpServletRequest.getHeader("String_Node_Str");
    referer=referer.replaceFirst("String_Node_Str" + PATIENT_ID_NOT_FOUND + "String_Node_Str","String_Node_Str");
    referer=referer.replaceFirst("String_Node_Str" + PATIENT_ID_NOT_FOUND + "String_Node_Str","String_Node_Str");
    return "String_Node_Str" + referer;
  }
  return REDIRECT_SHOW_PATIENT + encodeUrlPathSegment(patientList.get(0).getId(),httpServletRequest);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public String findByPatientId(@RequestParam String patientId,Model uiModel,HttpServletRequest httpServletRequest){
  List<Patient> patientList=patients.findByPatientId(patientId);
  if (patientList == null || patientList.isEmpty()) {
    uiModel.addAttribute(PATIENT_ID_NOT_FOUND,patientId);
    String referer=httpServletRequest.getHeader("String_Node_Str");
    referer=referer.replaceFirst("String_Node_Str" + PATIENT_ID_NOT_FOUND + "String_Node_Str","String_Node_Str");
    return "String_Node_Str" + referer;
  }
  return REDIRECT_SHOW_PATIENT + encodeUrlPathSegment(patientList.get(0).getId(),httpServletRequest);
}
Program: 84854
Project: 84854
Buggy source:
@Override public void onChange(boolean selfChange){
  updateBattery(null);
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  updateBattery();
}
Program: 84857
Project: 84857
Buggy source:
@Override public String toString(){
  return String.format("String_Node_Str",id,firstName,lastName);
}

Fixed version (ground truth):
@Override public String toString(){
  return String.format("String_Node_Str",getId(),getName());
}
Program: 84858
Project: 84858
Buggy source:
@GET @Produces(APPLICATION_XML) public String getAllUsers_Xml(){
  final StringBuffer buf=new StringBuffer();
  final ListIterator<User> iter=users.listIterator();
  while (iter.hasNext()) {
    if (!iter.hasPrevious()) {
      buf.append("String_Node_Str");
    }
    buf.append(iter.next().toXml());
    if (!iter.hasNext()) {
      buf.append("String_Node_Str");
    }
  }
  return buf.toString();
}

Fixed version (ground truth):
@GET @Produces(APPLICATION_XML) public List<User> getAllUsers_Xml(){
  return users;
}
Program: 84859
Project: 84859
Buggy source:
@Override public void onEnable(){
  PluginDescriptionFile pdfFile=this.getDescription();
  File worldsYml=new File(getDataFolder() + "String_Node_Str");
  File mainYml=new File(getDataFolder() + "String_Node_Str");
  setupFile(worldsYml);
  setupFile(mainYml);
  if (!setupDependencies())   this.getServer().getPluginManager().disablePlugin(this);
  wConfig=new Configuration(worldsYml);
  wConfig.load();
  mConfig=getConfiguration();
  List<World> worlds=getServer().getWorlds();
  for (  World world : worlds)   setupWorld(world.getName());
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.WORLD_LOAD,worldLoadListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.CUSTOM_EVENT,combatListener,Priority.Monitor,this);
  log.info(plugName + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  PluginDescriptionFile pdfFile=this.getDescription();
  File worldsYml=new File(getDataFolder() + "String_Node_Str");
  File mainYml=new File(getDataFolder() + "String_Node_Str");
  setupFile(worldsYml);
  setupFile(mainYml);
  wConfig=new Configuration(worldsYml);
  wConfig.load();
  mConfig=getConfiguration();
  List<World> worlds=getServer().getWorlds();
  for (  World world : worlds)   setupWorld(world.getName());
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.WORLD_LOAD,worldLoadListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.CUSTOM_EVENT,combatListener,Priority.Monitor,this);
  log.info(plugName + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}
Program: 84860
Project: 84860
Buggy source:
public void onEntityDeath(EntityDeathEvent event){
  if (KKKreditzHandler.isValidHandler() || !isValidEntity(event.getEntity()))   return;
  LivingEntity cEntity=(LivingEntity)event.getEntity();
  if (entityMap.containsKey(cEntity)) {
    Player player=entityMap.remove(cEntity);
    if (player == null)     return;
 else {
      CreatureType cType=getCType(cEntity);
      if (!KKPermissions.reward(player,cType.getName()))       return;
      KKWorldConfig conf=KillaKreditz.worldConfig.get(player.getWorld().getName());
      if (conf.get(cType) == null)       return;
 else {
        double reward=getReward(conf.getMinReward(cType),conf.getMaxReward(cType),conf.getChance(cType)) * KKPermissions.multiplier(player);
        if (reward == 0)         return;
 else {
          KKKreditzHandler.rewardPlayer(player.getName(),reward);
          player.sendMessage("String_Node_Str" + KKKreditzHandler.formatCurrency(reward) + "String_Node_Str"+ cType.getName());
        }
      }
    }
  }
}

Fixed version (ground truth):
public void onEntityDeath(EntityDeathEvent event){
  if (KKKreditzHandler.isValidHandler() || !isValidEntity(event.getEntity()))   return;
  LivingEntity cEntity=(LivingEntity)event.getEntity();
  if (entityMap.containsKey(cEntity)) {
    Player player=entityMap.remove(cEntity);
    if (player == null)     return;
 else {
      CreatureType cType=getCType(cEntity);
      if (!KKPermissions.reward(player,cType.getName().toLowerCase()))       return;
      KKWorldConfig conf=KillaKreditz.worldConfig.get(player.getWorld().getName());
      if (conf.get(cType) == null)       return;
 else {
        double reward=getReward(conf.getMinReward(cType),conf.getMaxReward(cType),conf.getChance(cType)) * KKPermissions.multiplier(player);
        if (reward == 0)         return;
 else {
          KKKreditzHandler.rewardPlayer(player.getName(),reward);
          player.sendMessage("String_Node_Str" + KKKreditzHandler.formatCurrency(reward) + "String_Node_Str"+ cType.getName());
        }
      }
    }
  }
}
Program: 84862
Project: 84862
Buggy source:
@SuppressWarnings("String_Node_Str") private void performSearch(){
  if (!"String_Node_Str".equals(searchTermField.getText().toString())) {
    progress=ProgressDialog.show(this,"String_Node_Str","String_Node_Str");
    Map<String,String> params=populateParameterMap();
    SearchResultsRetrieverTask retriever=new SearchResultsRetrieverTask(MainActivity.this);
    retriever.execute(params);
    hideSearchFields();
  }
 else {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void performSearch(){
  if (!"String_Node_Str".equals(searchTermField.getText().toString())) {
    progress=ProgressDialog.show(this,"String_Node_Str","String_Node_Str");
    Map<String,String> params=populateParameterMap();
    SearchResultsRetrieverTask retriever=new SearchResultsRetrieverTask(MainActivity.this);
    retriever.execute(params);
    hideSearchFields();
    if (!displayedMessage) {
      Toast msg=Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG);
      msg.setGravity(Gravity.BOTTOM,0,0);
      msg.show();
      displayedMessage=true;
    }
  }
 else {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}
Program: 84863
Project: 84863
Buggy source:
private void hideSearchFields(){
  InputMethodManager imm=(InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(searchTermField.getWindowToken(),0);
  searchTermField.setVisibility(View.GONE);
  submitButton.setVisibility(View.GONE);
  if (!displayedMessage) {
    Toast msg=Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG);
    msg.setGravity(Gravity.BOTTOM,0,0);
    msg.show();
    displayedMessage=true;
  }
}

Fixed version (ground truth):
private void hideSearchFields(){
  InputMethodManager imm=(InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(searchTermField.getWindowToken(),0);
  searchTermField.setVisibility(View.GONE);
  submitButton.setVisibility(View.GONE);
}
Program: 84865
Project: 84865
Buggy source:
public void move(Direction direction){
  prevRow=row;
  prevCol=col;
switch (direction) {
case N:
    row--;
  break;
case S:
row++;
break;
case E:
col--;
break;
case W:
col++;
break;
case NE:
row--;
col--;
break;
case NW:
row--;
col++;
break;
case SE:
row++;
col--;
break;
case SW:
row++;
col++;
break;
}
}

Fixed version (ground truth):
public void move(Direction direction){
  prevRow=row;
  prevCol=col;
switch (direction) {
case N:
    row--;
  break;
case S:
row++;
break;
case E:
col++;
break;
case W:
col--;
break;
case NE:
row--;
col++;
break;
case NW:
row--;
col--;
break;
case SE:
row++;
col++;
break;
case SW:
row++;
col--;
break;
}
}
Program: 84866
Project: 84866
Buggy source:
public void setWithinBounds(int maxRow,int maxCol){
  if (row > maxRow) {
    row=maxRow;
  }
  if (col > maxCol) {
    col=maxCol;
  }
}

Fixed version (ground truth):
public void setWithinBounds(int maxRow,int maxCol){
  if (row > maxRow) {
    row=maxRow;
  }
 else   if (row < 0) {
    row=0;
  }
  if (col > maxCol) {
    col=maxCol;
  }
 else   if (col < 0) {
    col=0;
  }
}
Program: 84867
Project: 84867
Buggy source:
public String getPassword(int startRow,int startCol,Sequence sequence){
  String pass=this.get(startRow,startCol);
  int row=startRow;
  int col=startCol;
  for (  SequenceItem i : sequence.getItemList()) {
    Direction dir=i.getDirection();
    for (int x=0; x < i.getLength(); x++) {
switch (dir) {
case N:
        row--;
      break;
case S:
    row++;
case E:
  col--;
case W:
col++;
case NE:
row--;
col--;
case NW:
row++;
col++;
case SE:
row++;
col--;
case SW:
row--;
col++;
}
if (row >= this.rows()) row=this.rows() - 1;
if (col >= this.cols()) col=this.cols() - 1;
pass+=this.get(row,col);
}
}
return pass;
}

Fixed version (ground truth):
public String getPassword(int startRow,int startCol,Sequence sequence){
  String pass=this.get(startRow,startCol);
  int row=startRow;
  int col=startCol;
  for (  SequenceItem i : sequence.getItemList()) {
    Direction dir=i.getDirection();
    for (int x=0; x < i.getLength(); x++) {
switch (dir) {
case N:
        row--;
      break;
case S:
    row++;
case E:
  col--;
case W:
col++;
case NE:
row--;
col--;
case NW:
row--;
col++;
case SE:
row++;
col--;
case SW:
row++;
col++;
}
if (row >= this.rows()) row=this.rows() - 1;
if (col >= this.cols()) col=this.cols() - 1;
pass+=this.get(row,col);
}
}
return pass;
}
Program: 84868
Project: 84868
Buggy source:
public static CtClass getCtClass(String className) throws BytecodeManipulationException {
  try {
    return classPool.get(className);
  }
 catch (  Exception e) {
    throw new BytecodeManipulationException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static CtClass getCtClass(String className) throws BytecodeManipulationException {
  try {
    return classPool.get(className);
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 84869
Project: 84869
Buggy source:
public boolean parseShares(){
  ArrayList<String> lines=createShares();
  ArrayList<String> worldList=new ArrayList<String>();
  for (  String line : lines) {
    String[] content=line.split("String_Node_Str");
    if ((content[0].matches("String_Node_Str"))) {
      String[] worlds=content[0].split("String_Node_Str");
      if (plugin.getServer().getWorld(worlds[0]) == null) {
        MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
        return false;
      }
 else {
        if (worldList.contains(worlds[0])) {
          MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
          return false;
        }
        worldList.add(worlds[0]);
        int i=1;
        while (i < worlds.length) {
          if (plugin.getServer().getWorld(worlds[i]) == null) {
            MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
          }
 else {
            if (worldList.contains(worlds[i])) {
              MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
              return false;
            }
 else {
              plugin.sharesMap.put(worlds[i],worlds[0]);
            }
          }
          i++;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean parseShares(){
  ArrayList<String> lines=createShares();
  ArrayList<String> worldList=new ArrayList<String>();
  for (  String line : lines) {
    String[] content=line.split("String_Node_Str");
    if (!(content[0].matches("String_Node_Str"))) {
      String[] worlds=content[0].split("String_Node_Str");
      if (plugin.getServer().getWorld(worlds[0]) == null) {
        MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
        return false;
      }
 else {
        if (worldList.contains(worlds[0])) {
          MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
          return false;
        }
        worldList.add(worlds[0]);
        int i=1;
        while (i < worlds.length) {
          if (plugin.getServer().getWorld(worlds[i]) == null) {
            MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
          }
 else {
            if (worldList.contains(worlds[i])) {
              MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
              return false;
            }
 else {
              plugin.sharesMap.put(worlds[i],worlds[0]);
              System.out.println("String_Node_Str" + worlds[i] + "String_Node_Str"+ worlds[0]);
            }
          }
          i++;
        }
      }
    }
  }
  return true;
}
Program: 84870
Project: 84870
Buggy source:
public void deleteIfUnused(String inventory){
  String[] parts=inventory.split("String_Node_Str");
  if (parts[0].matches("String_Node_Str")) {
    if (parts.length != 2 || this.sharesMap.containsKey(parts[1])) {
      inventories.remove(inventory);
      debugger.debugEvent(MultiInvEvent.INVENTORY_DELETE,new String[]{inventory});
    }
  }
}

Fixed version (ground truth):
public void deleteIfUnused(String inventory){
  String[] parts=inventory.split("String_Node_Str");
  if (parts[1].matches("String_Node_Str")) {
    if (parts.length != 2 || this.sharesMap.containsKey(parts[1])) {
      inventories.remove(inventory);
      debugger.debugEvent(MultiInvEvent.INVENTORY_DELETE_UNUSED,new String[]{inventory});
    }
  }
}
Program: 84871
Project: 84871
Buggy source:
@Override public void onEnable(){
  PluginDescriptionFile pdfFile=this.getDescription();
  pluginName=pdfFile.getName();
  Boolean shares=fileReader.parseShares();
  if (shares == false) {
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
  }
 else {
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
  }
  deSerialize();
  if (shares) {
    cleanWorldInventories();
  }
  log.info("String_Node_Str" + pluginName + "String_Node_Str"+ pdfFile.getVersion()+ "String_Node_Str");
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.WORLD_SAVE,worldListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.WORLD_LOAD,worldListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_LOGIN,playerListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_JOIN,playerListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_QUIT,playerListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_TELEPORT,playerListener,Priority.Monitor,this);
  setupPermissions();
}

Fixed version (ground truth):
@Override public void onEnable(){
  PluginDescriptionFile pdfFile=this.getDescription();
  pluginName=pdfFile.getName();
  Boolean shares=fileReader.parseShares();
  if (shares == false) {
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
    pluginEnabled=false;
  }
 else {
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
    pluginEnabled=true;
  }
  deSerialize();
  if (shares) {
    cleanWorldInventories();
  }
  log.info("String_Node_Str" + pluginName + "String_Node_Str"+ pdfFile.getVersion()+ "String_Node_Str");
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.WORLD_SAVE,worldListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.WORLD_LOAD,worldListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_LOGIN,playerListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_JOIN,playerListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_QUIT,playerListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.PLAYER_TELEPORT,playerListener,Priority.Monitor,this);
  setupPermissions();
}
Program: 84873
Project: 84873
Buggy source:
public void loadWorldInventory(Player player,String world){
  boolean newMember=true;
  if (plugin.sharesMap.containsKey(world)) {
    world=plugin.sharesMap.get(world);
  }
  String worldCheckName="String_Node_Str" + world;
  for (  String inventory : plugin.inventories.keySet()) {
    String[] parts=inventory.split("String_Node_Str");
    if (parts[0].equals(player.getName())) {
      newMember=false;
      if (parts[1].equals(worldCheckName)) {
        loadInventory(plugin.inventories.get(inventory),player);
        plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_LOAD,new String[]{inventory});
        return;
      }
    }
  }
  if (!newMember) {
    loadNewInventory(player);
  }
}

Fixed version (ground truth):
public void loadWorldInventory(Player player,String world){
  boolean newMember=true;
  if (plugin.sharesMap.containsKey(world)) {
    world=plugin.sharesMap.get(world);
  }
  String worldCheckName="String_Node_Str" + world;
  for (  String inventory : plugin.inventories.keySet()) {
    String[] parts=inventory.split("String_Node_Str");
    if (parts[0].equals(player.getName())) {
      newMember=false;
      if (parts[1].equals(worldCheckName)) {
        loadInventory(plugin.inventories.get(inventory),player);
        plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_LOAD,new String[]{inventory});
        return;
      }
    }
  }
  if (!newMember) {
    loadNewInventory(player);
    plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_LOAD_NEW,new String[]{player.getName()});
  }
}
Program: 84874
Project: 84874
Buggy source:
public void onPlayerTeleport(PlayerTeleportEvent event){
  String worldTo=event.getTo().getWorld().getName();
  Player player=event.getPlayer();
  String worldFrom=event.getFrom().getWorld().getName();
  plugin.debugger.debugEvent(MultiInvEvent.WORLD_CHANGE,new String[]{player.getName(),worldFrom,worldTo});
  String sharedWorld=plugin.sharesMap.get(worldTo);
  if (sharedWorld != null) {
    worldTo=sharedWorld;
    plugin.serialize();
  }
  if (!(worldTo.equals(worldFrom))) {
    plugin.playerInventory.storeWorldInventory(player,worldFrom);
    plugin.playerInventory.loadWorldInventory(player,worldTo);
  }
}

Fixed version (ground truth):
public void onPlayerTeleport(PlayerTeleportEvent event){
  String worldTo=event.getTo().getWorld().getName();
  Player player=event.getPlayer();
  String worldFrom=event.getFrom().getWorld().getName();
  plugin.debugger.debugEvent(MultiInvEvent.WORLD_CHANGE,new String[]{player.getName(),worldFrom,worldTo});
  if (plugin.sharesMap.containsKey(worldTo)) {
    worldTo=plugin.sharesMap.get(worldTo);
  }
  if (plugin.sharesMap.containsKey(worldFrom)) {
    worldFrom=plugin.sharesMap.get(worldFrom);
  }
  if (!(worldTo.equals(worldFrom))) {
    plugin.playerInventory.storeWorldInventory(player,worldFrom);
    plugin.playerInventory.loadWorldInventory(player,worldTo);
  }
}
Program: 84875
Project: 84875
Buggy source:
public boolean parseShares(){
  ArrayList<String> lines=createShares();
  ArrayList<String> worldList=new ArrayList<String>();
  for (  String line : lines) {
    String[] content=line.split("String_Node_Str");
    if (!(content[0].matches("String_Node_Str"))) {
      String[] worlds=content[0].split("String_Node_Str");
      if (plugin.getServer().getWorld(worlds[0]) == null) {
        MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
        return false;
      }
 else {
        if (worldList.contains(worlds[0])) {
          MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
          return false;
        }
        worldList.add(worlds[0]);
        int i=1;
        while (i < worlds.length) {
          if (plugin.getServer().getWorld(worlds[i]) == null) {
            MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
          }
 else {
            if (worldList.contains(worlds[i])) {
              MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
              return false;
            }
 else {
              plugin.sharesMap.put(worlds[i],worlds[0]);
            }
          }
          i++;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean parseShares(){
  ArrayList<String> lines=createShares();
  ArrayList<String> worldList=new ArrayList<String>();
  for (  String line : lines) {
    String[] content=line.split("String_Node_Str");
    if (!(content[0].matches("String_Node_Str"))) {
      String[] worlds=content[0].split("String_Node_Str");
      if (plugin.getServer().getWorld(worlds[0]) == null) {
        MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
        return false;
      }
 else {
        if (worldList.contains(worlds[0])) {
          MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
          return false;
        }
        worldList.add(worlds[0]);
        int i=1;
        while (i < worlds.length) {
          if (plugin.getServer().getWorld(worlds[i]) == null) {
            MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
          }
 else {
            if (worldList.contains(worlds[i])) {
              MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
              return false;
            }
 else {
              worldList.add(worlds[i]);
              plugin.sharesMap.put(worlds[i],worlds[0]);
            }
          }
          i++;
        }
      }
    }
  }
  return true;
}
Program: 84876
Project: 84876
Buggy source:
@Override public void onWorldSave(WorldSaveEvent event){
  for (  Player player : plugin.getServer().getOnlinePlayers()) {
    plugin.playerInventory.storeWorldInventory(player,player.getWorld().getName());
  }
  plugin.serialize();
}

Fixed version (ground truth):
@Override public void onWorldSave(WorldSaveEvent event){
  for (  Player player : plugin.getServer().getOnlinePlayers()) {
    plugin.playerInventory.storeWorldInventory(player,player.getWorld().getName());
  }
}
Program: 84877
Project: 84877
Buggy source:
@Override public void onWorldLoad(WorldLoadEvent event){
  MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ event.getWorld().getName()+ "String_Node_Str");
  Boolean shares=plugin.fileReader.parseShares();
  if (shares == false) {
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
    return;
  }
  MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
  plugin.cleanWorldInventories();
}

Fixed version (ground truth):
@Override public void onWorldLoad(WorldLoadEvent event){
  MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ event.getWorld().getName()+ "String_Node_Str");
  Boolean shares=plugin.fileReader.parseShares();
  if (shares == false) {
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
    MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
    plugin.pluginEnabled=false;
    return;
  }
  MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str");
  plugin.pluginEnabled=true;
  plugin.cleanWorldInventories();
}
Program: 84878
Project: 84878
Buggy source:
private void convertFormat(String inventory){
  String inventory2=inventory.replaceAll("String_Node_Str","String_Node_Str");
  if (!(inventory.equals(inventory2))) {
    String[] parts=inventory2.split("String_Node_Str");
    if (parts.length > 2) {
      inventory2=parts[0] + "String_Node_Str" + parts[1];
    }
    inventories.put(inventory2,inventories.get(inventory));
    debugger.debugEvent(MultiInvEvent.INVENTORY_ADDED,new String[]{inventory2});
    inventories.remove(inventory);
    debugger.debugEvent(MultiInvEvent.INVENTORY_DELETE,new String[]{inventory});
    log.info("String_Node_Str" + pluginName + "String_Node_Str"+ inventory+ "String_Node_Str"+ inventory2);
  }
  return;
}

Fixed version (ground truth):
private String convertFormat(String inventory){
  String inventory2=inventory.replaceAll("String_Node_Str","String_Node_Str");
  if (!(inventory.equals(inventory2))) {
    String[] parts=inventory2.split("String_Node_Str");
    if (parts.length > 2) {
      inventory2=parts[0] + "String_Node_Str" + parts[1];
    }
    inventories.put(inventory2,inventories.get(inventory));
    debugger.debugEvent(MultiInvEvent.INVENTORY_ADDED,new String[]{inventory2});
    inventories.remove(inventory);
    debugger.debugEvent(MultiInvEvent.INVENTORY_DELETE,new String[]{inventory});
    log.info("String_Node_Str" + pluginName + "String_Node_Str"+ inventory+ "String_Node_Str"+ inventory2);
  }
  return inventory2;
}
Program: 84879
Project: 84879
Buggy source:
public void deleteIfUnused(String inventory){
  String[] parts=inventory.split("String_Node_Str");
  if (parts.length != 2 || this.sharesMap.contains(parts[1])) {
    inventories.remove(inventory);
    debugger.debugEvent(MultiInvEvent.INVENTORY_DELETE,new String[]{inventory});
  }
}

Fixed version (ground truth):
public void deleteIfUnused(String inventory){
  String[] parts=inventory.split("String_Node_Str");
  if (parts.length != 2 || this.sharesMap.containsKey(parts[1])) {
    inventories.remove(inventory);
    debugger.debugEvent(MultiInvEvent.INVENTORY_DELETE,new String[]{inventory});
  }
}