nus-yam/ex-repair huggingface dataset:
Program: 59835
Project: 59835
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,Long> getHistogram(){
  Map<Range,Long> result=new LinkedHashMap<>();
  Map<Range,AtomicLong> snapshot=new LinkedHashMap<>(histogram);
  snapshot.forEach((range,value) -> result.put(range,value.get()));
  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,Long> getHistogram(){
  Map<Range,Long> result=new LinkedHashMap<>();
  Map<Range,AtomicLong> snapshot=new LinkedHashMap<>(histogram);
  snapshot.forEach((range,value) -> result.put(range,value.get()));
  return result;
}
Program: 59836
Project: 59836
Buggy source:
@Override public synchronized void reset(){
  max=Double.MIN_VALUE;
}

Fixed version (ground truth):
@Override public synchronized void reset(){
  max=Double.NEGATIVE_INFINITY;
}
Program: 59837
Project: 59837
Buggy source:
@Override public synchronized void reset(){
  min=Double.MAX_VALUE;
}

Fixed version (ground truth):
@Override public synchronized void reset(){
  min=Double.POSITIVE_INFINITY;
}
Program: 59838
Project: 59838
Buggy source:
@Override public Double getResult(){
  double min=Double.MAX_VALUE;
synchronized (fifo) {
    for (    Object o : fifo) {
      min=Math.min(min,(Double)o);
    }
  }
  return fifo.size() == 0 ? Double.NaN : min;
}

Fixed version (ground truth):
@Override public Double getResult(){
  double min=Double.POSITIVE_INFINITY;
synchronized (fifo) {
    for (    Object o : fifo) {
      min=Math.min(min,(Double)o);
    }
  }
  return fifo.size() == 0 ? Double.NaN : min;
}
Program: 59839
Project: 59839
Buggy source:
@Test(dataProvider="String_Node_Str") @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void accumulatorGenericTest(final Accumulator a,final Long start,final Long end,final Double result,final Double stressResult,final Double zero){
  Assert.assertEquals(a.getResult(),zero);
  for (long i=start; i <= end; i=i + 1) {
    a.add((double)i);
  }
  Assert.assertEquals(a.getResult(),result);
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}

Fixed version (ground truth):
@Test(dataProvider="String_Node_Str") @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void accumulatorGenericTest(final Accumulator a,final Long start,final Long end,final Number result,final Number stressResult,final Number zero){
  Assert.assertEquals(a.getResult(),zero);
  try {
    for (long i=start; i <= end; i=i + 1) {
      a.add((double)i);
    }
  }
 catch (  ClassCastException cce) {
    for (long i=start; i <= end; i=i + 1) {
      a.add(i);
    }
  }
  Assert.assertEquals(a.getResult(),result);
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}
Program: 59840
Project: 59840
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  for (long i=start; i <= end; i=i + 1L) {
    a.add((double)i);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  try {
    for (long i=start; i <= end; i=i + 1L) {
      a.add((double)i);
    }
  }
 catch (  ClassCastException cce) {
    for (long i=start; i <= end; i=i + 1) {
      a.add(i);
    }
  }
}
Program: 59841
Project: 59841
Buggy source:
@Test(dataProvider="String_Node_Str",groups={"String_Node_Str"}) @SuppressWarnings("String_Node_Str") public void accumulatorStressTest(final Accumulator a,final Long start,final Long end,final Double result,final Double stressResult,final Double zero) throws InterruptedException {
  List<Thread> stressors=new ArrayList<>();
  for (int i=0; i < STRESS_THREADS; i++) {
    stressors.add(new Thread(new AccumulatorStressor(a,start,end)));
  }
  long time=System.currentTimeMillis();
  for (  Thread t : stressors) {
    t.start();
  }
  for (  Thread t : stressors) {
    t.join();
  }
  time=System.currentTimeMillis() - time;
  Reporter.log("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ time+ "String_Node_Str");
  if (stressResult != null) {
    Assert.assertEquals(a.getResult(),stressResult);
  }
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}

Fixed version (ground truth):
@Test(dataProvider="String_Node_Str",groups={"String_Node_Str"}) @SuppressWarnings("String_Node_Str") public void accumulatorStressTest(final Accumulator a,final Long start,final Long end,final Number result,final Number stressResult,final Number zero) throws InterruptedException {
  List<Thread> stressors=new ArrayList<>();
  for (int i=0; i < STRESS_THREADS; i++) {
    stressors.add(new Thread(new AccumulatorStressor(a,start,end)));
  }
  long time=System.currentTimeMillis();
  for (  Thread t : stressors) {
    t.start();
  }
  for (  Thread t : stressors) {
    t.join();
  }
  time=System.currentTimeMillis() - time;
  Reporter.log("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ time+ "String_Node_Str");
  if (stressResult != null) {
    Assert.assertEquals(a.getResult(),stressResult);
  }
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}
Program: 59843
Project: 59843
Buggy source:
public static String parseTemplate(final String template,final Properties properties){
  return new StringTemplate(template,properties).toString();
}

Fixed version (ground truth):
public static String parseTemplate(final String template,final Properties properties){
  return new StringTemplate(template,properties).toString(properties);
}
Program: 59844
Project: 59844
Buggy source:
@SuppressWarnings("String_Node_Str") public StringTemplate(final String template,final Properties properties){
  this.originalTemplate=template;
  Engine engine=getEngine();
  vars.put("String_Node_Str",System.getenv());
  vars.put("String_Node_Str",System.getProperties());
  if (properties != null) {
    vars.putAll(properties);
  }
  try {
    if (engine.parseTemplate(PREFIX + template).getChildren().size() > PREFIX_TOKENS + 1) {
      this.template=engine.parseTemplate(PREFIX + template);
    }
  }
 catch (  ParseException pe) {
    log.error("String_Node_Str",pe);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public StringTemplate(final String template,final Properties properties){
  this.originalTemplate=template;
  vars.put("String_Node_Str",System.getenv());
  vars.put("String_Node_Str",System.getProperties());
  if (properties != null) {
    vars.putAll(properties);
  }
  try {
    final String firstPassTemplate=firstPass(template);
    final Template tmpTemplate=parseTemplate(firstPassTemplate);
    if (hasPlaceholders(tmpTemplate)) {
      this.template=tmpTemplate;
    }
 else {
      this.originalTemplate=firstPassTemplate;
    }
  }
 catch (  ParseException pe) {
    log.error("String_Node_Str",pe);
  }
}
Program: 59845
Project: 59845
Buggy source:
private String renderTemplate(final Map variables){
  if (template != null) {
    try {
      return template.evaluate(variables).toString();
    }
 catch (    ParseException pe) {
      log.error("String_Node_Str",pe);
    }
  }
  return originalTemplate;
}

Fixed version (ground truth):
private String renderTemplate(final Template template,final Map variables){
  if (template != null) {
    try {
      return template.evaluate(variables).toString();
    }
 catch (    ParseException pe) {
      log.error("String_Node_Str",pe);
    }
  }
  return originalTemplate;
}
Program: 59846
Project: 59846
Buggy source:
@Override public synchronized void reset(){
  max=Double.MIN_VALUE;
}

Fixed version (ground truth):
@Override public synchronized void reset(){
  max=Double.NEGATIVE_INFINITY;
}
Program: 59847
Project: 59847
Buggy source:
@Override public synchronized void reset(){
  min=Double.MAX_VALUE;
}

Fixed version (ground truth):
@Override public synchronized void reset(){
  min=Double.POSITIVE_INFINITY;
}
Program: 59848
Project: 59848
Buggy source:
@Override public Double getResult(){
  double min=Double.MAX_VALUE;
synchronized (fifo) {
    for (    Object o : fifo) {
      min=Math.min(min,(Double)o);
    }
  }
  return fifo.size() == 0 ? Double.NaN : min;
}

Fixed version (ground truth):
@Override public Double getResult(){
  double min=Double.POSITIVE_INFINITY;
synchronized (fifo) {
    for (    Object o : fifo) {
      min=Math.min(min,(Double)o);
    }
  }
  return fifo.size() == 0 ? Double.NaN : min;
}
Program: 59849
Project: 59849
Buggy source:
@Test(dataProvider="String_Node_Str") @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void accumulatorGenericTest(final Accumulator a,final Long start,final Long end,final Double result,final Double stressResult,final Double zero){
  Assert.assertEquals(a.getResult(),zero);
  for (long i=start; i <= end; i=i + 1) {
    a.add((double)i);
  }
  Assert.assertEquals(a.getResult(),result);
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}

Fixed version (ground truth):
@Test(dataProvider="String_Node_Str") @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void accumulatorGenericTest(final Accumulator a,final Long start,final Long end,final Number result,final Number stressResult,final Number zero){
  Assert.assertEquals(a.getResult(),zero);
  try {
    for (long i=start; i <= end; i=i + 1) {
      a.add((double)i);
    }
  }
 catch (  ClassCastException cce) {
    for (long i=start; i <= end; i=i + 1) {
      a.add(i);
    }
  }
  Assert.assertEquals(a.getResult(),result);
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}
Program: 59850
Project: 59850
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  for (long i=start; i <= end; i=i + 1L) {
    a.add((double)i);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  try {
    for (long i=start; i <= end; i=i + 1L) {
      a.add((double)i);
    }
  }
 catch (  ClassCastException cce) {
    for (long i=start; i <= end; i=i + 1) {
      a.add(i);
    }
  }
}
Program: 59851
Project: 59851
Buggy source:
@Test(dataProvider="String_Node_Str",groups={"String_Node_Str"}) @SuppressWarnings("String_Node_Str") public void accumulatorStressTest(final Accumulator a,final Long start,final Long end,final Double result,final Double stressResult,final Double zero) throws InterruptedException {
  List<Thread> stressors=new ArrayList<>();
  for (int i=0; i < STRESS_THREADS; i++) {
    stressors.add(new Thread(new AccumulatorStressor(a,start,end)));
  }
  long time=System.currentTimeMillis();
  for (  Thread t : stressors) {
    t.start();
  }
  for (  Thread t : stressors) {
    t.join();
  }
  time=System.currentTimeMillis() - time;
  Reporter.log("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ time+ "String_Node_Str");
  if (stressResult != null) {
    Assert.assertEquals(a.getResult(),stressResult);
  }
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}

Fixed version (ground truth):
@Test(dataProvider="String_Node_Str",groups={"String_Node_Str"}) @SuppressWarnings("String_Node_Str") public void accumulatorStressTest(final Accumulator a,final Long start,final Long end,final Number result,final Number stressResult,final Number zero) throws InterruptedException {
  List<Thread> stressors=new ArrayList<>();
  for (int i=0; i < STRESS_THREADS; i++) {
    stressors.add(new Thread(new AccumulatorStressor(a,start,end)));
  }
  long time=System.currentTimeMillis();
  for (  Thread t : stressors) {
    t.start();
  }
  for (  Thread t : stressors) {
    t.join();
  }
  time=System.currentTimeMillis() - time;
  Reporter.log("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ time+ "String_Node_Str");
  if (stressResult != null) {
    Assert.assertEquals(a.getResult(),stressResult);
  }
  a.reset();
  Assert.assertEquals(a.getResult(),zero);
}
Program: 59853
Project: 59853
Buggy source:
public static String parseTemplate(final String template,final Properties properties){
  return new StringTemplate(template,properties).toString();
}

Fixed version (ground truth):
public static String parseTemplate(final String template,final Properties properties){
  return new StringTemplate(template,properties).toString(properties);
}
Program: 59854
Project: 59854
Buggy source:
@SuppressWarnings("String_Node_Str") public StringTemplate(final String template,final Properties properties){
  this.originalTemplate=template;
  Engine engine=getEngine();
  vars.put("String_Node_Str",System.getenv());
  vars.put("String_Node_Str",System.getProperties());
  if (properties != null) {
    vars.putAll(properties);
  }
  try {
    if (engine.parseTemplate(PREFIX + template).getChildren().size() > PREFIX_TOKENS + 1) {
      this.template=engine.parseTemplate(PREFIX + template);
    }
  }
 catch (  ParseException pe) {
    log.error("String_Node_Str",pe);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public StringTemplate(final String template,final Properties properties){
  this.originalTemplate=template;
  vars.put("String_Node_Str",System.getenv());
  vars.put("String_Node_Str",System.getProperties());
  if (properties != null) {
    vars.putAll(properties);
  }
  try {
    final String firstPassTemplate=firstPass(template);
    final Template tmpTemplate=parseTemplate(firstPassTemplate);
    if (hasPlaceholders(tmpTemplate)) {
      this.template=tmpTemplate;
    }
 else {
      this.originalTemplate=firstPassTemplate;
    }
  }
 catch (  ParseException pe) {
    log.error("String_Node_Str",pe);
  }
}
Program: 59855
Project: 59855
Buggy source:
private String renderTemplate(final Map variables){
  if (template != null) {
    try {
      return template.evaluate(variables).toString();
    }
 catch (    ParseException pe) {
      log.error("String_Node_Str",pe);
    }
  }
  return originalTemplate;
}

Fixed version (ground truth):
private String renderTemplate(final Template template,final Map variables){
  if (template != null) {
    try {
      return template.evaluate(variables).toString();
    }
 catch (    ParseException pe) {
      log.error("String_Node_Str",pe);
    }
  }
  return originalTemplate;
}
Program: 59856
Project: 59856
Buggy source:
@Override public void report(final Measurement m) throws ReportingException {
  if (resultNames.isEmpty()) {
synchronized (this) {
      if (resultNames.isEmpty()) {
        presetResultNames(m);
        fileHeaders=getFileHeaders(m);
      }
    }
  }
  final String resultLine=getResultsLine(m);
synchronized (this) {
    final boolean csvFileExists=csvFile.exists();
    try (FileOutputStream fos=new FileOutputStream(csvFile,true);OutputStreamWriter osw=new OutputStreamWriter(fos,Utils.getDefaultEncoding());BufferedWriter bw=new BufferedWriter(osw)){
      if (!csvFileExists && !skipHeader) {
        bw.append(fileHeaders);
        bw.append(lineBreak);
      }
      if (linePrefix != null && !linePrefix.isEmpty()) {
        bw.append(linePrefix);
      }
      bw.append(resultLine);
      if (lineSuffix != null && !lineSuffix.isEmpty()) {
        bw.append(lineSuffix);
      }
      bw.append(lineBreak);
    }
 catch (    IOException ioe) {
      throw new ReportingException(String.format("String_Node_Str",csvFile.getPath()),ioe);
    }
  }
}

Fixed version (ground truth):
@Override public void report(final Measurement m) throws ReportingException {
  if (resultNames.isEmpty()) {
synchronized (this) {
      if (resultNames.isEmpty()) {
        presetResultNames(m);
        fileHeaders=getFileHeaders(m);
      }
    }
  }
  final StringBuilder sb=new StringBuilder();
  if (linePrefix != null && !linePrefix.isEmpty()) {
    sb.append(linePrefix);
  }
  sb.append(getResultsLine(m));
  if (lineSuffix != null && !lineSuffix.isEmpty()) {
    sb.append(lineSuffix);
  }
  sb.append(lineBreak);
synchronized (this) {
    final boolean csvFileExists=csvFile.exists();
    try (FileOutputStream fos=new FileOutputStream(csvFile,true);OutputStreamWriter osw=new OutputStreamWriter(fos,Utils.getDefaultEncoding());BufferedWriter bw=new BufferedWriter(osw)){
      if (!csvFileExists && !skipHeader) {
        bw.append(fileHeaders);
        bw.append(lineBreak);
      }
      bw.append(sb.toString());
    }
 catch (    IOException ioe) {
      throw new ReportingException(String.format("String_Node_Str",csvFile.getPath()),ioe);
    }
  }
}
Program: 59857
Project: 59857
Buggy source:
@Override public void report(final Measurement m) throws ReportingException {
  if (resultNames.isEmpty()) {
synchronized (this) {
      if (resultNames.isEmpty()) {
        presetResultNames(m);
        fileHeaders=getFileHeaders(m);
      }
    }
  }
  final String resultLine=getResultsLine(m);
synchronized (this) {
    final boolean csvFileExists=csvFile.exists();
    try (FileOutputStream fos=new FileOutputStream(csvFile,true);OutputStreamWriter osw=new OutputStreamWriter(fos,Utils.getDefaultEncoding());BufferedWriter bw=new BufferedWriter(osw)){
      if (!csvFileExists) {
        bw.append(fileHeaders);
        bw.newLine();
      }
      bw.append(resultLine);
      bw.newLine();
    }
 catch (    IOException ioe) {
      throw new ReportingException("String_Node_Str" + csvFile.getPath(),ioe);
    }
  }
}

Fixed version (ground truth):
@Override public void report(final Measurement m) throws ReportingException {
  if (resultNames.isEmpty()) {
synchronized (this) {
      if (resultNames.isEmpty()) {
        presetResultNames(m);
        fileHeaders=getFileHeaders(m);
      }
    }
  }
  final String resultLine=getResultsLine(m);
synchronized (this) {
    final boolean csvFileExists=csvFile.exists();
    try (FileOutputStream fos=new FileOutputStream(csvFile,true);OutputStreamWriter osw=new OutputStreamWriter(fos,Utils.getDefaultEncoding());BufferedWriter bw=new BufferedWriter(osw)){
      if (!csvFileExists) {
        bw.append(fileHeaders);
        bw.newLine();
      }
      bw.append(resultLine);
      bw.newLine();
    }
 catch (    IOException ioe) {
      throw new ReportingException(String.format("String_Node_Str",csvFile.getPath()),ioe);
    }
  }
}
Program: 59858
Project: 59858
Buggy source:
/** 
 * Used to set the value of path.
 * @param path The path value to set.
 */
public void setPath(final String path){
  this.path=path;
  this.csvFile=new File(this.path);
}

Fixed version (ground truth):
/** 
 * Used to set the value of path. Once the destination opens the target file, the changes to this property are ignored.
 * @param path The path value to set.
 */
public void setPath(final String path){
synchronized (this) {
    if (csvFile != null) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
  this.path=path;
}
Program: 59859
Project: 59859
Buggy source:
@Override public void close(){
}

Fixed version (ground truth):
@Override public void close(){
synchronized (this) {
    csvFile=null;
  }
}
Program: 59860
Project: 59860
Buggy source:
/** 
 * The measurements are appended to the original file.
 */
@Override public void open(){
synchronized (this) {
    csvFile=new File(path);
    if (csvFile.exists()) {
switch (appendStrategy) {
case RENAME:
        String name=csvFile.getAbsolutePath();
      File f=null;
    int ind=1;
  do {
    f=new File(name + "String_Node_Str" + (ind++));
  }
 while (f.exists());
csvFile=f;
break;
case OVERWRITE:
csvFile.delete();
break;
case FORCE_APPEND:
default :
}
}
}
if (log.isDebugEnabled()) {
log.debug("String_Node_Str" + csvFile.getAbsolutePath());
}
}

Fixed version (ground truth):
/** 
 * The measurements are appended to the original file.
 */
@Override public void open(){
synchronized (this) {
    csvFile=new File(path);
    if (csvFile.exists()) {
switch (appendStrategy) {
case RENAME:
        String name=csvFile.getAbsolutePath();
      File f=null;
    int ind=1;
  do {
    f=new File(name + "String_Node_Str" + (ind++));
  }
 while (f.exists());
csvFile=f;
break;
case OVERWRITE:
if (!csvFile.delete()) {
log.warn(String.format("String_Node_Str",csvFile.getAbsolutePath()));
}
break;
case FORCE_APPEND:
default :
}
}
}
if (log.isDebugEnabled()) {
log.debug(String.format("String_Node_Str",path));
}
}
Program: 59861
Project: 59861
Buggy source:
@Test public void testPathChange(){
  destinationProperties.put("String_Node_Str",PATH);
  final String CHANGED_PATH="String_Node_Str";
  final File secondPath=new File(CHANGED_PATH);
  secondPath.deleteOnExit();
  if (secondPath.exists()) {
    secondPath.delete();
  }
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.open();
    Assert.assertEquals(destination.getPath(),PATH);
    Assert.assertFalse(secondPath.exists());
    destination.report(measurementWithoutDefault);
    destination.setPath(CHANGED_PATH);
    Assert.assertEquals(destination.getPath(),CHANGED_PATH);
    destination.report(measurementWithoutDefault);
    Assert.assertTrue(secondPath.exists());
    destination.close();
    assertCSVFileContent("String_Node_Str" + ITERATION + "String_Node_Str");
    assertCSVFileContent(secondPath,"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 testPathChange(){
  destinationProperties.put("String_Node_Str",PATH);
  final String CHANGED_PATH="String_Node_Str";
  final File secondPath=new File(CHANGED_PATH);
  secondPath.deleteOnExit();
  if (secondPath.exists()) {
    secondPath.delete();
  }
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.open();
    Assert.assertEquals(destination.getPath(),PATH);
    Assert.assertFalse(secondPath.exists());
    destination.report(measurementWithoutDefault);
    boolean except=false;
    try {
      destination.setPath(CHANGED_PATH);
    }
 catch (    UnsupportedOperationException expected) {
      except=true;
    }
    Assert.assertTrue(except);
    destination.close();
    destination.setPath(CHANGED_PATH);
    destination.open();
    Assert.assertEquals(destination.getPath(),CHANGED_PATH);
    destination.report(measurementWithoutDefault);
    Assert.assertTrue(secondPath.exists());
    destination.close();
    assertCSVFileContent("String_Node_Str" + ITERATION + "String_Node_Str");
    assertCSVFileContent(secondPath,"String_Node_Str" + ITERATION + "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 59862
Project: 59862
Buggy source:
public MessageTemplate(final Message message,final long multiplicity,final List<MessageValidator> validators){
  this.message=message;
  prepareMatcher();
  this.multiplicity=multiplicity;
  this.validators=validators;
}

Fixed version (ground truth):
public MessageTemplate(final Message message,final long multiplicity,final List<MessageValidator> validators){
  this.message=message;
  preparePattern();
  this.multiplicity=multiplicity;
  this.validators=validators;
}
Program: 59863
Project: 59863
Buggy source:
public Matcher getMatcher(){
  return matcher;
}

Fixed version (ground truth):
public Matcher getMatcher(String text){
  return pattern != null ? pattern.matcher(text) : null;
}
Program: 59864
Project: 59864
Buggy source:
public Message getFilteredMessage(final Properties props){
  if (getMatcher() != null) {
    final Message m=MessageFactory.getMessage();
    String text=this.getMessage().getPayload().toString();
    text=Utils.filterProperties(text,getMatcher(),new DefaultPropertyGetter(props));
    m.setPayload(text);
    return m;
  }
 else {
    return message;
  }
}

Fixed version (ground truth):
public Message getFilteredMessage(final Properties props){
  if (pattern != null) {
    final Message m=MessageFactory.getMessage();
    String text=this.getMessage().getPayload().toString();
    text=Utils.filterProperties(text,getMatcher(text),new DefaultPropertyGetter(props));
    m.setPayload(text);
    return m;
  }
 else {
    return message;
  }
}
Program: 59866
Project: 59866
Buggy source:
@Override public void open(){
}

Fixed version (ground truth):
@Override public void open(){
  csvFile=new File(path);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + csvFile.getPath());
  }
}
Program: 59867
Project: 59867
Buggy source:
@Test public void testDefaultProperties(){
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.report(measurement);
    assertCSVFileContent("String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testDefaultProperties(){
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.open();
    destination.report(measurement);
    destination.close();
    assertCSVFileContent("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: 59868
Project: 59868
Buggy source:
@BeforeClass public void beforeClass(){
  measurement=new Measurement(42,123456000,12345);
  measurement.set(new Quantity<Double>(1111.11,"String_Node_Str"));
  measurement.set("String_Node_Str",new Quantity<Double>(222.22,"String_Node_Str"));
  measurementWithoutDefault=new Measurement(42,123456000,12345);
  measurementWithoutDefault.set("String_Node_Str",new Quantity<Number>(100,"String_Node_Str"));
  File csvOutputPath=new File("String_Node_Str");
  if (!csvOutputPath.exists()) {
    csvOutputPath.mkdir();
  }
  csvFile=new File(csvOutputPath,"String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public void beforeClass(){
  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"));
  measurementWithoutDefault=new Measurement(42,123456000,ITERATION - 1);
  measurementWithoutDefault.set("String_Node_Str",new Quantity<Number>(100,"String_Node_Str"));
  measurementStringResult=new Measurement(42,123456000,ITERATION - 1);
  measurementStringResult.set("String_Node_Str");
  measurementStringResult.set("String_Node_Str","String_Node_Str");
  File csvOutputPath=new File("String_Node_Str");
  if (!csvOutputPath.exists()) {
    csvOutputPath.mkdir();
  }
  csvFile=new File(csvOutputPath,"String_Node_Str");
}
Program: 59869
Project: 59869
Buggy source:
@Test public void testDestinationReport(){
  destinationProperties.put("String_Node_Str","String_Node_Str");
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.report(measurement);
    assertCSVFileContent("String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testDestinationReport(){
  destinationProperties.put("String_Node_Str","String_Node_Str");
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.open();
    destination.report(measurement);
    destination.close();
    assertCSVFileContent("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: 59870
Project: 59870
Buggy source:
@Test public void testNoDefaultResultMeasurement(){
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.report(measurementWithoutDefault);
    assertCSVFileContent("String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testNoDefaultResultMeasurement(){
  try {
    CSVDestination destination=(CSVDestination)ObjectFactory.summonInstance(CSVDestination.class.getName(),destinationProperties);
    destination.open();
    destination.report(measurementWithoutDefault);
    destination.close();
    assertCSVFileContent("String_Node_Str" + ITERATION + "String_Node_Str");
  }
 catch (  InstantiationException|IllegalAccessException|ClassNotFoundException|InvocationTargetException|ReportingException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 59871
Project: 59871
Buggy source:
/** 
 * Get the current iteration counter value. This can be used as an approximate value of passed iterations even though some of them might still be pending their execution. The value is always 1 number higher than the number of iterations executed (as the number can be used for a new iteration).
 * @return Current iteration counter value
 */
public long getIteration(){
  return iterations.get();
}

Fixed version (ground truth):
/** 
 * Get the current iteration counter value. This can be used as an approximate value of passed iterations even though some of them might still be pending their execution.
 * @return Current iteration counter value, -1 if there was no iteration so far.
 */
public long getIteration(){
  return iterations.get() - 1;
}
Program: 59872
Project: 59872
Buggy source:
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(timeFormat.format(time));
  sb.append("String_Node_Str");
  sb.append(iteration);
  sb.append("String_Node_Str");
  sb.append(percentage);
  sb.append("String_Node_Str");
  Object defaultResult=get();
  if (defaultResult != null) {
    sb.append("String_Node_Str");
    sb.append(get());
    sb.append("String_Node_Str");
  }
  for (  Entry<String,Object> entry : results.entrySet()) {
    if (!entry.getKey().equals(DEFAULT_RESULT)) {
      sb.append("String_Node_Str");
      sb.append(entry.getKey());
      sb.append("String_Node_Str");
      sb.append(entry.getValue());
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(Utils.timeToHMS(time));
  sb.append("String_Node_Str");
  sb.append(iteration);
  sb.append("String_Node_Str");
  sb.append(percentage);
  sb.append("String_Node_Str");
  Object defaultResult=get();
  if (defaultResult != null) {
    sb.append("String_Node_Str");
    sb.append(get());
    sb.append("String_Node_Str");
  }
  for (  Entry<String,Object> entry : results.entrySet()) {
    if (!entry.getKey().equals(DEFAULT_RESULT)) {
      sb.append("String_Node_Str");
      sb.append(entry.getKey());
      sb.append("String_Node_Str");
      sb.append(entry.getValue());
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}
Program: 59873
Project: 59873
Buggy source:
protected MeasurementUnit(final long iteration){
  this.iteration=iteration;
}

Fixed version (ground truth):
/** 
 * Constructor is protected. Use   {@link org.perfcake.nreporting.ReportManager#newMeasurementUnit()} to obtain a new instance.
 * @param iteration Current iteration number.
 */
protected MeasurementUnit(final long iteration){
  this.iteration=iteration;
}
Program: 59874
Project: 59874
Buggy source:
public long getLastTime(){
}

Fixed version (ground truth):
/** 
 * Gets time of the last measurement (time period between calls to   {@link #startMeasure()} and {@link #stopMeasure()} in milliseconds.
 * @return Time of the last measurement in milliseconds.
 */
public long getLastTime(){
}
Program: 59875
Project: 59875
Buggy source:
public void appendResult(final String label,final Object value){
  measurementResults.put(label,value);
}

Fixed version (ground truth):
/** 
 * Append a custom result.
 * @param label The label of the result.
 * @param value The value of the result.
 */
public void appendResult(final String label,final Object value){
  measurementResults.put(label,value);
}
Program: 59876
Project: 59876
Buggy source:
public void stopMeasure(){
  stopTime=System.nanoTime();
  totalTime=totalTime + getLastTime();
}

Fixed version (ground truth):
/** 
 * Stopts measuring.
 */
public void stopMeasure(){
  stopTime=System.nanoTime();
  totalTime=totalTime + getLastTime();
}
Program: 59877
Project: 59877
Buggy source:
public long getIteration(){
  return iteration;
}

Fixed version (ground truth):
/** 
 * Gets the number of current iteration of this Measurement Unit.
 * @return The number of iteration.
 */
public long getIteration(){
  return iteration;
}
Program: 59878
Project: 59878
Buggy source:
public void startMeasure(){
  startTime=System.nanoTime();
  stopTime=-1;
}

Fixed version (ground truth):
/** 
 * Starts measuring. This is independent on current system time.
 */
public void startMeasure(){
  startTime=System.nanoTime();
  stopTime=-1;
}
Program: 59879
Project: 59879
Buggy source:
public Object getResult(final String label){
  return measurementResults.get(label);
}

Fixed version (ground truth):
/** 
 * Get a custom result for the given label.
 * @param label The label of the custom result.
 * @return The value for the given custom result.
 */
public Object getResult(final String label){
  return measurementResults.get(label);
}
Program: 59880
Project: 59880
Buggy source:
public Map<String,Object> getResults(){
  return Collections.unmodifiableMap(measurementResults);
}

Fixed version (ground truth):
/** 
 * Get immutable map with all the custom results.
 * @return An immutable copy of the custom results map.
 */
public Map<String,Object> getResults(){
  return Collections.unmodifiableMap(measurementResults);
}
Program: 59881
Project: 59881
Buggy source:
public long getTotalTime(){
  return totalTime;
}

Fixed version (ground truth):
/** 
 * Gets total time measured during all mesurements done by this Measurement Unit (all time periods between calls to   {@link #startMeasure()} and {@link #stopMeasure()} in milliseconds.
 * @return The total time measured by this unit in milliseconds.
 */
public long getTotalTime(){
  return totalTime;
}
Program: 59882
Project: 59882
Buggy source:
/** 
 * Used to set the value of delimiter.
 * @param delimiter The delimiter value to set.
 */
public void setDelimiter(String delimiter){
  this.delimiter=delimiter;
}

Fixed version (ground truth):
/** 
 * Used to set the value of delimiter.
 * @param delimiter The delimiter value to set.
 */
public void setDelimiter(final String delimiter){
  this.delimiter=delimiter;
}
Program: 59884
Project: 59884
Buggy source:
/** 
 * Used to set the value of path.
 * @param path The path value to set.
 */
public void setPath(String path){
  this.path=path;
  this.csvFile=new File(this.path);
}

Fixed version (ground truth):
/** 
 * Used to set the value of path.
 * @param path The path value to set.
 */
public void setPath(final String path){
  this.path=path;
  this.csvFile=new File(this.path);
}
Program: 59885
Project: 59885
Buggy source:
/** 
 * Reports a single   {@link org.perfcake.nreporting.MeasurementUnit} to this reporter. This calls {@link #doReport(MeasurementUnit)} overrided by a child,accumulates results and reports iteration change and percentage change (if any).
 */
@Override public final void report(final MeasurementUnit mu) throws ReportingException {
  if (runInfo == null) {
    throw new ReportingException("String_Node_Str");
  }
  doReport(mu);
  accumulateResults(mu.getResults());
  reportIterations(mu.getIteration());
  final long percentage=Math.round(runInfo.getPercentage());
  if (percentage != lastPercentage) {
    lastPercentage=percentage;
    reportPercentage(percentage);
  }
}

Fixed version (ground truth):
/** 
 * Reports a single   {@link org.perfcake.nreporting.MeasurementUnit} to this reporter. This calls {@link #doReport(MeasurementUnit)} overrided by a child,accumulates results and reports iteration change and percentage change (if any).
 */
@Override public final void report(final MeasurementUnit mu) throws ReportingException {
  if (runInfo == null) {
    throw new ReportingException("String_Node_Str");
  }
  doReport(mu);
  accumulateResults(mu.getResults());
  reportIterations(mu.getIteration());
  final long percentage=(long)Math.floor(runInfo.getPercentage());
  if (percentage != lastPercentage) {
    lastPercentage=percentage;
    reportPercentage(percentage);
  }
}
Program: 59886
Project: 59886
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected Accumulator getAccumulator(final String key,final Class clazz){
  if (clazz.getName().equals(Double.class)) {
    return new AvgAccumulator();
  }
 else {
    return new LastValueAccumulator();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected Accumulator getAccumulator(final String key,final Class clazz){
  if (Double.class.equals(clazz)) {
    return new AvgAccumulator();
  }
 else {
    return new LastValueAccumulator();
  }
}
Program: 59887
Project: 59887
Buggy source:
@Override protected void doPublishResult(final PeriodType periodType,final Destination d) throws ReportingException {
  Measurement m=new Measurement(Math.round(runInfo.getPercentage()),runInfo.getRunTime(),runInfo.getIteration() - 1);
  m.set(new Quantity<Double>((Double)getAccumulatedResult(Measurement.DEFAULT_RESULT),"String_Node_Str"));
  publishAccumulatedResult(m);
  d.report(m);
}

Fixed version (ground truth):
@Override protected void doPublishResult(final PeriodType periodType,final Destination d) throws ReportingException {
  Measurement m=new Measurement(Math.round(runInfo.getPercentage()),runInfo.getRunTime(),runInfo.getIteration());
  m.set(new Quantity<Double>((Double)getAccumulatedResult(Measurement.DEFAULT_RESULT),"String_Node_Str"));
  publishAccumulatedResult(m);
  d.report(m);
}
Program: 59888
Project: 59888
Buggy source:
/** 
 * Starts a new measurement run. This resets the iteration counter.
 */
public void start(){
  reset();
  startTime=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Starts a new measurement run. This resets the iteration counter.
 */
public void start(){
  reset();
  startTime=System.currentTimeMillis();
  endTime=-1;
}
Program: 59889
Project: 59889
Buggy source:
/** 
 * Get the current iteration counter value. This can be used as an approximate value of passed iteration even though some of them might still be pending their execution.
 * @return Current iteration counter value
 */
public long getIteration(){
  return iterations.get();
}

Fixed version (ground truth):
/** 
 * Get the current iteration counter value. This can be used as an approximate value of passed iterations even though some of them might still be pending their execution. The value is always 1 number higher than the number of iterations executed (as the number can be used for a new iteration).
 * @return Current iteration counter value
 */
public long getIteration(){
  return iterations.get();
}
Program: 59890
Project: 59890
Buggy source:
public void stop(){
  started=false;
  runInfo.stop();
  rwLock.writeLock().lock();
  for (  Reporter r : reporters) {
    r.stop();
  }
  rwLock.writeLock().unlock();
}

Fixed version (ground truth):
public void stop(){
  runInfo.stop();
  rwLock.writeLock().lock();
  for (  Reporter r : reporters) {
    r.stop();
  }
  rwLock.writeLock().unlock();
}
Program: 59891
Project: 59891
Buggy source:
public void report(final MeasurementUnit mu) throws ReportingException {
  if (started) {
    rwLock.readLock().lock();
    for (    Reporter r : reporters) {
      r.report(mu);
    }
    rwLock.readLock().unlock();
  }
 else {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
public void report(final MeasurementUnit mu) throws ReportingException {
  if (runInfo.isRunning()) {
    rwLock.readLock().lock();
    for (    Reporter r : reporters) {
      r.report(mu);
    }
    rwLock.readLock().unlock();
  }
 else {
    log.debug("String_Node_Str");
  }
}
Program: 59892
Project: 59892
Buggy source:
public void start(){
  rwLock.writeLock().lock();
  for (  Reporter r : reporters) {
    r.start();
  }
  rwLock.writeLock().unlock();
  started=true;
  runInfo.start();
}

Fixed version (ground truth):
public void start(){
  runInfo.start();
  rwLock.writeLock().lock();
  for (  Reporter r : reporters) {
    r.start();
  }
  rwLock.writeLock().unlock();
}
Program: 59893
Project: 59893
Buggy source:
/** 
 * Gets a value of an accumulated result.
 * @param key Key in the results hash map.
 * @return The value associated with the given key.
 */
protected Object getAccumulatedResult(final String key){
  return accumulatedResults.get(key).getResult();
}

Fixed version (ground truth):
/** 
 * Gets a value of an accumulated result.
 * @param key Key in the results hash map.
 * @return The value associated with the given key.
 */
protected Object getAccumulatedResult(final String key){
  return accumulatedResults.get(key) == null ? null : accumulatedResults.get(key).getResult();
}
Program: 59894
Project: 59894
Buggy source:
@Override protected void doPublishResult(final PeriodType periodType,final Destination d) throws ReportingException {
  Measurement m=new Measurement(Math.round(runInfo.getPercentage()),runInfo.getRunTime(),runInfo.getIteration());
  m.set(new Quantity<Double>((Double)getAccumulatedResult(Measurement.DEFAULT_RESULT),"String_Node_Str"));
  publishAccumulatedResult(m);
  d.report(m);
}

Fixed version (ground truth):
@Override protected void doPublishResult(final PeriodType periodType,final Destination d) throws ReportingException {
  Measurement m=new Measurement(Math.round(runInfo.getPercentage()),runInfo.getRunTime(),runInfo.getIteration() - 1);
  m.set(new Quantity<Double>((Double)getAccumulatedResult(Measurement.DEFAULT_RESULT),"String_Node_Str"));
  publishAccumulatedResult(m);
  d.report(m);
}
Program: 59895
Project: 59895
Buggy source:
/** 
 * Used to set the value of property2.
 * @param property2 The property2 value to set.
 */
public void setProperty2(String property2){
  this.property2=property2;
}

Fixed version (ground truth):
/** 
 * Used to set the value of property2.
 * @param property2 The property2 value to set.
 */
public void setProperty2(final String property2){
  this.property2=property2;
}
Program: 59896
Project: 59896
Buggy source:
/** 
 * Used to set the value of property.
 * @param property The property value to set.
 */
public void setProperty(String property){
  this.property=property;
}

Fixed version (ground truth):
/** 
 * Used to set the value of property.
 * @param property The property value to set.
 */
public void setProperty(final String property){
  this.property=property;
}
Program: 59897
Project: 59897
Buggy source:
@Override public void report(Measurement m) throws ReportingException {
  System.out.println(m.toString());
}

Fixed version (ground truth):
@Override public void report(final Measurement m) throws ReportingException {
  lastMethod="String_Node_Str";
  lastMeasurement=m;
  System.out.println(m.toString());
  try {
    throw new Throwable("String_Node_Str");
  }
 catch (  Throwable t) {
    StringWriter sw=new StringWriter();
    t.printStackTrace(new PrintWriter(sw));
    if (sw.toString().contains("String_Node_Str")) {
      lastType=PeriodType.ITERATION;
    }
 else     if (sw.toString().contains("String_Node_Str")) {
      lastType=PeriodType.PERCENTAGE;
    }
 else     if (sw.toString().contains("String_Node_Str")) {
      lastType=PeriodType.TIME;
    }
 else {
      t.printStackTrace();
      lastType=null;
    }
  }
}
Program: 59898
Project: 59898
Buggy source:
@Override public void close(){
}

Fixed version (ground truth):
@Override public void close(){
  lastMethod="String_Node_Str";
}
Program: 59899
Project: 59899
Buggy source:
@Override public void open(){
}

Fixed version (ground truth):
@Override public void open(){
  lastMethod="String_Node_Str";
}
Program: 59901
Project: 59901
Buggy source:
/** 
 * Get the current iteration counter value. This can be used as an approximate value of passed iterations even though some of them might still be pending their execution. The value is always 1 number higher than the number of iterations executed (as the number can be used for a new iteration).
 * @return Current iteration counter value
 */
public long getIteration(){
  return iterations.get();
}

Fixed version (ground truth):
/** 
 * Get the current iteration counter value. This can be used as an approximate value of passed iterations even though some of them might still be pending their execution.
 * @return Current iteration counter value, -1 if there was no iteration so far.
 */
public long getIteration(){
  return iterations.get() - 1;
}
Program: 59902
Project: 59902
Buggy source:
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(timeFormat.format(time));
  sb.append("String_Node_Str");
  sb.append(iteration);
  sb.append("String_Node_Str");
  sb.append(percentage);
  sb.append("String_Node_Str");
  Object defaultResult=get();
  if (defaultResult != null) {
    sb.append("String_Node_Str");
    sb.append(get());
    sb.append("String_Node_Str");
  }
  for (  Entry<String,Object> entry : results.entrySet()) {
    if (!entry.getKey().equals(DEFAULT_RESULT)) {
      sb.append("String_Node_Str");
      sb.append(entry.getKey());
      sb.append("String_Node_Str");
      sb.append(entry.getValue());
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(Utils.timeToHMS(time));
  sb.append("String_Node_Str");
  sb.append(iteration);
  sb.append("String_Node_Str");
  sb.append(percentage);
  sb.append("String_Node_Str");
  Object defaultResult=get();
  if (defaultResult != null) {
    sb.append("String_Node_Str");
    sb.append(get());
    sb.append("String_Node_Str");
  }
  for (  Entry<String,Object> entry : results.entrySet()) {
    if (!entry.getKey().equals(DEFAULT_RESULT)) {
      sb.append("String_Node_Str");
      sb.append(entry.getKey());
      sb.append("String_Node_Str");
      sb.append(entry.getValue());
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}
Program: 59903
Project: 59903
Buggy source:
protected MeasurementUnit(final long iteration){
  this.iteration=iteration;
}

Fixed version (ground truth):
/** 
 * Constructor is protected. Use   {@link org.perfcake.nreporting.ReportManager#newMeasurementUnit()} to obtain a new instance.
 * @param iteration Current iteration number.
 */
protected MeasurementUnit(final long iteration){
  this.iteration=iteration;
}
Program: 59904
Project: 59904
Buggy source:
public long getLastTime(){
}

Fixed version (ground truth):
/** 
 * Gets time of the last measurement (time period between calls to   {@link #startMeasure()} and {@link #stopMeasure()} in milliseconds.
 * @return Time of the last measurement in milliseconds.
 */
public long getLastTime(){
}
Program: 59905
Project: 59905
Buggy source:
public void appendResult(final String label,final Object value){
  measurementResults.put(label,value);
}

Fixed version (ground truth):
/** 
 * Append a custom result.
 * @param label The label of the result.
 * @param value The value of the result.
 */
public void appendResult(final String label,final Object value){
  measurementResults.put(label,value);
}