Program: 59816
Project: 59816
Buggy source:
/** 
 * Combines the charts in the target path according to the matching attribute. That means a new chart containing the given attribute from all the charts generated in the given location is generated.
 * @param target Root path to an existing chart report.
 * @param matchingAttribute The name of the attribute present in all of the charts.
 * @param matchingCharts The charts to be combined.
 * @return The newly created chart meta-data.
 * @throws PerfCakeException When it was not possible to write the new chart data.
 */
private static C3Chart combineCharts(final Path target,final String matchingAttribute,final List<C3Chart> matchingCharts) throws PerfCakeException {
  final C3Chart newChart=new C3Chart();
  final String newBaseName=matchingCharts.stream().map(C3Chart::getBaseName).collect(Collectors.joining("String_Node_Str"));
  final List<String> attributes=new ArrayList<>();
  attributes.add(matchingCharts.get(0).getAttributes().get(0));
  attributes.addAll(matchingCharts.stream().map(ch -> String.format("String_Node_Str",ch.getName(),C3ChartHtmlTemplates.getCreatedAsString(ch))).collect(Collectors.toList()));
  newChart.setBaseName(COMBINED_PREFIX + fileCounter++);
  newChart.setxAxisType(matchingCharts.get(0).getxAxisType());
  newChart.setxAxis(matchingCharts.get(0).getxAxis());
  newChart.setyAxis(matchingCharts.get(0).getyAxis());
  newChart.setName("String_Node_Str" + matchingCharts.get(0).getGroup() + "String_Node_Str"+ matchingAttribute);
  newChart.setGroup(matchingCharts.get(0).getGroup());
  newChart.setAttributes(attributes);
  C3ChartData chartData=null;
  for (  final C3Chart chart : matchingCharts) {
    C3ChartData tmpChartData=new C3ChartData(chart.getBaseName(),target);
    tmpChartData=tmpChartData.filter(chart.getAttributes().indexOf(matchingAttribute));
    if (chartData == null) {
      chartData=tmpChartData;
    }
 else {
      chartData=chartData.combineWith(tmpChartData);
    }
  }
  new C3ChartDataFile(newChart,target,chartData);
  return newChart;
}

Fixed version (ground truth):
/** 
 * Combines the charts in the target path according to the matching attribute. That means a new chart containing the given attribute from all the charts generated in the given location is generated.
 * @param target Root path to an existing chart report.
 * @param matchingAttribute The name of the attribute present in all of the charts.
 * @param matchingCharts The charts to be combined.
 * @return The newly created chart meta-data.
 * @throws PerfCakeException When it was not possible to write the new chart data.
 */
private static C3Chart combineCharts(final Path target,final String matchingAttribute,final List<C3Chart> matchingCharts) throws PerfCakeException {
  final C3Chart newChart=new C3Chart();
  final List<String> attributes=new ArrayList<>();
  attributes.add(matchingCharts.get(0).getAttributes().get(0));
  attributes.addAll(matchingCharts.stream().map(ch -> String.format("String_Node_Str",ch.getName(),C3ChartHtmlTemplates.getCreatedAsString(ch))).collect(Collectors.toList()));
  newChart.setBaseName(COMBINED_PREFIX + fileCounter++);
  newChart.setxAxisType(matchingCharts.get(0).getxAxisType());
  newChart.setxAxis(matchingCharts.get(0).getxAxis());
  newChart.setyAxis(matchingCharts.get(0).getyAxis());
  newChart.setName("String_Node_Str" + matchingCharts.get(0).getGroup() + "String_Node_Str"+ matchingAttribute);
  newChart.setGroup(matchingCharts.get(0).getGroup());
  newChart.setAttributes(attributes);
  C3ChartData chartData=null;
  for (  final C3Chart chart : matchingCharts) {
    C3ChartData tmpChartData=new C3ChartData(chart.getBaseName(),target);
    tmpChartData=tmpChartData.filter(chart.getAttributes().indexOf(matchingAttribute));
    if (chartData == null) {
      chartData=tmpChartData;
    }
 else {
      chartData=chartData.combineWith(tmpChartData);
    }
  }
  new C3ChartDataFile(newChart,target,chartData);
  return newChart;
}