Program: 86240
Project: 86240
Buggy source:
/** 
 * Generates a   {@code Plot}.
 * @param tableController   the TopsoilTableController for the table
 * @param plotType  the TopsoilPlotType of the plot
 */
private static void generatePlot(TopsoilTableController tableController,TopsoilPlotType plotType,PlotContext plotContext){
  List<Map<String,Object>> data=plotContext.getData();
  PlotPropertiesPanelController propertiesPanel=tableController.getTabContent().getPlotPropertiesPanelController();
  Map<String,Object> plotProperties=propertiesPanel.getProperties();
  Plot plot;
switch (plotType) {
case BASE_PLOT:
    plot=new BasePlot();
  break;
case SCATTER_PLOT:
plot=new ScatterPlot();
break;
case UNCERTAINTY_ELLIPSE_PLOT:
plot=new UncertaintyEllipsePlot();
break;
case EVOLUTION_PLOT:
plot=new EvolutionPlot();
break;
default :
plot=plotType.getPlot();
break;
}
plot.setData(data);
plot.setProperties(plotProperties);
propertiesPanel.setPlot(plot);
Parent plotWindow=new PlotWindow(plot);
Scene scene=new Scene(plotWindow,800,600);
Stage plotStage=new Stage();
plotStage.setScene(scene);
plotStage.setResizable(false);
plotStage.setTitle(plotType.getName() + "String_Node_Str" + propertiesPanel.getTitle());
propertiesPanel.titleProperty().addListener(c -> {
if (propertiesPanel.getTitle().length() > 0) {
plotStage.setTitle(plotType.getName() + "String_Node_Str" + propertiesPanel.getTitle());
}
 else {
plotStage.setTitle(plotType.getName());
}
}
);
plotStage.setOnCloseRequest(closeEvent -> {
tableController.getTable().removeOpenPlot(plotType);
propertiesPanel.removePlot();
}
);
plotStage.show();
PlotInformation plotInfo=new PlotInformation(plot,plotType,propertiesPanel.getProperties(),plotContext,plotStage);
plotInfo.setVariableBindings(plotContext.getBindings());
tableController.getTable().addOpenPlot(plotInfo);
propertiesPanel.uncertaintyProperty().addListener(c -> {
PlotContext newContext=generatePlotContext(tableController);
List<Map<String,Object>> newData=newContext.getData();
plot.setData(newData);
}
);
}

Fixed version (ground truth):
/** 
 * Generates a   {@code Plot}.
 * @param tableController   the TopsoilTableController for the table
 * @param plotType  the TopsoilPlotType of the plot
 */
private static void generatePlot(TopsoilTableController tableController,TopsoilPlotType plotType,PlotContext plotContext){
  List<Map<String,Object>> data=plotContext.getData();
  PlotPropertiesPanelController propertiesPanel=tableController.getTabContent().getPlotPropertiesPanelController();
  Map<String,Object> plotProperties=propertiesPanel.getProperties();
  Plot plot=plotType.getPlot();
  plot.setData(data);
  plot.setProperties(plotProperties);
  propertiesPanel.setPlot(plot);
  Parent plotWindow=new PlotWindow(plot);
  Scene scene=new Scene(plotWindow,800,600);
  Stage plotStage=new Stage();
  plotStage.setScene(scene);
  plotStage.setResizable(false);
  plotStage.setTitle(plotType.getName() + "String_Node_Str" + propertiesPanel.getTitle());
  propertiesPanel.titleProperty().addListener(c -> {
    if (propertiesPanel.getTitle().length() > 0) {
      plotStage.setTitle(plotType.getName() + "String_Node_Str" + propertiesPanel.getTitle());
    }
 else {
      plotStage.setTitle(plotType.getName());
    }
  }
);
  plotStage.setOnCloseRequest(closeEvent -> {
    tableController.getTable().removeOpenPlot(plotType);
    propertiesPanel.removePlot();
  }
);
  plotStage.show();
  PlotInformation plotInfo=new PlotInformation(plot,plotType,propertiesPanel.getProperties(),plotContext,plotStage);
  plotInfo.setVariableBindings(plotContext.getBindings());
  tableController.getTable().addOpenPlot(plotInfo);
  propertiesPanel.uncertaintyProperty().addListener(c -> {
    PlotContext newContext=generatePlotContext(tableController);
    List<Map<String,Object>> newData=newContext.getData();
    plot.setData(newData);
  }
);
}