Program: 19270
Project: 19270
Buggy source:
/** 
 * SOS get obs request handler
 * @param netCDFDataset
 * @param stationName
 * @param variableNames
 * @param eventTime
 * @throws IOException 
 */
public SOSGetObservationRequestHandler(NetcdfDataset netCDFDataset,String[] stationName,String[] variableNames,String[] eventTime,Map<String,String> latLonRequest) throws IOException {
  super(netCDFDataset);
  CoordinateAxis heightAxis=netCDFDataset.findCoordinateAxis(AxisType.Height);
  this.variableNames=checkNetcdfFileForAxis(heightAxis,variableNames);
  if (getDatasetFeatureType() == FeatureType.GRID) {
    Variable depthAxis;
    if (!latLonRequest.isEmpty()) {
      depthAxis=(netCDFDataset.findVariable("String_Node_Str"));
      if (depthAxis != null) {
        this.variableNames=checkNetcdfFileForAxis((CoordinateAxis1D)depthAxis,this.variableNames);
      }
      this.variableNames=checkNetcdfFileForAxis(netCDFDataset.findCoordinateAxis(AxisType.Lat),this.variableNames);
      this.variableNames=checkNetcdfFileForAxis(netCDFDataset.findCoordinateAxis(AxisType.Lon),this.variableNames);
      CDMDataSet=new Grid(stationName,eventTime,this.variableNames,latLonRequest);
      CDMDataSet.setData(getGridDataset());
      return;
    }
  }
 else {
    if (getDatasetFeatureType() == FeatureType.TRAJECTORY) {
      CDMDataSet=new Trajectory(stationName,eventTime,variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION) {
      CDMDataSet=new TimeSeries(stationName,eventTime,variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION_PROFILE) {
      CDMDataSet=new TimeSeriesProfile(stationName,eventTime,variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.PROFILE) {
      CDMDataSet=new Profile(stationName,eventTime,variableNames);
    }
 else {
      CDMDataSet=null;
    }
    CDMDataSet.setData(getFeatureTypeDataSet());
  }
}

Fixed version (ground truth):
/** 
 * SOS get obs request handler
 * @param netCDFDataset
 * @param stationName
 * @param variableNames
 * @param eventTime
 * @throws IOException 
 */
public SOSGetObservationRequestHandler(NetcdfDataset netCDFDataset,String[] stationName,String[] variableNames,String[] eventTime,Map<String,String> latLonRequest) throws IOException {
  super(netCDFDataset);
  CoordinateAxis heightAxis=netCDFDataset.findCoordinateAxis(AxisType.Height);
  this.variableNames=checkNetcdfFileForAxis(heightAxis,variableNames);
  if (getDatasetFeatureType() == FeatureType.GRID) {
    Variable depthAxis;
    if (!latLonRequest.isEmpty()) {
      depthAxis=(netCDFDataset.findVariable("String_Node_Str"));
      if (depthAxis != null) {
        this.variableNames=checkNetcdfFileForAxis((CoordinateAxis1D)depthAxis,this.variableNames);
      }
      this.variableNames=checkNetcdfFileForAxis(netCDFDataset.findCoordinateAxis(AxisType.Lat),this.variableNames);
      this.variableNames=checkNetcdfFileForAxis(netCDFDataset.findCoordinateAxis(AxisType.Lon),this.variableNames);
      CDMDataSet=new Grid(stationName,eventTime,this.variableNames,latLonRequest);
      CDMDataSet.setData(getGridDataset());
      return;
    }
  }
 else {
    if (getDatasetFeatureType() == FeatureType.TRAJECTORY) {
      CDMDataSet=new Trajectory(stationName,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION) {
      CDMDataSet=new TimeSeries(stationName,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION_PROFILE) {
      CDMDataSet=new TimeSeriesProfile(stationName,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.PROFILE) {
      CDMDataSet=new Profile(stationName,eventTime,this.variableNames);
    }
 else {
      CDMDataSet=null;
    }
    if (CDMDataSet != null) {
      CDMDataSet.setData(getFeatureTypeDataSet());
    }
  }
}