nus-yam/ex-repair huggingface dataset:
Program: 69635
Project: 69635
Buggy source:
@Override public void expandExtendedSearch(UserRequest ureq){
  component.setDirty(true);
  extendedSearchExpanded=true;
  extendedSearchCtrl.setEnabled(true);
}

Fixed version (ground truth):
@Override public void expandExtendedSearch(UserRequest ureq){
  component.setDirty(true);
  extendedSearchExpanded=true;
  extendedSearchCtrl.setEnabled(true);
  if (searchFieldEl != null) {
    searchFieldEl.setVisible(false);
  }
}
Program: 69636
Project: 69636
Buggy source:
protected void evalExtendedSearch(UserRequest ureq){
  String search=null;
  if (searchFieldEl != null) {
    searchFieldEl.evalFormRequest(ureq);
    search=searchFieldEl.getValue();
  }
  List<String> condQueries=extendedSearchCtrl.getConditionalQueries();
  doSearch(ureq,search,condQueries);
}

Fixed version (ground truth):
protected void evalExtendedSearch(UserRequest ureq){
  String search=null;
  if (searchFieldEl != null && searchFieldEl.isEnabled() && searchFieldEl.isVisible()) {
    searchFieldEl.evalFormRequest(ureq);
    search=searchFieldEl.getValue();
  }
  List<String> condQueries=extendedSearchCtrl.getConditionalQueries();
  doSearch(ureq,search,condQueries);
}
Program: 69637
Project: 69637
Buggy source:
public int countRelations(Group group){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str");
  Number count=dbInstance.getCurrentEntityManager().createQuery(sb.toString(),Number.class).setParameter("String_Node_Str",group.getKey()).getSingleResult();
  return count == null ? 0 : count.intValue();
}

Fixed version (ground truth):
/** 
 * Count the number of relation from a group to repository entries
 * @param group
 * @return The number of relations
 */
public int countRelations(Group group){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str");
  Number count=dbInstance.getCurrentEntityManager().createQuery(sb.toString(),Number.class).setParameter("String_Node_Str",group.getKey()).getSingleResult();
  return count == null ? 0 : count.intValue();
}
Program: 69638
Project: 69638
Buggy source:
public List<RepositoryEntryToGroupRelation> getRelations(List<Group> groups){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  return dbInstance.getCurrentEntityManager().createQuery(sb.toString(),RepositoryEntryToGroupRelation.class).setParameter("String_Node_Str",groups).getResultList();
}

Fixed version (ground truth):
/** 
 * Get the relation from a base group to the repository entries
 * @param groups
 * @return The list of relations
 */
public List<RepositoryEntryToGroupRelation> getRelations(List<Group> groups){
  if (groups == null || groups.isEmpty()) {
    return Collections.emptyList();
  }
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  return dbInstance.getCurrentEntityManager().createQuery(sb.toString(),RepositoryEntryToGroupRelation.class).setParameter("String_Node_Str",groups).getResultList();
}
Program: 69642
Project: 69642
Buggy source:
@Override protected void formInnerEvent(UserRequest ureq,FormItem source,FormEvent event){
  if (source == searchButton) {
    fireSearchEvent(ureq);
  }
}

Fixed version (ground truth):
@Override protected void formInnerEvent(UserRequest ureq,FormItem source,FormEvent event){
  if (enabled) {
    if (source == searchButton) {
      fireSearchEvent(ureq);
    }
  }
}
Program: 69646
Project: 69646
Buggy source:
private void renderPageNumberLinks(StringOutput sb,FlexiTableComponent ftC,int page,int maxPage){
  if (maxPage < 12) {
    for (int i=0; i < maxPage; i++) {
      appendPagenNumberLink(sb,ftC,page,i);
    }
  }
 else {
    int powerOf10=String.valueOf(maxPage).length() - 1;
    int maxStepSize=(int)Math.pow(10,powerOf10);
    int stepSize=(int)Math.pow(10,String.valueOf(page).length() - 1);
    boolean isStep=false;
    int useEveryStep=3;
    int stepCnt=0;
    boolean isNear=false;
    int nearleft=5;
    int nearright=5;
    if (page < nearleft) {
      nearleft=page;
      nearright+=(nearright - nearleft);
    }
 else     if (page > (maxPage - nearright)) {
      nearright=maxPage - page;
      nearleft+=(nearleft - nearright);
    }
    for (int i=1; i <= maxPage; i++) {
      stepSize=adaptStepIfNeeded(page,maxStepSize,stepSize,i);
      isStep=((i % stepSize) == 0);
      if (isStep) {
        stepCnt++;
        isStep=isStep && (stepCnt % useEveryStep == 0);
      }
      isNear=(i > (page - nearleft) && i < (page + nearright));
      if (i == 1 || i == maxPage || isStep || isNear) {
        appendPagenNumberLink(sb,ftC,page,i);
      }
    }
  }
}

Fixed version (ground truth):
private void renderPageNumberLinks(StringOutput sb,FlexiTableComponent ftC,int page,int maxPage){
  if (maxPage < 12) {
    for (int i=0; i < maxPage; i++) {
      appendPagenNumberLink(sb,ftC,page,i);
    }
  }
 else {
    int powerOf10=String.valueOf(maxPage).length() - 1;
    int maxStepSize=(int)Math.pow(10,powerOf10);
    int stepSize=(int)Math.pow(10,String.valueOf(page).length() - 1);
    boolean isStep=false;
    int useEveryStep=3;
    int stepCnt=0;
    boolean isNear=false;
    int nearleft=5;
    int nearright=5;
    if (page < nearleft) {
      nearleft=page;
      nearright+=(nearright - nearleft);
    }
 else     if (page > (maxPage - nearright)) {
      nearright=maxPage - page;
      nearleft+=(nearleft - nearright);
    }
    for (int i=0; i <= maxPage; i++) {
      stepSize=adaptStepIfNeeded(page,maxStepSize,stepSize,i);
      isStep=((i % stepSize) == 0);
      if (isStep) {
        stepCnt++;
        isStep=isStep && (stepCnt % useEveryStep == 0);
      }
      isNear=(i > (page - nearleft) && i < (page + nearright));
      if (i == 0 || i == maxPage || isStep || isNear) {
        appendPagenNumberLink(sb,ftC,page,i);
      }
    }
  }
}
Program: 69648
Project: 69648
Buggy source:
@Override public final ResultInfos<AuthoringEntryRow> getRows(String query,List<String> condQueries,int firstResult,int maxResults,SortKey... orderBy){
  if (condQueries != null && condQueries.size() > 0) {
    String filter=condQueries.get(0);
    if (StringHelper.containsNonWhitespace(filter)) {
      searchParams.addResourceTypes(filter);
    }
 else {
      searchParams.setResourceTypes(null);
    }
  }
  if (StringHelper.containsNonWhitespace(query)) {
    try {
      List<Long> fullTextResults=searchClient.doSearch(query,null,searchParams.getIdentity(),searchParams.getRoles(),0,100);
      searchParams.setRepoEntryKeys(fullTextResults);
    }
 catch (    ServiceNotAvailableException|ParseException|QueryException e) {
      log.error("String_Node_Str",e);
    }
  }
  List<RepositoryEntryAuthorView> views=repositoryService.searchAuthorView(searchParams,firstResult,maxResults);
  List<AuthoringEntryRow> rows=processViewModel(views);
  ResultInfos<AuthoringEntryRow> results=new DefaultResultInfos<AuthoringEntryRow>(firstResult + rows.size(),-1,rows);
  if (firstResult == 0 && views.size() < maxResults) {
    count=new Integer(views.size());
  }
  return results;
}

Fixed version (ground truth):
@Override public final ResultInfos<AuthoringEntryRow> getRows(String query,List<String> condQueries,int firstResult,int maxResults,SortKey... orderBy){
  if (condQueries != null && condQueries.size() > 0) {
    String filter=condQueries.get(0);
    if (StringHelper.containsNonWhitespace(filter)) {
      searchParams.setResourceTypes(Collections.singletonList(filter));
    }
 else {
      searchParams.setResourceTypes(null);
    }
  }
  if (StringHelper.containsNonWhitespace(query)) {
    try {
      List<Long> fullTextResults=searchClient.doSearch(query,null,searchParams.getIdentity(),searchParams.getRoles(),0,100);
      searchParams.setRepoEntryKeys(fullTextResults);
    }
 catch (    ServiceNotAvailableException|ParseException|QueryException e) {
      log.error("String_Node_Str",e);
    }
  }
  List<RepositoryEntryAuthorView> views=repositoryService.searchAuthorView(searchParams,firstResult,maxResults);
  List<AuthoringEntryRow> rows=processViewModel(views);
  ResultInfos<AuthoringEntryRow> results=new DefaultResultInfos<AuthoringEntryRow>(firstResult + rows.size(),-1,rows);
  if (firstResult == 0 && views.size() < maxResults) {
    count=new Integer(views.size());
  }
  return results;
}
Program: 69649
Project: 69649
Buggy source:
@Override public boolean exists(){
  return delegate != null && delegate.exists();
}

Fixed version (ground truth):
@Override public boolean exists(){
  VFSContainer d=getDelegate();
  return d != null && d.exists();
}
Program: 69650
Project: 69650
Buggy source:
private void doUpdateAssessmentBySum(UserCourseEnvironment userCourseEnv,Identity assessedIdentity){
  OLATResourceable courseOres=OresHelper.createOLATResourceableInstance("String_Node_Str",userCourseEnv.getCourseEnvironment().getCourseResourceableId());
  ModuleConfiguration config=getModuleConfiguration();
  CheckboxManager checkboxManager=CoreSpringFactory.getImpl(CheckboxManager.class);
  int checkedBox=checkboxManager.countChecked(assessedIdentity,courseOres,getIdent());
  CheckboxList checkboxList=(CheckboxList)config.get(CONFIG_KEY_CHECKBOX);
  Integer cut=(Integer)config.get(CheckListCourseNode.CONFIG_KEY_PASSED_SUM_CUTVALUE);
  int minNumOfCheckbox=cut == null ? checkboxList.getNumOfCheckbox() : cut.intValue();
  boolean passed=checkedBox >= minNumOfCheckbox;
  Float score=null;
  if (passed) {
    Boolean scoreGrantedBool=(Boolean)config.get(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD);
    if (scoreGrantedBool != null && scoreGrantedBool.booleanValue()) {
      score=(Float)config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
    }
  }
  ScoreEvaluation sceval=new ScoreEvaluation(score,new Boolean(passed));
  AssessmentManager am=userCourseEnv.getCourseEnvironment().getAssessmentManager();
  Identity mySelf=userCourseEnv.getIdentityEnvironment().getIdentity();
  am.saveScoreEvaluation(this,mySelf,assessedIdentity,sceval,userCourseEnv,false);
  userCourseEnv.getScoreAccounting().scoreInfoChanged(this,sceval);
}

Fixed version (ground truth):
private void doUpdateAssessmentBySum(UserCourseEnvironment userCourseEnv,Identity assessedIdentity){
  OLATResourceable courseOres=OresHelper.createOLATResourceableInstance("String_Node_Str",userCourseEnv.getCourseEnvironment().getCourseResourceableId());
  ModuleConfiguration config=getModuleConfiguration();
  CheckboxManager checkboxManager=CoreSpringFactory.getImpl(CheckboxManager.class);
  int checkedBox=checkboxManager.countChecked(assessedIdentity,courseOres,getIdent());
  CheckboxList checkboxList=(CheckboxList)config.get(CONFIG_KEY_CHECKBOX);
  Integer cut=(Integer)config.get(CheckListCourseNode.CONFIG_KEY_PASSED_SUM_CUTVALUE);
  int minNumOfCheckbox=cut == null ? checkboxList.getNumOfCheckbox() : cut.intValue();
  boolean passed=checkedBox >= minNumOfCheckbox;
  Float score=null;
  if (passed) {
    Boolean scoreGrantedBool=(Boolean)config.get(MSCourseNode.CONFIG_KEY_HAS_SCORE_FIELD);
    if (scoreGrantedBool != null && scoreGrantedBool.booleanValue()) {
      score=checkboxManager.calculateScore(assessedIdentity,courseOres,getIdent());
      Float maxScore=(Float)config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
      if (maxScore != null && maxScore.floatValue() < score) {
        score=maxScore.floatValue();
      }
    }
  }
  ScoreEvaluation sceval=new ScoreEvaluation(score,new Boolean(passed));
  AssessmentManager am=userCourseEnv.getCourseEnvironment().getAssessmentManager();
  Identity mySelf=userCourseEnv.getIdentityEnvironment().getIdentity();
  am.saveScoreEvaluation(this,mySelf,assessedIdentity,sceval,userCourseEnv,false);
  userCourseEnv.getScoreAccounting().scoreInfoChanged(this,sceval);
}
Program: 69651
Project: 69651
Buggy source:
public String getKey(int which){
  return keys[which];
}

Fixed version (ground truth):
public String getKey(int which){
  if (which >= 0 && which < keys.length) {
    return keys[which];
  }
  return null;
}
Program: 69652
Project: 69652
Buggy source:
public String getCheckboxId(){
  return checkboxId;
}

Fixed version (ground truth):
/** 
 * This is an UUID
 * @return
 */
public String getCheckboxId(){
  return checkboxId;
}
Program: 69655
Project: 69655
Buggy source:
private void doDownloadFile(UserRequest ureq){
  ICourse course=CourseFactory.loadCourse(courseOres);
  CourseEnvironment courseEnv=course.getCourseEnvironment();
  VFSContainer container=checkboxManager.getFileContainer(courseEnv,courseNode,checkbox);
  VFSItem item=container.resolve(checkbox.getFilename());
  if (item instanceof VFSLeaf) {
    VFSMediaResource rsrc=new VFSMediaResource((VFSLeaf)item);
    rsrc.setDownloadable(true);
    ureq.getDispatchResult().setResultingMediaResource(rsrc);
  }
}

Fixed version (ground truth):
private void doDownloadFile(UserRequest ureq){
  VFSContainer container=getFileContainer();
  VFSItem item=container.resolve(checkbox.getFilename());
  if (item instanceof VFSLeaf) {
    VFSMediaResource rsrc=new VFSMediaResource((VFSLeaf)item);
    rsrc.setDownloadable(true);
    ureq.getDispatchResult().setResultingMediaResource(rsrc);
  }
}
Program: 69658
Project: 69658
Buggy source:
private void initCourseNodeInformation(StatisticAssessment stats){
  mainVC.contextPut("String_Node_Str",stats.getNumOfParticipants());
  mainVC.contextPut("String_Node_Str",resourceResult.getType());
  if (QTIType.test.equals(type)) {
    mainVC.contextPut("String_Node_Str",stats.getNumOfPassed());
    mainVC.contextPut("String_Node_Str",stats.getNumOfFailed());
    if (cutValue != null) {
      mainVC.contextPut("String_Node_Str",format(cutValue));
    }
 else {
      mainVC.contextPut("String_Node_Str","String_Node_Str");
    }
    mainVC.contextPut("String_Node_Str",format(maxScore));
    mainVC.contextPut("String_Node_Str",format(stats.getAverage()));
    mainVC.contextPut("String_Node_Str",format(stats.getRange()));
    mainVC.contextPut("String_Node_Str",format(stats.getStandardDeviation()));
    mainVC.contextPut("String_Node_Str",getModeString(stats.getMode()));
    mainVC.contextPut("String_Node_Str",format(stats.getMedian()));
  }
  String duration=duration(stats.getAverageDuration());
  mainVC.contextPut("String_Node_Str",duration);
}

Fixed version (ground truth):
private void initCourseNodeInformation(StatisticAssessment stats){
  mainVC.contextPut("String_Node_Str",stats.getNumOfParticipants());
  mainVC.contextPut("String_Node_Str",resourceResult.getType());
  mainVC.contextPut("String_Node_Str",courseResourceID);
  mainVC.contextPut("String_Node_Str",repoEntryId);
  if (QTIType.test.equals(type)) {
    mainVC.contextPut("String_Node_Str",stats.getNumOfPassed());
    mainVC.contextPut("String_Node_Str",stats.getNumOfFailed());
    if (cutValue != null) {
      mainVC.contextPut("String_Node_Str",format(cutValue));
    }
 else {
      mainVC.contextPut("String_Node_Str","String_Node_Str");
    }
    mainVC.contextPut("String_Node_Str",format(maxScore));
    mainVC.contextPut("String_Node_Str",format(stats.getAverage()));
    mainVC.contextPut("String_Node_Str",format(stats.getRange()));
    mainVC.contextPut("String_Node_Str",format(stats.getStandardDeviation()));
    mainVC.contextPut("String_Node_Str",getModeString(stats.getMode()));
    mainVC.contextPut("String_Node_Str",format(stats.getMedian()));
  }
  String duration=duration(stats.getAverageDuration());
  mainVC.contextPut("String_Node_Str",duration);
}
Program: 69660
Project: 69660
Buggy source:
public Series getSingleChoice(Item item){
  List<StatisticChoiceOption> statisticResponses=qtiStatisticsManager.getNumOfAnswersPerSingleChoiceAnswerOption(item,resourceResult.getSearchParams());
  String mediaBaseURL=resourceResult.getMediaBaseURL();
  boolean survey=QTIType.survey.equals(resourceResult.getType());
  int numOfParticipants=resourceResult.getQTIStatisticAssessment().getNumOfParticipants();
  int i=0;
  BarSeries d1=new BarSeries();
  List<ResponseInfos> responseInfos=new ArrayList<>();
  for (  StatisticChoiceOption statisticResponse : statisticResponses) {
    Response response=statisticResponse.getResponse();
    double ans_count=statisticResponse.getCount();
    Float points;
    String cssColor;
    if (survey) {
      points=null;
      cssColor="String_Node_Str";
    }
 else {
      points=response.getPoints();
      cssColor=response.isCorrect() ? "String_Node_Str" : "String_Node_Str";
    }
    String label=Integer.toString(++i);
    d1.add(ans_count,label,cssColor);
    String text=response.getContent().renderAsHtml(mediaBaseURL);
    responseInfos.add(new ResponseInfos(label,text,points,true,survey));
  }
  List<BarSeries> serieList=Collections.singletonList(d1);
  Series series=new Series(serieList,responseInfos,numOfParticipants);
  series.setChartType(BAR_CORRECT);
  series.setItemCss(getCssClass(item));
  return series;
}

Fixed version (ground truth):
public Series getSingleChoice(Item item){
  List<StatisticChoiceOption> statisticResponses=qtiStatisticsManager.getNumOfAnswersPerSingleChoiceAnswerOption(item,resourceResult.getSearchParams());
  String mediaBaseURL=resourceResult.getMediaBaseURL();
  boolean survey=QTIType.survey.equals(resourceResult.getType());
  int numOfParticipants=resourceResult.getQTIStatisticAssessment().getNumOfParticipants();
  int i=0;
  BarSeries d1=new BarSeries();
  List<ResponseInfos> responseInfos=new ArrayList<>();
  for (  StatisticChoiceOption statisticResponse : statisticResponses) {
    Response response=statisticResponse.getResponse();
    double ans_count=statisticResponse.getCount();
    Float points;
    String cssColor;
    if (survey) {
      points=null;
      cssColor="String_Node_Str";
    }
 else {
      points=response.getPoints();
      cssColor=response.isCorrect() ? "String_Node_Str" : "String_Node_Str";
    }
    String label=Integer.toString(++i);
    d1.add(ans_count,label,cssColor);
    String text=response.getContent().renderAsHtml(mediaBaseURL);
    responseInfos.add(new ResponseInfos(label,text,points,response.isCorrect(),survey));
  }
  List<BarSeries> serieList=Collections.singletonList(d1);
  Series series=new Series(serieList,responseInfos,numOfParticipants);
  series.setChartType(BAR_CORRECT);
  series.setItemCss(getCssClass(item));
  return series;
}
Program: 69662
Project: 69662
Buggy source:
public Series getKPrim(Item item){
  List<StatisticKPrimOption> statisticResponses=qtiStatisticsManager.getNumbersInKPrim(item,resourceResult.getSearchParams());
  String mediaBaseURL=resourceResult.getMediaBaseURL();
  boolean survey=QTIType.survey.equals(resourceResult.getType());
  int numOfParticipants=resourceResult.getQTIStatisticAssessment().getNumOfParticipants();
  int i=0;
  BarSeries d1=new BarSeries("String_Node_Str");
  BarSeries d2=new BarSeries("String_Node_Str");
  BarSeries d3=new BarSeries("String_Node_Str");
  List<ResponseInfos> responseInfos=new ArrayList<>();
  for (  StatisticKPrimOption statisticResponse : statisticResponses) {
    Response response=statisticResponse.getResponse();
    double right=statisticResponse.getNumOfCorrect();
    double wrong=statisticResponse.getNumOfIncorrect();
    double notanswered=numOfParticipants - right - wrong;
    String label=Integer.toString(++i);
    d1.add(right,label);
    d2.add(wrong,label);
    d3.add(notanswered,label);
    String text=response.getContent().renderAsHtml(mediaBaseURL);
    responseInfos.add(new ResponseInfos(label,text,null,true,survey));
  }
  List<BarSeries> serieList=new ArrayList<>(3);
  serieList.add(d1);
  serieList.add(d2);
  serieList.add(d3);
  Series series=new Series(serieList,responseInfos,numOfParticipants);
  series.setChartType(survey ? BAR_ANSWERED : BAR_CORRECT_WRONG_NOT);
  series.setItemCss(getCssClass(item));
  return series;
}

Fixed version (ground truth):
public Series getKPrim(Item item){
  List<StatisticKPrimOption> statisticResponses=qtiStatisticsManager.getNumbersInKPrim(item,resourceResult.getSearchParams());
  String mediaBaseURL=resourceResult.getMediaBaseURL();
  boolean survey=QTIType.survey.equals(resourceResult.getType());
  int numOfParticipants=resourceResult.getQTIStatisticAssessment().getNumOfParticipants();
  int i=0;
  BarSeries d1=new BarSeries("String_Node_Str");
  BarSeries d2=new BarSeries("String_Node_Str");
  BarSeries d3=new BarSeries("String_Node_Str");
  List<ResponseInfos> responseInfos=new ArrayList<>();
  for (  StatisticKPrimOption statisticResponse : statisticResponses) {
    Response response=statisticResponse.getResponse();
    double right=statisticResponse.getNumOfCorrect();
    double wrong=statisticResponse.getNumOfIncorrect();
    double notanswered=numOfParticipants - right - wrong;
    String label=Integer.toString(++i);
    d1.add(right,label);
    d2.add(wrong,label);
    d3.add(notanswered,label);
    String text=response.getContent().renderAsHtml(mediaBaseURL);
    responseInfos.add(new ResponseInfos(label,text,null,(right > 0f),survey));
  }
  List<BarSeries> serieList=new ArrayList<>(3);
  serieList.add(d1);
  serieList.add(d2);
  serieList.add(d3);
  Series series=new Series(serieList,responseInfos,numOfParticipants);
  series.setChartType(survey ? BAR_ANSWERED : BAR_CORRECT_WRONG_NOT);
  series.setItemCss(getCssClass(item));
  return series;
}
Program: 69663
Project: 69663
Buggy source:
/** 
 * check for valid email
 */
@Override public boolean isValidValue(User user,String value,ValidationError validationError,Locale locale){
  if (!super.isValidValue(user,value,validationError,locale)) {
    return false;
  }
  if (StringHelper.containsNonWhitespace(value)) {
    if (!MailHelper.isValidEmailAddress(value)) {
      validationError.setErrorKey(i18nFormElementLabelKey() + "String_Node_Str");
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * check for valid email
 */
@Override public boolean isValidValue(User user,String value,ValidationError validationError,Locale locale){
  if (!super.isValidValue(user,value,validationError,locale)) {
    return false;
  }
  if (StringHelper.containsNonWhitespace(value)) {
    value=value.toLowerCase().trim();
    if (!MailHelper.isValidEmailAddress(value)) {
      validationError.setErrorKey(i18nFormElementLabelKey() + "String_Node_Str");
      return false;
    }
  }
  return true;
}
Program: 69664
Project: 69664
Buggy source:
@Override public boolean isValid(User user,FormItem formItem,Map<String,String> formContext){
  if (!super.isValid(user,formItem,formContext)) {
    return false;
  }
  org.olat.core.gui.components.form.flexible.elements.TextElement textElement=(org.olat.core.gui.components.form.flexible.elements.TextElement)formItem;
  String value=textElement.getValue();
  if (StringHelper.containsNonWhitespace(value)) {
    if (!MailHelper.isValidEmailAddress(value)) {
      textElement.setErrorKey(i18nFormElementLabelKey() + "String_Node_Str",null);
      return false;
    }
    if (!isAddressAvailable(value,(formContext != null) ? (String)formContext.get("String_Node_Str") : null)) {
      textElement.setErrorKey(i18nFormElementLabelKey() + "String_Node_Str",null);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isValid(User user,FormItem formItem,Map<String,String> formContext){
  if (!super.isValid(user,formItem,formContext)) {
    return false;
  }
  org.olat.core.gui.components.form.flexible.elements.TextElement textElement=(org.olat.core.gui.components.form.flexible.elements.TextElement)formItem;
  String value=textElement.getValue();
  if (StringHelper.containsNonWhitespace(value)) {
    value=value.toLowerCase().trim();
    if (!MailHelper.isValidEmailAddress(value)) {
      textElement.setErrorKey(i18nFormElementLabelKey() + "String_Node_Str",null);
      return false;
    }
    if (!isAddressAvailable(value,(formContext != null) ? (String)formContext.get("String_Node_Str") : null)) {
      textElement.setErrorKey(i18nFormElementLabelKey() + "String_Node_Str",null);
      return false;
    }
  }
  return true;
}
Program: 69665
Project: 69665
Buggy source:
@Override protected void setInternalValue(User user,String mail){
  if (mail != null) {
    super.setInternalValue(user,mail.toLowerCase());
  }
 else {
    super.setInternalValue(user,null);
  }
}

Fixed version (ground truth):
@Override protected void setInternalValue(User user,String mail){
  if (mail != null) {
    super.setInternalValue(user,mail.toLowerCase().trim());
  }
 else {
    super.setInternalValue(user,null);
  }
}
Program: 69666
Project: 69666
Buggy source:
@Override public void reloadData(){
  if (dataSource != null) {
    dataSource.clear();
    dataSource.load(getSearchText(),getConditionalQueries(),0,getPageSize());
  }
}

Fixed version (ground truth):
@Override public void reloadData(){
  if (dataSource != null) {
    dataSource.clear();
    dataSource.load(getSearchText(),getConditionalQueries(),0,getPageSize());
  }
 else {
    if (dataModel instanceof FilterableFlexiTableModel) {
      if (filterEl != null && filterEl.isOneSelected()) {
        String filter=filterEl.getSelectedKey();
        ((FilterableFlexiTableModel)dataModel).filter(filter);
      }
    }
    if (dataModel instanceof SortableFlexiTableDataModel) {
      if (orderBy != null && orderBy.length > 0) {
        ((SortableFlexiTableDataModel<?>)dataModel).sort(orderBy[0]);
      }
    }
  }
  component.setDirty(true);
}
Program: 69667
Project: 69667
Buggy source:
public void addPageNumbers() throws IOException {
  float footerFontSize=10.0f;
  @SuppressWarnings("String_Node_Str") List<PDPage> allPages=document.getDocumentCatalog().getAllPages();
  int numOfPages=allPages.size();
  for (int i=0; i < allPages.size(); i++) {
    PDPage page=allPages.get(i);
    PDRectangle pageSize=page.findMediaBox();
    String text=(i + 1) + "String_Node_Str" + numOfPages;
    float stringWidth=getStringWidth(text,footerFontSize);
    float pageWidth=pageSize.getWidth();
    double x=(pageWidth - stringWidth) / 2.0f;
    double y=(marginTopBottom / 2.0f);
    PDPageContentStream contentStream=new PDPageContentStream(document,page,true,true,true);
    contentStream.beginText();
    contentStream.setFont(font,footerFontSize);
    contentStream.setTextTranslation(x,y);
    contentStream.drawString(text);
    contentStream.endText();
    contentStream.close();
  }
}

Fixed version (ground truth):
public void addPageNumbers() throws IOException {
  float footerFontSize=10.0f;
  @SuppressWarnings("String_Node_Str") List<PDPage> allPages=document.getDocumentCatalog().getAllPages();
  int numOfPages=allPages.size();
  for (int i=0; i < allPages.size(); i++) {
    PDPage page=allPages.get(i);
    PDRectangle pageSize=page.findMediaBox();
    String text=(i + 1) + "String_Node_Str" + numOfPages;
    float stringWidth=getStringWidth(text,footerFontSize);
    float pageWidth=pageSize.getWidth();
    double x=(pageWidth - stringWidth) / 2.0f;
    double y=(marginTopBottom / 2.0f);
    PDPageContentStream contentStream=new PDPageContentStream(document,page,true,true,true);
    contentStream.beginText();
    contentStream.setFont(font,footerFontSize);
    contentStream.setTextTranslation(x,y);
    contentStream.drawString(text);
    contentStream.endText();
    contentStream.beginText();
    contentStream.setFont(font,footerFontSize);
    contentStream.setTextTranslation(marginLeftRight,y);
    contentStream.drawString(printDate);
    contentStream.endText();
    contentStream.close();
  }
}
Program: 69668
Project: 69668
Buggy source:
public PdfDocument() throws IOException {
  document=new PDDocument();
}

Fixed version (ground truth):
public PdfDocument(Locale locale) throws IOException {
  document=new PDDocument();
  printDate=Formatter.getInstance(locale).formatDate(new Date());
}
Program: 69670
Project: 69670
Buggy source:
/** 
 * Init edit controller for this identity and this course node or use identity assessment overview if no course node is defined. (Rely on the instance variable currentCourseNode and assessedIdentityWrapper)
 * @param ureq
 * @param course
 */
private void initIdentityEditController(UserRequest ureq,ICourse course){
  if (currentCourseNode == null) {
    removeAsListenerAndDispose(identityAssessmentController);
    identityAssessmentController=new IdentityAssessmentEditController(getWindowControl(),ureq,stackPanel,assessedIdentityWrapper.getIdentity(),course,true);
    listenTo(identityAssessmentController);
    setContent(identityAssessmentController.getInitialComponent());
  }
 else {
    removeAsListenerAndDispose(assessmentEditController);
    assessmentEditController=new AssessmentEditController(ureq,getWindowControl(),stackPanel,course,currentCourseNode,assessedIdentityWrapper);
    listenTo(assessmentEditController);
    main.setContent(assessmentEditController.getInitialComponent());
  }
}

Fixed version (ground truth):
/** 
 * Init edit controller for this identity and this course node or use identity assessment overview if no course node is defined. (Rely on the instance variable currentCourseNode and assessedIdentityWrapper)
 * @param ureq
 * @param course
 */
private void initIdentityEditController(UserRequest ureq,ICourse course){
  if (currentCourseNode == null) {
    removeAsListenerAndDispose(identityAssessmentController);
    identityAssessmentController=new IdentityAssessmentEditController(getWindowControl(),ureq,stackPanel,assessedIdentityWrapper.getIdentity(),course,true);
    listenTo(identityAssessmentController);
    setContent(identityAssessmentController.getInitialComponent());
  }
 else {
    removeAsListenerAndDispose(assessmentEditController);
    assessmentEditController=new AssessmentEditController(ureq,getWindowControl(),stackPanel,course,currentCourseNode,assessedIdentityWrapper,true);
    listenTo(assessmentEditController);
    main.setContent(assessmentEditController.getInitialComponent());
  }
}
Program: 69671
Project: 69671
Buggy source:
private void doEditNodeAssessment(UserRequest ureq,AssessableCourseNode courseNode){
  if (mayEdit) {
    ICourse course=CourseFactory.loadCourse(ores);
    UserCourseInformationsManager userCourseInformationsManager=CoreSpringFactory.getImpl(UserCourseInformationsManager.class);
    Date initialLaunchDate=userCourseInformationsManager.getInitialLaunchDate(ores.getResourceableId(),assessedUserCourseEnvironment.getIdentityEnvironment().getIdentity());
    AssessedIdentityWrapper assessedIdentityWrapper=AssessmentHelper.wrapIdentity(assessedUserCourseEnvironment,initialLaunchDate,courseNode);
    assessmentEditCtr=new AssessmentEditController(ureq,getWindowControl(),stackPanel,course,courseNode,assessedIdentityWrapper);
    listenTo(assessmentEditCtr);
    main.setContent(assessmentEditCtr.getInitialComponent());
  }
 else {
    throw new OLATSecurityException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void doEditNodeAssessment(UserRequest ureq,AssessableCourseNode courseNode){
  if (mayEdit) {
    ICourse course=CourseFactory.loadCourse(ores);
    UserCourseInformationsManager userCourseInformationsManager=CoreSpringFactory.getImpl(UserCourseInformationsManager.class);
    Date initialLaunchDate=userCourseInformationsManager.getInitialLaunchDate(ores.getResourceableId(),assessedUserCourseEnvironment.getIdentityEnvironment().getIdentity());
    AssessedIdentityWrapper assessedIdentityWrapper=AssessmentHelper.wrapIdentity(assessedUserCourseEnvironment,initialLaunchDate,courseNode);
    assessmentEditCtr=new AssessmentEditController(ureq,getWindowControl(),stackPanel,course,courseNode,assessedIdentityWrapper,true);
    listenTo(assessmentEditCtr);
    main.setContent(assessmentEditCtr.getInitialComponent());
  }
 else {
    throw new OLATSecurityException("String_Node_Str");
  }
}
Program: 69672
Project: 69672
Buggy source:
/** 
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,org.olat.core.gui.control.WindowControl,org.olat.course.run.userview.UserCourseEnvironment,org.olat.course.run.userview.NodeEvaluation)
 */
@Override public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,WindowControl wControl,final UserCourseEnvironment userCourseEnv,NodeEvaluation ne,String nodecmd){
  updateModuleConfigDefaults(false);
  Controller ctrl;
  OLATResourceable ores=OresHelper.createOLATResourceableInstance("String_Node_Str",userCourseEnv.getCourseEnvironment().getCourseResourceableId());
  if (userCourseEnv.isCoach()) {
    ctrl=new CheckListRunForCoachController(ureq,wControl,userCourseEnv,ores,this);
  }
 else {
    ctrl=new CheckListRunController(ureq,wControl,userCourseEnv,ores,this);
  }
  Controller cont=TitledWrapperHelper.getWrapper(ureq,wControl,ctrl,this,ICON_CSS_CLASS);
  return new NodeRunConstructionResult(cont);
}

Fixed version (ground truth):
/** 
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,org.olat.core.gui.control.WindowControl,org.olat.course.run.userview.UserCourseEnvironment,org.olat.course.run.userview.NodeEvaluation)
 */
@Override public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,WindowControl wControl,final UserCourseEnvironment userCourseEnv,NodeEvaluation ne,String nodecmd){
  updateModuleConfigDefaults(false);
  Controller ctrl;
  OLATResourceable ores=OresHelper.createOLATResourceableInstance("String_Node_Str",userCourseEnv.getCourseEnvironment().getCourseResourceableId());
  if (userCourseEnv.isCoach() || userCourseEnv.isAdmin()) {
    ctrl=new CheckListRunForCoachController(ureq,wControl,userCourseEnv,ores,this);
  }
 else {
    ctrl=new CheckListRunController(ureq,wControl,userCourseEnv,ores,this);
  }
  Controller cont=TitledWrapperHelper.getWrapper(ureq,wControl,ctrl,this,ICON_CSS_CLASS);
  return new NodeRunConstructionResult(cont);
}
Program: 69673
Project: 69673
Buggy source:
private CheckboxWrapper forgeCheckboxWrapper(Checkbox checkbox,DBCheck check,boolean readOnly,FormItemContainer formLayout){
  String[] values=new String[]{translate(checkbox.getLabel().i18nKey())};
  String boxId="String_Node_Str" + checkbox.getCheckboxId();
  MultipleSelectionElement boxEl=uifactory.addCheckboxesHorizontal(boxId,null,formLayout,onKeys,values,null);
  boxEl.setEnabled(!readOnly);
  boxEl.setLabel(checkbox.getTitle(),null,false);
  boxEl.showLabel(true);
  boxEl.addActionListener(this,FormEvent.ONCHANGE);
  TextElement pointEl=null;
  if (withScore) {
    String pointId="String_Node_Str" + checkbox.getCheckboxId();
    String points=AssessmentHelper.getRoundedScore(checkbox.getPoints());
    pointEl=uifactory.addTextElement(pointId,null,16,points,formLayout);
    pointEl.setDisplaySize(5);
    pointEl.setExampleKey("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"});
  }
  CheckboxWrapper wrapper=new CheckboxWrapper(checkbox,check,boxEl,pointEl);
  boxEl.setUserObject(wrapper);
  if (check != null && check.getChecked() != null && check.getChecked().booleanValue()) {
    boxEl.select(onKeys[0],true);
    wrapper.setDbCheckbox(check.getCheckbox());
  }
  return wrapper;
}

Fixed version (ground truth):
private CheckboxWrapper forgeCheckboxWrapper(Checkbox checkbox,DBCheck check,boolean readOnly,FormItemContainer formLayout){
  String[] values=new String[]{translate(checkbox.getLabel().i18nKey())};
  String boxId="String_Node_Str" + checkbox.getCheckboxId();
  MultipleSelectionElement boxEl=uifactory.addCheckboxesHorizontal(boxId,null,formLayout,onKeys,values,null);
  boxEl.setEnabled(!readOnly);
  boxEl.setLabel(checkbox.getTitle(),null,false);
  boxEl.showLabel(true);
  boxEl.addActionListener(this,FormEvent.ONCHANGE);
  TextElement pointEl=null;
  if (withScore) {
    String pointId="String_Node_Str" + checkbox.getCheckboxId();
    String points=AssessmentHelper.getRoundedScore(check.getScore());
    pointEl=uifactory.addTextElement(pointId,null,16,points,formLayout);
    pointEl.setDisplaySize(5);
    pointEl.setExampleKey("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"});
  }
  CheckboxWrapper wrapper=new CheckboxWrapper(checkbox,check,boxEl,pointEl);
  boxEl.setUserObject(wrapper);
  if (check != null && check.getChecked() != null && check.getChecked().booleanValue()) {
    boxEl.select(onKeys[0],true);
    wrapper.setDbCheckbox(check.getCheckbox());
  }
  return wrapper;
}
Program: 69674
Project: 69674
Buggy source:
private void doOpenAssessment(UserRequest ureq){
  if (assessmentCtrl == null) {
    ICourse course=CourseFactory.loadCourse(courseOres);
    UserCourseEnvironment uce=AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity,course);
    AssessedIdentityWrapper idWrapper=AssessmentHelper.wrapIdentity(uce,null,courseNode);
    assessmentCtrl=new AssessmentEditController(ureq,getWindowControl(),null,course,courseNode,idWrapper);
    assessmentCtrl.setIdentityInfos(false);
    assessmentCtrl.setCourseNodeInfos(false);
    assessmentCtrl.setTitleInfos(false);
    listenTo(assessmentCtrl);
  }
  mainVC.put("String_Node_Str",assessmentCtrl.getInitialComponent());
}

Fixed version (ground truth):
private void doOpenAssessment(UserRequest ureq){
  if (assessmentCtrl == null) {
    ICourse course=CourseFactory.loadCourse(courseOres);
    UserCourseEnvironment uce=AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity,course);
    AssessedIdentityWrapper idWrapper=AssessmentHelper.wrapIdentity(uce,null,courseNode);
    assessmentCtrl=new AssessmentEditController(ureq,getWindowControl(),null,course,courseNode,idWrapper,false);
    assessmentCtrl.setIdentityInfos(false);
    assessmentCtrl.setCourseNodeInfos(false);
    assessmentCtrl.setTitleInfos(false);
    listenTo(assessmentCtrl);
  }
  mainVC.put("String_Node_Str",assessmentCtrl.getInitialComponent());
}
Program: 69675
Project: 69675
Buggy source:
private void doOpenEdit(UserRequest ureq,CheckListAssessmentRow row){
  if (editCtrl != null)   return;
  Identity assessedIdentity=securityManager.loadIdentityByKey(row.getIdentityKey());
  editCtrl=new AssessedIdentityOverviewController(ureq,getWindowControl(),assessedIdentity,courseOres,userCourseEnv,courseNode);
  listenTo(editCtrl);
  String title=courseNode.getShortTitle();
  Component content=editCtrl.getInitialComponent();
  cmc=new CloseableModalController(getWindowControl(),"String_Node_Str",content,true,title);
  listenTo(cmc);
  cmc.activate();
}

Fixed version (ground truth):
private void doOpenEdit(UserRequest ureq,CheckListAssessmentRow row){
  if (editCtrl != null)   return;
  Identity assessedIdentity=securityManager.loadIdentityByKey(row.getIdentityKey());
  editCtrl=new AssessedIdentityOverviewController(ureq,getWindowControl(),assessedIdentity,courseOres,userCourseEnv,courseNode);
  listenTo(editCtrl);
  String title=courseNode.getShortTitle();
  Component content=editCtrl.getInitialComponent();
  cmc=new CloseableModalController(getWindowControl(),translate("String_Node_Str"),content,true,title);
  listenTo(cmc);
  cmc.activate();
}
Program: 69676
Project: 69676
Buggy source:
private void doOpenBoxAssessment(UserRequest ureq){
  if (boxAssessmentCtrl != null)   return;
  List<CheckListAssessmentRow> rows=model.getBackedUpRows();
  boxAssessmentCtrl=new CheckboxAssessmentController(ureq,getWindowControl(),checkboxList,rows,courseOres,userCourseEnv,courseNode);
  listenTo(boxAssessmentCtrl);
  String title=translate("String_Node_Str");
  Component content=boxAssessmentCtrl.getInitialComponent();
  cmc=new CloseableModalController(getWindowControl(),"String_Node_Str",content,true,title);
  listenTo(cmc);
  cmc.activate();
}

Fixed version (ground truth):
private void doOpenBoxAssessment(UserRequest ureq){
  if (boxAssessmentCtrl != null)   return;
  List<CheckListAssessmentRow> rows=model.getObjects();
  boxAssessmentCtrl=new CheckboxAssessmentController(ureq,getWindowControl(),checkboxList,rows,courseOres,userCourseEnv,courseNode);
  listenTo(boxAssessmentCtrl);
  String title=translate("String_Node_Str");
  Component content=boxAssessmentCtrl.getInitialComponent();
  cmc=new CloseableModalController(getWindowControl(),translate("String_Node_Str"),content,true,title);
  listenTo(cmc);
  cmc.activate();
}
Program: 69677
Project: 69677
Buggy source:
private void doCheckedExportPDF(UserRequest ureq){
  try {
    String name=courseNode.getShortTitle();
    CheckedPDFExport pdfExport=new CheckedPDFExport(name,getTranslator(),withScore,userPropertyHandlers);
    pdfExport.setAuthor(userManager.getUserDisplayName(getIdentity()));
    pdfExport.setTitle(courseNode.getShortTitle());
    pdfExport.setSubject(courseNode.getLongTitle());
    pdfExport.setObjectives(courseNode.getLearningObjectives());
    pdfExport.create(checkboxList,model);
    ureq.getDispatchResult().setResultingMediaResource(pdfExport);
  }
 catch (  IOException|COSVisitorException|TransformerException e) {
    logError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void doCheckedExportPDF(UserRequest ureq){
  try {
    String name=courseNode.getShortTitle();
    CheckedPDFExport pdfExport=new CheckedPDFExport(name,getTranslator(),withScore,userPropertyHandlers);
    pdfExport.setAuthor(userManager.getUserDisplayName(getIdentity()));
    pdfExport.setCourseNodeTitle(courseNode.getShortTitle());
    pdfExport.setCourseTitle(courseNode.getLongTitle());
    pdfExport.create(checkboxList,model.getObjects());
    ureq.getDispatchResult().setResultingMediaResource(pdfExport);
  }
 catch (  IOException|COSVisitorException|TransformerException e) {
    logError("String_Node_Str",e);
  }
}
Program: 69679
Project: 69679
Buggy source:
@Override protected void event(UserRequest ureq,Controller source,Event event){
  if (editCtrl == source) {
    cmc.deactivate();
    cleanUp();
  }
 else   if (boxAssessmentCtrl == source) {
    cmc.deactivate();
    cleanUp();
    if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
      DBFactory.getInstance().commit();
      model.setObjects(loadDatas());
      table.reset();
      table.reloadData();
    }
  }
 else   if (cmc == source) {
    cleanUp();
  }
  super.event(ureq,source,event);
}

Fixed version (ground truth):
@Override protected void event(UserRequest ureq,Controller source,Event event){
  if (editCtrl == source) {
    cmc.deactivate();
    cleanUp();
    if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
      reloadTable();
    }
  }
 else   if (boxAssessmentCtrl == source) {
    cmc.deactivate();
    cleanUp();
    if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
      reloadTable();
    }
  }
 else   if (cmc == source) {
    cleanUp();
  }
  super.event(ureq,source,event);
}
Program: 69680
Project: 69680
Buggy source:
private void doExportPDF(UserRequest ureq){
  try {
    String name=courseNode.getShortTitle();
    CheckboxPDFExport pdfExport=new CheckboxPDFExport(name,getTranslator(),userPropertyHandlers);
    pdfExport.setAuthor(userManager.getUserDisplayName(getIdentity()));
    pdfExport.setTitle(courseNode.getShortTitle());
    pdfExport.setSubject(courseNode.getLongTitle());
    pdfExport.setObjectives(courseNode.getLearningObjectives());
    pdfExport.create(checkboxList,model);
    ureq.getDispatchResult().setResultingMediaResource(pdfExport);
  }
 catch (  IOException|COSVisitorException|TransformerException e) {
    logError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void doExportPDF(UserRequest ureq){
  try {
    String name=courseNode.getShortTitle();
    CheckboxPDFExport pdfExport=new CheckboxPDFExport(name,getTranslator(),userPropertyHandlers);
    pdfExport.setAuthor(userManager.getUserDisplayName(getIdentity()));
    pdfExport.setCourseNodeTitle(courseNode.getShortTitle());
    pdfExport.setCourseTitle(courseNode.getLongTitle());
    pdfExport.setCourseNodeTitle(courseNode.getShortTitle());
    String groupName=table.getSelectedFilterValue();
    pdfExport.setGroupName(groupName);
    pdfExport.create(checkboxList,model.getObjects());
    ureq.getDispatchResult().setResultingMediaResource(pdfExport);
  }
 catch (  IOException|COSVisitorException|TransformerException e) {
    logError("String_Node_Str",e);
  }
}
Program: 69682
Project: 69682
Buggy source:
/** 
 * @param ureq
 * @param wControl
 * @param mayModifyMembers
 * @param keepAtLeastOne
 * @param enableTablePreferences
 * @param aSecurityGroup
 * @param enableUserSelection
 */
public GroupController(UserRequest ureq,WindowControl wControl,boolean mayModifyMembers,boolean keepAtLeastOne,boolean enableTablePreferences,boolean enableUserSelection,boolean allowDownload,boolean mandatoryEmail,Group group,String role){
  super(ureq,wControl);
  init(ureq,mayModifyMembers,keepAtLeastOne,enableTablePreferences,enableUserSelection,allowDownload,mandatoryEmail,group,role);
}

Fixed version (ground truth):
/** 
 * @param ureq
 * @param wControl
 * @param mayModifyMembers
 * @param keepAtLeastOne
 * @param enableTablePreferences
 * @param aSecurityGroup
 * @param enableUserSelection
 */
public GroupController(UserRequest ureq,WindowControl wControl,boolean mayModifyMembers,boolean keepAtLeastOne,boolean enableTablePreferences,boolean enableUserSelection,boolean allowDownload,boolean mandatoryEmail,Group group,String role){
  super(ureq,wControl);
  securityManager=BaseSecurityManager.getInstance();
  imModule=CoreSpringFactory.getImpl(InstantMessagingModule.class);
  imService=CoreSpringFactory.getImpl(InstantMessagingService.class);
  userManager=CoreSpringFactory.getImpl(UserManager.class);
  sessionManager=CoreSpringFactory.getImpl(UserSessionManager.class);
  mailManager=CoreSpringFactory.getImpl(MailManager.class);
  groupDao=CoreSpringFactory.getImpl(GroupDAO.class);
  init(ureq,mayModifyMembers,keepAtLeastOne,enableTablePreferences,enableUserSelection,allowDownload,mandatoryEmail,group,role);
}
Program: 69683
Project: 69683
Buggy source:
public void deleteEntry(Identity identity,OLATResourceable ores){
  dbInstance.getCurrentEntityManager().createNamedQuery("String_Node_Str").setParameter("String_Node_Str",identity.getKey()).setParameter("String_Node_Str",ores.getResourceableId()).setParameter("String_Node_Str",ores.getResourceableTypeName()).executeUpdate();
}

Fixed version (ground truth):
public void deleteEntry(Identity identity,OLATResourceable ores){
  String del="String_Node_Str";
  dbInstance.getCurrentEntityManager().createQuery(del).setParameter("String_Node_Str",identity.getKey()).setParameter("String_Node_Str",ores.getResourceableId()).setParameter("String_Node_Str",ores.getResourceableTypeName()).executeUpdate();
}
Program: 69684
Project: 69684
Buggy source:
@Override public PrevNextFinishConfig getInitialPrevNextFinishConfig(){
  return new PrevNextFinishConfig(hasPreviousStep,true,false);
}

Fixed version (ground truth):
@Override public PrevNextFinishConfig getInitialPrevNextFinishConfig(){
  return new PrevNextFinishConfig(!hasPreviousStep,true,false);
}
Program: 69685
Project: 69685
Buggy source:
/** 
 * This constructor start the edit the bulk update.
 * @param ureq
 * @param courseNode
 * @param datas
 */
public BulkAssessment_2_DatasStep(UserRequest ureq,AssessableCourseNode courseNode,BulkAssessmentDatas datas,Task task){
  super(ureq);
  this.task=task;
  this.datas=datas;
  this.courseNode=courseNode;
  setI18nTitleAndDescr("String_Node_Str","String_Node_Str");
  setNextStep(new BulkAssessment_3_ValidationStep(ureq));
  hasPreviousStep=false;
}

Fixed version (ground truth):
/** 
 * This constructor start the edit the bulk update.
 * @param ureq
 * @param courseNode
 * @param datas
 */
public BulkAssessment_2_DatasStep(UserRequest ureq,AssessableCourseNode courseNode,BulkAssessmentDatas datas,Task task){
  super(ureq);
  this.task=task;
  this.datas=datas;
  this.courseNode=courseNode;
  setI18nTitleAndDescr("String_Node_Str","String_Node_Str");
  setNextStep(new BulkAssessment_3_ValidationStep(ureq));
  hasPreviousStep=(courseNode == null ? false : true);
}
Program: 69686
Project: 69686
Buggy source:
@After public void tearDown() throws Exception {
  try {
    JMSCodePointServerJunitHelper.stopServer();
    DBFactory.getInstance().closeSession();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@After public void tearDown() throws Exception {
  try {
    JMSCodePointServerJunitHelper.stopServer();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}
Program: 69687
Project: 69687
Buggy source:
public void tearDown() throws Exception {
  CourseFactory.deleteCourse(course);
  try {
    DBFactory.getInstance().closeSession();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void tearDown() throws Exception {
  CourseFactory.deleteCourse(course);
}