Program: 19246
Project: 19246
Buggy source:
private void setCDMDatasetForStations(NetcdfDataset netCDFDataset,String[] stationNames,String[] eventTime,Map<String,String> latLonRequest) throws IOException {
  System.out.println("String_Node_Str" + getDatasetFeatureType().name());
  String[] editedStationNames=new String[stationNames.length];
  if (stationVariable.getShape().length <= 1) {
    System.out.println("String_Node_Str");
    for (int i=0; i < stationNames.length; i++) {
      editedStationNames[i]=stationNames[i].replaceAll("String_Node_Str","String_Node_Str");
    }
    stationNames=editedStationNames.clone();
    System.out.println("String_Node_Str" + stationNames.length + "String_Node_Str");
    for (    String str : stationNames) {
      System.out.print(str + "String_Node_Str");
    }
  }
  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(stationNames,eventTime,this.variableNames,latLonRequest);
      CDMDataSet.setData(getGridDataset());
    }
  }
 else {
    if (getDatasetFeatureType() == FeatureType.TRAJECTORY) {
      CDMDataSet=new Trajectory(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION) {
      CDMDataSet=new TimeSeries(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION_PROFILE) {
      CDMDataSet=new TimeSeriesProfile(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.PROFILE) {
      CDMDataSet=new Profile(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.SECTION) {
      CDMDataSet=new Section(stationNames,eventTime,this.variableNames);
    }
 else {
      _log.error("String_Node_Str");
      output=new GetCapsOutputter();
      output.setupExceptionOutput("String_Node_Str");
      CDMDataSet=null;
      return;
    }
    System.out.println("String_Node_Str");
    if (CDMDataSet != null) {
      CDMDataSet.setData(getFeatureTypeDataSet());
    }
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setCDMDatasetForStations(NetcdfDataset netCDFDataset,String[] stationNames,String[] eventTime,Map<String,String> latLonRequest) throws IOException {
  String[] editedStationNames=new String[stationNames.length];
  if (stationVariable.getShape().length <= 1 && stationVariable.getDataType() != DataType.CHAR) {
    for (int i=0; i < stationNames.length; i++) {
      editedStationNames[i]=stationNames[i].replaceAll("String_Node_Str","String_Node_Str");
    }
    stationNames=editedStationNames.clone();
  }
  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(stationNames,eventTime,this.variableNames,latLonRequest);
      CDMDataSet.setData(getGridDataset());
    }
  }
 else {
    if (getDatasetFeatureType() == FeatureType.TRAJECTORY) {
      CDMDataSet=new Trajectory(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION) {
      CDMDataSet=new TimeSeries(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.STATION_PROFILE) {
      CDMDataSet=new TimeSeriesProfile(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.PROFILE) {
      CDMDataSet=new Profile(stationNames,eventTime,this.variableNames);
    }
 else     if (getDatasetFeatureType() == FeatureType.SECTION) {
      CDMDataSet=new Section(stationNames,eventTime,this.variableNames);
    }
 else {
      _log.error("String_Node_Str");
      output=new GetCapsOutputter();
      output.setupExceptionOutput("String_Node_Str");
      CDMDataSet=null;
      return;
    }
    if (CDMDataSet != null) {
      CDMDataSet.setData(getFeatureTypeDataSet());
    }
  }
}