Program: 84574
Project: 84574
Buggy source:
/** 
 * Called prior to form display.  Allows for data to be put  in the request to be used in the view
 * @see org.springframework.web.servlet.mvc.SimpleFormController#referenceData(javax.servlet.http.HttpServletRequest)
 */
protected Map<String,Object> referenceData(HttpServletRequest request) throws Exception {
  Map<String,Object> map=new HashMap<String,Object>();
  Set<PatientIdentifier> identifiers=new TreeSet<PatientIdentifier>();
  Patient patient=null;
  String causeOfDeathOther="String_Node_Str";
  if (Context.isAuthenticated()) {
    PatientService ps=Context.getPatientService();
    String patientId=request.getParameter("String_Node_Str");
    if (patientId != null && !patientId.equals("String_Node_Str")) {
      patient=ps.getPatient(Integer.valueOf(patientId));
      if (patient != null) {
        identifiers.addAll(patient.getActiveIdentifiers());
        String propCause=Context.getAdministrationService().getGlobalProperty("String_Node_Str");
        Concept conceptCause=Context.getConceptService().getConcept(propCause);
        if (conceptCause != null && patient.getPatientId() != null) {
          List<Obs> obssDeath=Context.getObsService().getObservationsByPersonAndConcept(patient,conceptCause);
          if (obssDeath.size() == 1) {
            Obs obsDeath=obssDeath.iterator().next();
            causeOfDeathOther=obsDeath.getValueText();
            if (causeOfDeathOther == null) {
              log.debug("String_Node_Str");
              causeOfDeathOther="String_Node_Str";
            }
 else {
              log.debug("String_Node_Str" + causeOfDeathOther);
            }
          }
 else {
            log.debug("String_Node_Str" + obssDeath.size());
          }
        }
 else {
          log.debug("String_Node_Str");
        }
      }
    }
  }
  for (  PatientIdentifier identifier : newIdentifiers) {
    identifier.setPatient(patient);
  }
  identifiers.addAll(newIdentifiers);
  if (pref.length() > 0)   for (  PatientIdentifier pi : identifiers)   pi.setPreferred(pref.equals(pi.getIdentifier() + pi.getIdentifierType().getPatientIdentifierTypeId()));
  if (Context.isAuthenticated())   map.put("String_Node_Str",Context.getAuthenticatedUser().getUserProperty(OpenmrsConstants.USER_PROPERTY_DEFAULT_LOCATION));
  map.put("String_Node_Str",identifiers);
  map.put("String_Node_Str",causeOfDeathOther);
  return map;
}

Fixed version (ground truth):
/** 
 * Called prior to form display.  Allows for data to be put  in the request to be used in the view
 * @see org.springframework.web.servlet.mvc.SimpleFormController#referenceData(javax.servlet.http.HttpServletRequest)
 */
protected Map<String,Object> referenceData(HttpServletRequest request) throws Exception {
  Map<String,Object> map=new HashMap<String,Object>();
  Set<PatientIdentifier> identifiers=new HashSet<PatientIdentifier>();
  Patient patient=null;
  String causeOfDeathOther="String_Node_Str";
  if (Context.isAuthenticated()) {
    PatientService ps=Context.getPatientService();
    String patientId=request.getParameter("String_Node_Str");
    if (patientId != null && !patientId.equals("String_Node_Str")) {
      patient=ps.getPatient(Integer.valueOf(patientId));
      if (patient != null) {
        identifiers.addAll(patient.getActiveIdentifiers());
        String propCause=Context.getAdministrationService().getGlobalProperty("String_Node_Str");
        Concept conceptCause=Context.getConceptService().getConcept(propCause);
        if (conceptCause != null && patient.getPatientId() != null) {
          List<Obs> obssDeath=Context.getObsService().getObservationsByPersonAndConcept(patient,conceptCause);
          if (obssDeath.size() == 1) {
            Obs obsDeath=obssDeath.iterator().next();
            causeOfDeathOther=obsDeath.getValueText();
            if (causeOfDeathOther == null) {
              log.debug("String_Node_Str");
              causeOfDeathOther="String_Node_Str";
            }
 else {
              log.debug("String_Node_Str" + causeOfDeathOther);
            }
          }
 else {
            log.debug("String_Node_Str" + obssDeath.size());
          }
        }
 else {
          log.debug("String_Node_Str");
        }
      }
    }
  }
  for (  PatientIdentifier identifier : newIdentifiers) {
    identifier.setPatient(patient);
  }
  identifiers.addAll(newIdentifiers);
  if (pref.length() > 0)   for (  PatientIdentifier pi : identifiers)   pi.setPreferred(pref.equals(pi.getIdentifier() + pi.getIdentifierType().getPatientIdentifierTypeId()));
  if (Context.isAuthenticated())   map.put("String_Node_Str",Context.getAuthenticatedUser().getUserProperty(OpenmrsConstants.USER_PROPERTY_DEFAULT_LOCATION));
  map.put("String_Node_Str",identifiers);
  map.put("String_Node_Str",causeOfDeathOther);
  return map;
}