Program: 114993
Project: 114993
Buggy source:
/** 
 * This is a generic method where the control enters first. Regardless what URL is being used. Depending upon the combination of URL parameters, further course is determined.
 */
@Override public LinkedHashMap<String,OdmClinicalDataBean> getClinicalData(String studyOID,String studySubjectOID,String studyEventOID,String formVersionOID,Boolean collectDNs,Boolean collectAudit,Locale locale,int userId){
  setLocale(locale);
  setCollectDns(collectDNs);
  setCollectAudits(collectAudit);
  LinkedHashMap<String,OdmClinicalDataBean> clinicalDataHash=new LinkedHashMap<String,OdmClinicalDataBean>();
  UserAccount userAccount=getUserAccountDao().findByColumnName(userId,"String_Node_Str");
  LOGGER.debug("String_Node_Str" + studyOID + "String_Node_Str"+ studySubjectOID+ "String_Node_Str"+ studyEventOID+ "String_Node_Str"+ formVersionOID+ "String_Node_Str"+ collectDNs+ "String_Node_Str"+ collectAudit);
  LOGGER.info("String_Node_Str");
  int parentStudyId=0;
  Study publicStudy=getStudyDao().findPublicStudy(studyOID);
  if (publicStudy.getStudy() != null) {
    isActiveRoleAtSite=true;
    parentStudyId=publicStudy.getStudy().getStudyId();
  }
 else {
    parentStudyId=publicStudy.getStudyId();
    isActiveRoleAtSite=false;
  }
  ArrayList<StudyUserRole> surlist=getStudyUserRoleDao().findAllUserRolesByUserAccountStudySites(userAccount,publicStudy.getStudyId(),parentStudyId);
  if (surlist == null || surlist.size() == 0) {
    return null;
  }
  if (!studySubjectOID.equals(INDICATE_ALL)) {
    StudySubjectDao ssdao=getStudySubjectDao();
    StudySubject ss=(StudySubject)getStudySubjectDao().findByColumnName(studySubjectOID,"String_Node_Str");
    studyOID=ss.getStudy().getOc_oid();
  }
  if (studyEventOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL)&& !studyOID.equals(INDICATE_ALL)) {
    LOGGER.info("String_Node_Str");
    LOGGER.info("String_Node_Str");
    clinicalDataHash.put(studyOID,getClinicalData(studyOID,studySubjectOID));
    return clinicalDataHash;
  }
 else   if (studyEventOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL) && studySubjectOID.equals(INDICATE_ALL)&& !studyOID.equals(INDICATE_ALL)) {
    LOGGER.info("String_Node_Str");
    return getClinicalData(studyOID);
  }
 else   if (!studyEventOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL)&& formVersionOID.equals(INDICATE_ALL)) {
    LOGGER.info("String_Node_Str");
    clinicalDataHash.put(studyOID,getClinicalDatas(studyOID,studySubjectOID,studyEventOID,null));
    return clinicalDataHash;
  }
 else   if (!studyEventOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL)&& !formVersionOID.equals(INDICATE_ALL)) {
    clinicalDataHash.put(studyOID,getClinicalDatas(studyOID,studySubjectOID,studyEventOID,formVersionOID));
    return clinicalDataHash;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This is a generic method where the control enters first. Regardless what URL is being used. Depending upon the combination of URL parameters, further course is determined.
 */
@Override public LinkedHashMap<String,OdmClinicalDataBean> getClinicalData(String studyOID,String studySubjectOID,String studyEventOID,String formVersionOID,Boolean collectDNs,Boolean collectAudit,Locale locale,int userId){
  setLocale(locale);
  setCollectDns(collectDNs);
  setCollectAudits(collectAudit);
  LinkedHashMap<String,OdmClinicalDataBean> clinicalDataHash=new LinkedHashMap<String,OdmClinicalDataBean>();
  UserAccount userAccount=getUserAccountDao().findByColumnName(userId,"String_Node_Str");
  LOGGER.debug("String_Node_Str" + studyOID + "String_Node_Str"+ studySubjectOID+ "String_Node_Str"+ studyEventOID+ "String_Node_Str"+ formVersionOID+ "String_Node_Str"+ collectDNs+ "String_Node_Str"+ collectAudit);
  LOGGER.info("String_Node_Str");
  int parentStudyId=0;
  Study publicStudy=getStudyDao().findPublicStudy(studyOID);
  if (publicStudy.getStudy() != null) {
    isActiveRoleAtSite=true;
    parentStudyId=publicStudy.getStudy().getStudyId();
  }
 else {
    parentStudyId=publicStudy.getStudyId();
    isActiveRoleAtSite=false;
  }
  ArrayList<StudyUserRole> surlist=getStudyUserRoleDao().findAllUserRolesByUserAccountStudySites(userAccount,publicStudy.getStudyId(),parentStudyId);
  if (surlist == null || surlist.size() == 0) {
    return null;
  }
  if (!studySubjectOID.equals(INDICATE_ALL)) {
  }
  if (studyEventOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL)&& !studyOID.equals(INDICATE_ALL)) {
    LOGGER.info("String_Node_Str");
    LOGGER.info("String_Node_Str");
    clinicalDataHash.put(studyOID,getClinicalData(studyOID,studySubjectOID));
    return clinicalDataHash;
  }
 else   if (studyEventOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL) && studySubjectOID.equals(INDICATE_ALL)&& !studyOID.equals(INDICATE_ALL)) {
    LOGGER.info("String_Node_Str");
    return getClinicalData(studyOID);
  }
 else   if (!studyEventOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL)&& formVersionOID.equals(INDICATE_ALL)) {
    LOGGER.info("String_Node_Str");
    clinicalDataHash.put(studyOID,getClinicalDatas(studyOID,studySubjectOID,studyEventOID,null));
    return clinicalDataHash;
  }
 else   if (!studyEventOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL)&& !formVersionOID.equals(INDICATE_ALL)) {
    clinicalDataHash.put(studyOID,getClinicalDatas(studyOID,studySubjectOID,studyEventOID,formVersionOID));
    return clinicalDataHash;
  }
  return null;
}