nus-yam/ex-repair huggingface dataset:
Program: 69361
Project: 69361
Buggy source:
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  if (formLayout instanceof FormLayoutContainer) {
    FormLayoutContainer layoutCont=(FormLayoutContainer)formLayout;
    if (assessedIdentityInfosCtrl != null) {
      layoutCont.put("String_Node_Str",assessedIdentityInfosCtrl.getInitialComponent());
    }
 else     if (anonym) {
      layoutCont.contextPut("String_Node_Str",Boolean.TRUE);
    }
    Results results=new Results(false,"String_Node_Str");
    results.setSessionState(testSessionState);
    layoutCont.contextPut("String_Node_Str",results);
    TestResult testResult=assessmentResult.getTestResult();
    if (testResult != null) {
      extractOutcomeVariable(testResult.getItemVariables(),results);
    }
    if (resultsOnfinish == ShowResultsOnFinish.sections || resultsOnfinish == ShowResultsOnFinish.details) {
      initFormSections(layoutCont);
    }
  }
}

Fixed version (ground truth):
@Override protected void initForm(FormItemContainer formLayout,Controller listener,UserRequest ureq){
  if (formLayout instanceof FormLayoutContainer) {
    FormLayoutContainer layoutCont=(FormLayoutContainer)formLayout;
    layoutCont.contextPut("String_Node_Str",new Boolean(withPrint));
    layoutCont.contextPut("String_Node_Str",Boolean.FALSE);
    if (withPrint) {
      layoutCont.contextPut("String_Node_Str","String_Node_Str" + layoutCont.getFormItemComponent().getDispatchID());
      layoutCont.getFormItemComponent().addListener(this);
    }
    if (assessedIdentityInfosCtrl != null) {
      layoutCont.put("String_Node_Str",assessedIdentityInfosCtrl.getInitialComponent());
    }
 else     if (anonym) {
      layoutCont.contextPut("String_Node_Str",Boolean.TRUE);
    }
    Results results=new Results(false,"String_Node_Str");
    results.setSessionState(testSessionState);
    layoutCont.contextPut("String_Node_Str",results);
    TestResult testResult=assessmentResult.getTestResult();
    if (testResult != null) {
      extractOutcomeVariable(testResult.getItemVariables(),results);
    }
    if (resultsOnfinish == ShowResultsOnFinish.sections || resultsOnfinish == ShowResultsOnFinish.details) {
      initFormSections(layoutCont);
    }
  }
}
Program: 69363
Project: 69363
Buggy source:
public AssessmentResultController(UserRequest ureq,WindowControl wControl,Identity assessedIdentity,boolean anonym,AssessmentTestSession candidateSession,ShowResultsOnFinish resultsOnfinish,File fUnzippedDirRoot,String mapperUri){
  super(ureq,wControl,"String_Node_Str");
  this.anonym=anonym;
  this.mapperUri=mapperUri;
  this.resultsOnfinish=resultsOnfinish;
  ResourceLocator fileResourceLocator=new PathResourceLocator(fUnzippedDirRoot.toPath());
  inputResourceLocator=ImsQTI21Resource.createResolvingResourceLocator(fileResourceLocator);
  assessmentObjectUri=qtiService.createAssessmentObjectUri(fUnzippedDirRoot);
  if (!anonym && assessedIdentity != null) {
    assessedIdentityInfosCtrl=new UserShortDescription(ureq,getWindowControl(),assessedIdentity);
    listenTo(assessedIdentityInfosCtrl);
  }
  resolvedAssessmentTest=qtiService.loadAndResolveAssessmentTest(fUnzippedDirRoot,false,false);
  testSessionState=qtiService.loadTestSessionState(candidateSession);
  assessmentResult=qtiService.getAssessmentResult(candidateSession);
  candidateSessionContext=new TerminatedStaticCandidateSessionContext(candidateSession);
  initForm(ureq);
}

Fixed version (ground truth):
public AssessmentResultController(UserRequest ureq,WindowControl wControl,Identity assessedIdentity,boolean anonym,AssessmentTestSession candidateSession,ShowResultsOnFinish resultsOnfinish,File fUnzippedDirRoot,String mapperUri,boolean withPrint){
  super(ureq,wControl,"String_Node_Str");
  this.anonym=anonym;
  this.mapperUri=mapperUri;
  this.withPrint=withPrint;
  this.resultsOnfinish=resultsOnfinish;
  this.assessedIdentity=assessedIdentity;
  this.candidateSession=candidateSession;
  this.fUnzippedDirRoot=fUnzippedDirRoot;
  ResourceLocator fileResourceLocator=new PathResourceLocator(fUnzippedDirRoot.toPath());
  inputResourceLocator=ImsQTI21Resource.createResolvingResourceLocator(fileResourceLocator);
  assessmentObjectUri=qtiService.createAssessmentObjectUri(fUnzippedDirRoot);
  if (!anonym && assessedIdentity != null) {
    assessedIdentityInfosCtrl=new UserShortDescription(ureq,getWindowControl(),assessedIdentity);
    listenTo(assessedIdentityInfosCtrl);
  }
  resolvedAssessmentTest=qtiService.loadAndResolveAssessmentTest(fUnzippedDirRoot,false,false);
  testSessionState=qtiService.loadTestSessionState(candidateSession);
  assessmentResult=qtiService.getAssessmentResult(candidateSession);
  candidateSessionContext=new TerminatedStaticCandidateSessionContext(candidateSession);
  initForm(ureq);
}
Program: 69364
Project: 69364
Buggy source:
/** 
 * Update the status and show the test results the test is at the end and the configuration allow it.
 * @param ureq
 * @return true if the results are visible
 */
private boolean updateStatusAndResults(UserRequest ureq){
  resultsVisible=false;
  if (testSessionController.getTestSessionState().isEnded() && deliveryOptions.getShowResultsOnFinish() != null && !ShowResultsOnFinish.none.equals(deliveryOptions.getShowResultsOnFinish())) {
    removeAsListenerAndDispose(resultCtrl);
    resultCtrl=new AssessmentResultController(ureq,getWindowControl(),assessedIdentity,anonym,AssessmentTestDisplayController.this.getCandidateSession(),deliveryOptions.getShowResultsOnFinish(),fUnzippedDirRoot,mapperUri);
    listenTo(resultCtrl);
    flc.add("String_Node_Str",resultCtrl.getInitialFormItem());
    resultsVisible=true;
  }
  if (testSessionController.getTestSessionState().isEnded() || testSessionController.findNextEnterableTestPart() == null) {
    closeTestButton.setI18nKey("String_Node_Str");
  }
 else {
    closeTestButton.setI18nKey("String_Node_Str");
  }
  closeResultsButton.setVisible(resultsVisible && showCloseResults);
  updateQtiWorksStatus();
  return resultsVisible;
}

Fixed version (ground truth):
/** 
 * Update the status and show the test results the test is at the end and the configuration allow it.
 * @param ureq
 * @return true if the results are visible
 */
private boolean updateStatusAndResults(UserRequest ureq){
  resultsVisible=false;
  if (testSessionController.getTestSessionState().isEnded() && deliveryOptions.getShowResultsOnFinish() != null && !ShowResultsOnFinish.none.equals(deliveryOptions.getShowResultsOnFinish())) {
    removeAsListenerAndDispose(resultCtrl);
    resultCtrl=new AssessmentResultController(ureq,getWindowControl(),assessedIdentity,anonym,AssessmentTestDisplayController.this.getCandidateSession(),deliveryOptions.getShowResultsOnFinish(),fUnzippedDirRoot,mapperUri,false);
    listenTo(resultCtrl);
    flc.add("String_Node_Str",resultCtrl.getInitialFormItem());
    resultsVisible=true;
  }
  if (testSessionController.getTestSessionState().isEnded() || testSessionController.findNextEnterableTestPart() == null) {
    closeTestButton.setI18nKey("String_Node_Str");
  }
 else {
    closeTestButton.setI18nKey("String_Node_Str");
  }
  closeResultsButton.setVisible(resultsVisible && showCloseResults);
  updateQtiWorksStatus();
  return resultsVisible;
}
Program: 69365
Project: 69365
Buggy source:
private void doOpenResult(UserRequest ureq,AssessmentTestSession session){
  if (resultCtrl != null)   return;
  FileResourceManager frm=FileResourceManager.getInstance();
  File fUnzippedDirRoot=frm.unzipFileResource(session.getTestEntry().getOlatResource());
  URI assessmentObjectUri=qtiService.createAssessmentObjectUri(fUnzippedDirRoot);
  File submissionDir=qtiService.getAssessmentResultFile(session);
  String mapperUri=registerCacheableMapper(null,"String_Node_Str" + session.getTestEntry().getKey(),new ResourcesMapper(assessmentObjectUri,submissionDir));
  resultCtrl=new AssessmentResultController(ureq,getWindowControl(),assessedIdentity,false,session,ShowResultsOnFinish.details,fUnzippedDirRoot,mapperUri);
  listenTo(resultCtrl);
  cmc=new CloseableModalController(getWindowControl(),"String_Node_Str",resultCtrl.getInitialComponent(),true,translate("String_Node_Str"));
  cmc.activate();
  listenTo(cmc);
}

Fixed version (ground truth):
private void doOpenResult(UserRequest ureq,AssessmentTestSession session){
  if (resultCtrl != null)   return;
  FileResourceManager frm=FileResourceManager.getInstance();
  File fUnzippedDirRoot=frm.unzipFileResource(session.getTestEntry().getOlatResource());
  URI assessmentObjectUri=qtiService.createAssessmentObjectUri(fUnzippedDirRoot);
  File submissionDir=qtiService.getAssessmentResultFile(session);
  String mapperUri=registerCacheableMapper(null,"String_Node_Str" + session.getTestEntry().getKey(),new ResourcesMapper(assessmentObjectUri,submissionDir));
  resultCtrl=new AssessmentResultController(ureq,getWindowControl(),assessedIdentity,false,session,ShowResultsOnFinish.details,fUnzippedDirRoot,mapperUri,true);
  listenTo(resultCtrl);
  cmc=new CloseableModalController(getWindowControl(),"String_Node_Str",resultCtrl.getInitialComponent(),true,translate("String_Node_Str"));
  cmc.activate();
  listenTo(cmc);
}
Program: 69366
Project: 69366
Buggy source:
/** 
 * Remove the runtime from the GUI stack only.
 * @param ureq
 * @param event
 */
private void doExitAssessment(UserRequest ureq,Event event){
  if (displayContainerController != null) {
    displayContainerController.deactivate(ureq);
  }
 else {
    getWindowControl().pop();
  }
  removeHistory(ureq);
  OLATResourceable ores=OresHelper.createOLATResourceableInstance("String_Node_Str",-1l);
  addToHistory(ureq,ores,null);
  if (!assessmentStopped) {
    assessmentStopped=true;
    singleUserEventCenter.deregisterFor(this,assessmentInstanceOres);
    AssessmentEvent assessmentStoppedEvent=new AssessmentEvent(AssessmentEvent.TYPE.STOPPED,userSession);
    singleUserEventCenter.fireEventToListenersOf(assessmentStoppedEvent,assessmentEventOres);
  }
  fireEvent(ureq,event);
}

Fixed version (ground truth):
/** 
 * Remove the runtime from the GUI stack only.
 * @param ureq
 * @param event
 * @param testEnded true if the test was ended and not suspended or cancelled (use to control increment of attempts)
 */
private void doExitAssessment(UserRequest ureq,Event event,boolean testEnded){
  if (displayContainerController != null) {
    displayContainerController.deactivate(ureq);
  }
 else {
    getWindowControl().pop();
  }
  removeHistory(ureq);
  OLATResourceable ores=OresHelper.createOLATResourceableInstance("String_Node_Str",-1l);
  addToHistory(ureq,ores,null);
  if (!assessmentStopped) {
    assessmentStopped=true;
    singleUserEventCenter.deregisterFor(this,assessmentInstanceOres);
    AssessmentEvent assessmentStoppedEvent=new AssessmentEvent(AssessmentEvent.TYPE.STOPPED,userSession);
    singleUserEventCenter.fireEventToListenersOf(assessmentStoppedEvent,assessmentEventOres);
  }
  if (testEnded) {
    incrementAttempts.set(true);
  }
  fireEvent(ureq,event);
}
Program: 69367
Project: 69367
Buggy source:
@Override protected void event(UserRequest ureq,Controller source,Event event){
  if (source == displayCtrl) {
    if (event == Event.CANCELLED_EVENT) {
      doExitAssessment(ureq,event);
      exposeResults(ureq);
      showInfo("String_Node_Str");
    }
 else     if ("String_Node_Str".equals(event.getCommand())) {
      doExitAssessment(ureq,event);
      exposeResults(ureq);
      showInfo("String_Node_Str");
    }
 else     if (event instanceof QTI21Event) {
      QTI21Event qe=(QTI21Event)event;
      if (QTI21Event.EXIT.equals(qe.getCommand())) {
        if (!displayCtrl.isResultsVisible()) {
          doExitAssessment(ureq,event);
          initAssessment(ureq);
        }
      }
 else       if (QTI21Event.CLOSE_RESULTS.equals(qe.getCommand())) {
        doExitAssessment(ureq,event);
        initAssessment(ureq);
      }
    }
  }
  super.event(ureq,source,event);
}

Fixed version (ground truth):
@Override protected void event(UserRequest ureq,Controller source,Event event){
  if (source == displayCtrl) {
    if (event == Event.CANCELLED_EVENT) {
      doExitAssessment(ureq,event,false);
      exposeResults(ureq);
      showInfo("String_Node_Str");
    }
 else     if ("String_Node_Str".equals(event.getCommand())) {
      doExitAssessment(ureq,event,false);
      exposeResults(ureq);
      showInfo("String_Node_Str");
    }
 else     if (event instanceof QTI21Event) {
      QTI21Event qe=(QTI21Event)event;
      if (QTI21Event.EXIT.equals(qe.getCommand())) {
        if (!displayCtrl.isResultsVisible()) {
          doExitAssessment(ureq,event,true);
          initAssessment(ureq);
        }
      }
 else       if (QTI21Event.CLOSE_RESULTS.equals(qe.getCommand())) {
        doExitAssessment(ureq,event,true);
        initAssessment(ureq);
      }
    }
  }
  super.event(ureq,source,event);
}
Program: 69369
Project: 69369
Buggy source:
private void generateStatusOfTranscodings(){
  availableTranscodings=new HashMap<>();
  availableTranscodings.put(240,new HashSet<Long>());
  availableTranscodings.put(360,new HashSet<Long>());
  availableTranscodings.put(480,new HashSet<Long>());
  availableTranscodings.put(720,new HashSet<Long>());
  availableTranscodings.put(1080,new HashSet<Long>());
  availableTranscodings.put(2160,new HashSet<Long>());
  List<String> types=new ArrayList<>();
  types.add("String_Node_Str");
  olatresources=olatresourceManager.findResourceByTypes(types);
  for (  OLATResource videoResource : olatresources) {
    List<VideoTranscoding> transcodings=videoManager.getVideoTranscodings(videoResource);
    for (    VideoTranscoding videoTranscoding : transcodings) {
      if (videoTranscoding.getStatus() != -1 || true) {
        availableTranscodings.get(videoTranscoding.getResolution()).add(videoTranscoding.getVideoResource().getKey());
      }
    }
  }
}

Fixed version (ground truth):
private void generateStatusOfTranscodings(){
  availableTranscodings=new HashMap<>();
  availableTranscodings.put(240,new HashSet<Long>());
  availableTranscodings.put(360,new HashSet<Long>());
  availableTranscodings.put(480,new HashSet<Long>());
  availableTranscodings.put(720,new HashSet<Long>());
  availableTranscodings.put(1080,new HashSet<Long>());
  availableTranscodings.put(2160,new HashSet<Long>());
  List<String> types=new ArrayList<>();
  types.add("String_Node_Str");
  olatresources=olatresourceManager.findResourceByTypes(types);
  for (  OLATResource videoResource : olatresources) {
    List<VideoTranscoding> transcodings=videoManager.getVideoTranscodings(videoResource);
    for (    VideoTranscoding videoTranscoding : transcodings) {
      if (videoTranscoding != null && videoTranscoding.getStatus() != -1) {
        Set<Long> oneResolution=availableTranscodings.get(videoTranscoding.getResolution());
        if (oneResolution != null) {
          oneResolution.add(videoTranscoding.getVideoResource().getKey());
        }
      }
    }
  }
}
Program: 69371
Project: 69371
Buggy source:
@Override protected void formInnerEvent(UserRequest ureq,FormItem source,FormEvent event){
  if (newBinderDropdown == source) {
    doNewBinderCallout(ureq);
  }
 else   if (newBinderFromCourseButton == source) {
    doNewBinderFromCourse(ureq);
  }
 else   if (source instanceof FormLink) {
    FormLink link=(FormLink)source;
    String cmd=link.getCmd();
    if ("String_Node_Str".equals(cmd)) {
      BinderRow row=(BinderRow)link.getUserObject();
      Activateable2 activateable=doOpenBinder(ureq,row);
      if (activateable != null) {
        activateable.activate(ureq,null,null);
      }
    }
  }
  super.formInnerEvent(ureq,source,event);
}

Fixed version (ground truth):
@Override protected void formInnerEvent(UserRequest ureq,FormItem source,FormEvent event){
  if (newBinderDropdown == source) {
    doNewBinderCallout(ureq);
  }
 else   if (newBinderFromCourseButton == source) {
    doNewBinderFromCourse(ureq);
  }
 else   if (tableEl == source) {
    if (event instanceof SelectionEvent) {
      SelectionEvent se=(SelectionEvent)event;
      String cmd=se.getCommand();
      if ("String_Node_Str".equals(cmd)) {
        BinderRow row=model.getObject(se.getIndex());
        Activateable2 activateable=doOpenBinder(ureq,row);
        if (activateable != null) {
          activateable.activate(ureq,null,null);
        }
      }
    }
  }
 else   if (source instanceof FormLink) {
    FormLink link=(FormLink)source;
    String cmd=link.getCmd();
    if ("String_Node_Str".equals(cmd)) {
      BinderRow row=(BinderRow)link.getUserObject();
      Activateable2 activateable=doOpenBinder(ureq,row);
      if (activateable != null) {
        activateable.activate(ureq,null,null);
      }
    }
  }
  super.formInnerEvent(ureq,source,event);
}
Program: 69372
Project: 69372
Buggy source:
@Override public void initTools(){
  editLink(!openInEditMode);
  stackPanel.addTool(editLink,Align.left);
  editMetadataLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
  editMetadataLink.setIconLeftCSS("String_Node_Str");
  editMetadataLink.setVisible(secCallback.canEditPageMetadata(page,assignments));
  stackPanel.addTool(editMetadataLink,Align.left);
  moveToTrashLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
  moveToTrashLink.setIconLeftCSS("String_Node_Str");
  moveToTrashLink.setVisible(secCallback.canDeletePage(page));
  stackPanel.addTool(moveToTrashLink,Align.right);
  if (secCallback.canRestorePage(page)) {
    restoreLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
    restoreLink.setIconLeftCSS("String_Node_Str");
    stackPanel.addTool(restoreLink,Align.left);
    deleteLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
    deleteLink.setIconLeftCSS("String_Node_Str");
    stackPanel.addTool(deleteLink,Align.left);
  }
}

Fixed version (ground truth):
@Override public void initTools(){
  editLink(!openInEditMode);
  stackPanel.addTool(editLink,Align.left);
  editMetadataLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
  editMetadataLink.setIconLeftCSS("String_Node_Str");
  editMetadataLink.setVisible(secCallback.canEditPageMetadata(page,assignments));
  stackPanel.addTool(editMetadataLink,Align.left);
  moveToTrashLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
  moveToTrashLink.setIconLeftCSS("String_Node_Str");
  moveToTrashLink.setElementCssClass("String_Node_Str");
  moveToTrashLink.setVisible(secCallback.canDeletePage(page));
  stackPanel.addTool(moveToTrashLink,Align.right);
  if (secCallback.canRestorePage(page)) {
    restoreLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
    restoreLink.setIconLeftCSS("String_Node_Str");
    stackPanel.addTool(restoreLink,Align.left);
    deleteLink=LinkFactory.createToolLink("String_Node_Str",translate("String_Node_Str"),this);
    deleteLink.setIconLeftCSS("String_Node_Str");
    deleteLink.setElementCssClass("String_Node_Str");
    stackPanel.addTool(deleteLink,Align.left);
  }
}
Program: 69373
Project: 69373
Buggy source:
protected void updateSections(){
  String selectedBinderKey=bindersEl.isOneSelected() ? bindersEl.getSelectedKey() : null;
  if (selectedBinderKey == null || "String_Node_Str".equals(selectedBinderKey)) {
    sectionsEl.setKeysAndValues(new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},null);
    sectionsEl.reset();
    sectionsEl.setVisible(false);
  }
 else {
    List<Section> sections=portfolioService.getSections(currentBinder);
    if (sections.isEmpty()) {
      sectionsEl.setKeysAndValues(new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},null);
      sectionsEl.reset();
      sectionsEl.setVisible(false);
    }
 else {
      int numOfSections=sections.size();
      String[] theKeys=new String[numOfSections];
      String[] theValues=new String[numOfSections];
      for (int i=0; i < numOfSections; i++) {
        Long sectionKey=sections.get(i).getKey();
        theKeys[i]=sectionKey.toString();
        theValues[i]=(i + 1) + "String_Node_Str" + sections.get(i).getTitle();
      }
      sectionsEl.setKeysAndValues(theKeys,theValues,null);
      sectionsEl.reset();
      sectionsEl.setEnabled(true);
      sectionsEl.setVisible(true);
    }
  }
}

Fixed version (ground truth):
protected void updateSections(){
  String selectedBinderKey=bindersEl.isOneSelected() ? bindersEl.getSelectedKey() : null;
  if (selectedBinderKey == null || "String_Node_Str".equals(selectedBinderKey)) {
    sectionsEl.setKeysAndValues(new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},null);
    sectionsEl.reset();
    sectionsEl.setVisible(false);
  }
 else {
    List<Section> sections=portfolioService.getSections(currentBinder);
    if (sections.isEmpty()) {
      sectionsEl.setKeysAndValues(new String[]{"String_Node_Str"},new String[]{"String_Node_Str"},null);
      sectionsEl.reset();
      sectionsEl.setVisible(false);
    }
 else {
      int numOfSections=sections.size();
      String[] theKeys=new String[numOfSections];
      String[] theValues=new String[numOfSections];
      for (int i=0; i < numOfSections; i++) {
        Long sectionKey=sections.get(i).getKey();
        theKeys[i]=sectionKey.toString();
        theValues[i]=sections.get(i).getTitle();
      }
      sectionsEl.setKeysAndValues(theKeys,theValues,null);
      sectionsEl.reset();
      sectionsEl.setEnabled(true);
      sectionsEl.setVisible(true);
    }
  }
}
Program: 69374
Project: 69374
Buggy source:
@Override protected void event(UserRequest ureq,Controller source,Event event){
  if (event instanceof RestoreBinderEvent || event instanceof DeleteBinderEvent) {
    stackPanel.popUpToController(this);
  }
  super.event(ureq,source,event);
}

Fixed version (ground truth):
@Override protected void event(UserRequest ureq,Controller source,Event event){
  if (event instanceof RestoreBinderEvent || event instanceof DeleteBinderEvent || event instanceof PageDeletedEvent) {
    stackPanel.popUpToController(this);
  }
  super.event(ureq,source,event);
}
Program: 69375
Project: 69375
Buggy source:
/** 
 * Yes in a dialog box controller.
 */
private void confirm(){
  By confirmButtonBy=By.xpath("String_Node_Str");
  OOGraphene.waitElement(confirmButtonBy,5,browser);
  OOGraphene.waitScrollTop(browser);
  browser.findElement(confirmButtonBy).click();
  OOGraphene.waitBusy(browser);
}

Fixed version (ground truth):
/** 
 * Yes in a dialog box controller.
 */
protected void confirm(){
  By confirmButtonBy=By.xpath("String_Node_Str");
  OOGraphene.waitElement(confirmButtonBy,5,browser);
  OOGraphene.waitScrollTop(browser);
  browser.findElement(confirmButtonBy).click();
  OOGraphene.waitBusy(browser);
}
Program: 69376
Project: 69376
Buggy source:
public BinderPage assertOnPageInToc(String title){
  By sectionTitleBy=By.xpath("String_Node_Str" + title + "String_Node_Str");
  OOGraphene.waitElement(sectionTitleBy,5,browser);
  return this;
}

Fixed version (ground truth):
public BinderPage assertOnPageInToc(String title){
  By pageTitleBy=By.xpath("String_Node_Str" + title + "String_Node_Str");
  OOGraphene.waitElement(pageTitleBy,5,browser);
  return this;
}
Program: 69378
Project: 69378
Buggy source:
public CopyVisitor(Path destDir) throws IOException {
  this.destDir=destDir;
  wikiDir=destDir.resolve(WIKI_RESOURCE_FOLDER_NAME);
  Files.createDirectories(wikiDir);
  mediaDir=destDir.resolve(WikiContainer.MEDIA_FOLDER_NAME);
  Files.createDirectories(mediaDir);
  Path versionDir=destDir.resolve(VERSION_FOLDER_NAME);
  Files.createDirectories(versionDir);
}

Fixed version (ground truth):
public CopyVisitor(Path sourceDir,Path destDir) throws IOException {
  this.destDir=destDir;
  this.sourceDir=sourceDir;
  Path wikiDir=destDir.resolve(WIKI_RESOURCE_FOLDER_NAME);
  Files.createDirectories(wikiDir);
  Path mediaDir=destDir.resolve(WikiContainer.MEDIA_FOLDER_NAME);
  Files.createDirectories(mediaDir);
  Path versionDir=destDir.resolve(VERSION_FOLDER_NAME);
  Files.createDirectories(versionDir);
}
Program: 69379
Project: 69379
Buggy source:
public boolean importWiki(File file,String filename,File targetDirectory){
  try {
    Path path=FileResource.getResource(file,filename);
    if (path == null) {
      return false;
    }
    Path destDir=targetDirectory.toPath();
    Files.walkFileTree(path,new CopyVisitor(destDir));
    return true;
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    return false;
  }
}

Fixed version (ground truth):
public boolean importWiki(File file,String filename,File targetDirectory){
  try {
    Path path=FileResource.getResource(file,filename);
    if (path == null) {
      return false;
    }
    Path destDir=targetDirectory.toPath();
    Files.walkFileTree(path,new ImportVisitor(destDir));
    return true;
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    return false;
  }
}
Program: 69380
Project: 69380
Buggy source:
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) throws IOException {
  String filename=file.getFileName().toString();
  if (filename.endsWith(WikiManager.WIKI_FILE_SUFFIX) || filename.endsWith(WikiManager.WIKI_PROPERTIES_SUFFIX)) {
    final Path destFile=Paths.get(wikiDir.toString(),file.toString());
    Files.copy(file,destFile,StandardCopyOption.REPLACE_EXISTING);
  }
 else   if (!filename.contains(WikiManager.WIKI_FILE_SUFFIX + "String_Node_Str") && !filename.contains(WikiManager.WIKI_PROPERTIES_SUFFIX + "String_Node_Str")) {
    final Path destFile=Paths.get(mediaDir.toString(),file.toString());
    Files.copy(file,destFile,StandardCopyOption.REPLACE_EXISTING);
  }
  return FileVisitResult.CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) throws IOException {
  String filename=file.getFileName().toString();
  if (filename.endsWith(WikiManager.WIKI_PROPERTIES_SUFFIX)) {
    final Path destFile=Paths.get(wikiDir.toString(),file.toString());
    resetAndCopyProperties(file,destFile);
  }
 else   if (filename.endsWith(WIKI_FILE_SUFFIX)) {
    final Path destFile=Paths.get(wikiDir.toString(),file.toString());
    Files.copy(file,destFile,StandardCopyOption.REPLACE_EXISTING);
  }
 else   if (!filename.contains(WIKI_FILE_SUFFIX + "String_Node_Str") && !filename.contains(WIKI_PROPERTIES_SUFFIX + "String_Node_Str")) {
    final Path destFile=Paths.get(mediaDir.toString(),file.toString());
    Files.copy(file,destFile,StandardCopyOption.REPLACE_EXISTING);
  }
  return FileVisitResult.CONTINUE;
}
Program: 69381
Project: 69381
Buggy source:
public HighScoreRunController(UserRequest ureq,WindowControl wControl,UserCourseEnvironment userCourseEnv,CourseNode courseNode){
  super(ureq,wControl,"String_Node_Str");
  List<AssessmentEntry> assessEntries=userCourseEnv.getCourseEnvironment().getAssessmentManager().getAssessmentEntries(courseNode);
  ModuleConfiguration config=courseNode.getModuleConfiguration();
  Date start=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_DATESTART) != null ? (Date)config.get(HighScoreEditController.CONFIG_KEY_DATESTART) : null;
  if (start != null && start.getTime() > new Date().getTime())   return;
  viewHighscore=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HIGHSCORE);
  if (!viewHighscore)   return;
  viewTable=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_LISTING);
  viewHistogram=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HISTOGRAM);
  viewPodium=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_PODIUM);
  anonymous=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_ANONYMIZE);
  int bestOnly=(int)config.get(HighScoreEditController.CONFIG_KEY_BESTONLY);
  tableSize=bestOnly != 0 ? (int)config.get(HighScoreEditController.CONFIG_KEY_NUMUSER) : assessEntries.size();
  ownIdentity=ureq.getIdentity();
  initLists();
  allScores=highScoreManager.sortRankByScore(assessEntries,allMembers,ownIdMembers,allPodium,ownIdIndices,tableSize,ownIdentity,userManager);
  initForm(ureq);
}

Fixed version (ground truth):
public HighScoreRunController(UserRequest ureq,WindowControl wControl,UserCourseEnvironment userCourseEnv,CourseNode courseNode){
  super(ureq,wControl,"String_Node_Str");
  List<AssessmentEntry> assessEntries=userCourseEnv.getCourseEnvironment().getAssessmentManager().getAssessmentEntries(courseNode);
  ModuleConfiguration config=courseNode.getModuleConfiguration();
  Date start=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_DATESTART) != null ? (Date)config.get(HighScoreEditController.CONFIG_KEY_DATESTART) : null;
  if (start != null && start.getTime() > new Date().getTime())   return;
  viewHighscore=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HIGHSCORE);
  if (!viewHighscore)   return;
  viewTable=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_LISTING);
  viewHistogram=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_HISTOGRAM);
  viewPodium=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_PODIUM);
  anonymous=config.getBooleanSafe(HighScoreEditController.CONFIG_KEY_ANONYMIZE);
  int bestOnly=config.getBooleanEntry(HighScoreEditController.CONFIG_KEY_BESTONLY) != null ? (int)config.get(HighScoreEditController.CONFIG_KEY_BESTONLY) : 0;
  tableSize=bestOnly != 0 ? (int)config.get(HighScoreEditController.CONFIG_KEY_NUMUSER) : assessEntries.size();
  ownIdentity=ureq.getIdentity();
  initLists();
  allScores=highScoreManager.sortRankByScore(assessEntries,allMembers,ownIdMembers,allPodium,ownIdIndices,tableSize,ownIdentity,userManager);
  initForm(ureq);
}
Program: 69382
Project: 69382
Buggy source:
public void setAdditionalOpenIDConnectIF(String providerName,String displayName,boolean rootEnabled,String issuer,String endPoint,String apiKey,String apiSecret){
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str","String_Node_Str",false);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",rootEnabled ? "String_Node_Str" : "String_Node_Str",false);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",apiKey,false);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",apiSecret,false);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",issuer,false);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",displayName,false);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",endPoint,true);
  updateProperties();
}

Fixed version (ground truth):
public void setAdditionalOpenIDConnectIF(String providerName,String displayName,boolean rootEnabled,String issuer,String endPoint,String apiKey,String apiSecret){
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str","String_Node_Str",true);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",rootEnabled ? "String_Node_Str" : "String_Node_Str",true);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",apiKey,true);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",apiSecret,true);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",issuer,true);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",displayName,true);
  setStringProperty("String_Node_Str" + providerName + "String_Node_Str",endPoint,true);
  updateProperties();
}
Program: 69383
Project: 69383
Buggy source:
public void removeAdditionalOpenIDConnectIF(String providerName){
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",false);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",false);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",false);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",false);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",false);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",false);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  updateProperties();
}

Fixed version (ground truth):
public void removeAdditionalOpenIDConnectIF(String providerName){
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  removeProperty("String_Node_Str" + providerName + "String_Node_Str",true);
  updateProperties();
}
Program: 69384
Project: 69384
Buggy source:
private void writeData(List<AssessmentResponse> responses,OpenXMLWorksheet exportSheet,OpenXMLWorkbook workbook){
  int num=0;
  SessionResponses sessionResponses=null;
  int numOfResponses=responses.size();
  for (int i=0; i < numOfResponses; i++) {
    AssessmentResponse response=responses.get(i);
    AssessmentItemSession itemSession=response.getAssessmentItemSession();
    AssessmentTestSession testSession=itemSession.getAssessmentTestSession();
    if (sessionResponses == null) {
      sessionResponses=new SessionResponses(testSession);
    }
 else     if (!sessionResponses.getSessionKey().equals(testSession.getKey())) {
      writeDataRow(++num,sessionResponses,exportSheet,workbook);
      sessionResponses=new SessionResponses(testSession);
    }
    sessionResponses.addResponse(itemSession,response);
  }
  writeDataRow(++num,sessionResponses,exportSheet,workbook);
}

Fixed version (ground truth):
private void writeData(List<AssessmentResponse> responses,OpenXMLWorksheet exportSheet,OpenXMLWorkbook workbook){
  int num=0;
  SessionResponses sessionResponses=null;
  int numOfResponses=responses.size();
  for (int i=0; i < numOfResponses; i++) {
    AssessmentResponse response=responses.get(i);
    AssessmentItemSession itemSession=response.getAssessmentItemSession();
    AssessmentTestSession testSession=itemSession.getAssessmentTestSession();
    if (sessionResponses == null) {
      sessionResponses=new SessionResponses(testSession);
    }
 else     if (!sessionResponses.getSessionKey().equals(testSession.getKey())) {
      writeDataRow(++num,sessionResponses,exportSheet,workbook);
      sessionResponses=new SessionResponses(testSession);
    }
    sessionResponses.addResponse(itemSession,response);
  }
  if (sessionResponses != null) {
    writeDataRow(++num,sessionResponses,exportSheet,workbook);
  }
}
Program: 69385
Project: 69385
Buggy source:
private AssessmentItemBuilder convertKPrim(Item item){
  KPrimAssessmentItemBuilder itemBuilder=new KPrimAssessmentItemBuilder(qtiSerializer);
  convertItemBasics(item,itemBuilder);
  Question question=item.getQuestion();
  itemBuilder.setShuffle(question.isShuffle());
  List<Response> responses=question.getResponses();
  List<SimpleAssociableChoice> choices=itemBuilder.getKprimChoices();
  for (int i=0; i < 4; i++) {
    Response response=responses.get(i);
    SimpleAssociableChoice choice=choices.get(i);
    String answer=response.getContent().renderAsHtmlForEditor();
    P firstChoiceText=AssessmentItemFactory.getParagraph(choice,answer);
    choice.getFlowStatics().clear();
    choice.getFlowStatics().add(firstChoiceText);
    if (response.isCorrect()) {
      itemBuilder.setAssociation(choice.getIdentifier(),QTI21Constants.CORRECT_IDENTIFIER);
    }
 else {
      itemBuilder.setAssociation(choice.getIdentifier(),QTI21Constants.WRONG_IDENTIFIER);
    }
  }
  double score=question.getMaxValue();
  itemBuilder.setMinScore(0.0d);
  itemBuilder.setMaxScore(score);
  return itemBuilder;
}

Fixed version (ground truth):
private AssessmentItemBuilder convertKPrim(Item item){
  KPrimAssessmentItemBuilder itemBuilder=new KPrimAssessmentItemBuilder(qtiSerializer);
  convertItemBasics(item,itemBuilder);
  Question question=item.getQuestion();
  itemBuilder.setShuffle(question.isShuffle());
  List<Response> responses=question.getResponses();
  List<SimpleAssociableChoice> choices=itemBuilder.getKprimChoices();
  for (int i=0; i < 4; i++) {
    Response response=responses.get(i);
    SimpleAssociableChoice choice=choices.get(i);
    String answer=response.getContent().renderAsHtmlForEditor();
    answer=prepareContent(answer);
    P firstChoiceText=AssessmentItemFactory.getParagraph(choice,answer);
    choice.getFlowStatics().clear();
    choice.getFlowStatics().add(firstChoiceText);
    if (response.isCorrect()) {
      itemBuilder.setAssociation(choice.getIdentifier(),QTI21Constants.CORRECT_IDENTIFIER);
    }
 else {
      itemBuilder.setAssociation(choice.getIdentifier(),QTI21Constants.WRONG_IDENTIFIER);
    }
  }
  double score=question.getMaxValue();
  itemBuilder.setMinScore(0.0d);
  itemBuilder.setMaxScore(score);
  return itemBuilder;
}
Program: 69386
Project: 69386
Buggy source:
private void convertItemBasics(Item item,AssessmentItemBuilder itemBuilder){
  AssessmentItem assessmentItem=itemBuilder.getAssessmentItem();
  if (StringHelper.containsNonWhitespace(item.getTitle())) {
    assessmentItem.setTitle(item.getTitle());
  }
  if (StringHelper.containsNonWhitespace(item.getLabel())) {
    assessmentItem.setLabel(item.getLabel());
  }
  Question question=item.getQuestion();
  String questionText=question.getQuestion().renderAsHtmlForEditor();
  itemBuilder.setQuestion(questionText);
  String hintText=question.getHintText();
  if (StringHelper.containsNonWhitespace(hintText)) {
    ModalFeedbackBuilder hint=itemBuilder.createHint();
    hint.setText(hintText);
  }
  String feedbackMastery=QTIEditHelper.getFeedbackMasteryText(item);
  if (StringHelper.containsNonWhitespace(feedbackMastery)) {
    ModalFeedbackBuilder feedback=itemBuilder.createCorrectFeedback();
    feedback.setText(feedbackMastery);
  }
  String feedbackFail=QTIEditHelper.getFeedbackFailText(item);
  if (StringHelper.containsNonWhitespace(feedbackFail)) {
    ModalFeedbackBuilder feedback=itemBuilder.createIncorrectFeedback();
    feedback.setText(feedbackFail);
  }
}

Fixed version (ground truth):
private void convertItemBasics(Item item,AssessmentItemBuilder itemBuilder){
  AssessmentItem assessmentItem=itemBuilder.getAssessmentItem();
  if (StringHelper.containsNonWhitespace(item.getTitle())) {
    assessmentItem.setTitle(item.getTitle());
  }
  if (StringHelper.containsNonWhitespace(item.getLabel())) {
    assessmentItem.setLabel(item.getLabel());
  }
  Question question=item.getQuestion();
  String questionText=question.getQuestion().renderAsHtmlForEditor();
  questionText=prepareContent(questionText);
  itemBuilder.setQuestion("String_Node_Str" + questionText + "String_Node_Str");
  String hintText=question.getHintText();
  if (StringHelper.containsNonWhitespace(hintText)) {
    ModalFeedbackBuilder hint=itemBuilder.createHint();
    hint.setText(hintText);
  }
  String feedbackMastery=QTIEditHelper.getFeedbackMasteryText(item);
  if (StringHelper.containsNonWhitespace(feedbackMastery)) {
    ModalFeedbackBuilder feedback=itemBuilder.createCorrectFeedback();
    feedback.setText(feedbackMastery);
  }
  String feedbackFail=QTIEditHelper.getFeedbackFailText(item);
  if (StringHelper.containsNonWhitespace(feedbackFail)) {
    ModalFeedbackBuilder feedback=itemBuilder.createIncorrectFeedback();
    feedback.setText(feedbackFail);
  }
}
Program: 69388
Project: 69388
Buggy source:
private AssessmentItemBuilder convertSingleChoice(Item item){
  SingleChoiceAssessmentItemBuilder itemBuilder=new SingleChoiceAssessmentItemBuilder(qtiSerializer);
  convertItemBasics(item,itemBuilder);
  itemBuilder.clearMapping();
  itemBuilder.clearSimpleChoices();
  itemBuilder.setScoreEvaluationMode(ScoreEvaluation.allCorrectAnswers);
  ChoiceInteraction interaction=itemBuilder.getChoiceInteraction();
  Question question=item.getQuestion();
  itemBuilder.setShuffle(question.isShuffle());
  List<Response> responses=question.getResponses();
  for (  Response response : responses) {
    String responseText=response.getContent().renderAsHtmlForEditor();
    SimpleChoice newChoice;
    if (StringHelper.isHtml(responseText)) {
      newChoice=AssessmentItemFactory.createSimpleChoice(interaction,"String_Node_Str",itemBuilder.getQuestionType().getPrefix());
      htmlBuilder.appendHtml(newChoice,responseText);
    }
 else {
      newChoice=AssessmentItemFactory.createSimpleChoice(interaction,responseText,itemBuilder.getQuestionType().getPrefix());
    }
    itemBuilder.addSimpleChoice(newChoice);
    if (response.isCorrect()) {
      itemBuilder.setCorrectAnswer(newChoice.getIdentifier());
    }
  }
  double correctScore=question.getSingleCorrectScore();
  if (correctScore >= 0.0d) {
    itemBuilder.setMinScore(0.0d);
    itemBuilder.setMaxScore(correctScore);
  }
  return itemBuilder;
}

Fixed version (ground truth):
private AssessmentItemBuilder convertSingleChoice(Item item){
  SingleChoiceAssessmentItemBuilder itemBuilder=new SingleChoiceAssessmentItemBuilder(qtiSerializer);
  convertItemBasics(item,itemBuilder);
  itemBuilder.clearMapping();
  itemBuilder.clearSimpleChoices();
  itemBuilder.setScoreEvaluationMode(ScoreEvaluation.allCorrectAnswers);
  ChoiceInteraction interaction=itemBuilder.getChoiceInteraction();
  Question question=item.getQuestion();
  itemBuilder.setShuffle(question.isShuffle());
  List<Response> responses=question.getResponses();
  for (  Response response : responses) {
    String responseText=response.getContent().renderAsHtmlForEditor();
    responseText=prepareContent(responseText);
    SimpleChoice newChoice;
    if (StringHelper.isHtml(responseText)) {
      newChoice=AssessmentItemFactory.createSimpleChoice(interaction,"String_Node_Str",itemBuilder.getQuestionType().getPrefix());
      htmlBuilder.appendHtml(newChoice,responseText);
    }
 else {
      newChoice=AssessmentItemFactory.createSimpleChoice(interaction,responseText,itemBuilder.getQuestionType().getPrefix());
    }
    itemBuilder.addSimpleChoice(newChoice);
    if (response.isCorrect()) {
      itemBuilder.setCorrectAnswer(newChoice.getIdentifier());
    }
  }
  double correctScore=question.getSingleCorrectScore();
  if (correctScore >= 0.0d) {
    itemBuilder.setMinScore(0.0d);
    itemBuilder.setMaxScore(correctScore);
  }
  return itemBuilder;
}
Program: 69390
Project: 69390
Buggy source:
@Test public void convert() throws URISyntaxException, IOException, XmlResourceNotFoundException, ImsManifestException {
  QTIDocument doc=loadDocument("String_Node_Str");
  File exportDir=new File(WebappHelper.getTmpDir(),"String_Node_Str" + UUID.randomUUID());
  exportDir.mkdirs();
  QTI12To21Converter converter=new QTI12To21Converter(exportDir,Locale.ENGLISH);
  converter.convert(doc);
  int validAssessmentItems=0;
  boolean validAssessmentTest=false;
  QtiContentPackageSummary readableManifest=null;
  File[] generatedFiles=exportDir.listFiles();
  for (  File generatedFile : generatedFiles) {
    String filename=generatedFile.getName();
    if (filename.equals("String_Node_Str")) {
      readableManifest=new QtiContentPackageExtractor(exportDir).parse();
    }
 else     if (filename.startsWith("String_Node_Str")) {
      validAssessmentTest=validateAssessmentTest(generatedFile);
    }
 else     if (filename.endsWith("String_Node_Str")) {
      boolean validItem=validateAssessmentItem(generatedFile);
      if (validItem) {
        validAssessmentItems++;
      }
    }
  }
  FileUtils.deleteDirsAndFiles(exportDir.toPath());
  Assert.assertTrue(validAssessmentTest);
  Assert.assertEquals(4,validAssessmentItems);
  Assert.assertEquals(1,readableManifest.getTestResources().size());
  Assert.assertEquals(4,readableManifest.getItemResources().size());
}

Fixed version (ground truth):
@Test public void convert() throws URISyntaxException, IOException, XmlResourceNotFoundException, ImsManifestException {
  QTIDocument doc=loadDocument("String_Node_Str");
  File exportDir=new File(WebappHelper.getTmpDir(),"String_Node_Str" + UUID.randomUUID());
  exportDir.mkdirs();
  QTI12To21Converter converter=new QTI12To21Converter(exportDir,Locale.ENGLISH);
  converter.convert(null,doc);
  int validAssessmentItems=0;
  boolean validAssessmentTest=false;
  QtiContentPackageSummary readableManifest=null;
  File[] generatedFiles=exportDir.listFiles();
  for (  File generatedFile : generatedFiles) {
    String filename=generatedFile.getName();
    if (filename.equals("String_Node_Str")) {
      readableManifest=new QtiContentPackageExtractor(exportDir).parse();
    }
 else     if (filename.startsWith("String_Node_Str")) {
      validAssessmentTest=validateAssessmentTest(generatedFile);
    }
 else     if (filename.endsWith("String_Node_Str")) {
      boolean validItem=validateAssessmentItem(generatedFile);
      if (validItem) {
        validAssessmentItems++;
      }
    }
  }
  FileUtils.deleteDirsAndFiles(exportDir.toPath());
  Assert.assertTrue(validAssessmentTest);
  Assert.assertEquals(4,validAssessmentItems);
  Assert.assertEquals(1,readableManifest.getTestResources().size());
  Assert.assertEquals(4,readableManifest.getItemResources().size());
}
Program: 69391
Project: 69391
Buggy source:
@Override public void startElement(String uri,String localName,String qName,Attributes attributes){
  if (video)   return;
  if ("String_Node_Str".equals(localName)) {
    localName=qName="String_Node_Str";
    attributes=new AttributesDelegate(attributes);
  }
 else   if ("String_Node_Str".equals(localName)) {
    String cssClass=attributes.getValue("String_Node_Str");
    if (cssClass != null && "String_Node_Str".equals(cssClass)) {
      video=true;
      return;
    }
  }
  super.startElement(uri,localName,qName,attributes);
}

Fixed version (ground truth):
@Override public void startElement(String uri,String localName,String qName,Attributes attributes){
  if (video)   return;
  if ("String_Node_Str".equals(localName)) {
    localName=qName="String_Node_Str";
    AttributesImpl attributesCleaned=new AttributesImpl("String_Node_Str");
    for (int i=0; i < attributes.getLength(); i++) {
      String name=attributes.getLocalName(i);
      if (!"String_Node_Str".equalsIgnoreCase(name)) {
        String value=attributes.getValue(i);
        attributesCleaned.addAttribute(name,value);
      }
    }
    attributes=new AttributesDelegate(attributesCleaned);
  }
 else   if ("String_Node_Str".equals(localName)) {
    String cssClass=attributes.getValue("String_Node_Str");
    if (cssClass != null && "String_Node_Str".equals(cssClass)) {
      video=true;
      return;
    }
  }
  super.startElement(uri,localName,qName,attributes);
}
Program: 69392
Project: 69392
Buggy source:
protected void ensureFeedbackBasicOutcomeDeclaration(){
  OutcomeDeclaration feedbackBasicDeclaration=assessmentItem.getOutcomeDeclaration(QTI21Constants.FEEDBACKBASIC_IDENTIFIER);
  if (feedbackBasicDeclaration == null) {
    feedbackBasicDeclaration=AssessmentItemFactory.createOutcomeDeclarationForFeedbackBasic(assessmentItem);
    assessmentItem.getOutcomeDeclarations().add(feedbackBasicDeclaration);
  }
}

Fixed version (ground truth):
protected void ensureFeedbackBasicOutcomeDeclaration(){
  AssessmentItemFactory.ensureFeedbackBasicOutcomeDeclaration(assessmentItem);
}