Program: 133662
Project: 133662
Buggy source:
/** 
 * @param shell
 * @param plotViewer
 * @param resource
 */
public void plotFile(Shell shell,CSVPlotViewer plotViewer,VizResource resource){
  File file=resource.getContents();
  String fileName=file.getAbsolutePath();
  CSVDataProvider newDataProvider=null;
  if (fileName.matches("String_Node_Str")) {
    CSVDataLoader newCSVDataLoader=new CSVDataLoader();
    newDataProvider=newCSVDataLoader.load(fileName);
  }
 else {
    return;
  }
  newDataProvider.setSource(file.getName());
  if (newDataProvider.getFeatureList().size() > 1) {
    setIndependentVar(shell,newDataProvider);
  }
  AddPlotDialog plotDialog=new AddPlotDialog(shell);
  if (plotDialog.open() == Window.CANCEL) {
    return;
  }
  String[] userSelectedPlotTypes=plotDialog.getSelections();
  if (userSelectedPlotTypes != null && userSelectedPlotTypes.length > 0) {
    final String plotType=userSelectedPlotTypes[0];
    if ("String_Node_Str".equals(plotType)) {
      if (newDataProvider.getDataHeight() == 0 || newDataProvider.getDataWidth() == 0) {
        return;
      }
      PlotProvider newPlotProvider=new PlotProvider();
      newPlotProvider.setPlotAsContour();
      String newPlotTitle=newDataProvider.getSourceInfo();
      Double plotTime=newDataProvider.getTimes().get(0);
      newDataProvider.setTime(plotTime);
      newPlotProvider.setPlotTitle(newPlotTitle);
      String yAxisFeature=newDataProvider.getFeatureList().get(0);
      SeriesProvider newContourSeries=new SeriesProvider();
      newContourSeries.setDataProvider(newDataProvider);
      newContourSeries.setDataMax(newDataProvider.getDataMax());
      newContourSeries.setDataMin(newDataProvider.getDataMin());
      newContourSeries.setTimeForDataProvider(plotTime);
      newContourSeries.setYDataFeature(yAxisFeature);
      newContourSeries.setSeriesTitle("String_Node_Str" + yAxisFeature);
      newPlotProvider.addSeries(plotTime,newContourSeries);
      plotViewer.addPlot(newPlotProvider);
    }
 else {
      SelectFeatureDialog featureDialog=new SelectFeatureDialog(shell);
      featureDialog.setXAxisFeatures(newDataProvider.getIndependentVariables());
      featureDialog.setYAxisFeatures(newDataProvider.getFeatureList());
      if (featureDialog.open() == Window.OK && !featureDialog.getXAxisFeatures().isEmpty() && !featureDialog.getYAxisFeatures().isEmpty()) {
        PlotProvider newPlotProvider=new PlotProvider();
        String newPlotTitle=newDataProvider.getSourceInfo();
        newPlotProvider.setPlotTitle(newPlotTitle);
        List<String> xAxisFeatures=featureDialog.getXAxisFeatures();
        List<String> yAxisFeatures=featureDialog.getYAxisFeatures();
        Double plotTime=newDataProvider.getTimes().get(0);
        newDataProvider.setTime(plotTime);
        for (        String xAxisFeature : xAxisFeatures) {
          String baseTitle="String_Node_Str" + xAxisFeature + "String_Node_Str"+ plotTime;
          for (          String yAxisFeature : yAxisFeatures) {
            String newSeriesTitle=yAxisFeature + baseTitle;
            SeriesProvider newSeriesProvider=new SeriesProvider();
            newSeriesProvider.setDataProvider(newDataProvider);
            newSeriesProvider.setTimeForDataProvider(plotTime);
            newSeriesProvider.setSeriesTitle(newSeriesTitle);
            newSeriesProvider.setXDataFeature(xAxisFeature);
            newSeriesProvider.setYDataFeature(yAxisFeature);
            newSeriesProvider.setSeriesType(plotType);
            newPlotProvider.addSeries(plotTime,newSeriesProvider);
            plotViewer.addPlot(newPlotProvider);
          }
        }
      }
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * @param shell
 * @param plotViewer
 * @param resource
 */
public void plotFile(Shell shell,CSVPlotViewer plotViewer,VizResource resource){
  File file=resource.getContents();
  String fileName=file.getAbsolutePath();
  CSVDataProvider newDataProvider=null;
  if (fileName.matches("String_Node_Str")) {
    CSVDataLoader newCSVDataLoader=new CSVDataLoader();
    newDataProvider=newCSVDataLoader.load(fileName);
  }
 else {
    return;
  }
  newDataProvider.setSource(file.getName());
  if (newDataProvider.getFeatureList().size() > 1) {
    setIndependentVar(shell,newDataProvider);
  }
  AddPlotDialog plotDialog=new AddPlotDialog(shell);
  if (plotDialog.open() == Window.CANCEL) {
    return;
  }
  String[] userSelectedPlotTypes=plotDialog.getSelections();
  if (userSelectedPlotTypes != null && userSelectedPlotTypes.length > 0) {
    final String plotType=userSelectedPlotTypes[0];
    if ("String_Node_Str".equals(plotType)) {
      if (newDataProvider.getDataHeight() == 0 || newDataProvider.getDataWidth() == 0) {
        return;
      }
      PlotProvider newPlotProvider=new PlotProvider();
      newPlotProvider.setPlotAsContour();
      String newPlotTitle=newDataProvider.getSourceInfo();
      Double plotTime=newDataProvider.getTimes().get(0);
      newDataProvider.setTime(plotTime);
      newPlotProvider.setPlotTitle(newPlotTitle);
      String yAxisFeature=newDataProvider.getFeatureList().get(0);
      SeriesProvider newContourSeries=new SeriesProvider();
      newContourSeries.setDataProvider(newDataProvider);
      newContourSeries.setDataMax(newDataProvider.getDataMax());
      newContourSeries.setDataMin(newDataProvider.getDataMin());
      newContourSeries.setTimeForDataProvider(plotTime);
      newContourSeries.setYDataFeature(yAxisFeature);
      newContourSeries.setSeriesTitle("String_Node_Str" + yAxisFeature);
      newPlotProvider.addSeries(plotTime,newContourSeries);
      plotViewer.addPlot(newPlotProvider);
    }
 else {
      SelectFeatureDialog featureDialog=new SelectFeatureDialog(shell);
      featureDialog.setXAxisFeatures(newDataProvider.getIndependentVariables());
      featureDialog.setYAxisFeatures(newDataProvider.getFeatureList());
      if (featureDialog.open() == Window.OK && !featureDialog.getXAxisFeatures().isEmpty() && !featureDialog.getYAxisFeatures().isEmpty()) {
        PlotProvider newPlotProvider=new PlotProvider();
        String newPlotTitle=newDataProvider.getSourceInfo();
        newPlotProvider.setPlotTitle(newPlotTitle);
        List<String> xAxisFeatures=featureDialog.getXAxisFeatures();
        List<String> yAxisFeatures=featureDialog.getYAxisFeatures();
        Double plotTime=newDataProvider.getTimes().get(0);
        newDataProvider.setTime(plotTime);
        for (        String xAxisFeature : xAxisFeatures) {
          String baseTitle="String_Node_Str" + xAxisFeature + "String_Node_Str"+ plotTime;
          for (          String yAxisFeature : yAxisFeatures) {
            String newSeriesTitle=yAxisFeature + baseTitle;
            SeriesProvider newSeriesProvider=new SeriesProvider();
            newSeriesProvider.setDataProvider(newDataProvider);
            newSeriesProvider.setTimeForDataProvider(plotTime);
            newSeriesProvider.setSeriesTitle(newSeriesTitle);
            newSeriesProvider.setXDataFeature(xAxisFeature);
            newSeriesProvider.setYDataFeature(yAxisFeature);
            newSeriesProvider.setSeriesType(plotType);
            newPlotProvider.addSeries(plotTime,newSeriesProvider);
          }
        }
        plotViewer.addPlot(newPlotProvider);
      }
    }
  }
  return;
}