nus-yam/ex-repair huggingface dataset:
Program: 59799
Project: 59799
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected Accumulator getAccumulator(final String key,final Class clazz){
  if (Double.class.equals(clazz)) {
    if (windowSize == Integer.MAX_VALUE) {
      return getNonWindowedAccumulator(key);
    }
 else {
      return getWindowedAccumulator(key);
    }
  }
  return super.getAccumulator(key,clazz);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected Accumulator getAccumulator(final String key,final Class clazz){
  if (Double.class.equals(clazz) || PerfCakeConst.REQUEST_SIZE_TAG.equals(key) || PerfCakeConst.RESPONSE_SIZE_TAG.equals(key)) {
    if (windowSize == Integer.MAX_VALUE) {
      return getNonWindowedAccumulator(key);
    }
 else {
      return getWindowedAccumulator(key);
    }
  }
  return super.getAccumulator(key,clazz);
}
Program: 59800
Project: 59800
Buggy source:
@Test public void testDefaults() throws InstantiationException, IllegalAccessException, ClassNotFoundException, InvocationTargetException {
  final ThroughputStatsReporter tsr=(ThroughputStatsReporter)ObjectFactory.summonInstance(ThroughputStatsReporter.class.getName(),new Properties());
  Assert.assertTrue(tsr.isAverageEnabled());
  Assert.assertTrue(tsr.isMinimumEnabled());
  Assert.assertTrue(tsr.isMaximumEnabled());
  Assert.assertNull(tsr.getAccumulatedResult(StatsReporter.AVERAGE));
  Assert.assertNull(tsr.getAccumulatedResult(StatsReporter.MINIMUM));
  Assert.assertNull(tsr.getAccumulatedResult(StatsReporter.MAXIMUM));
  Assert.assertNull(tsr.getAccumulatedResult(Measurement.DEFAULT_RESULT));
  final ResponseTimeStatsReporter rtsr=(ResponseTimeStatsReporter)ObjectFactory.summonInstance(ResponseTimeStatsReporter.class.getName(),new Properties());
  Assert.assertTrue(rtsr.isAverageEnabled());
  Assert.assertTrue(rtsr.isMinimumEnabled());
  Assert.assertTrue(rtsr.isMaximumEnabled());
  Assert.assertNull(rtsr.getAccumulatedResult(StatsReporter.AVERAGE));
  Assert.assertNull(rtsr.getAccumulatedResult(StatsReporter.MINIMUM));
  Assert.assertNull(rtsr.getAccumulatedResult(StatsReporter.MAXIMUM));
  Assert.assertNull(rtsr.getAccumulatedResult(Measurement.DEFAULT_RESULT));
}

Fixed version (ground truth):
@Test public void testDefaults() throws InstantiationException, IllegalAccessException, ClassNotFoundException, InvocationTargetException {
  final ThroughputStatsReporter tsr=(ThroughputStatsReporter)ObjectFactory.summonInstance(ThroughputStatsReporter.class.getName(),new Properties());
  Assert.assertTrue(tsr.isAverageEnabled());
  Assert.assertTrue(tsr.isMinimumEnabled());
  Assert.assertTrue(tsr.isMaximumEnabled());
  Assert.assertNull(tsr.getAccumulatedResult(StatsReporter.AVERAGE));
  Assert.assertNull(tsr.getAccumulatedResult(StatsReporter.MINIMUM));
  Assert.assertNull(tsr.getAccumulatedResult(StatsReporter.MAXIMUM));
  Assert.assertNull(tsr.getAccumulatedResult(Measurement.DEFAULT_RESULT));
  Assert.assertNull(tsr.getAccumulatedResult(PerfCakeConst.REQUEST_SIZE_TAG));
  Assert.assertNull(tsr.getAccumulatedResult(PerfCakeConst.RESPONSE_SIZE_TAG));
  final ResponseTimeStatsReporter rtsr=(ResponseTimeStatsReporter)ObjectFactory.summonInstance(ResponseTimeStatsReporter.class.getName(),new Properties());
  Assert.assertTrue(rtsr.isAverageEnabled());
  Assert.assertTrue(rtsr.isMinimumEnabled());
  Assert.assertTrue(rtsr.isMaximumEnabled());
  Assert.assertNull(rtsr.getAccumulatedResult(StatsReporter.AVERAGE));
  Assert.assertNull(rtsr.getAccumulatedResult(StatsReporter.MINIMUM));
  Assert.assertNull(rtsr.getAccumulatedResult(StatsReporter.MAXIMUM));
  Assert.assertNull(rtsr.getAccumulatedResult(Measurement.DEFAULT_RESULT));
  Assert.assertNull(rtsr.getAccumulatedResult(PerfCakeConst.REQUEST_SIZE_TAG));
  Assert.assertNull(rtsr.getAccumulatedResult(PerfCakeConst.RESPONSE_SIZE_TAG));
}
Program: 59801
Project: 59801
Buggy source:
private String getResultsLine(final Measurement m){
  final Object defaultResult=m.get();
  final Map<String,Object> results=m.getAll();
  final StringBuilder sb=new StringBuilder();
  sb.append(Utils.timeToHMS(m.getTime()));
  sb.append(delimiter);
  sb.append(m.getIteration() + 1);
  if (defaultResult != null) {
    sb.append(delimiter);
    if (defaultResult instanceof Quantity<?>) {
      sb.append(((Quantity<?>)defaultResult).getNumber());
    }
 else {
      sb.append(defaultResult);
    }
  }
  Object currentResult;
  for (  final String resultName : resultNames) {
    sb.append(delimiter);
    currentResult=results.get(resultName);
    if (currentResult instanceof Quantity<?>) {
      sb.append(((Quantity<?>)currentResult).getNumber());
    }
 else {
      sb.append(currentResult);
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Gets a single CSV result file line based on the measurement.
 * @param measurement The measurement to be reported in the CSV result file.
 * @return A new line entry to the CSV result file.
 */
private String getResultsLine(final Measurement measurement){
  final Object defaultResult=measurement.get();
  final Map<String,Object> results=measurement.getAll();
  final StringBuilder sb=new StringBuilder();
  sb.append(Utils.timeToHMS(measurement.getTime()));
  sb.append(delimiter);
  sb.append(measurement.getIteration() + 1);
  if (defaultResult != null) {
    sb.append(delimiter);
    if (defaultResult instanceof Quantity<?>) {
      sb.append(((Quantity<?>)defaultResult).getNumber());
    }
 else {
      sb.append(defaultResult);
    }
  }
  Object currentResult;
  for (  final String resultName : resultNames) {
    sb.append(delimiter);
    currentResult=results.get(resultName);
    if (currentResult instanceof Quantity<?>) {
      sb.append(((Quantity<?>)currentResult).getNumber());
    }
 else {
      sb.append(currentResult);
    }
  }
  return sb.toString();
}
Program: 59802
Project: 59802
Buggy source:
private void presetResultNames(final Measurement m){
  if (expectedAttributes.isEmpty()) {
    attributesExpected=false;
    final Map<String,Object> results=m.getAll();
    for (    final String key : results.keySet()) {
      if (!key.equals(Measurement.DEFAULT_RESULT)) {
        resultNames.add(key);
      }
    }
  }
 else {
    resultNames.addAll(expectedAttributes);
    attributesExpected=true;
  }
}

Fixed version (ground truth):
/** 
 * Autocompute the expectedAttributes when theyw ere not specified by the user.
 * @param measurement A sample measurement to read the attributes from.
 */
private void presetResultNames(final Measurement measurement){
  expectedAttributesEmpty=expectedAttributes.isEmpty();
  if (expectedAttributesEmpty) {
    final Map<String,Object> results=measurement.getAll();
    resultNames.addAll(results.keySet().stream().filter(key -> !key.equals(Measurement.DEFAULT_RESULT)).collect(Collectors.toList()));
  }
 else {
    resultNames.addAll(expectedAttributes);
  }
}
Program: 59803
Project: 59803
Buggy source:
@Override public void close(){
  if (dynamicAttributes) {
    expectedAttributes=buffer.getAttributes();
    openFile();
    buffer.replay((measurement) -> {
      try {
        realReport(measurement);
      }
 catch (      ReportingException e) {
        log.error("String_Node_Str",e);
      }
    }
);
  }
  closeFile();
}

Fixed version (ground truth):
@Override public void close(){
  if (dynamicAttributes) {
    expectedAttributes=buffer.getAttributes();
    if (wasWarmUp) {
      expectedAttributes.add(PerfCakeConst.WARM_UP_TAG);
    }
    openFile();
    buffer.replay((measurement) -> {
      try {
        realReport(measurement);
      }
 catch (      ReportingException e) {
        log.error("String_Node_Str",e);
      }
    }
,false);
  }
  closeFile();
}
Program: 59805
Project: 59805
Buggy source:
@Override public void open(){
  dynamicAttributes=expectedAttributes.stream().anyMatch(s -> s.endsWith("String_Node_Str"));
  if (expectedAttributes.contains(PerfCakeConst.WARM_UP_TAG)) {
    expectedAttributes.remove(PerfCakeConst.WARM_UP_TAG);
    expectedAttributes.addAll(expectedAttributes.stream().map(attr -> attr + "String_Node_Str" + PerfCakeConst.WARM_UP_TAG).collect(Collectors.toList()));
  }
  csvFile=new File(path);
  if (dynamicAttributes) {
    buffer=new DataBuffer(expectedAttributes);
  }
 else {
    openFile();
  }
}

Fixed version (ground truth):
@Override public void open(){
  dynamicAttributes=expectedAttributes.stream().anyMatch(s -> s.endsWith("String_Node_Str"));
  wasWarmUp=expectedAttributes.contains(PerfCakeConst.WARM_UP_TAG);
  csvFile=new File(path);
  if (dynamicAttributes) {
    buffer=new DataBuffer(expectedAttributes);
  }
 else {
    openFile();
  }
}
Program: 59806
Project: 59806
Buggy source:
@Test public void testDefaultProperties() throws IOException {
  final File defaultCSVFile=new File(DEFAULT_FILE_NAME);
  if (defaultCSVFile.exists()) {
    defaultCSVFile.delete();
  }
  try {
    final Properties destinationProperties=new Properties();
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    Assert.assertEquals(destination.getPath(),DEFAULT_FILE_NAME);
    Assert.assertEquals(destination.getDelimiter(),"String_Node_Str");
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<Double>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<Double>(222.22,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    destination.close();
    assertCSVFileContent(defaultCSVFile,"String_Node_Str" + Measurement.DEFAULT_RESULT + "String_Node_Str"+ ITERATION+ "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
 finally {
    defaultCSVFile.delete();
  }
}

Fixed version (ground truth):
@Test public void testDefaultProperties() throws IOException {
  final File defaultCSVFile=new File(DEFAULT_FILE_NAME);
  if (defaultCSVFile.exists()) {
    defaultCSVFile.delete();
  }
  try {
    final Properties destinationProperties=new Properties();
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    Assert.assertEquals(destination.getPath(),DEFAULT_FILE_NAME);
    Assert.assertEquals(destination.getDelimiter(),"String_Node_Str");
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<>(222.22,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    destination.close();
    assertCSVFileContent(defaultCSVFile,"String_Node_Str" + Measurement.DEFAULT_RESULT + "String_Node_Str"+ ITERATION+ "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
 finally {
    defaultCSVFile.delete();
  }
}
Program: 59807
Project: 59807
Buggy source:
@Test(expectedExceptions={ReportingException.class}) public void testPathIsNotFile() throws ReportingException {
  final Properties destinationProperties=new Properties();
  destinationProperties.setProperty("String_Node_Str","String_Node_Str");
  try {
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<Double>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<Double>(222.22,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    destination.close();
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test(expectedExceptions={ReportingException.class}) public void testPathIsNotFile() throws ReportingException {
  final Properties destinationProperties=new Properties();
  destinationProperties.setProperty("String_Node_Str","String_Node_Str");
  try {
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<>(222.22,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    destination.close();
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 59808
Project: 59808
Buggy source:
@Test public void testDestinationReport(){
  final Properties destinationProperties=new Properties();
  destinationProperties.put("String_Node_Str","String_Node_Str");
  destinationProperties.put("String_Node_Str",csvFile.getAbsolutePath());
  prepareFile(csvFile);
  try {
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<Double>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<Double>(222.22,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    destination.close();
    assertCSVFileContent(csvFile,"String_Node_Str" + Measurement.DEFAULT_RESULT + "String_Node_Str"+ ITERATION+ "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testDestinationReport(){
  final Properties destinationProperties=new Properties();
  destinationProperties.put("String_Node_Str","String_Node_Str");
  destinationProperties.put("String_Node_Str",csvFile.getAbsolutePath());
  prepareFile(csvFile);
  try {
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<>(222.22,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    destination.close();
    assertCSVFileContent(csvFile,"String_Node_Str" + Measurement.DEFAULT_RESULT + "String_Node_Str"+ ITERATION+ "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 59809
Project: 59809
Buggy source:
@Test public void testMultipleRecords(){
  final Properties destinationProperties=new Properties();
  destinationProperties.setProperty("String_Node_Str",csvFile.getAbsolutePath());
  prepareFile(csvFile);
  try {
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<Double>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<Double>(222.22,"String_Node_Str"));
    final Measurement measurement2=new Measurement(43,123457000,ITERATION);
    measurement2.set(new Quantity<Double>(2222.22,"String_Node_Str"));
    measurement2.set("String_Node_Str",new Quantity<Double>(333.33,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    Thread.sleep(100);
    destination.report(measurement2);
    destination.close();
    assertCSVFileContent(csvFile,"String_Node_Str" + Measurement.DEFAULT_RESULT + "String_Node_Str"+ ITERATION+ "String_Node_Str"+ (ITERATION + 1)+ "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException|InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testMultipleRecords(){
  final Properties destinationProperties=new Properties();
  destinationProperties.setProperty("String_Node_Str",csvFile.getAbsolutePath());
  prepareFile(csvFile);
  try {
    final CsvDestination destination=(CsvDestination)ObjectFactory.summonInstance(CsvDestination.class.getName(),destinationProperties);
    final Measurement measurement=new Measurement(42,123456000,ITERATION - 1);
    measurement.set(new Quantity<>(1111.11,"String_Node_Str"));
    measurement.set("String_Node_Str",new Quantity<>(222.22,"String_Node_Str"));
    final Measurement measurement2=new Measurement(43,123457000,ITERATION);
    measurement2.set(new Quantity<>(2222.22,"String_Node_Str"));
    measurement2.set("String_Node_Str",new Quantity<>(333.33,"String_Node_Str"));
    destination.open();
    destination.report(measurement);
    Thread.sleep(100);
    destination.report(measurement2);
    destination.close();
    assertCSVFileContent(csvFile,"String_Node_Str" + Measurement.DEFAULT_RESULT + "String_Node_Str"+ ITERATION+ "String_Node_Str"+ (ITERATION + 1)+ "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException|InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 59810
Project: 59810
Buggy source:
private void assertCSVFileContent(final File file,final String expected){
  try (Scanner scanner=new Scanner(file).useDelimiter("String_Node_Str")){
    Assert.assertEquals(scanner.next(),expected,"String_Node_Str");
  }
 catch (  final FileNotFoundException fnfe) {
    fnfe.printStackTrace();
    Assert.fail(fnfe.getMessage());
  }
}

Fixed version (ground truth):
private void assertCSVFileContent(final File file,final String expected){
  try (Scanner scanner=new Scanner(file,Utils.getDefaultEncoding()).useDelimiter("String_Node_Str")){
    Assert.assertEquals(scanner.next(),expected,"String_Node_Str");
  }
 catch (  final FileNotFoundException fnfe) {
    fnfe.printStackTrace();
    Assert.fail(fnfe.getMessage());
  }
}
Program: 59811
Project: 59811
Buggy source:
@Override public void close(){
  if (dynamicAttributes) {
    attributes=buffer.getAttributes();
    helper=new C3ChartHelper(this);
  }
  if (!helper.isInitialized()) {
    log.error("String_Node_Str");
  }
 else {
    try {
      if (dynamicAttributes) {
        buffer.replay((measurement) -> {
          try {
            helper.appendResult(measurement);
          }
 catch (          ReportingException e) {
            log.error("String_Node_Str",e);
          }
        }
);
      }
      helper.close();
      helper.compileResults();
    }
 catch (    final PerfCakeException e) {
      log.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (dynamicAttributes) {
    attributes=buffer.getAttributes();
    helper=new C3ChartHelper(this);
  }
  if (!helper.isInitialized()) {
    log.error("String_Node_Str");
  }
 else {
    try {
      if (dynamicAttributes) {
        buffer.replay((measurement) -> {
          try {
            helper.appendResult(measurement);
          }
 catch (          ReportingException e) {
            log.error("String_Node_Str",e);
          }
        }
);
      }
      helper.close();
      helper.compileResults(autoCombine);
    }
 catch (    final PerfCakeException e) {
      log.error("String_Node_Str",e);
    }
  }
}
Program: 59813
Project: 59813
Buggy source:
/** 
 * Creates a new helper for the given ChartDestination.
 * @param chartDestination The ChartDestination this helper is supposed to serve to.
 */
public C3ChartHelper(final ChartDestination chartDestination){
  try {
    final List<String> attributes=new ArrayList<>(chartDestination.getAttributesAsList());
    if (attributes.contains(PerfCakeConst.WARM_UP_TAG)) {
      attributes.remove(PerfCakeConst.WARM_UP_TAG);
      attributes.addAll(attributes.stream().map(a -> a + "String_Node_Str" + PerfCakeConst.WARM_UP_TAG).collect(Collectors.toList()));
    }
switch (chartDestination.getxAxisType()) {
case PERCENTAGE:
      attributes.add(0,COLUMN_PERCENT);
    break;
case TIME:
  attributes.add(0,COLUMN_TIME);
break;
case ITERATION:
attributes.add(0,COLUMN_ITERATION);
break;
}
final C3Chart chart=new C3Chart();
chart.setGroup(chartDestination.getGroup());
chart.setAttributes(attributes);
chart.setName(chartDestination.getName());
chart.setxAxisType(chartDestination.getxAxisType());
chart.setxAxis(chartDestination.getXAxis());
chart.setyAxis(chartDestination.getYAxis());
chart.setHeight(chartDestination.getChartHeight());
chartDataFile=new C3ChartDataFile(chart,chartDestination.getOutputDirAsPath());
chartDataFile.open();
initialized=true;
}
 catch (final PerfCakeException e) {
log.error(String.format("String_Node_Str",this.getClass().getName()),e);
initialized=false;
}
}

Fixed version (ground truth):
/** 
 * Creates a new helper for the given ChartDestination.
 * @param chartDestination The ChartDestination this helper is supposed to serve to.
 */
public C3ChartHelper(final ChartDestination chartDestination){
  try {
    final List<String> attributes=new ArrayList<>(chartDestination.getAttributesAsList());
switch (chartDestination.getxAxisType()) {
case PERCENTAGE:
      attributes.add(0,COLUMN_PERCENT);
    break;
case TIME:
  attributes.add(0,COLUMN_TIME);
break;
case ITERATION:
attributes.add(0,COLUMN_ITERATION);
break;
}
final C3Chart chart=new C3Chart();
chart.setGroup(chartDestination.getGroup());
chart.setAttributes(attributes);
chart.setName(chartDestination.getName());
chart.setxAxisType(chartDestination.getxAxisType());
chart.setxAxis(chartDestination.getxAxis());
chart.setyAxis(chartDestination.getyAxis());
chart.setHeight(chartDestination.getChartHeight());
chartDataFile=new C3ChartDataFile(chart,chartDestination.getOutputDirAsPath());
chartDataFile.open();
initialized=true;
}
 catch (final PerfCakeException e) {
log.error(String.format("String_Node_Str",this.getClass().getName()),e);
initialized=false;
}
}
Program: 59814
Project: 59814
Buggy source:
/** 
 * Creates the final result report compiling all the previous charts together.
 * @throws PerfCakeException When there was an error creating the report. Typically an I/O issue.
 */
public void compileResults() throws PerfCakeException {
  C3ChartReport.createReport(chartDataFile.getTarget(),chartDataFile.getChart());
}

Fixed version (ground truth):
/** 
 * Creates the final result report compiling all the previous charts together.
 * @param autoCombine True if we should combine the new results with the previous reports.
 * @throws PerfCakeException When there was an error creating the report. Typically an I/O issue.
 */
public void compileResults(final boolean autoCombine) throws PerfCakeException {
  C3ChartReport.createReport(chartDataFile.getTarget(),chartDataFile.getChart(),autoCombine);
}
Program: 59815
Project: 59815
Buggy source:
/** 
 * Creates the final report in the given location.
 * @param target Root path to an existing chart report.
 * @param mainChart The chart that was added during this run of the performance test.
 * @throws PerfCakeException When it was not possible to create the report.
 */
static void createReport(final Path target,final C3Chart mainChart) throws PerfCakeException {
  final File outputDir=Paths.get(target.toString(),"String_Node_Str").toFile();
  final List<C3Chart> charts=new ArrayList<>();
  charts.add(mainChart);
  try {
    deletePreviousCombinedCharts(outputDir);
    final File[] files=outputDir.listFiles(new DescriptionFileFilter());
    if (files != null) {
      final List<File> descriptionFiles=Arrays.asList(files);
      for (      final File f : descriptionFiles) {
        final C3Chart c=new C3ChartDataFile(f).getChart();
        if (!c.getBaseName().equals(mainChart.getBaseName())) {
          charts.add(c);
        }
      }
    }
    charts.sort(Comparator.comparingLong(C3Chart::getCreated));
    charts.addAll(analyzeMatchingCharts(target,charts));
  }
 catch (  final IOException e) {
    throw new PerfCakeException("String_Node_Str",e);
  }
  C3ChartHtmlTemplates.writeIndex(target,charts);
}

Fixed version (ground truth):
/** 
 * Creates the final report in the given location.
 * @param target Root path to an existing chart report.
 * @param mainChart The chart that was added during this run of the performance test.
 * @param autoCombine True if we should combine the new results with the previous reports.
 * @throws PerfCakeException When it was not possible to create the report.
 */
static void createReport(final Path target,final C3Chart mainChart,final boolean autoCombine) throws PerfCakeException {
  final File outputDir=Paths.get(target.toString(),"String_Node_Str").toFile();
  final List<C3Chart> charts=new ArrayList<>();
  charts.add(mainChart);
  try {
    deletePreviousCombinedCharts(outputDir);
    final File[] files=outputDir.listFiles(new DescriptionFileFilter());
    if (files != null) {
      final List<File> descriptionFiles=Arrays.asList(files);
      for (      final File f : descriptionFiles) {
        final C3Chart c=new C3ChartDataFile(f).getChart();
        if (!c.getBaseName().equals(mainChart.getBaseName())) {
          charts.add(c);
        }
      }
    }
    charts.sort(Comparator.comparingLong(C3Chart::getCreated));
    if (autoCombine) {
      charts.addAll(analyzeMatchingCharts(target,charts));
    }
  }
 catch (  final IOException e) {
    throw new PerfCakeException("String_Node_Str",e);
  }
  C3ChartHtmlTemplates.writeIndex(target,charts);
}
Program: 59817
Project: 59817
Buggy source:
/** 
 * Get the list of all attributes noticed during recording.
 * @return The list of all attributes noticed during recording.
 */
public List<String> getAttributes(){
  return realAttributes;
}

Fixed version (ground truth):
/** 
 * Get the list of all attributes noticed during recording.
 * @return The list of all attributes noticed during recording.
 */
public List<String> getAttributes(){
  final List<String> result=realAttributes.stream().collect(Collectors.toList());
  result.sort(String::compareTo);
  return result;
}
Program: 59818
Project: 59818
Buggy source:
/** 
 * Records the measurement and notices which attributes were present. In case of the warmUp phase, we record the attributes with _warmUp suffix to later separate the two phases. The list of attributes with the _warmUp extension is created in   {@link C3ChartHelper}.
 * @param measurement The measurement to be recorded.
 */
public void record(final Measurement measurement){
  data.add(measurement);
  boolean isWarmUp=measurement.get(PerfCakeConst.WARM_UP_TAG) != null ? (Boolean)measurement.get(PerfCakeConst.WARM_UP_TAG) : false;
  measurement.getAll().forEach((key,value) -> {
    final String warmUpKey=key + (isWarmUp ? "String_Node_Str" + PerfCakeConst.WARM_UP_TAG : "String_Node_Str");
    if (!realAttributes.contains(warmUpKey)) {
      if (attributes.contains(warmUpKey)) {
        realAttributes.add(warmUpKey);
      }
 else {
        attributes.forEach(attr -> {
          if (attr.endsWith("String_Node_Str")) {
            if (key.startsWith(attr.substring(0,attr.length() - 1))) {
              realAttributes.add(key);
            }
          }
 else           if (attr.endsWith("String_Node_Str" + PerfCakeConst.WARM_UP_TAG)) {
            if (key.startsWith(attr.substring(0,attr.length() - 2 - PerfCakeConst.WARM_UP_TAG.length())) && isWarmUp) {
              realAttributes.add(warmUpKey);
            }
          }
        }
);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Records the measurement and notices which attributes were present. In case of the warmUp phase, we record the attributes with _warmUp suffix to later separate the two phases. The list of attributes with the _warmUp extension is created in   {@link C3ChartHelper}.
 * @param measurement The measurement to be recorded.
 */
public void record(final Measurement measurement){
  data.add(measurement);
  boolean isWarmUp=measurement.get(PerfCakeConst.WARM_UP_TAG) != null ? (Boolean)measurement.get(PerfCakeConst.WARM_UP_TAG) : false;
  measurement.getAll().forEach((key,value) -> {
    final String warmUpKey=key + (isWarmUp ? "String_Node_Str" + PerfCakeConst.WARM_UP_TAG : "String_Node_Str");
    if ((isWarmUp && !realAttributes.contains(warmUpKey)) || (!isWarmUp && !realAttributes.contains(key))) {
      if (attributes.contains(warmUpKey)) {
        realAttributes.add(warmUpKey);
      }
      if (attributes.contains(key)) {
        realAttributes.add(key);
      }
 else {
        attributes.forEach(attr -> {
          if (attr.endsWith("String_Node_Str")) {
            if (key.startsWith(attr.substring(0,attr.length() - 1)) && !PerfCakeConst.WARM_UP_TAG.equals(key)) {
              realAttributes.add(key);
            }
          }
 else           if (attr.endsWith("String_Node_Str" + PerfCakeConst.WARM_UP_TAG)) {
            if (key.startsWith(attr.substring(0,attr.length() - 2 - PerfCakeConst.WARM_UP_TAG.length())) && isWarmUp) {
              realAttributes.add(warmUpKey);
            }
          }
        }
);
      }
    }
  }
);
}
Program: 59819
Project: 59819
Buggy source:
@Override public void publishResult(final PeriodType periodType,final Destination destination) throws ReportingException {
  final Measurement m=newMeasurement();
  DoublePercentileIterator pi;
  final DoubleHistogram localHistogram=histogram.copy();
switch (correctionMode) {
case AUTO:
    pi=new DoublePercentileIterator(localHistogram.copyCorrectedForCoordinatedOmission(avg.getResult()),1);
  break;
case USER:
pi=new DoublePercentileIterator(localHistogram.copyCorrectedForCoordinatedOmission(correction),1);
break;
default :
pi=new DoublePercentileIterator(localHistogram,1);
}
pi.reset(detail);
while (pi.hasNext()) {
DoubleHistogramIterationValue val=pi.next();
m.set(prefix + String.format(Locale.US,percentileFormatString,val.getPercentileLevelIteratedTo() / 100d),String.format(Locale.US,valueFormatString,val.getValueIteratedTo()));
}
destination.report(m);
}

Fixed version (ground truth):
@Override public void publishResult(final PeriodType periodType,final Destination destination) throws ReportingException {
  final Measurement m=newMeasurement();
  DoublePercentileIterator pi;
  final DoubleHistogram localHistogram=histogram.copy();
switch (correctionMode) {
case AUTO:
    pi=new DoublePercentileIterator(localHistogram.copyCorrectedForCoordinatedOmission(avg.getResult()),1);
  break;
case USER:
pi=new DoublePercentileIterator(localHistogram.copyCorrectedForCoordinatedOmission(correction),1);
break;
default :
pi=new DoublePercentileIterator(localHistogram,1);
}
pi.reset(detail);
while (pi.hasNext()) {
DoubleHistogramIterationValue val=pi.next();
m.set(prefix + String.format(Locale.US,percentileFormatString,val.getPercentileLevelIteratedTo() / 100d),formatOutput ? String.format(Locale.US,valueFormatString,val.getValueIteratedTo()) : val.getValueIteratedTo());
}
destination.report(m);
}
Program: 59822
Project: 59822
Buggy source:
/** 
 * Gets the properties of an object as a   {@link java.util.Properties} object.
 * @param object The object to be inspected.
 * @return All the properties of the object.
 * @throws IllegalAccessException When it was not possible to find, call, or use any of the getter methods.
 * @throws NoSuchMethodException When it was not possible to find, call, or use any of the getter methods.
 * @throws InvocationTargetException When it was not possible to find, call, or use any of the getter methods.
 */
public static Properties getObjectProperties(final Object object) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
  final Properties properties=new Properties();
  properties.putAll(BeanUtils.describe(object));
  return properties;
}

Fixed version (ground truth):
/** 
 * Gets the properties of an object as a   {@link java.util.Properties} object.
 * @param object The object to be inspected.
 * @return All the properties of the object.
 * @throws IllegalAccessException When it was not possible to find, call, or use any of the getter methods.
 * @throws NoSuchMethodException When it was not possible to find, call, or use any of the getter methods.
 * @throws InvocationTargetException When it was not possible to find, call, or use any of the getter methods.
 */
public static Properties getObjectProperties(final Object object) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
  final Properties properties=new Properties();
  final Map<String,String> attributes=BeanUtils.describe(object);
  attributes.forEach((key,value) -> {
    if (value != null) {
      properties.put(key,value);
    }
  }
);
  return properties;
}
Program: 59823
Project: 59823
Buggy source:
/** 
 * Sets the attributes that will be written to the chart.
 * @param attributes The attributes separated by comma.
 */
public void setAttributes(final String attributes){
  this.attributes=Arrays.asList(attributes.split("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Sets the attributes that will be written to the chart.
 * @param attributes The attributes separated by comma.
 */
public void setAttributes(final String attributes){
  this.attributes=new ArrayList<>(Arrays.asList(attributes.split("String_Node_Str")));
}
Program: 59824
Project: 59824
Buggy source:
@Override public void open(){
  dynamicAttributes=attributes.stream().anyMatch(s -> s.endsWith("String_Node_Str"));
  if (dynamicAttributes) {
    buffer=new DataBuffer(attributes);
  }
 else {
    helper=new C3ChartHelper(this);
  }
}

Fixed version (ground truth):
@Override public void open(){
  dynamicAttributes=attributes.stream().anyMatch(s -> s.endsWith("String_Node_Str"));
  if (attributes.contains(PerfCakeConst.WARM_UP_TAG)) {
    attributes.remove(PerfCakeConst.WARM_UP_TAG);
    attributes.addAll(attributes.stream().map(attr -> attr + "String_Node_Str" + PerfCakeConst.WARM_UP_TAG).collect(Collectors.toList()));
  }
  if (dynamicAttributes) {
    buffer=new DataBuffer(attributes);
  }
 else {
    helper=new C3ChartHelper(this);
  }
}
Program: 59826
Project: 59826
Buggy source:
/** 
 * Converts chart meta-data to properties.
 * @param chart Chart meta-data.
 * @return Properties pre-filled from the chart meta-data.
 */
private static Properties getChartProperties(final C3Chart chart){
  final Properties props=new Properties();
  props.setProperty("String_Node_Str",chart.getBaseName());
  props.setProperty("String_Node_Str",chart.getxAxis());
  props.setProperty("String_Node_Str",chart.getyAxis());
  props.setProperty("String_Node_Str",chart.getName());
  props.setProperty("String_Node_Str",String.valueOf(chart.getHeight()));
switch (chart.getxAxisType()) {
case TIME:
    props.setProperty("String_Node_Str","String_Node_Str");
  break;
case ITERATION:
props.setProperty("String_Node_Str","String_Node_Str");
break;
case PERCENTAGE:
props.setProperty("String_Node_Str","String_Node_Str");
break;
}
return props;
}

Fixed version (ground truth):
/** 
 * Converts chart meta-data to properties.
 * @param chart Chart meta-data.
 * @return Properties pre-filled from the chart meta-data.
 */
private static Properties getChartProperties(final C3Chart chart){
  final Properties props=new Properties();
  props.setProperty("String_Node_Str",chart.getBaseName());
  props.setProperty("String_Node_Str",chart.getxAxis());
  props.setProperty("String_Node_Str",chart.getyAxis());
  props.setProperty("String_Node_Str",chart.getName());
  props.setProperty("String_Node_Str",String.valueOf(chart.getHeight()));
switch (chart.getxAxisType()) {
case TIME:
    props.setProperty("String_Node_Str","String_Node_Str");
  props.setProperty("String_Node_Str",C3ChartHelper.COLUMN_TIME);
break;
case ITERATION:
props.setProperty("String_Node_Str","String_Node_Str");
props.setProperty("String_Node_Str",C3ChartHelper.COLUMN_ITERATION);
break;
case PERCENTAGE:
props.setProperty("String_Node_Str","String_Node_Str");
props.setProperty("String_Node_Str",C3ChartHelper.COLUMN_PERCENT);
break;
}
return props;
}
Program: 59827
Project: 59827
Buggy source:
public void record(final Measurement measurement){
  data.add(measurement);
  measurement.getAll().forEach((key,value) -> {
    if (attributes.contains(key) && !realAttributes.contains(key)) {
      realAttributes.add(key);
    }
    attributes.forEach(attr -> {
      if (attr.endsWith("String_Node_Str")) {
        if (key.startsWith(attr.substring(0,attr.length() - 1))) {
          if (!realAttributes.contains(key)) {
            realAttributes.add(key);
          }
        }
      }
    }
);
  }
);
}

Fixed version (ground truth):
public void record(final Measurement measurement){
  data.add(measurement);
  measurement.getAll().forEach((key,value) -> {
    if (!realAttributes.contains(key)) {
      if (attributes.contains(key)) {
        realAttributes.add(key);
      }
 else {
        attributes.forEach(attr -> {
          if (attr.endsWith("String_Node_Str")) {
            if (key.startsWith(attr.substring(0,attr.length() - 1))) {
              realAttributes.add(key);
            }
          }
 else           if (attr.endsWith("String_Node_Str" + PerfCakeConst.WARM_UP_TAG)) {
            if (key.startsWith(attr.substring(0,attr.length() - 2 - PerfCakeConst.WARM_UP_TAG.length()))) {
              realAttributes.add(key);
            }
          }
        }
);
      }
    }
  }
);
}
Program: 59828
Project: 59828
Buggy source:
/** 
 * Takes care of gentle shutdown of the generator based on the period type.
 * @throws java.lang.InterruptedException When waiting for the termination was interrupted.
 */
protected void shutdown() throws InterruptedException {
  if (runInfo.getDuration().getPeriodType() == PeriodType.ITERATION) {
    log.info(SHUTDOWN_LOG);
    adaptiveTermination();
    setStopTime();
  }
 else {
    setStopTime();
    log.info(SHUTDOWN_LOG);
    adaptiveTermination();
  }
  executorService.shutdownNow();
}

Fixed version (ground truth):
/** 
 * Takes care of gentle shutdown of the generator based on the period type.
 * @throws java.lang.InterruptedException When waiting for the termination was interrupted.
 */
protected void shutdown() throws InterruptedException {
  if (runInfo.getDuration().getPeriodType() == PeriodType.ITERATION) {
    log.info("String_Node_Str");
    adaptiveTermination();
    setStopTime();
  }
 else {
    setStopTime();
    log.info("String_Node_Str");
    adaptiveTermination();
  }
  executorService.shutdownNow();
}
Program: 59829
Project: 59829
Buggy source:
@Override public void publishResult(final PeriodType periodType,final Destination destination) throws ReportingException {
  final Measurement m=newMeasurement();
  DoublePercentileIterator pi;
switch (correctionMode) {
case AUTO:
    pi=new DoublePercentileIterator(histogram.copyCorrectedForCoordinatedOmission(avg.getResult()),1);
  break;
case USER:
pi=new DoublePercentileIterator(histogram.copyCorrectedForCoordinatedOmission(correction),1);
break;
default :
pi=new DoublePercentileIterator(histogram,1);
}
pi.reset(detail);
while (pi.hasNext()) {
DoubleHistogramIterationValue val=pi.next();
m.set(prefix + String.format(Locale.US,percentileFormatString,val.getPercentileLevelIteratedTo() / 100d),String.format(Locale.US,valueFormatString,val.getValueIteratedTo()));
}
destination.report(m);
}

Fixed version (ground truth):
@Override public void publishResult(final PeriodType periodType,final Destination destination) throws ReportingException {
  final Measurement m=newMeasurement();
  DoublePercentileIterator pi;
  final DoubleHistogram localHistogram=histogram.copy();
switch (correctionMode) {
case AUTO:
    pi=new DoublePercentileIterator(localHistogram.copyCorrectedForCoordinatedOmission(avg.getResult()),1);
  break;
case USER:
pi=new DoublePercentileIterator(localHistogram.copyCorrectedForCoordinatedOmission(correction),1);
break;
default :
pi=new DoublePercentileIterator(localHistogram,1);
}
pi.reset(detail);
while (pi.hasNext()) {
DoubleHistogramIterationValue val=pi.next();
m.set(prefix + String.format(Locale.US,percentileFormatString,val.getPercentileLevelIteratedTo() / 100d),String.format(Locale.US,valueFormatString,val.getValueIteratedTo()));
}
destination.report(m);
}
Program: 59830
Project: 59830
Buggy source:
/** 
 * Creates a new   {@link org.perfcake.reporting.MeasurementUnit measurement unit} with a unique iteration number.
 * @return A {@link org.perfcake.reporting.MeasurementUnit measurement unit} unit with a unique iteration number, or null if a measurement is not running or is already finished.
 */
public MeasurementUnit newMeasurementUnit(){
  if (!runInfo.isRunning()) {
    return null;
  }
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str");
  }
  return new MeasurementUnit(runInfo.getNextIteration());
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link org.perfcake.reporting.MeasurementUnit measurement unit} with a unique iteration number.
 * @return A {@link org.perfcake.reporting.MeasurementUnit measurement unit} unit with a unique iteration number, or null if a measurement is not running or is already finished.
 */
public MeasurementUnit newMeasurementUnit(){
  if (runInfo.isRunning()) {
    if (log.isTraceEnabled()) {
      log.trace("String_Node_Str");
    }
    return new MeasurementUnit(runInfo.getNextIteration());
  }
  return null;
}
Program: 59831
Project: 59831
Buggy source:
@Override public void doInit(final Properties messageAttributes) throws PerfCakeException {
  final HashMap<String,Object> env=new HashMap<String,Object>();
  env.put(Context.SECURITY_AUTHENTICATION,"String_Node_Str");
  if (ldapUsername != null) {
    env.put(Context.SECURITY_PRINCIPAL,ldapUsername);
  }
  if (ldapPassword != null) {
    env.put(Context.SECURITY_CREDENTIALS,ldapPassword);
  }
  env.put(Context.INITIAL_CONTEXT_FACTORY,"String_Node_Str");
  env.put(Context.PROVIDER_URL,safeGetTarget(messageAttributes));
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + safeGetTarget(messageAttributes));
  }
  try {
    ctx=new InitialLdapContext(env,null);
  }
 catch (  NamingException e) {
    throw new PerfCakeException("String_Node_Str",e);
  }
  searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
}

Fixed version (ground truth):
@Override public void doInit(final Properties messageAttributes) throws PerfCakeException {
  final Hashtable<String,Object> env=new Hashtable<>();
  env.put(Context.SECURITY_AUTHENTICATION,"String_Node_Str");
  if (ldapUsername != null) {
    env.put(Context.SECURITY_PRINCIPAL,ldapUsername);
  }
  if (ldapPassword != null) {
    env.put(Context.SECURITY_CREDENTIALS,ldapPassword);
  }
  env.put(Context.INITIAL_CONTEXT_FACTORY,"String_Node_Str");
  env.put(Context.PROVIDER_URL,safeGetTarget(messageAttributes));
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + safeGetTarget(messageAttributes));
  }
  try {
    ctx=new InitialLdapContext(env,null);
  }
 catch (  NamingException e) {
    throw new PerfCakeException("String_Node_Str",e);
  }
  searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
}
Program: 59832
Project: 59832
Buggy source:
/** 
 * Deletes all previsouly generated chart combinations. We are going to refresh them.
 * @param descriptionsDirectory The directory with existing generated charts.
 * @throws IOException When it was not possible to delete any of the charts.
 */
private void deletePreviousCombinedCharts(final File descriptionsDirectory) throws IOException {
  final StringBuilder issues=new StringBuilder();
  for (  final File f : descriptionsDirectory.listFiles(new CombinedJsFileFilter())) {
    if (!f.delete()) {
      issues.append(String.format("String_Node_Str",f.getAbsolutePath()));
    }
  }
  if (issues.length() > 0) {
    throw new IOException(issues.toString());
  }
}

Fixed version (ground truth):
/** 
 * Deletes all previsouly generated chart combinations. We are going to refresh them.
 * @param descriptionsDirectory The directory with existing generated charts.
 * @throws IOException When it was not possible to delete any of the charts.
 */
private void deletePreviousCombinedCharts(final File descriptionsDirectory) throws IOException {
  final StringBuilder issues=new StringBuilder();
  final File[] files=descriptionsDirectory.listFiles(new CombinedJsFileFilter());
  if (files != null) {
    for (    final File f : files) {
      if (!f.delete()) {
        issues.append(String.format("String_Node_Str",f.getAbsolutePath()));
      }
    }
  }
  if (issues.length() > 0) {
    throw new IOException(issues.toString());
  }
}
Program: 59833
Project: 59833
Buggy source:
/** 
 * Creates the final report including generation of the main index.html file based on all previously generated reports in the same directory.
 * @throws org.perfcake.PerfCakeException When it was not possible to generate the report.
 */
public void compileResults() throws PerfCakeException {
  final File outputDir=Paths.get(target.toString(),"String_Node_Str").toFile();
  final List<Chart> charts=new ArrayList<>();
  charts.add(mainChart);
  try {
    deletePreviousCombinedCharts(outputDir);
    final List<File> descriptionFiles=Arrays.asList(outputDir.listFiles(new DescriptionFileFilter()));
    for (    final File f : descriptionFiles) {
      final Chart c=Chart.fromDescriptionFile(f);
      if (!c.getBaseName().equals(mainChart.getBaseName())) {
        charts.add(c);
      }
    }
    charts.addAll(analyzeMatchingCharts(charts));
  }
 catch (  final IOException e) {
    throw new PerfCakeException("String_Node_Str",e);
  }
  writeIndex(getLoadersHtml(charts),getJsHtml(charts),getDivHtml(charts));
}

Fixed version (ground truth):
/** 
 * Creates the final report including generation of the main index.html file based on all previously generated reports in the same directory.
 * @throws org.perfcake.PerfCakeException When it was not possible to generate the report.
 */
public void compileResults() throws PerfCakeException {
  final File outputDir=Paths.get(target.toString(),"String_Node_Str").toFile();
  final List<Chart> charts=new ArrayList<>();
  charts.add(mainChart);
  try {
    deletePreviousCombinedCharts(outputDir);
    final File[] files=outputDir.listFiles(new DescriptionFileFilter());
    if (files != null) {
      final List<File> descriptionFiles=Arrays.asList(files);
      for (      final File f : descriptionFiles) {
        final Chart c=Chart.fromDescriptionFile(f);
        if (!c.getBaseName().equals(mainChart.getBaseName())) {
          charts.add(c);
        }
      }
    }
    charts.addAll(analyzeMatchingCharts(charts));
  }
 catch (  final IOException e) {
    throw new PerfCakeException("String_Node_Str",e);
  }
  writeIndex(getLoadersHtml(charts),getJsHtml(charts),getDivHtml(charts));
}
Program: 59834
Project: 59834
Buggy source:
/** 
 * Gets the actual counts for individual ranges of the histogram.
 * @return The actual counts for individual ranges of the histogram.
 */
public Map<Range,Double> getHistogramInPercent(){
  Map<Range,Double> result=new LinkedHashMap<>();
  Map<Range,AtomicLong> snapshot=new LinkedHashMap<>(histogram);
  final long count=getCount(snapshot);
  if (count == 0) {
    snapshot.forEach((range,value) -> result.put(range,0d));
  }
 else {
    snapshot.forEach((range,value) -> result.put(range,((double)value.get()) / count * 100.0d));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Gets the actual counts for individual ranges of the histogram.
 * @return The actual counts for individual ranges of the histogram.
 */
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="String_Node_Str",justification="String_Node_Str") public Map<Range,Double> getHistogramInPercent(){
  Map<Range,Double> result=new LinkedHashMap<>();
  Map<Range,AtomicLong> snapshot=new LinkedHashMap<>(histogram);
  final long count=getCount(snapshot);
  if (count == 0) {
    snapshot.forEach((range,value) -> result.put(range,0d));
  }
 else {
    snapshot.forEach((range,value) -> result.put(range,((double)value.get()) / count * 100.0d));
  }
  return result;
}