Program: 19231
Project: 19231
Buggy source:
private void setStationData() throws IOException {
  List<String> stationNames=new ArrayList<String>(this.getStationNames().size());
  for (  String str : this.getStationNames().values()) {
    stationNames.add(str);
  }
switch (this.getDatasetFeatureType()) {
case STATION:
    this.stationData=new TimeSeries(stationNames.toArray(new String[stationNames.size()]),null,null);
  this.stationData.setData(this.getFeatureTypeDataSet());
break;
case STATION_PROFILE:
this.stationData=new TimeSeriesProfile(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
case PROFILE:
stationNames=ListComprehension.map(stationNames,new ListComprehension.Func<String,String>(){
public String apply(String in){
return in.replaceAll("String_Node_Str","String_Node_Str");
}
}
);
this.stationData=new Profile(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
case TRAJECTORY:
stationNames=ListComprehension.map(stationNames,new ListComprehension.Func<String,String>(){
public String apply(String in){
return in.replaceAll("String_Node_Str","String_Node_Str");
}
}
);
this.stationData=new Trajectory(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
default :
logger.error("String_Node_Str" + this.getDatasetFeatureType().toString());
this.errorString="String_Node_Str";
}
}

Fixed version (ground truth):
private void setStationData() throws IOException {
  List<String> stationNames=new ArrayList<String>(this.getStationNames().size());
  for (  String str : this.getStationNames().values()) {
    stationNames.add(str);
  }
switch (this.getDatasetFeatureType()) {
case STATION:
    this.stationData=new TimeSeries(stationNames.toArray(new String[stationNames.size()]),null,null);
  this.stationData.setData(this.getFeatureTypeDataSet());
break;
case STATION_PROFILE:
this.stationData=new TimeSeriesProfile(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
case PROFILE:
stationNames=ListComprehension.map(stationNames,new ListComprehension.Func<String,String>(){
public String apply(String in){
return in.replaceAll("String_Node_Str","String_Node_Str");
}
}
);
this.stationData=new Profile(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
case TRAJECTORY:
stationNames=ListComprehension.map(stationNames,new ListComprehension.Func<String,String>(){
public String apply(String in){
return in.replaceAll("String_Node_Str","String_Node_Str");
}
}
);
this.stationData=new Trajectory(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
case SECTION:
stationNames=ListComprehension.map(stationNames,new ListComprehension.Func<String,String>(){
public String apply(String in){
return in.replaceAll("String_Node_Str","String_Node_Str");
}
}
);
this.stationData=new Section(stationNames.toArray(new String[stationNames.size()]),null,null);
this.stationData.setData(this.getFeatureTypeDataSet());
break;
case GRID:
List<String> dataVars=new ArrayList<String>();
for (VariableSimpleIF var : this.getDataVariables()) {
dataVars.add(var.getShortName());
}
HashMap<String,String> latLon=new HashMap<String,String>();
latLon.put("String_Node_Str",this.getGridDataset().getBoundingBox().getLatMin() + "String_Node_Str" + this.getGridDataset().getBoundingBox().getLatMax());
latLon.put("String_Node_Str",this.getGridDataset().getBoundingBox().getLonMin() + "String_Node_Str" + this.getGridDataset().getBoundingBox().getLonMax());
this.stationData=new Grid(stationNames.toArray(new String[stationNames.size()]),null,dataVars.toArray(new String[dataVars.size()]),latLon);
this.stationData.setData(this.getGridDataset());
break;
default :
logger.error("String_Node_Str" + this.getDatasetFeatureType().toString());
this.errorString="String_Node_Str";
}
}