Program: 19264
Project: 19264
Buggy source:
private void parseObservations(){
  if (CDMDataSet == null) {
    setupExceptionOutput("String_Node_Str");
    return;
  }
  setObsCollectionMetaData();
  int numStations;
  numStations=CDMDataSet.getNumberOfStations();
  for (int stNum=0; stNum < numStations; stNum++) {
    document=XMLDomUtils.addObservationElement(document);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",description,stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",title,stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str","String_Node_Str",STATION_GML_BASE + CDMDataSet.getStationName(stNum),stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",getStationLowerLatLonStr(stNum),stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",getStationUpperLatLonStr(stNum),stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",stNum);
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",stNum);
    if (CDMDataSet != null) {
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",CDMDataSet.getTimeBegin(stNum),stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",CDMDataSet.getTimeEnd(stNum),stNum);
    }
    document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",location,stNum);
    for (int i=0; i < variableNames.length; i++) {
      String variableName=variableNames[i];
      document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str","String_Node_Str" + variableName,stNum);
    }
    if (featureOfInterest != null) {
      document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",featureOfInterest + CDMDataSet.getStationName(stNum),stNum);
    }
 else {
      document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",CDMDataSet.getStationName(stNum),stNum);
    }
    document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",stNum);
    addDatasetResults(stNum);
  }
}

Fixed version (ground truth):
private void parseObservations(){
  if (CDMDataSet == null) {
    setupExceptionOutput("String_Node_Str");
    return;
  }
  setObsCollectionMetaData();
  int numStations;
  numStations=CDMDataSet.getNumberOfStations();
  for (int stNum=0; stNum < numStations; stNum++) {
    if (CDMDataSet.isStationInFinalList(stNum)) {
      document=XMLDomUtils.addObservationElement(document);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",description,stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",title,stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str","String_Node_Str",STATION_GML_BASE + CDMDataSet.getStationName(stNum),stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",getStationLowerLatLonStr(stNum),stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",getStationUpperLatLonStr(stNum),stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",stNum);
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",stNum);
      if (CDMDataSet != null) {
        document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",CDMDataSet.getTimeBegin(stNum),stNum);
        document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",CDMDataSet.getTimeEnd(stNum),stNum);
      }
      document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",location,stNum);
      for (int i=0; i < variableNames.length; i++) {
        String variableName=variableNames[i];
        document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str","String_Node_Str" + variableName,stNum);
      }
      if (featureOfInterest != null) {
        document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",featureOfInterest + CDMDataSet.getStationName(stNum),stNum);
      }
 else {
        document=XMLDomUtils.addNodeAndAttribute(document,OM_OBSERVATION,"String_Node_Str","String_Node_Str",CDMDataSet.getStationName(stNum),stNum);
      }
      document=XMLDomUtils.addNodeAllOptions(document,OM_OBSERVATION,"String_Node_Str",stNum);
      addDatasetResults(stNum);
    }
  }
}