nus-yam/ex-repair huggingface dataset:
Program: 115085
Project: 115085
Buggy source:
private ODMcomplexTypeDefinitionFormData getFormDataPerCrf(CRFVersionBean crfVersion,StudyEventBean nextEvent,List<EventCRFBean> eventCrfs,CRFDAO crfDAO,String formUrl){
  EventCRFBean selectedEventCRFBean=null;
  CRFBean crfBean=(CRFBean)crfDAO.findByVersionId(crfVersion.getCrfId());
  for (  EventCRFBean eventCRFBean : eventCrfs) {
    if (eventCRFBean.getCRFVersionId() == crfVersion.getId()) {
      selectedEventCRFBean=eventCRFBean;
      break;
    }
  }
  return generateFormData(crfVersion,nextEvent,selectedEventCRFBean,crfBean,formUrl);
}

Fixed version (ground truth):
private ODMcomplexTypeDefinitionFormData getFormDataPerCrf(CRFVersionBean crfVersion,StudyEventBean nextEvent,List<EventCRFBean> eventCrfs,CRFDAO crfDAO,String formUrl){
  EventCRFBean selectedEventCRFBean=null;
  CRFBean crfBean=(CRFBean)crfDAO.findByVersionId(crfVersion.getId());
  for (  EventCRFBean eventCRFBean : eventCrfs) {
    if (eventCRFBean.getCRFVersionId() == crfVersion.getId()) {
      selectedEventCRFBean=eventCRFBean;
      break;
    }
  }
  return generateFormData(crfVersion,nextEvent,selectedEventCRFBean,crfBean,formUrl);
}
Program: 115088
Project: 115088
Buggy source:
@SuppressWarnings("String_Node_Str") private static Map<String,String> buildTokensMap(DisplaySectionBean section,StudySubjectBean studySubject,StudyBean study,StudyEventDefinitionBean eventDef,StudyEventBean event,DataSource dataSource){
  ItemDAO itemDAO=new ItemDAO(dataSource);
  List<ItemBean> items=itemDAO.findAllWithItemDataByCRFVersionId(section.getCrfVersion().getId(),section.getEventCRF().getId());
  Map<String,String> tokensMap=new HashMap<String,String>();
  tokensMap.put("String_Node_Str",encode(studySubject.getName()));
  tokensMap.put("String_Node_Str",encode(study.getName()));
  tokensMap.put("String_Node_Str",encode(eventDef.getName()));
  if (event == null)   tokensMap.put("String_Node_Str","String_Node_Str");
 else   tokensMap.put("String_Node_Str",encode(Integer.toString(event.getSampleOrdinal())));
  tokensMap.put("String_Node_Str",encode(section.getCrf().getName()));
  tokensMap.put("String_Node_Str",encode(section.getCrfVersion().getName()));
  for (  ItemBean item : items) {
    List<String> values=new ArrayList<String>();
    for (    ItemDataBean itemData : item.getItemDataElements()) {
      values.add(itemData.getValue());
    }
    String value=StringUtils.join(values,',');
    tokensMap.put("String_Node_Str" + item.getName() + "String_Node_Str",value);
  }
  if (LOG.isDebugEnabled()) {
    for (    String key : tokensMap.keySet()) {
      LOG.debug("String_Node_Str",key,tokensMap.get(key));
    }
  }
  return tokensMap;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static Map<String,String> buildTokensMap(DisplaySectionBean section,StudySubjectBean studySubject,StudyBean study,StudyEventDefinitionBean eventDef,StudyEventBean event,DataSource dataSource){
  ItemDAO itemDAO=new ItemDAO(dataSource);
  List<ItemBean> items=itemDAO.findAllWithItemDataByCRFVersionId(section.getCrfVersion().getId(),section.getEventCRF().getId());
  Map<String,String> tokensMap=new HashMap<String,String>();
  tokensMap.put("String_Node_Str",encode(studySubject.getName()));
  tokensMap.put("String_Node_Str",encode(study.getName()));
  tokensMap.put("String_Node_Str",encode(eventDef.getName()));
  if (event == null)   tokensMap.put("String_Node_Str","String_Node_Str");
 else   tokensMap.put("String_Node_Str",encode(Integer.toString(event.getSampleOrdinal())));
  tokensMap.put("String_Node_Str",encode(section.getCrf().getName()));
  tokensMap.put("String_Node_Str",encode(section.getCrfVersion().getName()));
  for (  ItemBean item : items) {
    List<String> values=new ArrayList<String>();
    for (    ItemDataBean itemData : item.getItemDataElements()) {
      values.add(itemData.getValue());
    }
    String value=StringUtils.join(values,',');
    tokensMap.put("String_Node_Str" + item.getName() + "String_Node_Str",encode(value));
  }
  if (LOG.isDebugEnabled()) {
    for (    String key : tokensMap.keySet()) {
      LOG.debug("String_Node_Str",key,tokensMap.get(key));
    }
  }
  return tokensMap;
}
Program: 115089
Project: 115089
Buggy source:
public void validateOidInAction(String oid,Errors e){
  if (getExpressionService().getExpressionSize(oid).intValue() > 1) {
    getRuleSetBeanWrapper().error(createError("String_Node_Str",new String[]{oid}));
  }
  try {
    if (getExpressionService().getStudyEventDefinitionFromExpressionForEventScheduling(oid,true) == null)     getRuleSetBeanWrapper().error(createError("String_Node_Str",new String[]{oid}));
  }
 catch (  OpenClinicaSystemException ose) {
    getRuleSetBeanWrapper().error(createError("String_Node_Str",new String[]{oid}));
  }
}

Fixed version (ground truth):
public void validateOidInAction(String oid,Errors e){
  try {
    if (getExpressionService().getExpressionSize(oid).intValue() > 1 || getExpressionService().getStudyEventDefinitionFromExpressionForEventScheduling(oid,true) == null) {
      getRuleSetBeanWrapper().error(createError("String_Node_Str",new String[]{oid}));
    }
  }
 catch (  OpenClinicaSystemException ose) {
    getRuleSetBeanWrapper().error(createError("String_Node_Str",new String[]{oid}));
  }
}
Program: 115091
Project: 115091
Buggy source:
public String createSubject(SubjectBean subjectBean,StudyBean studyBean,Date enrollmentDate,String secondaryId){
  if (subjectBean.getUniqueIdentifier() != null && subjectBean.getUniqueIdentifier().trim().length() > 0 && getSubjectDao().findByUniqueIdentifier(subjectBean.getUniqueIdentifier()).getId() != 0) {
    subjectBean=getSubjectDao().findByUniqueIdentifier(subjectBean.getUniqueIdentifier());
  }
 else {
    subjectBean.setStatus(Status.AVAILABLE);
    subjectBean=getSubjectDao().create(subjectBean);
  }
  StudySubjectBean studySubject=createStudySubject(subjectBean,studyBean,enrollmentDate,secondaryId);
  getStudySubjectDao().createWithoutGroup(studySubject);
  return studySubject.getLabel();
}

Fixed version (ground truth):
public String createSubject(SubjectBean subjectBean,StudyBean studyBean,Date enrollmentDate,String secondaryId){
  if (subjectBean.getUniqueIdentifier() != null && subjectBean.getUniqueIdentifier().trim().length() > 0 && getSubjectDao().findByUniqueIdentifier(subjectBean.getUniqueIdentifier()).getId() != 0) {
    String label=subjectBean.getLabel();
    subjectBean=getSubjectDao().findByUniqueIdentifier(subjectBean.getUniqueIdentifier());
    subjectBean.setLabel(label);
  }
 else {
    subjectBean.setStatus(Status.AVAILABLE);
    subjectBean=getSubjectDao().create(subjectBean);
  }
  StudySubjectBean studySubject=createStudySubject(subjectBean,studyBean,enrollmentDate,secondaryId);
  getStudySubjectDao().createWithoutGroup(studySubject);
  return studySubject.getLabel();
}
Program: 115099
Project: 115099
Buggy source:
private String cleanProperty(String property){
  property=property.trim();
  return property.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private String cleanProperty(String property){
  if (property == null) {
    property="String_Node_Str";
  }
  property=property.trim();
  return property.replaceAll("String_Node_Str","String_Node_Str");
}
Program: 115103
Project: 115103
Buggy source:
public static SpreadSheetItemUtil isItemWithSameParameterExists(CrfTemplateColumnNameEnum param_column_index,String column_value,ArrayList<SpreadSheetItemUtil> row_items){
  for (  SpreadSheetItemUtil cur_item : row_items) {
switch (param_column_index) {
case ITEM_NAME:
{
        if (cur_item.getItemName().equals(column_value)) {
          return cur_item;
        }
        break;
      }
  }
}
return null;
}

Fixed version (ground truth):
public static SpreadSheetItemUtil isItemWithSameParameterExists(CrfTemplateColumnNameEnum param_column_index,String column_value,List<SpreadSheetItemUtil> row_items,boolean isIncludingMyself){
  int last_item_to_check=0;
  for (  SpreadSheetItemUtil cur_item : row_items) {
    if (!isIncludingMyself) {
      if (last_item_to_check == row_items.size() - 1) {
        break;
      }
    }
    last_item_to_check++;
switch (param_column_index) {
case ITEM_NAME:
{
        if (cur_item.getItemName().equals(column_value)) {
          return cur_item;
        }
        break;
      }
  }
}
return null;
}
Program: 115106
Project: 115106
Buggy source:
/** 
 * Handles the HTTP <code>POST</code> method.
 * @param request servlet request
 * @param response servlet response
 */
@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException {
  try {
    LOGGER.debug("String_Node_Str");
    process(request,response);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
 finally {
    unlockCRFOnError(request);
  }
}

Fixed version (ground truth):
/** 
 * Handles the HTTP <code>POST</code> method.
 * @param request servlet request
 * @param response servlet response
 */
@Override protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException {
  try {
    LOGGER.debug("String_Node_Str");
    process(request,response);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    unlockCRFOnError(request);
  }
}
Program: 115107
Project: 115107
Buggy source:
/** 
 * Handles the HTTP <code>GET</code> method.
 * @param request
 * @param response
 * @throws ServletException
 * @throws java.io.IOException
 */
@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException {
  try {
    LOGGER.debug("String_Node_Str");
    process(request,response);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
 finally {
    unlockCRFOnError(request);
  }
}

Fixed version (ground truth):
/** 
 * Handles the HTTP <code>GET</code> method.
 * @param request
 * @param response
 * @throws ServletException
 * @throws java.io.IOException
 */
@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException {
  try {
    LOGGER.debug("String_Node_Str");
    process(request,response);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    unlockCRFOnError(request);
  }
}
Program: 115111
Project: 115111
Buggy source:
@Override protected void mayProceed(HttpServletRequest request,HttpServletResponse response) throws InsufficientPermissionException {
  mayAccess(request);
  checkStudyLocked(Page.LIST_STUDY_SUBJECTS,respage.getString("String_Node_Str"),request,response);
  checkStudyFrozen(Page.LIST_STUDY_SUBJECTS,respage.getString("String_Node_Str"),request,response);
  HttpSession session=request.getSession();
  locale=LocaleResolver.getLocale(request);
  session.setAttribute("String_Node_Str","String_Node_Str");
  getInputBeans(request);
  return;
}

Fixed version (ground truth):
@Override protected void mayProceed(HttpServletRequest request,HttpServletResponse response) throws InsufficientPermissionException {
  mayAccess(request);
  checkStudyLocked(Page.LIST_STUDY_SUBJECTS,respage.getString("String_Node_Str"),request,response);
  checkStudyFrozen(Page.LIST_STUDY_SUBJECTS,respage.getString("String_Node_Str"),request,response);
  HttpSession session=request.getSession();
  locale=LocaleResolver.getLocale(request);
  session.setAttribute("String_Node_Str","String_Node_Str");
  SectionBean sssbjams=(SectionBean)request.getAttribute("String_Node_Str");
  getInputBeans(request);
  return;
}
Program: 115112
Project: 115112
Buggy source:
public void loadDBValue(){
  ResponseSetBean rsb=metadata.getResponseSet();
  org.akaza.openclinica.bean.core.ResponseType rt=rsb.getResponseType();
  String dbValue=data.getValue();
  if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CHECKBOX) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECTMULTI)) {
    String dbValues[]=dbValue.split("String_Node_Str");
    if (dbValues != null) {
      for (      String element : dbValues) {
        if (element != null) {
          rsb.setSelected(element.trim(),true);
        }
      }
    }
  }
 else   if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXT) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXTAREA) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.CALCULATION)|| rt.equals(org.akaza.openclinica.bean.core.ResponseType.GROUP_CALCULATION)|| rt.equals(org.akaza.openclinica.bean.core.ResponseType.INSTANT_CALCULATION)) {
    rsb.setValue(dbValue);
  }
 else   if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.FILE)) {
    if (dbValue.length() > 0) {
      dbData.setValue(dbValue);
      File f=new File(dbValue);
      String filename=f.getName();
      if (f.isFile()) {
        rsb.setValue(filename);
      }
 else {
        rsb.setValue("String_Node_Str" + filename);
      }
    }
 else {
      rsb.setValue(dbValue);
    }
  }
 else {
    if (dbValue != null) {
      dbValue=dbValue.trim();
    }
    rsb.setSelected(dbValue,true);
  }
  metadata.setResponseSet(rsb);
}

Fixed version (ground truth):
public void loadDBValue(){
  ResponseSetBean rsb=getMetadata().getResponseSet();
  org.akaza.openclinica.bean.core.ResponseType rt=rsb.getResponseType();
  String dbValue=getData().getValue();
  if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CHECKBOX) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECTMULTI)) {
    String dbValues[]=dbValue.split("String_Node_Str");
    if (dbValues != null) {
      for (      String element : dbValues) {
        if (element != null) {
          rsb.setSelected(element.trim(),true);
        }
      }
    }
  }
 else   if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXT) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXTAREA) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.CALCULATION)|| rt.equals(org.akaza.openclinica.bean.core.ResponseType.GROUP_CALCULATION)|| rt.equals(org.akaza.openclinica.bean.core.ResponseType.INSTANT_CALCULATION)) {
    rsb.setValue(dbValue);
  }
 else   if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.FILE)) {
    if (dbValue.length() > 0) {
      getDbData().setValue(dbValue);
      File f=new File(dbValue);
      String filename=f.getName();
      if (f.isFile()) {
        rsb.setValue(filename);
      }
 else {
        rsb.setValue("String_Node_Str" + filename);
      }
    }
 else {
      rsb.setValue(dbValue);
    }
  }
 else {
    if (dbValue != null) {
      dbValue=dbValue.trim();
    }
    rsb.setSelected(dbValue,true);
  }
  getMetadata().setResponseSet(rsb);
}
Program: 115116
Project: 115116
Buggy source:
public Boolean sendEmail(String to,String from,String subject,String body,Boolean htmlEmail,String successMessage,String failMessage,Boolean sendMessage,HttpServletRequest request) throws Exception {
  Boolean messageSent=true;
  try {
    JavaMailSenderImpl mailSender=(JavaMailSenderImpl)SpringServletAccess.getApplicationContext(getServletContext()).getBean("String_Node_Str");
    MimeMessage mimeMessage=mailSender.createMimeMessage();
    MimeMessageHelper helper=new MimeMessageHelper(mimeMessage,htmlEmail);
    helper.setFrom(from);
    helper.setTo(processMultipleImailAddresses(to.trim()));
    helper.setSubject(subject);
    helper.setText(body,true);
    mailSender.send(mimeMessage);
    if (successMessage != null && sendMessage) {
      addPageMessage(successMessage,request);
    }
    logger.debug("String_Node_Str",new Date());
  }
 catch (  MailException me) {
    me.printStackTrace();
    if (failMessage != null && sendMessage) {
      addPageMessage(failMessage,request);
    }
    logger.debug("String_Node_Str",new Date(),me.toString());
    messageSent=false;
  }
  return messageSent;
}

Fixed version (ground truth):
public Boolean sendEmail(String to,String from,String subject,String body,Boolean htmlEmail,String successMessage,String failMessage,Boolean sendMessage,HttpServletRequest request) throws Exception {
  Boolean messageSent=true;
  try {
    JavaMailSenderImpl mailSender=(JavaMailSenderImpl)SpringServletAccess.getApplicationContext(getServletContext()).getBean("String_Node_Str");
    Properties javaMailProperties=mailSender.getJavaMailProperties();
    if (null != javaMailProperties) {
      if (javaMailProperties.get("String_Node_Str") == null || ((String)javaMailProperties.get("String_Node_Str")).equalsIgnoreCase("String_Node_Str")) {
        javaMailProperties.put("String_Node_Str","String_Node_Str");
      }
    }
    MimeMessage mimeMessage=mailSender.createMimeMessage();
    MimeMessageHelper helper=new MimeMessageHelper(mimeMessage,htmlEmail);
    helper.setFrom(from);
    helper.setTo(processMultipleImailAddresses(to.trim()));
    helper.setSubject(subject);
    helper.setText(body,true);
    mailSender.send(mimeMessage);
    if (successMessage != null && sendMessage) {
      addPageMessage(successMessage,request);
    }
    logger.debug("String_Node_Str",new Date());
  }
 catch (  MailException me) {
    me.printStackTrace();
    if (failMessage != null && sendMessage) {
      addPageMessage(failMessage,request);
    }
    logger.debug("String_Node_Str",new Date(),me.toString());
    messageSent=false;
  }
  return messageSent;
}
Program: 115117
Project: 115117
Buggy source:
public Boolean sendEmail(String to,String from,String subject,String body,Boolean htmlEmail,String successMessage,String failMessage,Boolean sendMessage) throws Exception {
  Boolean messageSent=true;
  try {
    JavaMailSenderImpl mailSender=(JavaMailSenderImpl)SpringServletAccess.getApplicationContext(context).getBean("String_Node_Str");
    MimeMessage mimeMessage=mailSender.createMimeMessage();
    MimeMessageHelper helper=new MimeMessageHelper(mimeMessage,htmlEmail);
    helper.setFrom(from);
    helper.setTo(processMultipleImailAddresses(to.trim()));
    helper.setSubject(subject);
    helper.setText(body,true);
    mailSender.send(mimeMessage);
    if (successMessage != null && sendMessage) {
      addPageMessage(successMessage);
    }
    logger.debug("String_Node_Str",new Date());
  }
 catch (  MailException me) {
    me.printStackTrace();
    if (failMessage != null && sendMessage) {
      addPageMessage(failMessage);
    }
    logger.debug("String_Node_Str",new Date(),me.toString());
    messageSent=false;
  }
  return messageSent;
}

Fixed version (ground truth):
public Boolean sendEmail(String to,String from,String subject,String body,Boolean htmlEmail,String successMessage,String failMessage,Boolean sendMessage) throws Exception {
  Boolean messageSent=true;
  try {
    JavaMailSenderImpl mailSender=(JavaMailSenderImpl)SpringServletAccess.getApplicationContext(context).getBean("String_Node_Str");
    Properties javaMailProperties=mailSender.getJavaMailProperties();
    if (null != javaMailProperties) {
      if (javaMailProperties.get("String_Node_Str") == null || ((String)javaMailProperties.get("String_Node_Str")).equalsIgnoreCase("String_Node_Str")) {
        javaMailProperties.put("String_Node_Str","String_Node_Str");
      }
    }
    MimeMessage mimeMessage=mailSender.createMimeMessage();
    MimeMessageHelper helper=new MimeMessageHelper(mimeMessage,htmlEmail);
    helper.setFrom(from);
    helper.setTo(processMultipleImailAddresses(to.trim()));
    helper.setSubject(subject);
    helper.setText(body,true);
    mailSender.send(mimeMessage);
    if (successMessage != null && sendMessage) {
      addPageMessage(successMessage);
    }
    logger.debug("String_Node_Str",new Date());
  }
 catch (  MailException me) {
    me.printStackTrace();
    if (failMessage != null && sendMessage) {
      addPageMessage(failMessage);
    }
    logger.debug("String_Node_Str",new Date(),me.toString());
    messageSent=false;
  }
  return messageSent;
}
Program: 115118
Project: 115118
Buggy source:
public File getFile(String fileName,String relDirectory){
  try {
    InputStream inputStream=getInputStream(fileName);
    File f=new File(getField("String_Node_Str") + relDirectory + fileName);
    logMe("String_Node_Str" + f.getAbsolutePath());
    return f;
  }
 catch (  IOException e) {
    throw new OpenClinicaSystemException(e.getMessage(),e.fillInStackTrace());
  }
}

Fixed version (ground truth):
public File getFile(String fileName,String relDirectory){
  try {
    InputStream inputStream=getInputStream(fileName);
    File f=new File(getField("String_Node_Str") + relDirectory + fileName);
    return f;
  }
 catch (  IOException e) {
    throw new OpenClinicaSystemException(e.getMessage(),e.fillInStackTrace());
  }
}
Program: 115119
Project: 115119
Buggy source:
private static String replaceCatHome(String value){
  String catalina=null;
  if (catalina == null) {
    catalina=System.getProperty("String_Node_Str");
    logMe("String_Node_Str" + catalina);
  }
  if (catalina == null) {
    catalina=System.getProperty("String_Node_Str");
    logMe("String_Node_Str" + catalina);
  }
  if (catalina == null) {
    catalina=System.getenv("String_Node_Str");
    logMe("String_Node_Str" + catalina);
  }
  if (catalina == null) {
    catalina=System.getenv("String_Node_Str");
    logMe("String_Node_Str" + catalina);
  }
  if (value.contains("String_Node_Str") && catalina != null) {
    value=value.replace("String_Node_Str",catalina);
    logMe("String_Node_Str" + catalina);
  }
  if (value.contains("String_Node_Str") && catalina != null) {
    value=value.replace("String_Node_Str",catalina);
    logMe("String_Node_Str" + catalina);
  }
  logMe("String_Node_Str" + value);
  return value;
}

Fixed version (ground truth):
private static String replaceCatHome(String value){
  String catalina=null;
  if (catalina == null) {
    catalina=System.getProperty("String_Node_Str");
  }
  if (catalina == null) {
    catalina=System.getProperty("String_Node_Str");
  }
  if (catalina == null) {
    catalina=System.getenv("String_Node_Str");
  }
  if (catalina == null) {
    catalina=System.getenv("String_Node_Str");
  }
  if (value.contains("String_Node_Str") && catalina != null) {
    value=value.replace("String_Node_Str",catalina);
  }
  if (value.contains("String_Node_Str") && catalina != null) {
    value=value.replace("String_Node_Str",catalina);
  }
  return value;
}
Program: 115120
Project: 115120
Buggy source:
private static String replaceWebapp(String value){
  logMe(value);
  if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp);
  }
 else   if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp.toLowerCase());
  }
  if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp.toLowerCase());
  }
 else   if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp);
  }
  return value;
}

Fixed version (ground truth):
private static String replaceWebapp(String value){
  if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp);
  }
 else   if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp.toLowerCase());
  }
  if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp.toLowerCase());
  }
 else   if (value.contains("String_Node_Str")) {
    value=value.replace("String_Node_Str",webapp);
  }
  return value;
}
Program: 115121
Project: 115121
Buggy source:
public void reportUrl(){
  String contHome=System.getProperty("String_Node_Str");
  logMe("String_Node_Str" + contHome);
  logMe("String_Node_Str" + System.getenv().toString());
  Properties pros=System.getProperties();
  Enumeration proEnum=pros.propertyNames();
  for (; proEnum.hasMoreElements(); ) {
    String propName=(String)proEnum.nextElement();
    String propValue=(String)pros.get(propName);
    logMe("String_Node_Str" + propName + "String_Node_Str"+ propValue);
  }
}

Fixed version (ground truth):
public void reportUrl(){
  String contHome=System.getProperty("String_Node_Str");
  Properties pros=System.getProperties();
  Enumeration proEnum=pros.propertyNames();
  for (; proEnum.hasMoreElements(); ) {
    String propName=(String)proEnum.nextElement();
    String propValue=(String)pros.get(propName);
  }
}
Program: 115122
Project: 115122
Buggy source:
public void setResourceLoader(ResourceLoader resourceLoader){
  this.resourceLoader=resourceLoader;
  try {
    setODM_MAPPING_DIR();
    webapp=getWebAppName(resourceLoader.getResource("String_Node_Str").getURI().getPath());
    logMe("String_Node_Str" + webapp);
    String dbName=dataInfo.getProperty("String_Node_Str");
    DATAINFO=dataInfo;
    dataInfo=setDataInfoProperties();
    EXTRACTINFO=extractInfo;
    DB_NAME=dbName;
    SQLFactory factory=SQLFactory.getInstance();
    factory.run(dbName,resourceLoader);
    if (extractInfo != null) {
      copyBaseToDest(resourceLoader);
      copyODMMappingXMLtoResources(resourceLoader);
      extractProperties=findExtractProperties();
      copyImportRulesFiles();
    }
  }
 catch (  OpenClinicaSystemException e) {
    logger.debug(e.getMessage());
    logger.debug(e.toString());
    throw new OpenClinicaSystemException(e.getMessage(),e.fillInStackTrace());
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void setResourceLoader(ResourceLoader resourceLoader){
  this.resourceLoader=resourceLoader;
  try {
    setODM_MAPPING_DIR();
    webapp=getWebAppName(resourceLoader.getResource("String_Node_Str").getURI().getPath());
    String dbName=dataInfo.getProperty("String_Node_Str");
    DATAINFO=dataInfo;
    dataInfo=setDataInfoProperties();
    EXTRACTINFO=extractInfo;
    DB_NAME=dbName;
    SQLFactory factory=SQLFactory.getInstance();
    factory.run(dbName,resourceLoader);
    if (extractInfo != null) {
      copyBaseToDest(resourceLoader);
      copyODMMappingXMLtoResources(resourceLoader);
      extractProperties=findExtractProperties();
      copyImportRulesFiles();
    }
  }
 catch (  OpenClinicaSystemException e) {
    logger.debug(e.getMessage());
    logger.debug(e.toString());
    throw new OpenClinicaSystemException(e.getMessage(),e.fillInStackTrace());
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 115125
Project: 115125
Buggy source:
/** 
 * For changing values which are applicable to all properties, for ex webapp name can be used in any properties
 */
private void setDataInfoVals(){
  Enumeration<String> properties=(Enumeration<String>)DATAINFO.propertyNames();
  String vals, key;
  while (properties.hasMoreElements()) {
    key=properties.nextElement();
    vals=DATAINFO.getProperty(key);
    logMe("String_Node_Str" + key + "String_Node_Str"+ vals);
    vals=replaceWebapp(vals);
    vals=replaceCatHome(vals);
    logMe("String_Node_Str" + key + "String_Node_Str"+ vals);
    DATAINFO.setProperty(key,vals);
  }
}

Fixed version (ground truth):
/** 
 * For changing values which are applicable to all properties, for ex webapp name can be used in any properties
 */
private void setDataInfoVals(){
  Enumeration<String> properties=(Enumeration<String>)DATAINFO.propertyNames();
  String vals, key;
  while (properties.hasMoreElements()) {
    key=properties.nextElement();
    vals=DATAINFO.getProperty(key);
    vals=replaceWebapp(vals);
    vals=replaceCatHome(vals);
    DATAINFO.setProperty(key,vals);
  }
}
Program: 115126
Project: 115126
Buggy source:
public String checkValidityOfItemOrItemGroupOidInCrf(String oid,RuleSetBean ruleSet){
  oid=oid.trim();
  String[] theOid=oid.split(ESCAPED_SEPERATOR);
  if (theOid.length == 2) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(theOid[0]);
    Boolean isItemGroupBePartOfCrfOrNull=ruleSet.getCrfId() != null ? itemGroup.getCrfId().equals(ruleSet.getCrfId()) : true;
    if (itemGroup != null && isItemGroupBePartOfCrfOrNull) {
      if (ruleSet.getCrfId() != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return "String_Node_Str";
      }
      if (ruleSet.getCrfId() != null && !itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return oid;
      }
      ItemBean item=getItemDao().findItemByGroupIdandItemOid(itemGroup.getId(),theOid[1]);
      if (item != null) {
        return "String_Node_Str";
      }
    }
  }
  if (theOid.length == 1) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(oid);
    if (itemGroup != null) {
      if (ruleSet.getCrfId() != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return "String_Node_Str";
      }
      if (ruleSet.getCrfId() != null && !itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return oid;
      }
      return "String_Node_Str";
    }
    ItemBean item=getItemDao().findByOid(oid).get(0);
    if (item != null) {
      return "String_Node_Str";
    }
  }
  return oid;
}

Fixed version (ground truth):
public String checkValidityOfItemOrItemGroupOidInCrf(String oid,RuleSetBean ruleSet){
  oid=oid.trim();
  String[] theOid=oid.split(ESCAPED_SEPERATOR);
  if (theOid.length == 2) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(theOid[0]);
    Boolean isItemGroupBePartOfCrfOrNull=ruleSet.getCrfId() != null ? itemGroup.getCrfId().equals(ruleSet.getCrfId()) : true;
    if (itemGroup != null && isItemGroupBePartOfCrfOrNull) {
      if (ruleSet.getCrfId() != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return "String_Node_Str";
      }
      if (ruleSet.getCrfId() != null && !itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return oid;
      }
      ItemBean item=getItemDao().findItemByGroupIdandItemOid(itemGroup.getId(),theOid[1]);
      if (item != null) {
        return "String_Node_Str";
      }
    }
  }
  if (theOid.length == 1) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(oid);
    if (itemGroup != null) {
      if (ruleSet.getCrfId() != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return "String_Node_Str";
      }
      if (ruleSet.getCrfId() != null && !itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
        return oid;
      }
      return "String_Node_Str";
    }
    ItemBean item=(ItemBean)getItemDao().findByOid(oid).get(0);
    if (item != null) {
      return "String_Node_Str";
    }
  }
  return oid;
}
Program: 115127
Project: 115127
Buggy source:
private String fixGroupOrdinal(String ruleExpression,String targetExpression,List<ItemDataBean> itemData,EventCRFBean eventCrf){
  String returnedRuleExpression=ruleExpression;
  if (getItemGroupOid(ruleExpression).equals(getItemGroupOid(targetExpression))) {
    if (getGroupOrdninalCurated(ruleExpression).equals("String_Node_Str") && !getGroupOrdninalCurated(targetExpression).equals("String_Node_Str")) {
      returnedRuleExpression=replaceGroupOidOrdinalInExpression(ruleExpression,Integer.valueOf(getGroupOrdninalCurated(targetExpression)));
    }
  }
 else {
    EventCRFBean theEventCrfBean=null;
    if (eventCrf != null) {
      theEventCrfBean=eventCrf;
    }
 else     if (!itemData.isEmpty()) {
      theEventCrfBean=(EventCRFBean)getEventCRFDao().findByPK(itemData.get(0).getEventCRFId());
    }
 else {
      return returnedRuleExpression;
    }
    Integer itemId=itemData.isEmpty() ? getItemDao().findByOid(getItemOid(ruleExpression)).get(0).getId() : itemData.get(0).getItemId();
    ItemGroupMetadataBean itemGroupMetadataBean=(ItemGroupMetadataBean)getItemGroupMetadataDao().findByItemAndCrfVersion(itemId,theEventCrfBean.getCRFVersionId());
    if (isGroupRepeating(itemGroupMetadataBean) && getGroupOrdninalCurated(ruleExpression).equals("String_Node_Str")) {
      returnedRuleExpression=replaceGroupOidOrdinalInExpression(ruleExpression,Integer.valueOf(getGroupOrdninalCurated(targetExpression)));
    }
  }
  return returnedRuleExpression;
}

Fixed version (ground truth):
private String fixGroupOrdinal(String ruleExpression,String targetExpression,List<ItemDataBean> itemData,EventCRFBean eventCrf){
  String returnedRuleExpression=ruleExpression;
  if (getItemGroupOid(ruleExpression).equals(getItemGroupOid(targetExpression))) {
    if (getGroupOrdninalCurated(ruleExpression).equals("String_Node_Str") && !getGroupOrdninalCurated(targetExpression).equals("String_Node_Str")) {
      returnedRuleExpression=replaceGroupOidOrdinalInExpression(ruleExpression,Integer.valueOf(getGroupOrdninalCurated(targetExpression)));
    }
  }
 else {
    EventCRFBean theEventCrfBean=null;
    if (eventCrf != null) {
      theEventCrfBean=eventCrf;
    }
 else     if (!itemData.isEmpty()) {
      theEventCrfBean=(EventCRFBean)getEventCRFDao().findByPK(itemData.get(0).getEventCRFId());
    }
 else {
      return returnedRuleExpression;
    }
    Integer itemId=itemData.isEmpty() ? ((EntityBean)getItemDao().findByOid(getItemOid(ruleExpression)).get(0)).getId() : itemData.get(0).getItemId();
    ItemGroupMetadataBean itemGroupMetadataBean=(ItemGroupMetadataBean)getItemGroupMetadataDao().findByItemAndCrfVersion(itemId,theEventCrfBean.getCRFVersionId());
    if (isGroupRepeating(itemGroupMetadataBean) && getGroupOrdninalCurated(ruleExpression).equals("String_Node_Str")) {
      returnedRuleExpression=replaceGroupOidOrdinalInExpression(ruleExpression,Integer.valueOf(getGroupOrdninalCurated(targetExpression)));
    }
  }
  return returnedRuleExpression;
}
Program: 115131
Project: 115131
Buggy source:
private static void logMe(String message){
  logger.info(message);
}

Fixed version (ground truth):
private static void logMe(String message){
  System.out.println(message);
  logger.info(message);
}
Program: 115137
Project: 115137
Buggy source:
public static void updateEventDef(EventDefinitionCRFBean edcBean,EventDefinitionCRFDAO edcDao,ArrayList versionList){
  ArrayList<Integer> idList=new ArrayList<Integer>();
  CRFVersionBean temp=(CRFVersionBean)versionList.get(0);
  if (StringUtil.isBlank(edcBean.getSelectedVersionIds())) {
    edcBean.setDefaultVersionId(temp.getId());
    edcDao.update(edcBean);
  }
 else {
    String sversionIds=edcBean.getSelectedVersionIds();
    String[] ids=sversionIds.split("String_Node_Str");
    for (    String id : ids) {
      idList.add(Integer.valueOf(id));
    }
    for (int i=0; i < versionList.size(); i++) {
      CRFVersionBean versionBean=(CRFVersionBean)versionList.get(i);
      if (idList.contains(versionBean.getId())) {
        edcBean.setDefaultVersionId(versionBean.getId());
        edcDao.update(edcBean);
        break;
      }
    }
  }
}

Fixed version (ground truth):
public static void updateEventDef(EventDefinitionCRFBean edcBean,EventDefinitionCRFDAO edcDao,ArrayList versionList,int crfVIdToLock){
  ArrayList<Integer> idList=new ArrayList<Integer>();
  CRFVersionBean temp=(CRFVersionBean)versionList.get(0);
  if (StringUtil.isBlank(edcBean.getSelectedVersionIds())) {
    if ((null != temp) && (temp.getId() == crfVIdToLock)) {
      CRFVersionBean temp2=(CRFVersionBean)versionList.get(1);
      edcBean.setDefaultVersionId(temp2.getId());
    }
 else {
      edcBean.setDefaultVersionId(temp.getId());
    }
    edcDao.update(edcBean);
  }
 else {
    String sversionIds=edcBean.getSelectedVersionIds();
    String[] ids=sversionIds.split("String_Node_Str");
    for (    String id : ids) {
      idList.add(Integer.valueOf(id));
    }
    for (int i=0; i < versionList.size(); i++) {
      CRFVersionBean versionBean=(CRFVersionBean)versionList.get(i);
      if (idList.contains(versionBean.getId())) {
        edcBean.setDefaultVersionId(versionBean.getId());
        edcDao.update(edcBean);
        break;
      }
    }
  }
}
Program: 115138
Project: 115138
Buggy source:
public static void updateEventDef(EventDefinitionCRFBean edcBean,EventDefinitionCRFDAO edcDao,ArrayList versionList,int crfVIdToLock){
  ArrayList<Integer> idList=new ArrayList<Integer>();
  CRFVersionBean temp=(CRFVersionBean)versionList.get(0);
  if (StringUtil.isBlank(edcBean.getSelectedVersionIds())) {
    if ((null != temp) && (temp.getId() == crfVIdToLock)) {
      CRFVersionBean temp2=(CRFVersionBean)versionList.get(1);
      edcBean.setDefaultVersionId(temp2.getId());
    }
 else {
      edcBean.setDefaultVersionId(temp.getId());
    }
    edcDao.update(edcBean);
  }
 else {
    String sversionIds=edcBean.getSelectedVersionIds();
    String[] ids=sversionIds.split("String_Node_Str");
    for (    String id : ids) {
      idList.add(Integer.valueOf(id));
    }
    for (int i=0; i < versionList.size(); i++) {
      CRFVersionBean versionBean=(CRFVersionBean)versionList.get(i);
      if (idList.contains(versionBean.getId())) {
        edcBean.setDefaultVersionId(versionBean.getId());
        edcDao.update(edcBean);
        break;
      }
    }
  }
}

Fixed version (ground truth):
public static void updateEventDef(EventDefinitionCRFBean edcBean,EventDefinitionCRFDAO edcDao,ArrayList versionList,int crfVIdToLock){
  ArrayList<Integer> idList=new ArrayList<Integer>();
  CRFVersionBean temp=null;
  if ((null != versionList) && (versionList.size() > 0)) {
    temp=(CRFVersionBean)versionList.get(0);
  }
  if (StringUtil.isBlank(edcBean.getSelectedVersionIds())) {
    if ((null != temp) && (temp.getId() == crfVIdToLock) && (null != versionList)&& (versionList.size() > 1)) {
      CRFVersionBean temp2=(CRFVersionBean)versionList.get(1);
      edcBean.setDefaultVersionId(temp2.getId());
    }
 else {
      edcBean.setDefaultVersionId(temp.getId());
    }
    edcDao.update(edcBean);
  }
 else {
    String sversionIds=edcBean.getSelectedVersionIds();
    String[] ids=sversionIds.split("String_Node_Str");
    for (    String id : ids) {
      idList.add(Integer.valueOf(id));
    }
    for (int i=0; i < versionList.size(); i++) {
      CRFVersionBean versionBean=(CRFVersionBean)versionList.get(i);
      if (idList.contains(versionBean.getId())) {
        edcBean.setDefaultVersionId(versionBean.getId());
        edcDao.update(edcBean);
        break;
      }
    }
  }
}
Program: 115149
Project: 115149
Buggy source:
@Override public void configureTableFacade(HttpServletResponse response,TableFacade tableFacade){
  super.configureTableFacade(response,tableFacade);
  tableFacade.addFilterMatcher(new MatcherKey(Date.class,"String_Node_Str"),new DateFilterMatcher(getDateFormat()));
  tableFacade.addFilterMatcher(new MatcherKey(Date.class,"String_Node_Str"),new DateFilterMatcher(getDateFormat()));
  tableFacade.addFilterMatcher(new MatcherKey(UserAccountBean.class,"String_Node_Str"),new GenericFilterMatecher());
  tableFacade.addFilterMatcher(new MatcherKey(UserAccountBean.class,"String_Node_Str"),new GenericFilterMatecher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new AgeDaysFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new AgeDaysFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new DNTypeFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new DNResolutionStatusFilterMatcher());
}

Fixed version (ground truth):
@Override public void configureTableFacade(HttpServletResponse response,TableFacade tableFacade){
  super.configureTableFacade(response,tableFacade);
  tableFacade.addFilterMatcher(new MatcherKey(Date.class,"String_Node_Str"),new DateFilterMatcher(getDateFormat()));
  tableFacade.addFilterMatcher(new MatcherKey(Date.class,"String_Node_Str"),new DateFilterMatcher(getDateFormat()));
  tableFacade.addFilterMatcher(new MatcherKey(UserAccountBean.class,"String_Node_Str"),new GenericFilterMatecher());
  tableFacade.addFilterMatcher(new MatcherKey(UserAccountBean.class,"String_Node_Str"),new GenericFilterMatecher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new StringFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new AgeDaysFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new AgeDaysFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new DNTypeFilterMatcher());
  tableFacade.addFilterMatcher(new MatcherKey(String.class,"String_Node_Str"),new DNResolutionStatusFilterMatcher());
}
Program: 115152
Project: 115152
Buggy source:
protected void setPopUpURL(String url){
  if (url != null && request != null) {
    request.setAttribute(POP_UP_URL,url);
    logger.info("String_Node_Str" + url);
    System.out.println("String_Node_Str" + url);
  }
}

Fixed version (ground truth):
protected void setPopUpURL(String url){
  if (url != null && request != null) {
    request.setAttribute(POP_UP_URL,url);
    request.setAttribute("String_Node_Str",1);
    logger.info("String_Node_Str" + url);
    System.out.println("String_Node_Str" + url);
  }
}
Program: 115153
Project: 115153
Buggy source:
public String execute(String criteria){
  String theCriteria="String_Node_Str";
  for (  Sort sort : sorts) {
    if (theCriteria.length() == 0) {
      theCriteria+=buildCriteriaInitial(criteria,sort.getProperty(),sort.getOrder());
    }
 else {
      theCriteria+=buildCriteria(criteria,sort.getProperty(),sort.getOrder());
    }
  }
  return theCriteria;
}

Fixed version (ground truth):
public String execute(String criteria){
  String theCriteria="String_Node_Str";
  for (  Sort sort : sorts) {
    if (columnMapping.get(sort.getProperty()) == null || columnMapping.get(sort.getProperty()).length() == 0) {
      continue;
    }
    if (theCriteria.length() == 0) {
      theCriteria+=buildCriteriaInitial(criteria,sort.getProperty(),sort.getOrder());
    }
 else {
      theCriteria+=buildCriteria(criteria,sort.getProperty(),sort.getOrder());
    }
  }
  return theCriteria;
}
Program: 115158
Project: 115158
Buggy source:
private String getCrfVersionStatus(String seSubjectEventStatus,int cvStatusId,int ecStatusId,int validatorId){
  DataEntryStage stage=DataEntryStage.INVALID;
  Status status=Status.get(ecStatusId);
  if (stage.equals(DataEntryStage.INVALID) || status.equals(Status.INVALID)) {
    stage=DataEntryStage.UNCOMPLETED;
  }
  if (status.equals(Status.AVAILABLE)) {
    stage=DataEntryStage.INITIAL_DATA_ENTRY;
  }
  if (status.equals(Status.PENDING)) {
    if (validatorId != 0) {
      stage=DataEntryStage.DOUBLE_DATA_ENTRY;
    }
 else {
      stage=DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE;
    }
  }
  if (status.equals(Status.UNAVAILABLE)) {
    stage=DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE;
  }
  if (status.equals(Status.LOCKED)) {
    stage=DataEntryStage.LOCKED;
  }
  try {
    if (seSubjectEventStatus.equals(SubjectEventStatus.LOCKED.getName()) || seSubjectEventStatus.equals(SubjectEventStatus.SKIPPED.getName()) || seSubjectEventStatus.equals(SubjectEventStatus.STOPPED.getName())) {
      stage=DataEntryStage.LOCKED;
    }
 else     if (seSubjectEventStatus.equals(SubjectEventStatus.INVALID.getName())) {
      stage=DataEntryStage.LOCKED;
    }
 else     if (cvStatusId != 1) {
      stage=DataEntryStage.LOCKED;
    }
  }
 catch (  NullPointerException e) {
    System.out.println("String_Node_Str");
  }
  logger.debug("String_Node_Str" + stage.getName());
  return stage.getName();
}

Fixed version (ground truth):
private String getCrfVersionStatus(String seSubjectEventStatus,int cvStatusId,int ecStatusId,int validatorId){
  DataEntryStage stage=DataEntryStage.INVALID;
  Status status=Status.get(ecStatusId);
  if (stage.equals(DataEntryStage.INVALID) || status.equals(Status.INVALID)) {
    stage=DataEntryStage.UNCOMPLETED;
  }
  if (status.equals(Status.AVAILABLE)) {
    stage=DataEntryStage.INITIAL_DATA_ENTRY;
  }
  if (status.equals(Status.PENDING)) {
    if (validatorId != 0) {
      stage=DataEntryStage.DOUBLE_DATA_ENTRY;
    }
 else {
      stage=DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE;
    }
  }
  if (status.equals(Status.UNAVAILABLE)) {
    stage=DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE;
  }
  if (status.equals(Status.LOCKED)) {
    stage=DataEntryStage.LOCKED;
  }
  try {
    if (seSubjectEventStatus.equals(SubjectEventStatus.LOCKED.getName()) || seSubjectEventStatus.equals(SubjectEventStatus.SKIPPED.getName()) || seSubjectEventStatus.equals(SubjectEventStatus.STOPPED.getName())) {
      stage=DataEntryStage.LOCKED;
    }
 else     if (seSubjectEventStatus.equals(SubjectEventStatus.INVALID.getName())) {
      stage=DataEntryStage.LOCKED;
    }
 else     if (cvStatusId != 1) {
      stage=DataEntryStage.LOCKED;
    }
  }
 catch (  NullPointerException e) {
    logger.debug("String_Node_Str");
  }
  logger.debug("String_Node_Str" + stage.getName());
  return stage.getName();
}
Program: 115163
Project: 115163
Buggy source:
private void createTable(){
  ViewRuleAssignmentTableFactory factory=new ViewRuleAssignmentTableFactory(showMoreLink,getCoreResources().getField("String_Node_Str"),isDesigner);
  factory.setRuleSetService(getRuleSetService());
  factory.setItemFormMetadataDAO(getItemFormMetadataDAO());
  factory.setCurrentStudy(currentStudy);
  String ruleAssignmentsHtml=factory.createTable(request,response).render();
  request.setAttribute("String_Node_Str",ruleAssignmentsHtml);
  createStudyEventForInfoPanel();
  if (ruleAssignmentsHtml != null) {
    if (isDesigner) {
      forwardPage(Page.VIEW_RULE_SETS_DESIGNER);
    }
 else {
      forwardPage(Page.VIEW_RULE_SETS2);
    }
  }
}

Fixed version (ground truth):
private void createTable(){
  String designerURL=getCoreResources().getField("String_Node_Str") + "String_Node_Str" + getHostPath()+ "String_Node_Str"+ getContextPath()+ "String_Node_Str"+ currentStudy.getOid()+ "String_Node_Str"+ ub.getName();
  ViewRuleAssignmentTableFactory factory=new ViewRuleAssignmentTableFactory(showMoreLink,designerURL,isDesigner);
  factory.setRuleSetService(getRuleSetService());
  factory.setItemFormMetadataDAO(getItemFormMetadataDAO());
  factory.setCurrentStudy(currentStudy);
  String ruleAssignmentsHtml=factory.createTable(request,response).render();
  request.setAttribute("String_Node_Str",ruleAssignmentsHtml);
  createStudyEventForInfoPanel();
  if (ruleAssignmentsHtml != null) {
    if (isDesigner) {
      forwardPage(Page.VIEW_RULE_SETS_DESIGNER);
    }
 else {
      forwardPage(Page.VIEW_RULE_SETS2);
    }
  }
}
Program: 115165
Project: 115165
Buggy source:
private void createTable(){
  String designerURL=getCoreResources().getField("String_Node_Str") + "String_Node_Str" + getHostPath()+ "String_Node_Str"+ getContextPath()+ "String_Node_Str"+ currentStudy.getOid()+ "String_Node_Str"+ ub.getName();
  ViewRuleAssignmentTableFactory factory=new ViewRuleAssignmentTableFactory(showMoreLink,designerURL,isDesigner);
  factory.setRuleSetService(getRuleSetService());
  factory.setItemFormMetadataDAO(getItemFormMetadataDAO());
  factory.setCurrentStudy(currentStudy);
  String ruleAssignmentsHtml=factory.createTable(request,response).render();
  request.setAttribute("String_Node_Str",ruleAssignmentsHtml);
  createStudyEventForInfoPanel();
  if (ruleAssignmentsHtml != null) {
    if (isDesigner) {
      forwardPage(Page.VIEW_RULE_SETS_DESIGNER);
    }
 else {
      forwardPage(Page.VIEW_RULE_SETS2);
    }
  }
}

Fixed version (ground truth):
private void createTable(){
  ViewRuleAssignmentTableFactory factory=new ViewRuleAssignmentTableFactory(showMoreLink,getCoreResources().getField("String_Node_Str"),isDesigner);
  factory.setRuleSetService(getRuleSetService());
  factory.setItemFormMetadataDAO(getItemFormMetadataDAO());
  factory.setCurrentStudy(currentStudy);
  String ruleAssignmentsHtml=factory.createTable(request,response).render();
  request.setAttribute("String_Node_Str",ruleAssignmentsHtml);
  createStudyEventForInfoPanel();
  if (ruleAssignmentsHtml != null) {
    if (isDesigner) {
      forwardPage(Page.VIEW_RULE_SETS_DESIGNER);
    }
 else {
      forwardPage(Page.VIEW_RULE_SETS2);
    }
  }
}