Program: 19226
Project: 19226
Buggy source:
private void setCDMDatasetForStations(NetcdfDataset netCDFDataset,String[] eventTime,Map<String,String> latLonRequest,CoordinateAxis heightAxis) throws IOException {
  if (getDatasetFeatureType() == FeatureType.GRID) {
    if (!latLonRequest.containsKey(LON)) {
      formatter=new ErrorFormatter();
      ((ErrorFormatter)formatter).setException("String_Node_Str",MISSING_PARAMETER,"String_Node_Str");
      CDMDataSet=null;
      return;
    }
    if (!latLonRequest.containsKey(LAT)) {
      formatter=new ErrorFormatter();
      ((ErrorFormatter)formatter).setException("String_Node_Str",MISSING_PARAMETER,"String_Node_Str");
      CDMDataSet=null;
      return;
    }
    List<String> lats=Arrays.asList(latLonRequest.get(LAT).split("String_Node_Str"));
    for (    String s : lats) {
      try {
        Double.parseDouble(s);
      }
 catch (      NumberFormatException e) {
        formatter=new ErrorFormatter();
        ((ErrorFormatter)formatter).setException("String_Node_Str",INVALID_PARAMETER,"String_Node_Str");
        CDMDataSet=null;
        return;
      }
    }
    List<String> lons=Arrays.asList(latLonRequest.get(LON).split("String_Node_Str"));
    for (    String s : lons) {
      try {
        Double.parseDouble(s);
      }
 catch (      NumberFormatException e) {
        formatter=new ErrorFormatter();
        ((ErrorFormatter)formatter).setException("String_Node_Str",INVALID_PARAMETER,"String_Node_Str");
        CDMDataSet=null;
        return;
      }
    }
    Variable depthAxis;
    if (!latLonRequest.isEmpty()) {
      List<String> variableNamesNew=new ArrayList<String>();
      variableNamesNew.addAll(Arrays.asList(this.obsProperties));
      depthAxis=(netCDFDataset.findVariable(DEPTH));
      if (depthAxis != null) {
        this.depthAxisName=depthAxis.getFullName();
        this.obsProperties=checkNetcdfFileForAxis((CoordinateAxis1D)depthAxis,this.obsProperties);
      }
      CoordinateAxis lonAxis=netCDFDataset.findCoordinateAxis(AxisType.Lon);
      this.lonAxisName=lonAxis.getFullName();
      this.obsProperties=checkNetcdfFileForAxis(lonAxis,this.obsProperties);
      CoordinateAxis latAxis=netCDFDataset.findCoordinateAxis(AxisType.Lat);
      this.latAxisName=latAxis.getFullName();
      this.obsProperties=checkNetcdfFileForAxis(latAxis,this.obsProperties);
      CDMDataSet=new Grid(this.procedures,eventTime,this.obsProperties,latLonRequest);
      CDMDataSet.setData(getGridDataset());
    }
  }
 else {
    FeatureType currType=getDatasetFeatureType();
    String stationsNamesFromUrn[]=new String[this.procedures.length];
    Map<String,String> urnMap=this.getUrnToStationName();
    for (int statI=0; statI < this.procedures.length; statI++) {
      stationsNamesFromUrn[statI]=urnMap.get(procedures[statI]);
    }
    if (currType == FeatureType.TRAJECTORY) {
      CDMDataSet=new Trajectory(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else     if (currType == FeatureType.STATION) {
      CDMDataSet=new TimeSeries(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else     if (currType == FeatureType.STATION_PROFILE) {
      CDMDataSet=new TimeSeriesProfile(stationsNamesFromUrn,eventTime,this.obsProperties,this.requestFirstTime,this.requestLastTime,this.timeVariable.getRank() > 1,heightAxis);
    }
 else     if (currType == FeatureType.PROFILE) {
      CDMDataSet=new Profile(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else     if (currType == FeatureType.SECTION) {
      CDMDataSet=new Section(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else {
      formatter=new ErrorFormatter();
      ((ErrorFormatter)formatter).setException("String_Node_Str");
      CDMDataSet=null;
      return;
    }
    CDMDataSet.setData(getFeatureTypeDataSet());
  }
}

Fixed version (ground truth):
private void setCDMDatasetForStations(NetcdfDataset netCDFDataset,String[] eventTime,Map<String,String> latLonRequest,CoordinateAxis heightAxis) throws IOException {
  if (getDatasetFeatureType() == FeatureType.GRID) {
    if (!latLonRequest.containsKey(LON)) {
      formatter=new ErrorFormatter();
      ((ErrorFormatter)formatter).setException("String_Node_Str",MISSING_PARAMETER,"String_Node_Str");
      CDMDataSet=null;
      return;
    }
    if (!latLonRequest.containsKey(LAT)) {
      formatter=new ErrorFormatter();
      ((ErrorFormatter)formatter).setException("String_Node_Str",MISSING_PARAMETER,"String_Node_Str");
      CDMDataSet=null;
      return;
    }
    List<String> lats=Arrays.asList(latLonRequest.get(LAT).split("String_Node_Str"));
    for (    String s : lats) {
      try {
        Double.parseDouble(s);
      }
 catch (      NumberFormatException e) {
        formatter=new ErrorFormatter();
        ((ErrorFormatter)formatter).setException("String_Node_Str",INVALID_PARAMETER,"String_Node_Str");
        CDMDataSet=null;
        return;
      }
    }
    List<String> lons=Arrays.asList(latLonRequest.get(LON).split("String_Node_Str"));
    for (    String s : lons) {
      try {
        Double.parseDouble(s);
      }
 catch (      NumberFormatException e) {
        formatter=new ErrorFormatter();
        ((ErrorFormatter)formatter).setException("String_Node_Str",INVALID_PARAMETER,"String_Node_Str");
        CDMDataSet=null;
        return;
      }
    }
    Variable depthAxis;
    if (!latLonRequest.isEmpty()) {
      List<String> variableNamesNew=new ArrayList<String>();
      variableNamesNew.addAll(Arrays.asList(this.obsProperties));
      depthAxis=netCDFDataset.findCoordinateAxis(AxisType.Height);
      if (depthAxis != null) {
        this.depthAxisName=depthAxis.getFullName();
        this.obsProperties=checkNetcdfFileForAxis((CoordinateAxis1D)depthAxis,this.obsProperties);
      }
      CoordinateAxis lonAxis=netCDFDataset.findCoordinateAxis(AxisType.Lon);
      this.lonAxisName=lonAxis.getFullName();
      this.obsProperties=checkNetcdfFileForAxis(lonAxis,this.obsProperties);
      CoordinateAxis latAxis=netCDFDataset.findCoordinateAxis(AxisType.Lat);
      this.latAxisName=latAxis.getFullName();
      this.obsProperties=checkNetcdfFileForAxis(latAxis,this.obsProperties);
      CDMDataSet=new Grid(this.procedures,eventTime,this.obsProperties,latLonRequest);
      CDMDataSet.setData(getGridDataset());
    }
  }
 else {
    FeatureType currType=getDatasetFeatureType();
    String stationsNamesFromUrn[]=new String[this.procedures.length];
    Map<String,String> urnMap=this.getUrnToStationName();
    for (int statI=0; statI < this.procedures.length; statI++) {
      stationsNamesFromUrn[statI]=urnMap.get(procedures[statI]);
    }
    if (currType == FeatureType.TRAJECTORY) {
      CDMDataSet=new Trajectory(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else     if (currType == FeatureType.STATION) {
      CDMDataSet=new TimeSeries(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else     if (currType == FeatureType.STATION_PROFILE) {
      CDMDataSet=new TimeSeriesProfile(stationsNamesFromUrn,eventTime,this.obsProperties,this.requestFirstTime,this.requestLastTime,this.timeVariable.getRank() > 1,heightAxis);
    }
 else     if (currType == FeatureType.PROFILE) {
      CDMDataSet=new Profile(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else     if (currType == FeatureType.SECTION) {
      CDMDataSet=new Section(stationsNamesFromUrn,eventTime,this.obsProperties);
    }
 else {
      formatter=new ErrorFormatter();
      ((ErrorFormatter)formatter).setException("String_Node_Str");
      CDMDataSet=null;
      return;
    }
    CDMDataSet.setData(getFeatureTypeDataSet());
  }
  CoordinateAxis depthAxis=netCDFDataset.findCoordinateAxis(AxisType.Height);
  if (depthAxis != null)   this.depthAxisName=depthAxis.getFullName();
  CoordinateAxis lonAxis=netCDFDataset.findCoordinateAxis(AxisType.Lon);
  if (lonAxis != null)   this.lonAxisName=lonAxis.getFullName();
  CoordinateAxis latAxis=netCDFDataset.findCoordinateAxis(AxisType.Lat);
  if (latAxis != null)   this.latAxisName=latAxis.getFullName();
}