nus-yam/ex-repair huggingface dataset:
Program: 84580
Project: 84580
Buggy source:
/** 
 * Convenience method that will check this concept for subtype values (ConceptNumeric, ConceptDerived, etc) and insert a line into that subtable if needed. This prevents a hibernate ConstraintViolationException
 * @param concept the concept that will be inserted
 */
private void insertRowIntoSubclassIfNecessary(Concept concept){
  Connection connection=sessionFactory.getCurrentSession().connection();
  if (concept instanceof ConceptNumeric) {
    try {
      PreparedStatement ps=connection.prepareStatement("String_Node_Str");
      ps.setInt(1,concept.getConceptId());
      ps.setInt(2,concept.getConceptId());
      ps.execute();
      if (ps.getResultSet().next()) {
        ps=connection.prepareStatement("String_Node_Str");
        ps.setInt(1,concept.getConceptId());
        ps.executeUpdate();
      }
 else {
      }
    }
 catch (    SQLException e) {
      log.error("String_Node_Str",e);
    }
  }
 else   if (concept instanceof ConceptDerived) {
  }
}

Fixed version (ground truth):
/** 
 * Convenience method that will check this concept for subtype values (ConceptNumeric, ConceptDerived, etc) and insert a line into that subtable if needed. This prevents a hibernate ConstraintViolationException
 * @param concept the concept that will be inserted
 */
private void insertRowIntoSubclassIfNecessary(Concept concept){
  Connection connection=sessionFactory.getCurrentSession().connection();
  if (concept instanceof ConceptNumeric) {
    try {
      PreparedStatement ps=connection.prepareStatement("String_Node_Str");
      ps.setInt(1,concept.getConceptId());
      ps.setInt(2,concept.getConceptId());
      ps.execute();
      if (ps.getResultSet().next()) {
        sessionFactory.getCurrentSession().clear();
        ps=connection.prepareStatement("String_Node_Str");
        ps.setInt(1,concept.getConceptId());
        ps.executeUpdate();
      }
 else {
      }
    }
 catch (    SQLException e) {
      log.error("String_Node_Str",e);
    }
  }
 else   if (concept instanceof ConceptDerived) {
  }
}
Program: 84581
Project: 84581
Buggy source:
/** 
 * This is called prior to displaying a form for the first time.  It tells Spring the form/command object to load into the request
 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
 */
protected Object formBackingObject(HttpServletRequest request) throws ServletException {
  Concept concept=null;
  ConceptService cs=Context.getConceptService();
  String conceptId=request.getParameter("String_Node_Str");
  if (conceptId == null) {
  }
 else   if (isFormSubmission(request)) {
    concept=new Concept(Integer.valueOf(conceptId));
  }
 else   if (conceptId != null) {
    concept=cs.getConcept(Integer.valueOf(conceptId));
  }
  if (concept == null)   concept=new Concept();
  return concept;
}

Fixed version (ground truth):
/** 
 * This is called prior to displaying a form for the first time.  It tells Spring the form/command object to load into the request
 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
 */
protected Object formBackingObject(HttpServletRequest request) throws ServletException {
  Concept concept=null;
  ConceptService cs=Context.getConceptService();
  String conceptId=request.getParameter("String_Node_Str");
  if (conceptId == null) {
  }
 else   if (conceptId != null) {
    concept=cs.getConcept(Integer.valueOf(conceptId));
  }
  if (concept == null)   concept=new Concept();
  return concept;
}
Program: 84584
Project: 84584
Buggy source:
/** 
 * @see org.openmrs.api.db.ConceptDAO#getConceptDatatypes(java.lang.String)
 */
public List<ConceptDatatype> getConceptDatatypes(String name) throws DAOException {
  Criteria crit=sessionFactory.getCurrentSession().createCriteria(ConceptDatatype.class);
  if (name != null)   crit.add(Expression.like("String_Node_Str",name,MatchMode.START));
  return crit.list();
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.api.db.ConceptDAO#getConceptDatatypes(java.lang.String)
 */
@SuppressWarnings("String_Node_Str") public List<ConceptDatatype> getConceptDatatypes(String name) throws DAOException {
  Criteria crit=sessionFactory.getCurrentSession().createCriteria(ConceptDatatype.class);
  if (name != null)   crit.add(Expression.like("String_Node_Str",name,MatchMode.START));
  return crit.list();
}
Program: 84585
Project: 84585
Buggy source:
/** 
 * @see org.openmrs.api.db.ConceptDAO#getAllConceptDatatypes(boolean)
 */
public List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired) throws DAOException {
  Criteria crit=sessionFactory.getCurrentSession().createCriteria(ConceptDatatype.class);
  if (includeRetired == false)   crit.add(Expression.eq("String_Node_Str",false));
  return crit.list();
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.api.db.ConceptDAO#getAllConceptDatatypes(boolean)
 */
@SuppressWarnings("String_Node_Str") public List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired) throws DAOException {
  Criteria crit=sessionFactory.getCurrentSession().createCriteria(ConceptDatatype.class);
  if (includeRetired == false)   crit.add(Expression.eq("String_Node_Str",false));
  return crit.list();
}
Program: 84586
Project: 84586
Buggy source:
/** 
 * @see org.openmrs.api.db.ConceptDAO#purgeConceptClass(org.openmrs.ConceptClass)
 */
public void purgeConceptClass(ConceptClass cc) throws DAOException {
  sessionFactory.getCurrentSession().createQuery("String_Node_Str").setInteger("String_Node_Str",cc.getConceptClassId()).executeUpdate();
  sessionFactory.getCurrentSession().delete(cc);
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.api.db.ConceptDAO#purgeConceptClass(org.openmrs.ConceptClass)
 */
public void purgeConceptClass(ConceptClass cc) throws DAOException {
  sessionFactory.getCurrentSession().delete(cc);
}
Program: 84587
Project: 84587
Buggy source:
private void parse(String reference) throws InvalidReferenceRuleException {
  log.info("String_Node_Str" + reference);
  int firstDotIndex=reference.indexOf('.');
  if (firstDotIndex == -1)   throw new InvalidReferenceRuleException("String_Node_Str");
  if (firstDotIndex < 1)   throw new InvalidReferenceRuleException("String_Node_Str");
  if (firstDotIndex >= reference.length() - 1)   throw new InvalidReferenceRuleException("String_Node_Str");
  String dataSourceName=reference.substring(0,firstDotIndex);
  key=reference.substring(firstDotIndex + 1);
  dataSource=Context.getLogicService().getLogicDataSource(dataSourceName);
  if (dataSource == null)   throw new InvalidReferenceRuleException("String_Node_Str" + dataSourceName);
  if (!dataSource.hasKey(key))   throw new InvalidReferenceRuleException("String_Node_Str" + key + "String_Node_Str"+ dataSourceName+ "String_Node_Str");
}

Fixed version (ground truth):
private void parse(String reference) throws InvalidReferenceRuleException {
  log.info("String_Node_Str" + reference);
  int firstDotIndex=reference.indexOf('.');
  if (firstDotIndex == -1)   throw new InvalidReferenceRuleException("String_Node_Str");
  if (firstDotIndex < 1)   throw new InvalidReferenceRuleException("String_Node_Str");
  if (firstDotIndex >= reference.length() - 1)   throw new InvalidReferenceRuleException("String_Node_Str");
  String dataSourceName=reference.substring(0,firstDotIndex);
  key=reference.substring(firstDotIndex + 1);
  dataSource=Context.getLogicService().getLogicDataSource(dataSourceName);
  if (dataSource == null)   throw new InvalidReferenceRuleException("String_Node_Str" + dataSourceName);
  if (key == null || !dataSource.hasKey(key))   throw new InvalidReferenceRuleException("String_Node_Str" + key + "String_Node_Str"+ dataSourceName+ "String_Node_Str"+ reference);
}
Program: 84588
Project: 84588
Buggy source:
/** 
 * The onSubmit function receives the form/command object that was modified by the input form and saves it to the db
 * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object,org.springframework.validation.BindException)
 */
protected ModelAndView onSubmit(HttpServletRequest request,HttpServletResponse response,Object obj,BindException errors) throws Exception {
  HttpSession httpSession=request.getSession();
  String view=getFormView();
  if (Context.isAuthenticated()) {
    ConceptClass cc=(ConceptClass)obj;
    Context.getAdministrationService().updateConceptClass(cc);
    view=getSuccessView();
    httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR,"String_Node_Str");
  }
  return new ModelAndView(new RedirectView(view));
}

Fixed version (ground truth):
/** 
 * The onSubmit function receives the form/command object that was modified by the input form and saves it to the db
 * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object,org.springframework.validation.BindException)
 */
protected ModelAndView onSubmit(HttpServletRequest request,HttpServletResponse response,Object obj,BindException errors) throws Exception {
  HttpSession httpSession=request.getSession();
  String view=getFormView();
  if (Context.isAuthenticated()) {
    ConceptClass cc=(ConceptClass)obj;
    Context.getConceptService().saveConceptClass(cc);
    view=getSuccessView();
    httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR,"String_Node_Str");
  }
  return new ModelAndView(new RedirectView(view));
}
Program: 84590
Project: 84590
Buggy source:
@SuppressWarnings("String_Node_Str") public Map<Integer,List<DrugOrder>> getDrugOrders(Cohort patients,List<Concept> drugConcepts) throws DAOException {
  Map<Integer,List<DrugOrder>> ret=new HashMap<Integer,List<DrugOrder>>();
  Criteria criteria=sessionFactory.getCurrentSession().createCriteria(DrugOrder.class);
  criteria.setCacheMode(CacheMode.IGNORE);
  if (patients != null)   criteria.add(Restrictions.in("String_Node_Str",patients.getMemberIds()));
  if (drugConcepts != null)   criteria.add(Restrictions.in("String_Node_Str",drugConcepts));
  criteria.add(Restrictions.eq("String_Node_Str",false));
  criteria.addOrder(org.hibernate.criterion.Order.asc("String_Node_Str"));
  log.debug("String_Node_Str" + criteria);
  List<DrugOrder> temp=criteria.list();
  for (  DrugOrder regimen : temp) {
    Integer ptId=regimen.getPatient().getPatientId();
    List<DrugOrder> list=ret.get(ptId);
    if (list == null) {
      list=new ArrayList<DrugOrder>();
      ret.put(ptId,list);
    }
    list.add(regimen);
  }
  return ret;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Map<Integer,List<DrugOrder>> getDrugOrders(Cohort patients,List<Concept> drugConcepts) throws DAOException {
  Map<Integer,List<DrugOrder>> ret=new HashMap<Integer,List<DrugOrder>>();
  if (patients != null && patients.size() == 0)   return ret;
  Criteria criteria=sessionFactory.getCurrentSession().createCriteria(DrugOrder.class);
  criteria.setCacheMode(CacheMode.IGNORE);
  if (patients != null)   criteria.add(Restrictions.in("String_Node_Str",patients.getMemberIds()));
  if (drugConcepts != null)   criteria.add(Restrictions.in("String_Node_Str",drugConcepts));
  criteria.add(Restrictions.eq("String_Node_Str",false));
  criteria.addOrder(org.hibernate.criterion.Order.asc("String_Node_Str"));
  log.debug("String_Node_Str" + criteria);
  List<DrugOrder> temp=criteria.list();
  for (  DrugOrder regimen : temp) {
    Integer ptId=regimen.getPatient().getPatientId();
    List<DrugOrder> list=ret.get(ptId);
    if (list == null) {
      list=new ArrayList<DrugOrder>();
      ret.put(ptId,list);
    }
    list.add(regimen);
  }
  return ret;
}
Program: 84592
Project: 84592
Buggy source:
public List<DrugOrder> getDrugOrders(String drugSetName){
  Map<Integer,List<DrugOrder>> patientIdDrugOrderMap;
  if (drugOrderMap.containsKey(drugSetName)) {
    patientIdDrugOrderMap=drugOrderMap.get(drugSetName);
  }
 else {
    Concept drugSet=conceptService.getConceptByName(drugSetName);
    patientIdDrugOrderMap=patientSetService.getCurrentDrugOrders(getPatientSetIfNotAllPatients(),drugSet);
    drugOrderMap.put(drugSetName,patientIdDrugOrderMap);
  }
  return patientIdDrugOrderMap.get(patientId);
}

Fixed version (ground truth):
public List<DrugOrder> getDrugOrders(String drugSetName){
  Map<Integer,List<DrugOrder>> patientIdDrugOrderMap;
  if (drugOrderMap.containsKey(drugSetName)) {
    patientIdDrugOrderMap=drugOrderMap.get(drugSetName);
  }
 else {
    Concept drugSet=conceptService.getConceptByName(drugSetName);
    patientIdDrugOrderMap=patientSetService.getDrugOrders(getPatientSetIfNotAllPatients(),drugSet);
    drugOrderMap.put(drugSetName,patientIdDrugOrderMap);
  }
  return patientIdDrugOrderMap.get(patientId);
}
Program: 84593
Project: 84593
Buggy source:
/** 
 * @see org.openmrs.scheduler.SchedulerService#getStatus(java.lang.Integer)
 */
@Override public String getStatus(Integer id){
  TimerSchedulerTask scheduledTask=scheduledTasks.get(id);
  if (scheduledTask != null) {
    if (scheduledTask.scheduledExecutionTime() > 0) {
      return "String_Node_Str" + new Date(scheduledTask.scheduledExecutionTime());
    }
 else {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.scheduler.SchedulerService#getStatus(java.lang.Integer)
 */
public String getStatus(Integer id){
  TimerSchedulerTask scheduledTask=scheduledTasks.get(id);
  if (scheduledTask != null) {
    if (scheduledTask.scheduledExecutionTime() > 0) {
      return "String_Node_Str" + new Date(scheduledTask.scheduledExecutionTime());
    }
 else {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}
Program: 84594
Project: 84594
Buggy source:
/** 
 * Get the first occurence of matching <code>obs.concept</code> out of the patient's encounters
 * @param concept
 * @param attrs the List of attributes to fetch
 * @return
 * @throws Exception
 */
public List<Object> getFirstObsWithValues(Concept concept,List<String> attrs) throws Exception {
  attrs.add(0,null);
  List<List<Object>> obs=getObsWithValues(concept,attrs);
  if (obs == null) {
    List<Object> blankRow=new Vector<Object>();
    for (    String attr : attrs)     blankRow.add("String_Node_Str");
    return blankRow;
  }
  if (obs.size() > 0) {
    return obs.get(0);
  }
  log.info("String_Node_Str" + concept + "String_Node_Str"+ patientId);
  return null;
}

Fixed version (ground truth):
/** 
 * Get the first occurence of matching <code>obs.concept</code> out of the patient's encounters
 * @param concept
 * @param attrs the List of attributes to fetch
 * @return
 * @throws Exception
 */
public List<Object> getFirstObsWithValues(Concept concept,List<String> attrs) throws Exception {
  attrs.add(0,null);
  List<List<Object>> obs=getObsWithValues(concept,attrs);
  if (obs == null) {
    List<Object> blankRow=new Vector<Object>();
    for (    String attr : attrs)     blankRow.add("String_Node_Str");
    return blankRow;
  }
  if (obs.size() > 0) {
    return obs.get(obs.size() - 1);
  }
  log.info("String_Node_Str" + concept + "String_Node_Str"+ patientId);
  return null;
}
Program: 84595
Project: 84595
Buggy source:
/** 
 * @see org.openmrs.api.db.PatientService#getRelationships(org.openmrs.Person)
 */
@SuppressWarnings("String_Node_Str") public List<Relationship> getRelationships(Person person,boolean showVoided) throws DAOException {
  Query query=null;
  List<Relationship> relationships=new Vector<Relationship>();
  if (person == null)   return relationships;
  String voided=showVoided ? "String_Node_Str" : "String_Node_Str";
  query=sessionFactory.getCurrentSession().createQuery("String_Node_Str" + voided + "String_Node_Str").setParameter("String_Node_Str",person).setParameter("String_Node_Str",person);
  if (query != null)   relationships=query.list();
  return relationships;
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.api.db.PatientService#getRelationships(org.openmrs.Person)
 */
@SuppressWarnings("String_Node_Str") public List<Relationship> getRelationships(Person person,boolean showVoided) throws DAOException {
  Criteria criteria=sessionFactory.getCurrentSession().createCriteria(Relationship.class,"String_Node_Str").add(Expression.or(Expression.eq("String_Node_Str",person),Expression.eq("String_Node_Str",person)));
  if (!showVoided) {
    criteria.add(Expression.eq("String_Node_Str",showVoided));
  }
  return criteria.list();
}
Program: 84596
Project: 84596
Buggy source:
public PatientSet filterInverse(PatientSet input){
  List<Integer> drugIds=new ArrayList<Integer>();
  for (  Drug d : getDrugListToUse())   drugIds.add(d.getDrugId());
  PatientSet ps=Context.getPatientSetService().getPatientsHavingDrugOrder(input.getPatientIds(),drugIds,getAnyOrAll(),OpenmrsUtil.fromDateHelper(null,getWithinLastDays(),getWithinLastMonths(),getUntilDaysAgo(),getUntilMonthsAgo(),getSinceDate(),getUntilDate()),OpenmrsUtil.fromDateHelper(null,getWithinLastDays(),getWithinLastMonths(),getUntilDaysAgo(),getUntilMonthsAgo(),getSinceDate(),getUntilDate()));
  return input.subtract(ps);
}

Fixed version (ground truth):
public PatientSet filterInverse(PatientSet input){
  List<Integer> drugIds=new ArrayList<Integer>();
  for (  Drug d : getDrugListToUse())   drugIds.add(d.getDrugId());
  PatientSet ps=Context.getPatientSetService().getPatientsHavingDrugOrder(input.getPatientIds(),drugIds,getAnyOrAll(),OpenmrsUtil.fromDateHelper(null,getWithinLastDays(),getWithinLastMonths(),getUntilDaysAgo(),getUntilMonthsAgo(),getSinceDate(),getUntilDate()),OpenmrsUtil.toDateHelper(null,getWithinLastDays(),getWithinLastMonths(),getUntilDaysAgo(),getUntilMonthsAgo(),getSinceDate(),getUntilDate()));
  return input.subtract(ps);
}
Program: 84597
Project: 84597
Buggy source:
/** 
 * Callback method that tells the task that it has stopped executing.
 */
public void stopExecuting(){
  log.info("String_Node_Str" + taskDefinition.getName() + "String_Node_Str");
  this.isExecuting=false;
}

Fixed version (ground truth):
/** 
 * Callback method that tells the task that it has stopped executing.
 */
public void stopExecuting(){
  this.isExecuting=false;
}
Program: 84598
Project: 84598
Buggy source:
/** 
 * Authenticate the context so the task can call service layer.
 */
protected void authenticate(){
  log.info("String_Node_Str" + taskDefinition.getName() + "String_Node_Str");
  try {
    AdministrationService adminService=Context.getAdministrationService();
    Context.authenticate(adminService.getGlobalProperty("String_Node_Str"),adminService.getGlobalProperty("String_Node_Str"));
  }
 catch (  ContextAuthenticationException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Authenticate the context so the task can call service layer.
 */
protected void authenticate(){
  try {
    AdministrationService adminService=Context.getAdministrationService();
    Context.authenticate(adminService.getGlobalProperty("String_Node_Str"),adminService.getGlobalProperty("String_Node_Str"));
  }
 catch (  ContextAuthenticationException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 84599
Project: 84599
Buggy source:
/** 
 * Callback method that tells the task that it has started executing.
 */
public void startExecuting(){
  log.info("String_Node_Str" + taskDefinition.getName() + "String_Node_Str");
  this.isExecuting=true;
}

Fixed version (ground truth):
/** 
 * Callback method that tells the task that it has started executing.
 */
public void startExecuting(){
  this.isExecuting=true;
}
Program: 84600
Project: 84600
Buggy source:
/** 
 * @see org.openmrs.scheduler.Task#initialize(org.openmrs.scheduler.TaskConfig)
 */
public void initialize(final TaskDefinition definition){
  log.info("String_Node_Str" + definition.getName() + "String_Node_Str");
  this.taskDefinition=definition;
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.scheduler.Task#initialize(org.openmrs.scheduler.TaskConfig)
 */
public void initialize(final TaskDefinition definition){
  this.taskDefinition=definition;
}
Program: 84601
Project: 84601
Buggy source:
/** 
 * @see org.openmrs.scheduler.Task#shutdown()
 */
public void shutdown(){
  log.info("String_Node_Str" + taskDefinition.getName() + "String_Node_Str");
  taskDefinition=null;
}

Fixed version (ground truth):
/** 
 * @see org.openmrs.scheduler.Task#shutdown()
 */
public void shutdown(){
  taskDefinition=null;
}
Program: 84603
Project: 84603
Buggy source:
protected void modifyCollections(Concept c){
  User authUser=Context.getAuthenticatedUser();
  Date timestamp=new Date();
  if (c.getCreator() == null) {
    c.setCreator(authUser);
    c.setDateCreated(timestamp);
  }
 else {
    c.setChangedBy(authUser);
    c.setDateChanged(timestamp);
  }
  if (c.getNames() != null) {
    for (    ConceptName cn : c.getNames()) {
      if (cn.getCreator() == null) {
        cn.setCreator(authUser);
        cn.setDateCreated(timestamp);
      }
    }
  }
  for (  ConceptSynonym syn : c.getSynonyms()) {
    if (syn.getCreator() == null) {
      syn.setCreator(authUser);
      syn.setDateCreated(timestamp);
    }
    syn.setConcept(c);
  }
  if (c.getConceptSets() != null) {
    for (    ConceptSet set : c.getConceptSets()) {
      if (set.getCreator() == null) {
        set.setCreator(authUser);
        set.setDateCreated(timestamp);
      }
      set.setConceptSet(c);
    }
  }
  if (c.getAnswers(true) != null) {
    for (    ConceptAnswer ca : c.getAnswers(true)) {
      if (ca.getCreator() == null) {
        ca.setCreator(authUser);
        ca.setDateCreated(timestamp);
      }
      ca.setConcept(c);
    }
  }
}

Fixed version (ground truth):
protected void modifyCollections(Concept c){
  User authUser=Context.getAuthenticatedUser();
  Date timestamp=new Date();
  if (c.getCreator() == null) {
    c.setCreator(authUser);
    if (c.getDateCreated() == null)     c.setDateCreated(timestamp);
  }
 else {
    c.setChangedBy(authUser);
    if (c.getDateChanged() == null)     c.setDateChanged(timestamp);
  }
  if (c.getNames() != null) {
    for (    ConceptName cn : c.getNames()) {
      if (cn.getCreator() == null) {
        cn.setCreator(authUser);
        if (cn.getDateCreated() == null)         cn.setDateCreated(timestamp);
      }
    }
  }
  for (  ConceptSynonym syn : c.getSynonyms()) {
    if (syn.getCreator() == null) {
      syn.setCreator(authUser);
      if (syn.getDateCreated() == null)       syn.setDateCreated(timestamp);
    }
    syn.setConcept(c);
  }
  if (c.getConceptSets() != null) {
    for (    ConceptSet set : c.getConceptSets()) {
      if (set.getCreator() == null) {
        set.setCreator(authUser);
        if (set.getDateCreated() == null)         set.setDateCreated(timestamp);
      }
      set.setConceptSet(c);
    }
  }
  if (c.getAnswers(true) != null) {
    for (    ConceptAnswer ca : c.getAnswers(true)) {
      if (ca.getCreator() == null) {
        ca.setCreator(authUser);
        if (ca.getDateCreated() == null)         ca.setDateCreated(timestamp);
      }
      ca.setConcept(c);
    }
  }
}
Program: 84604
Project: 84604
Buggy source:
public void save(ActionEvent actionEvent){
  FacesContext context=FacesContext.getCurrentInstance();
  CategoryBean bean=(CategoryBean)context.getApplication().evaluateExpressionGet(context,"String_Node_Str",CategoryBean.class);
  if (selectedNode != null) {
    category.setParent((Category)selectedNode.getData());
    new DefaultTreeNode(category,selectedNode);
    selectedNode.setExpanded(true);
  }
 else {
    new DefaultTreeNode(category,bean.getRoot());
  }
  categoryService.createNew(category);
  FacesMessage facesMessage=new FacesMessage(FacesMessage.SEVERITY_INFO,"String_Node_Str","String_Node_Str");
  FacesContext.getCurrentInstance().addMessage(null,facesMessage);
  category=new Category();
}

Fixed version (ground truth):
public void save(ActionEvent actionEvent){
  FacesContext context=FacesContext.getCurrentInstance();
  CategoryBean bean=(CategoryBean)context.getApplication().evaluateExpressionGet(context,"String_Node_Str",CategoryBean.class);
  if (selectedNode != null) {
    category.setParent((Category)selectedNode.getData());
    new DefaultTreeNode(category,selectedNode).setSelected(false);
    selectedNode.setExpanded(true);
    selectedNode.setSelected(false);
  }
 else {
    new DefaultTreeNode(category,bean.getRoot());
  }
  categoryService.createNew(category);
  FacesMessage facesMessage=new FacesMessage(FacesMessage.SEVERITY_INFO,"String_Node_Str","String_Node_Str");
  FacesContext.getCurrentInstance().addMessage(null,facesMessage);
  category=new Category();
}
Program: 84605
Project: 84605
Buggy source:
public void createValueList(){
  if (!values.isEmpty() && valueList.isEmpty()) {
    valueList.addAll(values);
  }
}

Fixed version (ground truth):
public void createValueList(){
  if (this.valueList == null) {
    valueList=new ArrayList<ScenarioValue>();
  }
  if (!values.isEmpty() && valueList.isEmpty()) {
    valueList.addAll(values);
  }
}
Program: 84606
Project: 84606
Buggy source:
public static XStream getConfiguredXStream(){
  XStream xstream=new XStream();
  xstream.alias("String_Node_Str",Scenario.class);
  xstream.alias("String_Node_Str",Scenarios.class);
  xstream.alias("String_Node_Str",Scenario.ScenarioValue.class);
  xstream.addImplicitCollection(Scenarios.class,"String_Node_Str");
  xstream.addImplicitCollection(Scenario.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.class,"String_Node_Str");
  xstream.aliasField("String_Node_Str",Scenario.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.ScenarioValue.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.ScenarioValue.class,"String_Node_Str");
  xstream.aliasField("String_Node_Str",Scenario.ScenarioValue.class,"String_Node_Str");
  return xstream;
}

Fixed version (ground truth):
public static XStream getConfiguredXStream(){
  XStream xstream=new XStream();
  xstream.alias("String_Node_Str",Scenario.class);
  xstream.alias("String_Node_Str",Scenarios.class);
  xstream.alias("String_Node_Str",Scenario.ScenarioValue.class);
  xstream.addImplicitCollection(Scenarios.class,"String_Node_Str");
  xstream.addImplicitCollection(Scenario.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.class,"String_Node_Str");
  xstream.aliasField("String_Node_Str",Scenario.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.ScenarioValue.class,"String_Node_Str");
  xstream.useAttributeFor(Scenario.ScenarioValue.class,"String_Node_Str");
  xstream.aliasField("String_Node_Str",Scenario.ScenarioValue.class,"String_Node_Str");
  xstream.omitField(Scenario.class,"String_Node_Str");
  return xstream;
}
Program: 84608
Project: 84608
Buggy source:
public void createValueList(){
  if (!values.isEmpty()) {
    valueList.addAll(values);
  }
}

Fixed version (ground truth):
public void createValueList(){
  if (!values.isEmpty() && valueList.isEmpty()) {
    valueList.addAll(values);
  }
}
Program: 84609
Project: 84609
Buggy source:
public boolean addScenario(Scenario sco){
  return scenarioSet.add(sco);
}

Fixed version (ground truth):
public boolean addScenario(Scenario sco){
  sco.createValueList();
  return scenarioSet.add(sco);
}
Program: 84610
Project: 84610
Buggy source:
@Override public void report(){
  for (  Map.Entry<Integer,ClearedTrade[]> entry : data.entrySet()) {
    String delim="String_Node_Str";
    for (    ClearedTrade trade : entry.getValue()) {
      if (null == trade) {
        output.print(delim + "String_Node_Str");
      }
 else {
        output.format("String_Node_Str",delim,trade.getExecutionMWh(),trade.getExecutionPrice());
      }
      delim="String_Node_Str";
    }
    output.println();
  }
}

Fixed version (ground truth):
@Override public void report(){
  for (  Map.Entry<Integer,ClearedTrade[]> entry : data.entrySet()) {
    String delim="String_Node_Str";
    ClearedTrade[] trades=entry.getValue();
    if (trades.length != 24)     log.error("String_Node_Str" + trades.length);
    for (int i=0; i < trades.length; i++) {
      if (null == trades[i]) {
        output.print(delim + "String_Node_Str");
      }
 else {
        output.format("String_Node_Str",delim,trades[i].getExecutionMWh(),trades[i].getExecutionPrice());
      }
      delim="String_Node_Str";
    }
    output.println();
  }
  output.close();
}
Program: 84611
Project: 84611
Buggy source:
@Override public void setup(){
  dor=(DomainObjectReader)getBean("String_Node_Str");
  timeslotRepo=(TimeslotRepo)getBean("String_Node_Str");
  timeService=(TimeService)getBean("String_Node_Str");
  dor.registerNewObjectListener(new TimeslotUpdateHandler(),TimeslotUpdate.class);
  dor.registerNewObjectListener(new ClearedTradeHandler(),ClearedTrade.class);
  ignoreCount=ignoreInitial;
  data=new TreeMap<Integer,ClearedTrade[]>();
  try {
    output=new PrintWriter(new File(dataFilename));
  }
 catch (  FileNotFoundException e) {
    log.error("String_Node_Str" + dataFilename);
  }
}

Fixed version (ground truth):
@Override public void setup(){
  timeslotRepo=(TimeslotRepo)getBean("String_Node_Str");
  timeService=(TimeService)getBean("String_Node_Str");
  registerNewObjectListener(new TimeslotUpdateHandler(),TimeslotUpdate.class);
  registerNewObjectListener(new ClearedTradeHandler(),ClearedTrade.class);
  ignoreCount=ignoreInitial;
  data=new TreeMap<Integer,ClearedTrade[]>();
  try {
    output=new PrintWriter(new File(dataFilename));
  }
 catch (  FileNotFoundException e) {
    log.error("String_Node_Str" + dataFilename);
  }
}
Program: 84612
Project: 84612
Buggy source:
@Before public void setUp() throws Exception {
  dor=new DomainObjectReader();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
}
Program: 84613
Project: 84613
Buggy source:
@Test public void extractCodeLocationsOfStringWith2AnsiCodes() throws Exception {
  assertEquals(3,AnsiCodesReader.extractCodeLocations("String_Node_Str").size());
  assertEquals(3,AnsiCodesReader.extractCodeLocations("String_Node_Str").size());
}

Fixed version (ground truth):
@Test public void extractCodeLocationsOfStringWith2AnsiCodes() throws Exception {
  assertEquals(3,AnsiCodesReader.extractCodeLocations("String_Node_Str").size());
  assertEquals(3,AnsiCodesReader.extractCodeLocations("String_Node_Str").size());
  assertEquals(3,AnsiCodesReader.extractCodeLocations("String_Node_Str").size());
  assertEquals(3,AnsiCodesReader.extractCodeLocations("String_Node_Str").size());
}
Program: 84614
Project: 84614
Buggy source:
/** 
 * "CSI n [;k] m" Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences.
 */
static List<CodeLocation> extractCodeLocations(String str) throws Exception {
  ArrayList<CodeLocation> back=new ArrayList<CodeLocation>();
  if (str == null) {
    return back;
  }
  Matcher m=finder.matcher(str);
  int offset=0;
  int maxOffset=str.length() - 3;
  while (offset < maxOffset && m.find(offset)) {
    String n=m.group(2);
    int code=(n.length() == 0) ? 0 : Integer.parseInt(n);
    if (m.group(4) == null) {
      back.add(new CodeLocation(code,m.start(),m.end() - 1));
    }
 else {
      back.add(new CodeLocation(code,m.start(),m.start(4) - 1));
      back.add(new CodeLocation(Integer.parseInt(m.group(4)),m.start(4),m.end() - 1));
    }
    offset=m.end() + 1;
  }
  return back;
}

Fixed version (ground truth):
/** 
 * "CSI n [;k] m" Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences.
 */
static List<CodeLocation> extractCodeLocations(String str) throws Exception {
  ArrayList<CodeLocation> back=new ArrayList<CodeLocation>();
  if (str == null) {
    return back;
  }
  Matcher m=finder.matcher(str);
  int offset=0;
  int maxOffset=str.length() - 3;
  while (offset < maxOffset && m.find(offset)) {
    String n=m.group(2);
    int code=(n.length() == 0) ? 0 : Integer.parseInt(n);
    if (m.group(4) == null) {
      back.add(new CodeLocation(code,m.start(),m.end() - 1));
    }
 else {
      back.add(new CodeLocation(code,m.start(),m.start(4) - 1));
      back.add(new CodeLocation(Integer.parseInt(m.group(4)),m.start(4),m.end() - 1));
    }
    offset=m.end();
  }
  return back;
}
Program: 84615
Project: 84615
Buggy source:
public void mouseClicked(){
  world.mousePressed(mouseX,mouseY);
}

Fixed version (ground truth):
public void mouseClicked(){
  int action=world.mousePressed(mouseX,mouseY);
switch (action) {
case 1:
    change=true;
  nextScreen=new World(this);
break;
default :
break;
}
}
Program: 84616
Project: 84616
Buggy source:
public void draw(){
  background(0);
  world.update();
  world.display();
}

Fixed version (ground truth):
public void draw(){
  background(0);
  world.update();
  world.display();
  if (change) {
    world=nextScreen;
    change=false;
  }
}
Program: 84617
Project: 84617
Buggy source:
public void display(){
  parent.background(0);
  PImage bg=parent.loadImage("String_Node_Str");
  PImage start=parent.loadImage("String_Node_Str");
  PImage logo=parent.loadImage("String_Node_Str","String_Node_Str");
  PImage exit=parent.loadImage("String_Node_Str");
  parent.image(bg,0,0,parent.width,parent.height);
  parent.image(logo,0,0);
  parent.image(start,10,400);
  parent.image(exit,375,400);
}

Fixed version (ground truth):
public void display(){
  parent.background(0);
  PImage bg=parent.loadImage("String_Node_Str");
  PImage start=parent.loadImage("String_Node_Str");
  PImage exit=parent.loadImage("String_Node_Str");
  parent.image(bg,0,0,parent.width,parent.height);
  parent.image(start,10,400);
  parent.image(exit,375,400);
}
Program: 84618
Project: 84618
Buggy source:
public void mousePressed(int mouseX,int mouseY){
  if (10 <= mouseX && mouseX <= 376 && 400 <= mouseY && mouseY <= 516) {
  }
  if (375 <= mouseX && mouseX <= 736 && 400 <= mouseY && mouseY <= 516) {
    System.exit(0);
  }
}

Fixed version (ground truth):
public int mousePressed(int mouseX,int mouseY){
  if (10 <= mouseX && mouseX <= 376 && 400 <= mouseY && mouseY <= 516) {
    return 1;
  }
  if (375 <= mouseX && mouseX <= 736 && 400 <= mouseY && mouseY <= 516) {
    System.exit(0);
  }
  return 2;
}
Program: 84619
Project: 84619
Buggy source:
public Level(PApplet p,File file) throws FileNotFoundException {
  levelXML=new XMLElement(new FileReader(file)).getChild("String_Node_Str");
  for (int i=0; i < levelXML.getChildCount(); i++) {
    int x=Integer.parseInt(levelXML.getChild(i).getString("String_Node_Str").toString());
    int y=Integer.parseInt(levelXML.getChild(i).getString("String_Node_Str").toString());
    System.out.println(x + "String_Node_Str" + y);
  }
}

Fixed version (ground truth):
public Level(PApplet p,File file) throws FileNotFoundException {
  levelXML=new XMLElement(new FileReader(file)).getChild("String_Node_Str");
  levelList=new ArrayList<Brick>();
  for (int i=0; i < levelXML.getChildCount(); i++) {
    int x=Integer.parseInt(levelXML.getChild(i).getString("String_Node_Str").toString());
    int y=Integer.parseInt(levelXML.getChild(i).getString("String_Node_Str").toString());
    System.out.println(x + "String_Node_Str" + y);
    levelList.add(new Brick(p,x,y));
  }
}
Program: 84622
Project: 84622
Buggy source:
public void removeStudent(Student student){
  if (getAssignment() != null && getModel() != null)   ((TimetableModel)getModel()).getCommittedStudentConflictsCounter().dec(student.countConflictPlacements((Placement)getAssignment()));
  iStudents.remove(student);
  iSameStudents.clear();
  iCommitedConflicts.clear();
}

Fixed version (ground truth):
public void removeStudent(Student student){
  if (!iStudents.remove(student))   return;
  if (getAssignment() != null && getModel() != null)   ((TimetableModel)getModel()).getCommittedStudentConflictsCounter().dec(student.countConflictPlacements((Placement)getAssignment()));
  iSameStudents.clear();
  iCommitedConflicts.clear();
}
Program: 84623
Project: 84623
Buggy source:
/** 
 * Add an enrolled student 
 */
public void addStudent(Student student){
  if (iStudents.contains(student))   return;
  if (getAssignment() != null && getModel() != null)   ((TimetableModel)getModel()).getCommittedStudentConflictsCounter().inc(student.countConflictPlacements((Placement)getAssignment()));
  iStudents.add(student);
  iSameStudents.clear();
  iCommitedConflicts.clear();
}

Fixed version (ground truth):
/** 
 * Add an enrolled student 
 */
public void addStudent(Student student){
  if (!iStudents.add(student))   return;
  if (getAssignment() != null && getModel() != null)   ((TimetableModel)getModel()).getCommittedStudentConflictsCounter().inc(student.countConflictPlacements((Placement)getAssignment()));
  iSameStudents.clear();
  iCommitedConflicts.clear();
}
Program: 84624
Project: 84624
Buggy source:
public void assign(long iteration,Value value){
  super.assign(iteration,value);
  if (value != null && getModel() != null) {
    ((TimetableModel)getModel()).getCommittedStudentConflictsCounter().inc(getCommitedConflicts((Placement)value));
  }
}

Fixed version (ground truth):
public void assign(long iteration,Value value){
  if (value != null && getModel() != null) {
    ((TimetableModel)getModel()).getCommittedStudentConflictsCounter().inc(getCommitedConflicts((Placement)value));
  }
  super.assign(iteration,value);
}
Program: 84625
Project: 84625
Buggy source:
/** 
 * Removes a model listener 
 */
public void removeModelListener(ModelListener listener){
  if (listener instanceof InfoProvider)   iInfoProviders.removeElement(listener);
  for (Enumeration e=iVariables.elements(); e.hasMoreElements(); )   listener.variableRemoved((Variable)e.nextElement());
  for (Enumeration e=iConstraints.elements(); e.hasMoreElements(); )   listener.constraintRemoved((Constraint)e.nextElement());
  iModelListeners.removeElement(listener);
}

Fixed version (ground truth):
/** 
 * Removes a model listener 
 */
public void removeModelListener(ModelListener listener){
  if (listener instanceof InfoProvider)   iInfoProviders.removeElement(listener);
  iModelListeners.removeElement(listener);
}
Program: 84626
Project: 84626
Buggy source:
/** 
 * Removes a global constraint from the model 
 */
public void removeGlobalConstraint(GlobalConstraint constraint){
  constraint.setModel(null);
  iConstraints.removeElement(constraint);
  if (constraint instanceof InfoProvider)   iInfoProviders.removeElement(constraint);
  for (Enumeration e=iModelListeners.elements(); e.hasMoreElements(); )   ((ModelListener)e.nextElement()).constraintRemoved(constraint);
}

Fixed version (ground truth):
/** 
 * Removes a global constraint from the model 
 */
public void removeGlobalConstraint(GlobalConstraint constraint){
  constraint.setModel(null);
  iGlobalConstraints.removeElement(constraint);
  if (constraint instanceof InfoProvider)   iInfoProviders.removeElement(constraint);
  for (Enumeration e=iModelListeners.elements(); e.hasMoreElements(); )   ((ModelListener)e.nextElement()).constraintRemoved(constraint);
}
Program: 84627
Project: 84627
Buggy source:
/** 
 * Adds a model listener 
 */
public void addModelListener(ModelListener listener){
  iModelListeners.addElement(listener);
  if (listener instanceof InfoProvider)   iInfoProviders.addElement(listener);
  for (Enumeration e=iConstraints.elements(); e.hasMoreElements(); )   listener.constraintAdded((Constraint)e.nextElement());
  for (Enumeration e=iVariables.elements(); e.hasMoreElements(); )   listener.variableAdded((Variable)e.nextElement());
}

Fixed version (ground truth):
/** 
 * Adds a model listener 
 */
public void addModelListener(ModelListener listener){
  iModelListeners.addElement(listener);
  if (listener instanceof InfoProvider)   iInfoProviders.addElement(listener);
}
Program: 84628
Project: 84628
Buggy source:
/** 
 * Adds a global constraint to the model 
 */
public void addGlobalConstraint(GlobalConstraint constraint){
  constraint.setModel(this);
  iConstraints.addElement(constraint);
  if (constraint instanceof InfoProvider)   iInfoProviders.addElement(constraint);
  for (Enumeration e=iModelListeners.elements(); e.hasMoreElements(); )   ((ModelListener)e.nextElement()).constraintAdded(constraint);
}

Fixed version (ground truth):
/** 
 * Adds a global constraint to the model 
 */
public void addGlobalConstraint(GlobalConstraint constraint){
  constraint.setModel(this);
  iGlobalConstraints.addElement(constraint);
  if (constraint instanceof InfoProvider)   iInfoProviders.addElement(constraint);
  for (Enumeration e=iModelListeners.elements(); e.hasMoreElements(); )   ((ModelListener)e.nextElement()).constraintAdded(constraint);
}
Program: 84629
Project: 84629
Buggy source:
/** 
 * Returns a list of avaliable apps
 * @throws URISyntaxException 
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public String getAppStoreListForPlatform(@PathVariable int platform,@RequestParam(required=true) int listType,@RequestParam(required=false) String category,@RequestParam(required=true) int count,Model model) throws URISyntaxException {
  logger.info("String_Node_Str" + platform + "String_Node_Str"+ listType+ "String_Node_Str"+ count);
  AppStoreList appStoreList=appStoreService.getAppStoreListForPlatform(count,listType,platform,category);
  model.addAttribute("String_Node_Str",gson.toJson(appStoreList));
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns a list of avaliable apps
 * @throws URISyntaxException 
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public String getAppStoreListForPlatform(@PathVariable int platform,@RequestParam(required=true) int listType,@RequestParam(required=true) int count,Model model) throws URISyntaxException {
  logger.info("String_Node_Str" + platform + "String_Node_Str"+ listType+ "String_Node_Str"+ count);
  AppStoreList appStoreList=appStoreService.getAppStoreListForPlatform(count,listType,platform);
  model.addAttribute("String_Node_Str",gson.toJson(appStoreList));
  return "String_Node_Str";
}
Program: 84630
Project: 84630
Buggy source:
@Test public void testWithOnlyDateAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date now=new Date();
  service.getUkaProgram(now,null,null,null,null);
  Mockito.verify(mock).getUkaProgram(now);
}

Fixed version (ground truth):
@Test public void testWithOnlyDateAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date now=new Date();
  service.getUkaProgram("String_Node_Str",now,null,null,null,null);
  Mockito.verify(mock).getUkaProgram(now);
}
Program: 84631
Project: 84631
Buggy source:
@Test public void testWithDateFromAndTOAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date from=new Date();
  Date to=new Date(from.getTime() + 8640000);
  service.getUkaProgram(null,from,to,false,null);
  Mockito.verify(mock).getUkaProgram(from,to);
}

Fixed version (ground truth):
@Test public void testWithDateFromAndTOAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date from=new Date();
  Date to=new Date(from.getTime() + 8640000);
  service.getUkaProgram("String_Node_Str",null,from,to,false,null);
  Mockito.verify(mock).getUkaProgram(from,to);
}
Program: 84632
Project: 84632
Buggy source:
@Test public void testWithAllIsTrueAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  service.getUkaProgram(null,null,null,true,null);
  Mockito.verify(mock).getUkaProgram();
}

Fixed version (ground truth):
@Test public void testWithAllIsTrueAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  service.getUkaProgram("String_Node_Str",null,null,null,true,null);
  Mockito.verify(mock).getUkaProgram();
}
Program: 84633
Project: 84633
Buggy source:
@Test public void testWithDateFromAndTOAndDateAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date from=new Date();
  Date to=new Date(from.getTime() + 8640000);
  Date now=new Date();
  service.getUkaProgram(now,from,to,false,null);
  Mockito.verify(mock).getUkaProgram(now);
}

Fixed version (ground truth):
@Test public void testWithDateFromAndTOAndDateAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date from=new Date();
  Date to=new Date(from.getTime() + 8640000);
  Date now=new Date();
  service.getUkaProgram("String_Node_Str",now,from,to,false,null);
  Mockito.verify(mock).getUkaProgram(now);
}
Program: 84634
Project: 84634
Buggy source:
@Test public void testWithOnlyPlaceAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  String place="String_Node_Str";
  service.getUkaProgram(null,null,null,false,place);
  Mockito.verify(mock).getUkaProgram(place);
}

Fixed version (ground truth):
@Test public void testWithOnlyPlaceAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  String place="String_Node_Str";
  service.getUkaProgram("String_Node_Str",null,null,null,false,place);
  Mockito.verify(mock).getUkaProgram(place);
}
Program: 84635
Project: 84635
Buggy source:
@Test public void testWithDateFromAndTOAndPlaceAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date from=new Date();
  Date to=new Date(from.getTime() + 8640000);
  String place="String_Node_Str";
  service.getUkaProgram(null,from,to,false,place);
  Mockito.verify(mock).getUkaProgram(from,to,place);
}

Fixed version (ground truth):
@Test public void testWithDateFromAndTOAndPlaceAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date from=new Date();
  Date to=new Date(from.getTime() + 8640000);
  String place="String_Node_Str";
  service.getUkaProgram("String_Node_Str",null,from,to,false,place);
  Mockito.verify(mock).getUkaProgram(from,to,place);
}
Program: 84636
Project: 84636
Buggy source:
@Test public void testWithDateAndPlaceAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date now=new Date();
  String place="String_Node_Str";
  service.getUkaProgram(now,null,null,false,place);
  Mockito.verify(mock).getUkaProgram(now,place);
}

Fixed version (ground truth):
@Test public void testWithDateAndPlaceAsInput(){
  UkaProgramService service=new UkaProgramService();
  UkaProgramRepository mock=Mockito.mock(UkaProgramRepository.class);
  service.setUkaProgramRepository(mock);
  Date now=new Date();
  String place="String_Node_Str";
  service.getUkaProgram("String_Node_Str",now,null,null,false,place);
  Mockito.verify(mock).getUkaProgram(now,place);
}