nus-yam/ex-repair huggingface dataset:
Program: 47953
Project: 47953
Buggy source:
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  remoteProcessMessageResult=(Boolean)e.getMessage();
  semaphore.release();
}

Fixed version (ground truth):
@Override public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
  RemoteWorkerDelegate worker=getWorkerDelegate(ctx);
  worker.remoteProcessMessageResult=(Boolean)e.getMessage();
  worker.semaphore.release();
}
Program: 47954
Project: 47954
Buggy source:
@Override public void channelClosed(ChannelHandlerContext ctx,ChannelStateEvent e) throws Exception {
  semaphore.release();
  super.channelClosed(ctx,e);
}

Fixed version (ground truth):
@Override public void channelClosed(ChannelHandlerContext ctx,ChannelStateEvent e) throws Exception {
  RemoteWorkerDelegate worker=getWorkerDelegate(ctx);
  if (worker != null) {
    worker.semaphore.release();
    super.channelClosed(ctx,e);
  }
}
Program: 47955
Project: 47955
Buggy source:
@Override public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e) throws Exception {
  resultHandlerException=e.getCause();
  semaphore.release();
}

Fixed version (ground truth):
@Override public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e) throws Exception {
  RemoteWorkerDelegate worker=getWorkerDelegate(ctx);
  if (worker != null) {
    worker.resultHandlerException=e.getCause();
    worker.semaphore.release();
  }
}
Program: 47956
Project: 47956
Buggy source:
public void start() throws Exception {
  String hbaseModeProp=System.getProperty(HBASE_MODE_PROP_NAME);
  if (hbaseModeProp == null || hbaseModeProp.equals("String_Node_Str") || hbaseModeProp.equals("String_Node_Str")) {
    MODE=Mode.EMBED;
  }
 else   if (hbaseModeProp.equals("String_Node_Str")) {
    MODE=Mode.CONNECT;
  }
 else {
    throw new RuntimeException("String_Node_Str" + HBASE_MODE_PROP_NAME + "String_Node_Str"+ hbaseModeProp);
  }
  System.out.println("String_Node_Str" + MODE);
  CONF=HBaseConfiguration.create();
switch (MODE) {
case EMBED:
    addHBaseTestProps(CONF);
  addUserProps(CONF);
System.clearProperty(HBaseTestingUtility.TEST_DIRECTORY_KEY);
TEST_UTIL=new HBaseTestingUtility(CONF);
TEST_UTIL.startMiniCluster(1);
CONF=TEST_UTIL.getConfiguration();
break;
case CONNECT:
CONF.set("String_Node_Str","String_Node_Str");
CONF.set("String_Node_Str","String_Node_Str");
addUserProps(CONF);
cleanZooKeeper();
cleanTables();
break;
default :
throw new RuntimeException("String_Node_Str" + MODE);
}
}

Fixed version (ground truth):
public void start() throws Exception {
  String hbaseModeProp=System.getProperty(HBASE_MODE_PROP_NAME);
  if (hbaseModeProp == null || hbaseModeProp.equals("String_Node_Str") || hbaseModeProp.equals("String_Node_Str")) {
    MODE=Mode.EMBED;
  }
 else   if (hbaseModeProp.equals("String_Node_Str")) {
    MODE=Mode.CONNECT;
  }
 else {
    throw new RuntimeException("String_Node_Str" + HBASE_MODE_PROP_NAME + "String_Node_Str"+ hbaseModeProp);
  }
  System.out.println("String_Node_Str" + MODE);
  CONF=HBaseConfiguration.create();
switch (MODE) {
case EMBED:
    addHBaseTestProps(CONF);
  addUserProps(CONF);
System.clearProperty(HBaseTestingUtility.TEST_DIRECTORY_KEY);
TEST_UTIL=new HBaseTestingUtility(CONF);
TEST_UTIL.startMiniCluster(1);
long before=System.currentTimeMillis();
while (!TEST_UTIL.getMiniHBaseCluster().getMaster().isInitialized()) {
if (System.currentTimeMillis() - before > 60000) {
throw new RuntimeException("String_Node_Str");
}
System.out.println("String_Node_Str");
Thread.sleep(500);
}
CONF=TEST_UTIL.getConfiguration();
break;
case CONNECT:
CONF.set("String_Node_Str","String_Node_Str");
CONF.set("String_Node_Str","String_Node_Str");
addUserProps(CONF);
cleanZooKeeper();
cleanTables();
break;
default :
throw new RuntimeException("String_Node_Str" + MODE);
}
}
Program: 47957
Project: 47957
Buggy source:
/** 
 * Returns a space-separated string containing the specified amount of words.
 */
public static String get(WordList list,int amount){
  StringBuffer buffer=new StringBuffer(20 * amount);
  for (int i=0; i < amount; i++) {
    buffer.append(get());
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * Returns a space-separated string containing the specified amount of words.
 */
public static String get(WordList list,int amount){
  StringBuffer buffer=new StringBuffer(20 * amount);
  for (int i=0; i < amount; i++) {
    if (i > 0)     buffer.append(' ');
    buffer.append(get(list));
  }
  return buffer.toString();
}
Program: 47959
Project: 47959
Buggy source:
@Override public String readLine() throws IOException {
  currentLine++;
  return super.readLine();
}

Fixed version (ground truth):
@Override public String readLine() throws IOException {
  if (unreadLine) {
    unreadLine=false;
    return line;
  }
  currentLine++;
  this.line=super.readLine();
  return line;
}
Program: 47960
Project: 47960
Buggy source:
@Test(timeout=270000) public void testMultipleSubscriptions() throws Exception {
  String subscriptionId2="String_Node_Str";
  ValidationMessageListener validationListener2=new ValidationMessageListener("String_Node_Str",subscriptionId2,rowLog);
  rowLogConfigurationManager.addSubscription(rowLog.getId(),subscriptionId2,RowLogSubscription.Type.Netty,3,2);
  waitForSubscription(subscriptionId);
  RemoteListenerHandler remoteListener2=new RemoteListenerHandler(rowLog,subscriptionId2,validationListener2,rowLogConfigurationManager);
  remoteListener2.start();
  validationListener.expectMessages(10);
  validationListener2.expectMessages(10);
  RowLogMessage message;
  for (long seqnr=0L; seqnr < 2; seqnr++) {
    for (int rownr=20; rownr < 25; rownr++) {
      byte[] data=Bytes.toBytes(rownr);
      data=Bytes.add(data,Bytes.toBytes(seqnr));
      message=rowLog.putMessage(Bytes.toBytes("String_Node_Str" + rownr),data,null,null);
      validationListener.expectMessage(message);
      validationListener2.expectMessage(message);
    }
  }
  processor.start();
  validationListener.waitUntilMessagesConsumed(120000);
  validationListener2.waitUntilMessagesConsumed(120000);
  processor.stop();
  validationListener2.validate();
  remoteListener2.stop();
  rowLogConfigurationManager.removeSubscription(rowLog.getId(),subscriptionId2);
  validationListener.validate();
}

Fixed version (ground truth):
@Test(timeout=270000) public void testMultipleSubscriptions() throws Exception {
  String subscriptionId2="String_Node_Str";
  ValidationMessageListener validationListener2=new ValidationMessageListener("String_Node_Str",subscriptionId2,rowLog);
  rowLogConfigurationManager.addSubscription(rowLog.getId(),subscriptionId2,RowLogSubscription.Type.Netty,3,2);
  waitForSubscription(subscriptionId2);
  RemoteListenerHandler remoteListener2=new RemoteListenerHandler(rowLog,subscriptionId2,validationListener2,rowLogConfigurationManager);
  remoteListener2.start();
  validationListener.expectMessages(10);
  validationListener2.expectMessages(10);
  RowLogMessage message;
  for (long seqnr=0L; seqnr < 2; seqnr++) {
    for (int rownr=20; rownr < 25; rownr++) {
      byte[] data=Bytes.toBytes(rownr);
      data=Bytes.add(data,Bytes.toBytes(seqnr));
      message=rowLog.putMessage(Bytes.toBytes("String_Node_Str" + rownr),data,null,null);
      validationListener.expectMessage(message);
      validationListener2.expectMessage(message);
    }
  }
  processor.start();
  validationListener.waitUntilMessagesConsumed(120000);
  validationListener2.waitUntilMessagesConsumed(120000);
  processor.stop();
  validationListener2.validate();
  remoteListener2.stop();
  rowLogConfigurationManager.removeSubscription(rowLog.getId(),subscriptionId2);
  validationListener.validate();
}
Program: 47961
Project: 47961
Buggy source:
public boolean processMessage(RowLogMessage msg){
  long before=System.currentTimeMillis();
  try {
    RecordEvent event=new RecordEvent(msg.getPayload());
    RecordId recordId=repository.getIdGenerator().fromBytes(msg.getRowKey());
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + event.toJson());
    }
    if (event.getType().equals(DELETE)) {
      indexer.delete(recordId);
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str" + "String_Node_Str",recordId));
      }
      updateDenormalizedData(recordId,event,null,null);
    }
 else {
      handleRecordCreateUpdate(recordId,event);
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    long after=System.currentTimeMillis();
    metrics.messageProcessed(after - before);
  }
  return true;
}

Fixed version (ground truth):
public boolean processMessage(RowLogMessage msg){
  long before=System.currentTimeMillis();
  ClassLoader currentCL=Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(myContextClassLoader);
    RecordEvent event=new RecordEvent(msg.getPayload());
    RecordId recordId=repository.getIdGenerator().fromBytes(msg.getRowKey());
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + event.toJson());
    }
    if (event.getType().equals(DELETE)) {
      indexer.delete(recordId);
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str" + "String_Node_Str",recordId));
      }
      updateDenormalizedData(recordId,event,null,null);
    }
 else {
      handleRecordCreateUpdate(recordId,event);
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    long after=System.currentTimeMillis();
    metrics.messageProcessed(after - before);
    Thread.currentThread().setContextClassLoader(currentCL);
  }
  return true;
}
Program: 47962
Project: 47962
Buggy source:
public IndexUpdater(Indexer indexer,RowLog rowLog,int consumerId,Repository repository,LinkIndex linkIndex){
  this.indexer=indexer;
  this.rowLog=rowLog;
  this.consumerId=consumerId;
  this.repository=repository;
  this.typeManager=repository.getTypeManager();
  this.linkIndex=linkIndex;
  this.metrics=new IndexUpdaterMetrics();
  rowLog.registerConsumer(indexerListener);
}

Fixed version (ground truth):
public IndexUpdater(Indexer indexer,RowLog rowLog,int consumerId,Repository repository,LinkIndex linkIndex){
  this.indexer=indexer;
  this.rowLog=rowLog;
  this.consumerId=consumerId;
  this.repository=repository;
  this.typeManager=repository.getTypeManager();
  this.linkIndex=linkIndex;
  this.myContextClassLoader=Thread.currentThread().getContextClassLoader();
  this.metrics=new IndexUpdaterMetrics();
  rowLog.registerConsumer(indexerListener);
}
Program: 47963
Project: 47963
Buggy source:
private Throwable restoreCauses(GenericArray<AvroExceptionCause> remoteCauses){
  Throwable result=null;
  for (  AvroExceptionCause remoteCause : remoteCauses) {
    List<StackTraceElement> stackTrace=new ArrayList<StackTraceElement>((int)remoteCause.stackTrace.size());
    for (    AvroStackTraceElement el : remoteCause.stackTrace) {
      stackTrace.add(new StackTraceElement(convert(el.className),convert(el.methodName),convert(el.fileName),el.lineNumber));
    }
    RestoredException cause=new RestoredException(convert(remoteCause.message),convert(remoteCause.className),stackTrace);
    if (result == null) {
      result=cause;
    }
 else {
      result.initCause(cause);
    }
  }
  return result;
}

Fixed version (ground truth):
private Throwable restoreCauses(GenericArray<AvroExceptionCause> remoteCauses){
  Throwable result=null;
  for (  AvroExceptionCause remoteCause : remoteCauses) {
    List<StackTraceElement> stackTrace=new ArrayList<StackTraceElement>((int)remoteCause.stackTrace.size());
    for (    AvroStackTraceElement el : remoteCause.stackTrace) {
      stackTrace.add(new StackTraceElement(convert(el.className),convert(el.methodName),convert(el.fileName),el.lineNumber));
    }
    RestoredException cause=new RestoredException(convert(remoteCause.message),convert(remoteCause.className),stackTrace);
    if (result == null) {
      result=cause;
    }
 else {
      result.initCause(cause);
      result=cause;
    }
  }
  return result;
}
Program: 47964
Project: 47964
Buggy source:
public RowLock lockRow(byte[] rowKey) throws IOException {
  long now=System.currentTimeMillis();
  Get get=new Get(rowKey);
  get.addColumn(family,qualifier);
  if (!table.exists(get)) {
    hbaseRowLock=table.lockRow(rowKey);
    if (hbaseRowLock == null)     return null;
    try {
      Put put=new Put(rowKey,hbaseRowLock);
      byte[] lock=Bytes.toBytes(now);
      put.add(family,qualifier,lock);
      table.put(put);
      return new RowLock(rowKey,now);
    }
  finally {
      table.unlockRow(hbaseRowLock);
    }
  }
 else {
    Result result=table.get(get);
    byte[] previousLock=null;
    long previousTimestamp=-1L;
    if (!result.isEmpty()) {
      previousLock=result.getValue(family,qualifier);
      if (previousLock != null) {
        previousTimestamp=Bytes.toLong(previousLock);
      }
    }
    if ((previousTimestamp == -1) || (previousTimestamp + timeout < now)) {
      Put put=new Put(rowKey);
      byte[] lock=Bytes.toBytes(now);
      put.add(family,qualifier,lock);
      if (table.checkAndPut(rowKey,family,qualifier,previousLock,put)) {
        return new RowLock(rowKey,now);
      }
    }
    return null;
  }
}

Fixed version (ground truth):
public RowLock lockRow(byte[] rowKey) throws IOException {
  long now=System.currentTimeMillis();
  Get get=new Get(rowKey);
  get.addColumn(family,qualifier);
  if (!table.exists(get)) {
    org.apache.hadoop.hbase.client.RowLock hbaseRowLock=table.lockRow(rowKey);
    if (hbaseRowLock == null)     return null;
    try {
      Put put=new Put(rowKey,hbaseRowLock);
      byte[] lock=Bytes.toBytes(now);
      put.add(family,qualifier,lock);
      table.put(put);
      return new RowLock(rowKey,now);
    }
  finally {
      table.unlockRow(hbaseRowLock);
    }
  }
 else {
    Result result=table.get(get);
    byte[] previousLock=null;
    long previousTimestamp=-1L;
    if (!result.isEmpty()) {
      previousLock=result.getValue(family,qualifier);
      if (previousLock != null) {
        previousTimestamp=Bytes.toLong(previousLock);
      }
    }
    if ((previousTimestamp == -1) || (previousTimestamp + timeout < now)) {
      Put put=new Put(rowKey);
      byte[] lock=Bytes.toBytes(now);
      put.add(family,qualifier,lock);
      if (table.checkAndPut(rowKey,family,qualifier,previousLock,put)) {
        return new RowLock(rowKey,now);
      }
    }
    return null;
  }
}
Program: 47965
Project: 47965
Buggy source:
private void argstoString(StringBuilder builder){
  if (!copyAll || variantProps != null) {
    builder.append("String_Node_Str");
    boolean firstArg=true;
    if (!copyAll) {
      builder.append("String_Node_Str");
      firstArg=false;
    }
    if (variantProps != null) {
      for (      Map.Entry<String,PropertyValue> entry : variantProps.entrySet()) {
        if (firstArg) {
          firstArg=false;
        }
 else {
          builder.append("String_Node_Str");
        }
switch (entry.getValue().mode) {
case COPY:
          builder.append('+').append(entry.getKey());
        break;
case REMOVE:
      builder.append('-').append(entry.getKey());
    break;
case SET:
  builder.append(entry.getKey()).append('=').append(entry.getValue().value);
break;
}
}
}
}
}

Fixed version (ground truth):
private void argstoString(StringBuilder builder){
  boolean firstArg=true;
  if (!copyAll) {
    builder.append("String_Node_Str");
    firstArg=false;
  }
  if (variantProps != null) {
    for (    Map.Entry<String,PropertyValue> entry : variantProps.entrySet()) {
      if (firstArg) {
        firstArg=false;
      }
 else {
        builder.append("String_Node_Str");
      }
switch (entry.getValue().mode) {
case COPY:
        builder.append('+').append(entry.getKey());
      break;
case REMOVE:
    builder.append('-').append(entry.getKey());
  break;
case SET:
builder.append(entry.getKey()).append('=').append(entry.getValue().value);
break;
}
}
}
}
Program: 47966
Project: 47966
Buggy source:
/** 
 * Creates a string representation of this link. <p>The syntax is: <pre>{recordId}.!*;arg1=val1;+arg2;-arg3<pre> <p>The recordId is optional. Arguments, if any, follow after the . symbol and are separated by ';' symbols. Note that the {recordId} itself also contains a dot to separate the record id type and its actual content (e.g. USER.235523432). <p>The '!*' argument indicates 'not copyAll', copyAll is the default if not specified. <p><tt>arg1=val1</tt> is an example of specifying an exact value for a variant property. <p><tt>+arg2</tt> is an explicit copy of the variant property 'arg2' from the context. Does only make sense when not using copyAll, thus when !* is in the link. <p><<tt>-arg3</tt> is a removal (exclusion) of a variant property copied by using copyAll. <p>The arguments will always be specified in alphabetical order, ignoring the + or - symbol. "Not copyAll" (!*) is always the first argument.
 */
@Override public String toString(){
  if (masterRecordId == null && variantProps == null) {
    if (copyAll) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  StringBuilder builder=new StringBuilder();
  if (masterRecordId != null) {
    builder.append(masterRecordId.toString());
  }
  argstoString(builder);
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * Creates a string representation of this link. <p>The syntax is: <pre>{recordId}.!*;arg1=val1;+arg2;-arg3<pre> <p>The recordId is optional. Arguments, if any, follow after the . symbol and are separated by ';' symbols. Note that the {recordId} itself also contains a dot to separate the record id type and its actual content (e.g. USER.235523432). <p>The '!*' argument indicates 'not copyAll', copyAll is the default if not specified. <p><tt>arg1=val1</tt> is an example of specifying an exact value for a variant property. <p><tt>+arg2</tt> is an explicit copy of the variant property 'arg2' from the context. Does only make sense when not using copyAll, thus when !* is in the link. <p><<tt>-arg3</tt> is a removal (exclusion) of a variant property copied by using copyAll. <p>The arguments will always be specified in alphabetical order, ignoring the + or - symbol. "Not copyAll" (!*) is always the first argument.
 */
@Override public String toString(){
  if (masterRecordId == null && variantProps == null) {
    if (copyAll) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  StringBuilder builder=new StringBuilder();
  if (masterRecordId != null) {
    builder.append(masterRecordId.toString());
  }
  if (!copyAll || variantProps != null) {
    builder.append("String_Node_Str");
    argstoString(builder);
  }
  return builder.toString();
}
Program: 47967
Project: 47967
Buggy source:
@Test public void testIndividualCopy(){
  RecordId recordId=idGenerator.newRecordId("String_Node_Str");
  Link link=Link.newBuilder().recordId(recordId).copyAll(false).copy("String_Node_Str").set("String_Node_Str","String_Node_Str").create();
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  Map<String,String> ctxVarProps=new HashMap<String,String>();
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  RecordId ctx=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),ctxVarProps);
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertNull(resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals(2,resolved.getVariantProperties().size());
}

Fixed version (ground truth):
@Test public void testIndividualCopy(){
  RecordId recordId=idGenerator.newRecordId("String_Node_Str");
  Link link=Link.newBuilder().recordId(recordId).copyAll(false).copy("String_Node_Str").set("String_Node_Str","String_Node_Str").create();
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(link,Link.fromBytes(link.toBytes(),idGenerator));
  Map<String,String> ctxVarProps=new HashMap<String,String>();
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  RecordId ctx=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),ctxVarProps);
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertNull(resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals(2,resolved.getVariantProperties().size());
}
Program: 47968
Project: 47968
Buggy source:
@Test public void testRecordIdWithVarProps(){
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId masterRecordId=idGenerator.newRecordId("String_Node_Str");
  RecordId recordId=idGenerator.newRecordId(masterRecordId,varProps);
  Link link=Link.newBuilder().recordId(recordId).copyAll(false).create();
  assertEquals(masterRecordId,link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(2,link.getVariantProps().size());
  assertEquals(Link.PropertyMode.SET,link.getVariantProps().get("String_Node_Str").getMode());
  assertEquals("String_Node_Str",link.getVariantProps().get("String_Node_Str").getValue());
  Map<String,String> ctxVarProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId ctx=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),ctxVarProps);
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertEquals(2,resolved.getVariantProperties().size());
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testRecordIdWithVarProps(){
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId masterRecordId=idGenerator.newRecordId("String_Node_Str");
  RecordId recordId=idGenerator.newRecordId(masterRecordId,varProps);
  Link link=Link.newBuilder().recordId(recordId).copyAll(false).create();
  assertEquals(masterRecordId,link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(link,Link.fromBytes(link.toBytes(),idGenerator));
  assertEquals(2,link.getVariantProps().size());
  assertEquals(Link.PropertyMode.SET,link.getVariantProps().get("String_Node_Str").getMode());
  assertEquals("String_Node_Str",link.getVariantProps().get("String_Node_Str").getValue());
  Map<String,String> ctxVarProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId ctx=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),ctxVarProps);
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertEquals(2,resolved.getVariantProperties().size());
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
}
Program: 47969
Project: 47969
Buggy source:
@Test public void testIndividualRemove(){
  RecordId recordId=idGenerator.newRecordId("String_Node_Str");
  Link link=Link.newBuilder().recordId(recordId).remove("String_Node_Str").set("String_Node_Str","String_Node_Str").create();
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  Map<String,String> ctxVarProps=new HashMap<String,String>();
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  RecordId ctx=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),ctxVarProps);
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertNull(resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals(2,resolved.getVariantProperties().size());
}

Fixed version (ground truth):
@Test public void testIndividualRemove(){
  RecordId recordId=idGenerator.newRecordId("String_Node_Str");
  Link link=Link.newBuilder().recordId(recordId).remove("String_Node_Str").set("String_Node_Str","String_Node_Str").create();
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(link,Link.fromBytes(link.toBytes(),idGenerator));
  Map<String,String> ctxVarProps=new HashMap<String,String>();
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  ctxVarProps.put("String_Node_Str","String_Node_Str");
  RecordId ctx=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),ctxVarProps);
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertNull(resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals("String_Node_Str",resolved.getVariantProperties().get("String_Node_Str"));
  assertEquals(2,resolved.getVariantProperties().size());
}
Program: 47970
Project: 47970
Buggy source:
@Test public void testLinkToSelf(){
  Link link=Link.newBuilder().create();
  assertNull(link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId recordId=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),varProps);
  RecordId resolved=link.resolve(recordId,idGenerator);
  assertEquals(recordId,resolved);
}

Fixed version (ground truth):
@Test public void testLinkToSelf(){
  Link link=Link.newBuilder().create();
  assertNull(link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(link,Link.fromBytes(link.toBytes(),idGenerator));
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId recordId=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),varProps);
  RecordId resolved=link.resolve(recordId,idGenerator);
  assertEquals(recordId,resolved);
}
Program: 47971
Project: 47971
Buggy source:
@Test public void testPlainRecordId(){
  RecordId recordId=idGenerator.newRecordId("String_Node_Str");
  Link link=Link.newBuilder().recordId(recordId).create();
  assertTrue(link.copyAll());
  assertEquals(recordId,link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  RecordId ctx=idGenerator.newRecordId("String_Node_Str");
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertEquals(recordId,resolved);
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  ctx=idGenerator.newRecordId(ctx,varProps);
  resolved=link.resolve(ctx,idGenerator);
  assertEquals(recordId,resolved.getMaster());
  assertEquals(2,resolved.getVariantProperties().size());
}

Fixed version (ground truth):
@Test public void testPlainRecordId(){
  RecordId recordId=idGenerator.newRecordId("String_Node_Str");
  Link link=Link.newBuilder().recordId(recordId).create();
  assertTrue(link.copyAll());
  assertEquals(recordId,link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(link,Link.fromBytes(link.toBytes(),idGenerator));
  RecordId ctx=idGenerator.newRecordId("String_Node_Str");
  RecordId resolved=link.resolve(ctx,idGenerator);
  assertEquals(recordId,resolved);
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  ctx=idGenerator.newRecordId(ctx,varProps);
  resolved=link.resolve(ctx,idGenerator);
  assertEquals(recordId,resolved.getMaster());
  assertEquals(2,resolved.getVariantProperties().size());
}
Program: 47972
Project: 47972
Buggy source:
@Test public void testLinkToMaster(){
  Link link=Link.newBuilder().copyAll(false).create();
  assertNull(link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId recordId=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),varProps);
  RecordId resolved=link.resolve(recordId,idGenerator);
  assertEquals(recordId.getMaster(),resolved);
}

Fixed version (ground truth):
@Test public void testLinkToMaster(){
  Link link=Link.newBuilder().copyAll(false).create();
  assertNull(link.getMasterRecordId());
  assertEquals("String_Node_Str",link.toString());
  assertEquals(link,Link.fromString(link.toString(),idGenerator));
  assertEquals(link,Link.fromBytes(link.toBytes(),idGenerator));
  Map<String,String> varProps=new HashMap<String,String>();
  varProps.put("String_Node_Str","String_Node_Str");
  varProps.put("String_Node_Str","String_Node_Str");
  RecordId recordId=idGenerator.newRecordId(idGenerator.newRecordId("String_Node_Str"),varProps);
  RecordId resolved=link.resolve(recordId,idGenerator);
  assertEquals(recordId.getMaster(),resolved);
}
Program: 47974
Project: 47974
Buggy source:
@Test public void testData() throws Exception {
  final String INDEX_NAME="String_Node_Str";
  IndexManager indexManager=new IndexManager(TEST_UTIL.getConfiguration());
  IndexDefinition indexDef=new IndexDefinition(INDEX_NAME);
  indexDef.addStringField("String_Node_Str");
  indexManager.createIndex(indexDef);
  Index index=indexManager.getIndex(INDEX_NAME);
  String[] values=new String[]{"String_Node_Str","String_Node_Str"};
  for (  String value : values) {
    IndexEntry entry=new IndexEntry();
    entry.addField("String_Node_Str",value);
    entry.addData(Bytes.toBytes("String_Node_Str"),Bytes.toBytes(value));
    index.addEntry(entry,Bytes.toBytes(value));
  }
  Query query=new Query();
  query.setRangeCondition("String_Node_Str","String_Node_Str","String_Node_Str");
  QueryResult result=index.performQuery(query);
  assertNotNull(result.next());
  assertEquals("String_Node_Str",result.getDataAsString("String_Node_Str"));
  assertNotNull(result.next());
  assertEquals("String_Node_Str",result.getDataAsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testData() throws Exception {
  final String INDEX_NAME="String_Node_Str";
  IndexManager indexManager=new IndexManager(TEST_UTIL.getConfiguration());
  IndexDefinition indexDef=new IndexDefinition(INDEX_NAME);
  indexDef.addStringField("String_Node_Str");
  indexManager.createIndex(indexDef);
  Index index=indexManager.getIndex(INDEX_NAME);
  String[] values=new String[]{"String_Node_Str","String_Node_Str"};
  for (  String value : values) {
    IndexEntry entry=new IndexEntry();
    entry.addField("String_Node_Str",value);
    entry.addData(Bytes.toBytes("String_Node_Str"),Bytes.toBytes(value));
    index.addEntry(entry,Bytes.toBytes(value));
  }
  Query query=new Query();
  query.setRangeCondition("String_Node_Str",Query.MIN_VALUE,Query.MAX_VALUE);
  QueryResult result=index.performQuery(query);
  assertNotNull(result.next());
  assertEquals("String_Node_Str",result.getDataAsString("String_Node_Str"));
  assertNotNull(result.next());
  assertEquals("String_Node_Str",result.getDataAsString("String_Node_Str"));
}
Program: 47975
Project: 47975
Buggy source:
private void loadExecutionData() throws IOException {
  executionDataStore=new ExecutionDataStore();
  sessionInfoStore=new SessionInfoStore();
  for (  FilePath filePath : execFiles) {
    File executionDataFile=new File(filePath.getRemote());
    try {
      final InputStream inputStream=new BufferedInputStream(new FileInputStream(executionDataFile));
      try {
        final ExecutionDataReader reader=new ExecutionDataReader(inputStream);
        reader.setSessionInfoVisitor(sessionInfoStore);
        reader.setExecutionDataVisitor(executionDataStore);
        reader.read();
      }
  finally {
        inputStream.close();
      }
    }
 catch (    final IOException e) {
      System.out.println("String_Node_Str" + executionDataFile);
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void loadExecutionData() throws IOException {
  executionDataStore=new ExecutionDataStore();
  sessionInfoStore=new SessionInfoStore();
  for (  FilePath filePath : execFiles) {
    File executionDataFile=new File(filePath.getRemote());
    try {
      try (final InputStream inputStream=new BufferedInputStream(new FileInputStream(executionDataFile))){
        final ExecutionDataReader reader=new ExecutionDataReader(inputStream);
        reader.setSessionInfoVisitor(sessionInfoStore);
        reader.setExecutionDataVisitor(executionDataStore);
        reader.read();
      }
     }
 catch (    final IOException e) {
      System.out.println("String_Node_Str" + executionDataFile);
      e.printStackTrace();
    }
  }
}
Program: 47976
Project: 47976
Buggy source:
public ExecutionFileLoader(){
  execFiles=new ArrayList<FilePath>();
}

Fixed version (ground truth):
public ExecutionFileLoader(){
  execFiles=new ArrayList<>();
}
Program: 47977
Project: 47977
Buggy source:
public void setExcludes(String[] excludes){
  this.excludes=excludes;
}

Fixed version (ground truth):
public void setExcludes(String... excludes){
  this.excludes=excludes;
}
Program: 47978
Project: 47978
Buggy source:
public void setIncludes(String[] includes){
  this.includes=includes;
}

Fixed version (ground truth):
public void setIncludes(String... includes){
  this.includes=includes;
}
Program: 47981
Project: 47981
Buggy source:
/** 
 * Obtains the detailed   {@link CoverageReport} instance.
 */
public synchronized CoverageReport getResult(){
  if (report != null) {
    final CoverageReport r=report.get();
    if (r != null) {
      return r;
    }
  }
  final JacocoReportDir reportFolder=getJacocoReport();
  try {
    CoverageReport r=new CoverageReport(this,reportFolder.parse(inclusions,exclusions));
    report=new WeakReference<CoverageReport>(r);
    r.setThresholds(thresholds);
    return r;
  }
 catch (  IOException e) {
    getLogger().println("String_Node_Str" + reportFolder);
    e.printStackTrace(getLogger());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Obtains the detailed   {@link CoverageReport} instance.
 */
public synchronized CoverageReport getResult(){
  if (report != null) {
    final CoverageReport r=report.get();
    if (r != null) {
      return r;
    }
  }
  final JacocoReportDir reportFolder=getJacocoReport();
  try {
    CoverageReport r=new CoverageReport(this,reportFolder.parse(inclusions,exclusions));
    report=new WeakReference<>(r);
    r.setThresholds(thresholds);
    return r;
  }
 catch (  IOException e) {
    getLogger().println("String_Node_Str" + reportFolder);
    e.printStackTrace(getLogger());
    return null;
  }
}
Program: 47983
Project: 47983
Buggy source:
public FilePath[] invoke(File f,VirtualChannel channel) throws IOException {
  FilePath base=new FilePath(f);
  ArrayList<FilePath> localDirectoryPaths=new ArrayList<FilePath>();
  String[] includes=input.split(DIR_SEP);
  DirectoryScanner ds=new DirectoryScanner();
  ds.setIncludes(includes);
  ds.setCaseSensitive(false);
  ds.setBasedir(f);
  ds.scan();
  String[] dirs=ds.getIncludedDirectories();
  for (  String dir : dirs) {
    localDirectoryPaths.add(base.child(dir));
  }
  FilePath[] lfp={};
  return localDirectoryPaths.toArray(lfp);
}

Fixed version (ground truth):
public FilePath[] invoke(File f,VirtualChannel channel) throws IOException {
  FilePath base=new FilePath(f);
  ArrayList<FilePath> localDirectoryPaths=new ArrayList<>();
  String[] includes=input.split(DIR_SEP);
  DirectoryScanner ds=new DirectoryScanner();
  ds.setIncludes(includes);
  ds.setCaseSensitive(false);
  ds.setBasedir(f);
  ds.scan();
  String[] dirs=ds.getIncludedDirectories();
  for (  String dir : dirs) {
    localDirectoryPaths.add(base.child(dir));
  }
  FilePath[] lfp={};
  return localDirectoryPaths.toArray(lfp);
}
Program: 47984
Project: 47984
Buggy source:
protected static FilePath[] resolveDirPaths(FilePath workspace,TaskListener listener,final String input){
  FilePath[] directoryPaths=null;
  try {
    directoryPaths=workspace.act(new ResolveDirPaths(input));
  }
 catch (  InterruptedException ie) {
    ie.printStackTrace();
  }
catch (  IOException io) {
    io.printStackTrace();
  }
  return directoryPaths;
}

Fixed version (ground truth):
protected static FilePath[] resolveDirPaths(FilePath workspace,TaskListener listener,final String input){
  FilePath[] directoryPaths=null;
  try {
    directoryPaths=workspace.act(new ResolveDirPaths(input));
  }
 catch (  InterruptedException|IOException ie) {
    ie.printStackTrace();
  }
  return directoryPaths;
}
Program: 47985
Project: 47985
Buggy source:
@Override public boolean isApplicable(Class<? extends AbstractProject> aClass){
  return true;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public boolean isApplicable(Class<? extends AbstractProject> aClass){
  return true;
}
Program: 47987
Project: 47987
Buggy source:
/** 
 * Lists up existing jacoco.exec files.
 */
public List<File> getExecFiles(){
  List<File> r=new ArrayList<File>();
  int i=0;
  File root=getExecFilesDir();
  File checkPath;
  while ((checkPath=new File(root,"String_Node_Str" + i)).exists()) {
    r.add(new File(checkPath,"String_Node_Str"));
    i++;
  }
  return r;
}

Fixed version (ground truth):
/** 
 * Lists up existing jacoco.exec files.
 */
public List<File> getExecFiles(){
  List<File> r=new ArrayList<>();
  int i=0;
  File root=getExecFilesDir();
  File checkPath;
  while ((checkPath=new File(root,"String_Node_Str" + i)).exists()) {
    r.add(new File(checkPath,"String_Node_Str"));
    i++;
  }
  return r;
}
Program: 47988
Project: 47988
Buggy source:
/** 
 * Parses the saved "jacoco.exec" files into an   {@link ExecutionFileLoader}.
 */
public ExecutionFileLoader parse(String[] includes,String[] excludes) throws IOException {
  ExecutionFileLoader efl=new ExecutionFileLoader();
  for (  File exec : getExecFiles()) {
    efl.addExecFile(new FilePath(exec));
  }
  efl.setIncludes(includes);
  efl.setExcludes(excludes);
  efl.setClassDir(new FilePath(getClassesDir()));
  efl.setSrcDir(new FilePath(getSourcesDir()));
  efl.loadBundleCoverage();
  return efl;
}

Fixed version (ground truth):
/** 
 * Parses the saved "jacoco.exec" files into an   {@link ExecutionFileLoader}.
 */
public ExecutionFileLoader parse(String[] includes,String... excludes) throws IOException {
  ExecutionFileLoader efl=new ExecutionFileLoader();
  for (  File exec : getExecFiles()) {
    efl.addExecFile(new FilePath(exec));
  }
  efl.setIncludes(includes);
  efl.setExcludes(excludes);
  efl.setClassDir(new FilePath(getClassesDir()));
  efl.setSrcDir(new FilePath(getSourcesDir()));
  efl.loadBundleCoverage();
  return efl;
}
Program: 47989
Project: 47989
Buggy source:
public void apply(JFreeChart chart){
  final CategoryPlot plot=chart.getCategoryPlot();
  Map<Axis,Integer> axisIds=new HashMap<Axis,Integer>();
  int axisId=0;
  for (  Axis axis : axes) {
    LineAndShapeRenderer renderer=new LineAndShapeRenderer(true,false);
    renderer.setBaseStroke(new BasicStroke(baseStroke));
    plot.setRenderer(axisId,renderer);
    axisIds.put(axis,axisId);
    axisId++;
  }
  for (  Plot p : plots) {
    axisId=axisIds.get(p.axis);
    int lineIdPerAxis=plot.getDataset(axisId).getRowIndex(p.getMessage());
    LineAndShapeRenderer renderer=(LineAndShapeRenderer)plot.getRenderer(axisId);
    renderer.setSeriesPaint(lineIdPerAxis,p.color);
    renderer.setSeriesItemLabelPaint(lineIdPerAxis,p.color);
    renderer.setSeriesFillPaint(lineIdPerAxis,p.color);
  }
  chart.getLegend().setPosition(RectangleEdge.RIGHT);
  chart.setBackgroundPaint(Color.white);
  plot.setBackgroundPaint(Color.WHITE);
  plot.setOutlinePaint(null);
  plot.setRangeGridlinesVisible(true);
  plot.setRangeGridlinePaint(Color.black);
  plot.setInsets(new RectangleInsets(5.0,0,0,5.0));
}

Fixed version (ground truth):
public void apply(JFreeChart chart){
  final CategoryPlot plot=chart.getCategoryPlot();
  Map<Axis,Integer> axisIds=new HashMap<>();
  int axisId=0;
  for (  Axis axis : axes) {
    LineAndShapeRenderer renderer=new LineAndShapeRenderer(true,false);
    renderer.setBaseStroke(new BasicStroke(baseStroke));
    plot.setRenderer(axisId,renderer);
    axisIds.put(axis,axisId);
    axisId++;
  }
  for (  Plot p : plots) {
    axisId=axisIds.get(p.axis);
    int lineIdPerAxis=plot.getDataset(axisId).getRowIndex(p.getMessage());
    LineAndShapeRenderer renderer=(LineAndShapeRenderer)plot.getRenderer(axisId);
    renderer.setSeriesPaint(lineIdPerAxis,p.color);
    renderer.setSeriesItemLabelPaint(lineIdPerAxis,p.color);
    renderer.setSeriesFillPaint(lineIdPerAxis,p.color);
  }
  chart.getLegend().setPosition(RectangleEdge.RIGHT);
  chart.setBackgroundPaint(Color.white);
  plot.setBackgroundPaint(Color.WHITE);
  plot.setOutlinePaint(null);
  plot.setRangeGridlinesVisible(true);
  plot.setRangeGridlinePaint(Color.black);
  plot.setInsets(new RectangleInsets(5.0,0,0,5.0));
}
Program: 47990
Project: 47990
Buggy source:
@Override protected JFreeChart createGraph(){
  Map<Axis,CategoryDataset> dataSets=new LinkedHashMap<Axis,CategoryDataset>();
  Map<Axis,DataSetBuilder<String,NumberOnlyBuildLabel>> dataSetBuilders=createDataSetBuilder(obj);
  for (  Entry<Axis,DataSetBuilder<String,NumberOnlyBuildLabel>> e : dataSetBuilders.entrySet()) {
    dataSets.put(e.getKey(),e.getValue().build());
  }
  List<Axis> axes=new ArrayList<Axis>(dataSets.keySet());
  final JFreeChart chart=ChartFactory.createLineChart(null,null,null,dataSets.get(axes.get(0)),PlotOrientation.VERTICAL,true,true,false);
  final CategoryPlot plot=chart.getCategoryPlot();
  CategoryAxis domainAxis=new ShiftedCategoryAxis(null);
  plot.setDomainAxis(domainAxis);
  domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
  domainAxis.setLowerMargin(0.0);
  domainAxis.setUpperMargin(0.0);
  domainAxis.setCategoryMargin(0.0);
  int axisId=0;
  for (  Axis axis : axes) {
    int di=axisId;
    plot.setDataset(di,dataSets.get(axis));
    plot.mapDatasetToRangeAxis(di,axisId);
    NumberAxis numberAxis=new NumberAxis(axis.getLabel());
    plot.setRangeAxis(axisId,numberAxis);
    numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    setBounds(axis,numberAxis);
    axisId++;
  }
  layout.apply(chart);
  return chart;
}

Fixed version (ground truth):
@Override protected JFreeChart createGraph(){
  Map<Axis,CategoryDataset> dataSets=new LinkedHashMap<>();
  Map<Axis,DataSetBuilder<String,NumberOnlyBuildLabel>> dataSetBuilders=createDataSetBuilder(obj);
  for (  Entry<Axis,DataSetBuilder<String,NumberOnlyBuildLabel>> e : dataSetBuilders.entrySet()) {
    dataSets.put(e.getKey(),e.getValue().build());
  }
  List<Axis> axes=new ArrayList<>(dataSets.keySet());
  final JFreeChart chart=ChartFactory.createLineChart(null,null,null,dataSets.get(axes.get(0)),PlotOrientation.VERTICAL,true,true,false);
  final CategoryPlot plot=chart.getCategoryPlot();
  CategoryAxis domainAxis=new ShiftedCategoryAxis(null);
  plot.setDomainAxis(domainAxis);
  domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
  domainAxis.setLowerMargin(0.0);
  domainAxis.setUpperMargin(0.0);
  domainAxis.setCategoryMargin(0.0);
  int axisId=0;
  for (  Axis axis : axes) {
    int di=axisId;
    plot.setDataset(di,dataSets.get(axis));
    plot.mapDatasetToRangeAxis(di,axisId);
    NumberAxis numberAxis=new NumberAxis(axis.getLabel());
    plot.setRangeAxis(axisId,numberAxis);
    numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    setBounds(axis,numberAxis);
    axisId++;
  }
  layout.apply(chart);
  return chart;
}
Program: 47992
Project: 47992
Buggy source:
/** 
 * Get JaCoCo coverage results of all jobs and store into a sorted HashMap by date.
 * @param jobs jobs of Dashboard view
 * @param daysNumber number of days
 * @return Map The sorted summaries
 */
public static Map<LocalDate,JacocoCoverageResultSummary> loadChartDataWithinRange(List<Job> jobs,int daysNumber){
  Map<LocalDate,JacocoCoverageResultSummary> summaries=new HashMap<LocalDate,JacocoCoverageResultSummary>();
  LocalDate lastDate=Utils.getLastDate(jobs);
  if (lastDate == null) {
    return null;
  }
  LocalDate firstDate=lastDate.minusDays(daysNumber);
  for (  Job<?,?> job : jobs) {
    Run<?,?> run=job.getLastCompletedBuild();
    if (null != run) {
      LocalDate runDate=new LocalDate(run.getTimestamp());
      while (runDate.isAfter(firstDate)) {
        summarize(summaries,run,runDate,job);
        run=run.getPreviousBuild();
        while (run != null && run.isBuilding()) {
          run=run.getPreviousBuild();
        }
        if (null == run) {
          break;
        }
        runDate=new LocalDate(run.getTimestamp());
      }
    }
  }
  Map<LocalDate,JacocoCoverageResultSummary> sortedSummaries=new TreeMap<LocalDate,JacocoCoverageResultSummary>(summaries);
  return sortedSummaries;
}

Fixed version (ground truth):
/** 
 * Get JaCoCo coverage results of all jobs and store into a sorted HashMap by date.
 * @param jobs jobs of Dashboard view
 * @param daysNumber number of days
 * @return Map The sorted summaries
 */
public static Map<LocalDate,JacocoCoverageResultSummary> loadChartDataWithinRange(List<Job<?,?>> jobs,int daysNumber){
  Map<LocalDate,JacocoCoverageResultSummary> summaries=new HashMap<>();
  LocalDate lastDate=Utils.getLastDate(jobs);
  if (lastDate == null) {
    return null;
  }
  LocalDate firstDate=lastDate.minusDays(daysNumber);
  for (  Job<?,?> job : jobs) {
    Run<?,?> run=job.getLastCompletedBuild();
    if (null != run) {
      LocalDate runDate=new LocalDate(run.getTimestamp());
      while (runDate.isAfter(firstDate)) {
        summarize(summaries,run,runDate,job);
        run=run.getPreviousBuild();
        while (run != null && run.isBuilding()) {
          run=run.getPreviousBuild();
        }
        if (null == run) {
          break;
        }
        runDate=new LocalDate(run.getTimestamp());
      }
    }
  }
  Map<LocalDate,JacocoCoverageResultSummary> sortedSummaries=new TreeMap<>(summaries);
  return sortedSummaries;
}
Program: 47993
Project: 47993
Buggy source:
/** 
 * Getter of the total of block coverage.
 * @return float the total of block coverage.
 */
public float getTotalInstructionCoverage(){
  if (this.getCoverageResults().size() <= 0) {
    return 0.0f;
  }
  float totalInstr=this.getInstructionCoverage() / this.getCoverageResults().size();
  totalInstr=Utils.roundFLoat(1,BigDecimal.ROUND_HALF_EVEN,totalInstr);
  return totalInstr;
}

Fixed version (ground truth):
/** 
 * Getter of the total of block coverage.
 * @return float the total of block coverage.
 */
public float getTotalInstructionCoverage(){
  if (this.getCoverageResults().size() <= 0) {
    return 0.0f;
  }
  float totalInstr=this.getInstructionCoverage() / this.getCoverageResults().size();
  totalInstr=Utils.roundFloat(1,RoundingMode.HALF_EVEN,totalInstr);
  return totalInstr;
}