Program: 115049
Project: 115049
Buggy source:
/** 
 * This method construct an object which has all the study parameter values
 * @param study
 * @return
 */
public StudyBean setParametersForStudy(StudyBean study){
  StudyParameterValueDAO spvdao=new StudyParameterValueDAO(ds);
  ArrayList parameters=spvdao.findAllParameters();
  StudyParameterConfig spc=new StudyParameterConfig();
  for (int i=0; i < parameters.size(); i++) {
    StudyParameter sp=(StudyParameter)parameters.get(i);
    String handle=sp.getHandle();
    StudyParameterValueBean spv=spvdao.findByHandleAndStudy(study.getId(),handle);
    if (spv.getId() > 0) {
      if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setCollectDob(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setGenderRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setDiscrepancyManagement(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSubjectPersonIdRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewerNameRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewerNameDefault(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewerNameEditable(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewDateRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewDateDefault(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewDateEditable(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSubjectIdGeneration(spv.getValue());
        logger.debug("String_Node_Str" + spc.getSubjectIdGeneration());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSubjectIdPrefixSuffix(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setPersonIdShownOnCRF(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSecondaryLabelViewable(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setAdminForcedReasonForChange(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setEventLocationRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setParticipantPortal(spv.getValue());
      }
    }
  }
  study.setStudyParameterConfig(spc);
  return study;
}

Fixed version (ground truth):
/** 
 * This method construct an object which has all the study parameter values
 * @param study
 * @return
 */
public StudyBean setParametersForStudy(StudyBean study){
  StudyParameterValueDAO spvdao=new StudyParameterValueDAO(ds);
  ArrayList parameters=spvdao.findAllParameters();
  StudyParameterConfig spc=new StudyParameterConfig();
  for (int i=0; i < parameters.size(); i++) {
    StudyParameter sp=(StudyParameter)parameters.get(i);
    String handle=sp.getHandle();
    StudyParameterValueBean spv=spvdao.findByHandleAndStudy(study.getId(),handle);
    if (spv.getId() > 0) {
      if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setCollectDob(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setGenderRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setDiscrepancyManagement(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSubjectPersonIdRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewerNameRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewerNameDefault(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewerNameEditable(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewDateRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewDateDefault(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setInterviewDateEditable(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSubjectIdGeneration(spv.getValue());
        logger.debug("String_Node_Str" + spc.getSubjectIdGeneration());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSubjectIdPrefixSuffix(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setPersonIdShownOnCRF(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setSecondaryLabelViewable(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setAdminForcedReasonForChange(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setEventLocationRequired(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setParticipantPortal(spv.getValue());
      }
 else       if (handle.equalsIgnoreCase("String_Node_Str")) {
        spc.setRandomization(spv.getValue());
      }
    }
  }
  study.setStudyParameterConfig(spc);
  return study;
}