Program: 26453
Project: 26453
Buggy source:
protected void formatChart(){
  super.formatChart();
  chart.setTitle(definition.getTitle());
  XYPlot plot=chart.getXYPlot();
  plot.getDomainAxis().setLabel(definition.getXAxisLabel());
  plot.getRangeAxis().setLabel(definition.getYAxisLabel());
  if (definition.usePercentYAxis()) {
    LineChartBuilder.setPercentYAxis(chart);
  }
  if (definition.isStacked()) {
    StackedXYAreaRenderer2 renderer=(StackedXYAreaRenderer2)plot.getRenderer();
    renderer.setLegendArea(new java.awt.Rectangle(10,10));
    renderer.setBaseToolTipGenerator(tooltipGenerator);
  }
 else {
    StandardXYItemRenderer renderer=(StandardXYItemRenderer)plot.getRenderer(0);
    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);
    renderer.setPlotDiscontinuous(true);
    renderer.setGapThresholdType(UnitType.ABSOLUTE);
    recalculateGapThreshold(0);
    renderer.setBaseToolTipGenerator(tooltipGenerator);
  }
  if (definition.hasSecondaryYAxis()) {
    plot.getRangeAxis(1).setLabel(definition.getSecondaryYAxisLabel());
    StandardXYItemRenderer renderer=(StandardXYItemRenderer)plot.getRenderer(1);
    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);
    renderer.setPlotDiscontinuous(true);
    renderer.setGapThresholdType(UnitType.ABSOLUTE);
    recalculateGapThreshold(1);
    renderer.setBaseToolTipGenerator(tooltipGenerator);
  }
  for (int i=0; i < plot.getRangeAxisCount(); i++) {
    plot.getRangeAxis(i).setLabelFont(LABEL_FONT);
    plot.getRangeAxis(i).setTickLabelFont(AXIS_FONT);
  }
  plot.getDomainAxis().setLabelFont(LABEL_FONT);
  plot.getDomainAxis().setTickLabelFont(AXIS_FONT);
  plot.setRangeGridlinePaint(GRID_COLOR);
  plot.setRangeGridlineStroke(GRID_LINES);
}

Fixed version (ground truth):
protected void formatChart(){
  super.formatChart();
  chart.setTitle(definition.getTitle());
  XYPlot plot=chart.getXYPlot();
  plot.getDomainAxis().setLabel(definition.getXAxisLabel());
  plot.getRangeAxis().setLabel(definition.getYAxisLabel());
  if (definition.usePercentYAxis()) {
    LineChartBuilder.setPercentYAxis(chart);
  }
  TimeAndValueTooltipGenerator tooltipGenerator=new TimeAndValueTooltipGenerator();
  if (definition.isStacked()) {
    StackedXYAreaRenderer2 renderer=(StackedXYAreaRenderer2)plot.getRenderer();
    renderer.setLegendArea(new java.awt.Rectangle(10,10));
    renderer.setBaseToolTipGenerator(tooltipGenerator);
  }
 else {
    StandardXYItemRenderer renderer=(StandardXYItemRenderer)plot.getRenderer(0);
    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);
    renderer.setPlotDiscontinuous(true);
    renderer.setGapThresholdType(UnitType.ABSOLUTE);
    recalculateGapThreshold(0);
    renderer.setBaseToolTipGenerator(tooltipGenerator);
  }
  if (definition.hasSecondaryYAxis()) {
    plot.getRangeAxis(1).setLabel(definition.getSecondaryYAxisLabel());
    StandardXYItemRenderer renderer=(StandardXYItemRenderer)plot.getRenderer(1);
    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);
    renderer.setPlotDiscontinuous(true);
    renderer.setGapThresholdType(UnitType.ABSOLUTE);
    recalculateGapThreshold(1);
    renderer.setBaseToolTipGenerator(tooltipGenerator);
  }
  for (int i=0; i < plot.getRangeAxisCount(); i++) {
    plot.getRangeAxis(i).setLabelFont(LABEL_FONT);
    plot.getRangeAxis(i).setTickLabelFont(AXIS_FONT);
  }
  plot.getDomainAxis().setLabelFont(LABEL_FONT);
  plot.getDomainAxis().setTickLabelFont(AXIS_FONT);
  plot.setRangeGridlinePaint(GRID_COLOR);
  plot.setRangeGridlineStroke(GRID_LINES);
}