nus-yam/ex-repair huggingface dataset:
Program: 162980
Project: 162980
Buggy source:
@Override public long nextPos(){
  long pos=searchPos;
  while (true) {
    long entry=bytes.readLong(pos);
    if (entry == UNSET_ENTRY) {
      searchPos=pos;
      return -1L;
    }
    pos=step(pos);
    if (key(entry) == searchHash) {
      searchPos=pos;
      return value(entry);
    }
  }
}

Fixed version (ground truth):
@Override public long nextPos(SearchState searchState){
  long pos=searchState.searchPos;
  while (true) {
    long entry=bytes.readLong(pos);
    if (entry == UNSET_ENTRY) {
      searchState.searchPos=pos;
      return -1L;
    }
    pos=step(pos);
    if (key(entry) == searchState.searchHash) {
      searchState.searchPos=pos;
      return value(entry);
    }
  }
}
Program: 162981
Project: 162981
Buggy source:
@Override public void removePrevPos(){
  long prevPos=stepBack(searchPos);
  long entry=bytes.readLong(prevPos);
  positions.clear(value(entry));
  removePos(prevPos);
}

Fixed version (ground truth):
@Override public void removePrevPos(SearchState searchState){
  long prevPos=stepBack(searchState.searchPos);
  long entry=bytes.readLong(prevPos);
  positions.clear(value(entry));
  removePos(prevPos);
}
Program: 162982
Project: 162982
Buggy source:
/** 
 * Used for start a search for a given key
 */
void startSearch(long key);

Fixed version (ground truth):
/** 
 * Used for start a search for a given key
 */
void startSearch(long key,SearchState searchStateToReuse);
Program: 162983
Project: 162983
Buggy source:
void replacePrevPos(long newValue);

Fixed version (ground truth):
void replacePrevPos(SearchState searchState,long newValue);
Program: 162984
Project: 162984
Buggy source:
/** 
 * Used for getting the next position for a given key
 * @return the next position for the last search or negative value
 */
long nextPos();

Fixed version (ground truth):
/** 
 * Used for getting the next position for a given key
 * @return the next position for the last search or negative value
 */
long nextPos(SearchState searchState);
Program: 162985
Project: 162985
Buggy source:
void removePrevPos();

Fixed version (ground truth):
void removePrevPos(SearchState searchState);
Program: 162986
Project: 162986
Buggy source:
void putAfterFailedSearch(long value);

Fixed version (ground truth):
void putAfterFailedSearch(SearchState searchState,long value);
Program: 162989
Project: 162989
Buggy source:
@Parameterized.Parameters public static Collection<Object[]> data(){
  return Arrays.asList(new Object[][]{{TypeOfMap.SIMPLE},{TypeOfMap.REPLICATED},{TypeOfMap.STATELESS}});
}

Fixed version (ground truth):
@Parameterized.Parameters public static Collection<Object[]> data(){
  return asList(new Object[][]{{TypeOfMap.SIMPLE},{TypeOfMap.REPLICATED},{TypeOfMap.STATELESS}});
}
Program: 162990
Project: 162990
Buggy source:
@Test public void testSetValue() throws IOException {
  if (typeOfMap == TypeOfMap.STATELESS)   return;
  ChronicleMapBuilder<String,Set<String>> builder=ChronicleMapBuilder.of(String.class,(Class<Set<String>>)(Class)Set.class).valueMarshaller(SetMarshaller.of(new StringMarshaller(8)));
  try (ChronicleMap<String,Set<String>> map=newInstance(builder)){
    map.put("String_Node_Str",Collections.<String>emptySet());
    map.put("String_Node_Str",new LinkedHashSet<String>(Arrays.asList("String_Node_Str")));
    Set<String> list1=new LinkedHashSet<>();
    try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(new LinkedHashSet<String>(Arrays.asList("String_Node_Str")),list1);
    }
     Set<String> list2=new LinkedHashSet<>();
    try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(new LinkedHashSet<String>(Arrays.asList("String_Node_Str")),list2);
    }
     try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(new LinkedHashSet<String>(Arrays.asList("String_Node_Str","String_Node_Str")),list1);
    }
     try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(new LinkedHashSet<String>(Arrays.asList("String_Node_Str","String_Node_Str")),list2);
    }
   }
 }

Fixed version (ground truth):
@Test public void testSetValue() throws IOException {
  if (typeOfMap == TypeOfMap.STATELESS)   return;
  ChronicleMapBuilder<String,Set<String>> builder=ChronicleMapBuilder.of(String.class,(Class<Set<String>>)(Class)Set.class).valueMarshaller(SetMarshaller.of(new StringMarshaller(8)));
  try (ChronicleMap<String,Set<String>> map=newInstance(builder)){
    map.put("String_Node_Str",Collections.<String>emptySet());
    map.put("String_Node_Str",new LinkedHashSet<String>(asList("String_Node_Str")));
    Set<String> list1=new LinkedHashSet<>();
    try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(new LinkedHashSet<String>(asList("String_Node_Str")),list1);
    }
     Set<String> list2=new LinkedHashSet<>();
    try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(new LinkedHashSet<String>(asList("String_Node_Str")),list2);
    }
     try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(new LinkedHashSet<String>(asList("String_Node_Str","String_Node_Str")),list1);
    }
     try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(new LinkedHashSet<String>(asList("String_Node_Str","String_Node_Str")),list2);
    }
   }
 }
Program: 162991
Project: 162991
Buggy source:
@Test @Ignore("String_Node_Str") public void testCharArrayValue() throws ExecutionException, InterruptedException, IOException {
  int valueSize=10;
  char[] expected=new char[valueSize];
  Arrays.fill(expected,'X');
  ChronicleMapBuilder<CharSequence,char[]> builder=ChronicleMapBuilder.of(CharSequence.class,char[].class);
  try (ChronicleMap<CharSequence,char[]> map=newInstance(builder)){
    map.put("String_Node_Str",expected);
    char[] actual=map.get("String_Node_Str");
    System.out.println(actual);
    assertTrue(Arrays.equals(expected,map.get("String_Node_Str")));
  }
 }

Fixed version (ground truth):
@Test public void testCharArrayValue() throws ExecutionException, InterruptedException, IOException {
  int valueSize=10;
  char[] expected=new char[valueSize];
  Arrays.fill(expected,'X');
  ChronicleMapBuilder<CharSequence,char[]> builder=ChronicleMapBuilder.of(CharSequence.class,char[].class);
  try (ChronicleMap<CharSequence,char[]> map=newInstance(builder)){
    map.put("String_Node_Str",expected);
    char[] actual=map.get("String_Node_Str");
    System.out.println(actual);
    assertEquals(Chars.asList(expected),Chars.asList(map.get("String_Node_Str")));
  }
 }
Program: 162992
Project: 162992
Buggy source:
@Test public void testListValue() throws IOException {
  if (typeOfMap == TypeOfMap.STATELESS)   return;
  ChronicleMapBuilder<String,List<String>> builder=ChronicleMapBuilder.of(String.class,(Class<List<String>>)(Class)List.class).valueMarshaller(ListMarshaller.of(new StringMarshaller(8)));
  try (ChronicleMap<String,List<String>> map=newInstance(builder)){
    map.put("String_Node_Str",Collections.<String>emptyList());
    map.put("String_Node_Str",Arrays.asList("String_Node_Str"));
    List<String> list1=new ArrayList<>();
    try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(Arrays.asList("String_Node_Str"),list1);
    }
     List<String> list2=new ArrayList<>();
    try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(Arrays.asList("String_Node_Str"),list2);
    }
     try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      list2.add("String_Node_Str");
      assertEquals(Arrays.asList("String_Node_Str","String_Node_Str"),list2);
    }
     try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(Arrays.asList("String_Node_Str","String_Node_Str"),list1);
    }
     try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(Arrays.asList("String_Node_Str","String_Node_Str"),list2);
    }
   }
 }

Fixed version (ground truth):
@Test public void testListValue() throws IOException {
  if (typeOfMap == TypeOfMap.STATELESS)   return;
  ChronicleMapBuilder<String,List<String>> builder=ChronicleMapBuilder.of(String.class,(Class<List<String>>)(Class)List.class).valueMarshaller(ListMarshaller.of(new StringMarshaller(8)));
  try (ChronicleMap<String,List<String>> map=newInstance(builder)){
    map.put("String_Node_Str",Collections.<String>emptyList());
    map.put("String_Node_Str",asList("String_Node_Str"));
    List<String> list1=new ArrayList<>();
    try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(asList("String_Node_Str"),list1);
    }
     List<String> list2=new ArrayList<>();
    try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(asList("String_Node_Str"),list2);
    }
     try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      list2.add("String_Node_Str");
      assertEquals(asList("String_Node_Str","String_Node_Str"),list2);
    }
     try (WriteContext wc=map.acquireUsingLocked("String_Node_Str",list1)){
      list1.add("String_Node_Str");
      assertEquals(asList("String_Node_Str","String_Node_Str"),list1);
    }
     try (ReadContext rc=map.getUsingLocked("String_Node_Str",list2)){
      assertTrue(rc.present());
      assertEquals(asList("String_Node_Str","String_Node_Str"),list2);
    }
   }
 }
Program: 162995
Project: 162995
Buggy source:
private void clearMetaData(long offset){
  if (metaDataBytes > 0)   bytes.zeroOut(offset,offset + metaDataBytes);
}

Fixed version (ground truth):
final void clearMetaData(long offset){
  if (metaDataBytes > 0)   bytes.zeroOut(offset,offset + metaDataBytes);
}
Program: 162996
Project: 162996
Buggy source:
private long alloc(int blocks){
  if (blocks > maxEntryOversizeFactor)   throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str"+ maxEntryOversizeFactor+ "String_Node_Str");
  long ret=freeList.setNextNContinuousClearBits(nextPosToSearchFrom,blocks);
  if (ret == DirectBitSet.NOT_FOUND || ret + blocks > entriesPerSegment) {
    if (ret + blocks > entriesPerSegment)     freeList.clear(ret,ret + blocks);
    ret=freeList.setNextNContinuousClearBits(0L,blocks);
    if (ret == DirectBitSet.NOT_FOUND || ret + blocks > entriesPerSegment) {
      if (ret + blocks > entriesPerSegment)       freeList.clear(ret,ret + blocks);
      if (blocks == 1) {
        throw new IllegalStateException("String_Node_Str");
      }
 else {
        throw new IllegalStateException("String_Node_Str" + blocks + "String_Node_Str");
      }
    }
    updateNextPosToSearchFrom(ret,blocks);
  }
 else {
    if (blocks == 1 || freeList.isSet(nextPosToSearchFrom)) {
      updateNextPosToSearchFrom(ret,blocks);
    }
  }
  return ret;
}

Fixed version (ground truth):
final long alloc(int blocks){
  if (blocks > maxEntryOversizeFactor)   throw new IllegalArgumentException("String_Node_Str" + blocks + "String_Node_Str"+ maxEntryOversizeFactor+ "String_Node_Str");
  long ret=freeList.setNextNContinuousClearBits(nextPosToSearchFrom,blocks);
  if (ret == DirectBitSet.NOT_FOUND || ret + blocks > entriesPerSegment) {
    if (ret + blocks > entriesPerSegment)     freeList.clear(ret,ret + blocks);
    ret=freeList.setNextNContinuousClearBits(0L,blocks);
    if (ret == DirectBitSet.NOT_FOUND || ret + blocks > entriesPerSegment) {
      if (ret + blocks > entriesPerSegment)       freeList.clear(ret,ret + blocks);
      if (blocks == 1) {
        throw new IllegalStateException("String_Node_Str");
      }
 else {
        throw new IllegalStateException("String_Node_Str" + blocks + "String_Node_Str");
      }
    }
    updateNextPosToSearchFrom(ret,blocks);
  }
 else {
    if (blocks == 1 || freeList.isSet(nextPosToSearchFrom)) {
      updateNextPosToSearchFrom(ret,blocks);
    }
  }
  return ret;
}
Program: 162998
Project: 162998
Buggy source:
/** 
 * @throws IOException
 */
public ReplicationHubFindByName(ReplicationHub replicationHub) throws IOException {
  LOG.info("String_Node_Str" + replicationHub);
  this.replicationHub=replicationHub;
  ReplicationChannel channel=replicationHub.createChannel((short)MAP_BY_NAME_CHANNEL);
  final MapEventListener<CharSequence,MapInstanceConfig> listener=new MapEventListener<CharSequence,MapInstanceConfig>(){
    @Override public void onPut(    CharSequence key,    MapInstanceConfig value,    MapInstanceConfig replacedValue){
      super.onPut(key,value,replacedValue);
      boolean added=replacedValue == null;
      if (!added || value == null)       return;
      LOG.info("String_Node_Str" + value.name + "String_Node_Str"+ value.channel.channelId());
      try {
        toReplicatedViaChannel(value.mapBuilder,value.channel.channelId()).create();
      }
 catch (      IllegalStateException e) {
        LOG.debug("String_Node_Str" + value.name + "String_Node_Str"+ value.channel.channelId(),e);
      }
catch (      IOException e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
;
  this.map=(Map)ChronicleMapBuilder.of(CharSequence.class,MapInstanceConfig.class).entrySize(3000).entries(128).eventListener(listener).instance().replicatedViaChannel(channel).create();
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + map);
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
public ReplicationHubFindByName(ReplicationHub replicationHub) throws IOException {
  LOG.info("String_Node_Str" + replicationHub);
  this.replicationHub=replicationHub;
  ReplicationChannel channel=replicationHub.createChannel((short)MAP_BY_NAME_CHANNEL);
  final MapEventListener<CharSequence,MapInstanceConfig> listener=new MapEventListener<CharSequence,MapInstanceConfig>(){
    @Override public void onPut(    CharSequence key,    MapInstanceConfig value,    MapInstanceConfig replacedValue){
      super.onPut(key,value,replacedValue);
      boolean added=replacedValue == null;
      if (!added || value == null)       return;
      LOG.info("String_Node_Str" + value.name + "String_Node_Str"+ value.channel.channelId());
      try {
        toReplicatedViaChannel(value.mapBuilder,value.channel.channelId()).create();
      }
 catch (      IllegalStateException e) {
        LOG.debug("String_Node_Str" + value.name + "String_Node_Str"+ value.channel.channelId(),e);
      }
catch (      IOException e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
;
  this.map=(Map)ChronicleMapBuilder.of(CharSequence.class,MapInstanceConfig.class).entrySize(4000).entries(128).eventListener(listener).instance().replicatedViaChannel(channel).create();
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + map);
}
Program: 162999
Project: 162999
Buggy source:
@Test @Ignore public void testLarge() throws Exception {
  int s=8 * 1024;
  for (int i=0; i < 10; i++) {
    System.out.println("String_Node_Str" + i);
    int entries=s * s;
    testEntriesMaxSize(s,entries * 4 / 5,entries * 4 / 3,i);
    entries*=2;
    testEntriesMaxSize(s,entries * 4 / 5,entries * 4 / 3,i);
  }
  System.out.printf("String_Node_Str",scoreCount / score);
}

Fixed version (ground truth):
@Test @Ignore("String_Node_Str") public void testLarge() throws Exception {
  int s=8 * 1024;
  for (int i=0; i < 10; i++) {
    System.out.println("String_Node_Str" + i);
    int entries=s * s;
    testEntriesMaxSize(s,entries * 4 / 5,entries * 4 / 3,i);
    entries*=2;
    testEntriesMaxSize(s,entries * 4 / 5,entries * 4 / 3,i);
  }
  System.out.printf("String_Node_Str",scoreCount / score);
}
Program: 163000
Project: 163000
Buggy source:
@Test @Ignore("String_Node_Str") public void testSerializingBuilder() throws TimeoutException, InterruptedException, IOException {
  final MapInstanceConfig<CharSequence,CharSequence> config=(MapInstanceConfig<CharSequence,CharSequence>)ChronicleMapBuilder.of(CharSequence.class,CharSequence.class).entries(2).minSegments(2).replication((byte)1,TcpTransportAndNetworkConfig.of(8244)).removeReturnsNull(true).instance().name("String_Node_Str");
  final ChronicleMap<CharSequence,CharSequence> map=findMapByName.create(config);
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(map.get("String_Node_Str"),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSerializingBuilder() throws TimeoutException, InterruptedException, IOException {
  final MapInstanceConfig<CharSequence,CharSequence> config=(MapInstanceConfig<CharSequence,CharSequence>)ChronicleMapBuilder.of(CharSequence.class,CharSequence.class).entrySize(900).entries(2).minSegments(2).replication((byte)1,TcpTransportAndNetworkConfig.of(8244)).removeReturnsNull(true).instance().name("String_Node_Str");
  final ChronicleMap<CharSequence,CharSequence> map=findMapByName.create(config);
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(map.get("String_Node_Str"),"String_Node_Str");
}
Program: 163001
Project: 163001
Buggy source:
@Override public final void readUnlock(){
  try {
    segmentHeader.unlockRWReadLock(LOCK_OFFSET);
  }
 catch (  IllegalMonitorStateException e) {
    errorListener.errorOnUnlock(e);
  }
}

Fixed version (ground truth):
@Override public final void readUnlock(){
  try {
    segmentHeader.unlockRWWriteLock(LOCK_OFFSET);
  }
 catch (  IllegalMonitorStateException e) {
    errorListener.errorOnUnlock(e);
  }
}
Program: 163002
Project: 163002
Buggy source:
@Override public final ReadLocked<K,KI,MKI,V,VI,MVI> readLock(@Nullable SegmentState segmentState){
  while (true) {
    final boolean success=segmentHeader.tryRWReadLock(LOCK_OFFSET,lockTimeOutNS);
    if (success) {
      if (segmentState != null) {
        return segmentState.readLocked(this);
      }
 else {
        return null;
      }
    }
    if (currentThread().isInterrupted()) {
      throw new IllegalStateException(new InterruptedException("String_Node_Str"));
    }
 else {
      errorListener.onLockTimeout(segmentHeader.threadIdForLockLong(LOCK_OFFSET));
      segmentHeader.resetLockLong(LOCK_OFFSET);
    }
  }
}

Fixed version (ground truth):
@Override public final ReadLocked<K,KI,MKI,V,VI,MVI> readLock(@Nullable SegmentState segmentState){
  while (true) {
    final boolean success=segmentHeader.tryRWWriteLock(LOCK_OFFSET,lockTimeOutNS);
    if (success) {
      if (segmentState != null) {
        return segmentState.readLocked(this);
      }
 else {
        return null;
      }
    }
    if (currentThread().isInterrupted()) {
      throw new IllegalStateException(new InterruptedException("String_Node_Str"));
    }
 else {
      errorListener.onLockTimeout(segmentHeader.threadIdForLockLong(LOCK_OFFSET));
      segmentHeader.resetLockLong(LOCK_OFFSET);
    }
  }
}
Program: 163003
Project: 163003
Buggy source:
void exerciseLargeStrings(ChronicleMap<String,String> map,int run,int start,int finish,int entrySize){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  XMLEncoder xml=new XMLEncoder(baos);
  Map<String,String> map2=new HashMap<>();
  Random rand=new Random(1);
  for (int i=0; i < entrySize / 80; i++)   map2.put("String_Node_Str" + i,"String_Node_Str" + rand.nextInt(1000));
  xml.writeObject(map2);
  xml.close();
  String value=baos.toString().substring(0,entrySize);
  if (run == 0) {
    DirectBytes bytes=DirectStore.allocate(entrySize).bytes();
    SnappyStringMarshaller.INSTANCE.write(bytes,value);
    bytes.flip();
    SnappyStringMarshaller.INSTANCE.read(bytes);
    bytes.release();
  }
  Object lock=TESTING ? Thread.currentThread() : map;
  List<String> keys=new ArrayList<>();
  for (int i=start; i < finish; i++) {
    String key="String_Node_Str" + i;
    String object;
synchronized (lock) {
      map.put(key,value);
      keys.add(key);
      for (      String s : keys)       assertTrue(s,map.containsKey(s));
      object=map.get(key);
      assertTrue(key,map.containsKey(key));
    }
    assertNotNull(key,object);
    assertEquals(key,entrySize,object.length());
  }
  for (int i=start; i < finish; i++) {
    String key="String_Node_Str" + i;
synchronized (lock) {
      String object=map.get(key);
      assertNotNull(key,object);
      assertEquals(key,entrySize,object.length());
    }
  }
}

Fixed version (ground truth):
void exerciseLargeStrings(ChronicleMap<String,String> map,int run,int start,int finish,int entrySize){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  XMLEncoder xml=new XMLEncoder(baos);
  Map<String,String> map2=new HashMap<>();
  Random rand=new Random(1);
  for (int i=0; i < entrySize / 80; i++)   map2.put("String_Node_Str" + i,"String_Node_Str" + rand.nextInt(1000));
  xml.writeObject(map2);
  xml.close();
  String value=baos.toString().substring(0,entrySize);
  if (run == 0) {
    DirectBytes bytes=DirectStore.allocate(entrySize).bytes();
    SnappyStringMarshaller.INSTANCE.write(bytes,value);
    bytes.flip();
    SnappyStringMarshaller.INSTANCE.read(bytes);
    bytes.release();
  }
  for (int i=start; i < finish; i++) {
    String key="String_Node_Str" + i;
    String object;
    map.put(key,value);
    object=map.get(key);
    assertTrue(key,map.containsKey(key));
    assertNotNull(key,object);
    assertEquals(key,entrySize,object.length());
  }
  for (int i=start; i < finish; i++) {
    String key="String_Node_Str" + i;
    String object=map.get(key);
    assertNotNull(key,object);
    assertEquals(key,entrySize,object.length());
  }
}
Program: 163004
Project: 163004
Buggy source:
@Test @Ignore public void testLargeStrings() throws ExecutionException, InterruptedException {
  final ChronicleMap<String,String> map=ChronicleMapBuilder.of(String.class,String.class).valueMarshaller(SnappyStringMarshaller.INSTANCE).actualSegments(1).entries(ENTRIES * 2).entrySize(ENTRY_SIZE / 4).putReturnsNull(true).create();
{
    int threads=4;
    ExecutorService es=Executors.newFixedThreadPool(threads);
    final int block=ENTRIES / threads;
    for (int i=0; i < 3; i++) {
      long start=System.currentTimeMillis();
      List<Future<?>> futureList=new ArrayList<>();
      for (int t=0; t < threads; t++) {
        final int finalT=t;
        final int finalI=i;
        futureList.add(es.submit(new Runnable(){
          @Override public void run(){
            exerciseLargeStrings(map,finalI,finalT * block,finalT * block + block,ENTRY_SIZE);
          }
        }
));
      }
      for (      Future<?> future : futureList) {
        future.get();
      }
      long time=System.currentTimeMillis() - start;
      long operations=3;
      System.out.printf("String_Node_Str",operations * ENTRIES * ENTRY_SIZE / 1e6 / (time / 1e3));
    }
    es.shutdown();
    if (es.isTerminated())     map.close();
  }
}

Fixed version (ground truth):
@Test @Ignore public void testLargeStrings() throws ExecutionException, InterruptedException, IOException {
  File file=File.createTempFile("String_Node_Str","String_Node_Str");
  final ChronicleMap<String,String> map=ChronicleMapBuilder.of(String.class,String.class).valueMarshaller(SnappyStringMarshaller.INSTANCE).actualSegments(1).entries(ENTRIES * 2).entrySize(ENTRY_SIZE / 4).putReturnsNull(true).createPersistedTo(file);
{
    int threads=4;
    ExecutorService es=Executors.newFixedThreadPool(threads);
    final int block=ENTRIES / threads;
    for (int i=0; i < 3; i++) {
      long start=System.currentTimeMillis();
      List<Future<?>> futureList=new ArrayList<>();
      for (int t=0; t < threads; t++) {
        final int finalT=t;
        final int finalI=i;
        futureList.add(es.submit(new Runnable(){
          @Override public void run(){
            exerciseLargeStrings(map,finalI,finalT * block,finalT * block + block,ENTRY_SIZE);
          }
        }
));
      }
      for (      Future<?> future : futureList) {
        future.get();
      }
      long time=System.currentTimeMillis() - start;
      long operations=3;
      System.out.printf("String_Node_Str",operations * ENTRIES * ENTRY_SIZE / 1e6 / (time / 1e3));
    }
    es.shutdown();
    if (es.isTerminated())     map.close();
  }
}
Program: 163005
Project: 163005
Buggy source:
private synchronized SocketChannel lazyConnect(final long timeoutMs,final InetSocketAddress remoteAddress){
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + remoteAddress);
  SocketChannel result;
  long timeoutAt=System.currentTimeMillis() + timeoutMs;
  for (; ; ) {
    checkTimeout(timeoutAt);
    closeExisting();
    try {
      result=AbstractChannelReplicator.openSocketChannel(closeables);
      result.connect(config.remoteAddress());
      result.socket().setTcpNoDelay(true);
      doHandShaking(result);
      break;
    }
 catch (    IOException e) {
      if (closeables != null)       closeables.closeQuietly();
    }
catch (    Exception e) {
      if (closeables != null)       closeables.closeQuietly();
      throw e;
    }
  }
  return result;
}

Fixed version (ground truth):
private synchronized SocketChannel lazyConnect(final long timeoutMs,final InetSocketAddress remoteAddress){
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + remoteAddress + "String_Node_Str"+ name);
  SocketChannel result;
  long timeoutAt=System.currentTimeMillis() + timeoutMs;
  for (; ; ) {
    checkTimeout(timeoutAt);
    closeExisting();
    try {
      result=AbstractChannelReplicator.openSocketChannel(closeables);
      result.connect(config.remoteAddress());
      result.socket().setTcpNoDelay(true);
      doHandShaking(result);
      break;
    }
 catch (    IOException e) {
      if (closeables != null)       closeables.closeQuietly();
    }
catch (    Exception e) {
      if (closeables != null)       closeables.closeQuietly();
      throw e;
    }
  }
  return result;
}
Program: 163006
Project: 163006
Buggy source:
/** 
 * initiates a very simple level of handshaking with the remote server, we send a special ID of -127 ( when the server receives this it knows its dealing with a stateless client, receive back an identifier from the server
 * @param clientChannel clientChannel
 * @throws java.io.IOException
 */
private synchronized void doHandShaking(@NotNull final SocketChannel clientChannel) throws IOException {
  connectionByte[0]=STATELESS_CLIENT_IDENTIFIER;
  this.connectionOutBuffer.clear();
  long timeoutTime=System.currentTimeMillis() + config.timeoutMs();
  while (connectionOutBuffer.hasRemaining()) {
    clientChannel.write(connectionOutBuffer);
    checkTimeout(timeoutTime);
  }
  this.connectionOutBuffer.clear();
  if (!clientChannel.finishConnect() || !clientChannel.socket().isBound())   return;
  while (this.connectionOutBuffer.position() <= 0) {
    clientChannel.read(this.connectionOutBuffer);
    checkTimeout(timeoutTime);
  }
  byte remoteIdentifier=connectionByte[0];
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + remoteIdentifier);
}

Fixed version (ground truth):
/** 
 * initiates a very simple level of handshaking with the remote server, we send a special ID of -127 ( when the server receives this it knows its dealing with a stateless client, receive back an identifier from the server
 * @param clientChannel clientChannel
 * @throws java.io.IOException
 */
private synchronized void doHandShaking(@NotNull final SocketChannel clientChannel) throws IOException {
  connectionByte[0]=STATELESS_CLIENT_IDENTIFIER;
  this.connectionOutBuffer.clear();
  long timeoutTime=System.currentTimeMillis() + config.timeoutMs();
  while (connectionOutBuffer.hasRemaining()) {
    clientChannel.write(connectionOutBuffer);
    checkTimeout(timeoutTime);
  }
  this.connectionOutBuffer.clear();
  if (!clientChannel.finishConnect() || !clientChannel.socket().isBound())   return;
  while (this.connectionOutBuffer.position() <= 0) {
    clientChannel.read(this.connectionOutBuffer);
    checkTimeout(timeoutTime);
  }
  byte remoteIdentifier=connectionByte[0];
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + remoteIdentifier + "String_Node_Str"+ name);
}
Program: 163007
Project: 163007
Buggy source:
StatelessChronicleMap(@NotNull final StatelessMapConfig config,@NotNull final ChronicleMapBuilder chronicleMapBuilder) throws IOException {
  this.chronicleMapBuilder=chronicleMapBuilder;
  this.config=config;
  keyReaderWithSize=new ReaderWithSize<>(chronicleMapBuilder.keyBuilder);
  keyWriterWithSize=new WriterWithSize<>(chronicleMapBuilder.keyBuilder);
  valueReaderWithSize=new ReaderWithSize<>(chronicleMapBuilder.valueBuilder);
  valueWriterWithSize=new WriterWithSize<>(chronicleMapBuilder.valueBuilder);
  this.putReturnsNull=chronicleMapBuilder.putReturnsNull();
  this.removeReturnsNull=chronicleMapBuilder.removeReturnsNull();
  this.maxEntrySize=chronicleMapBuilder.entrySize(true);
  if (maxEntrySize < 128)   maxEntrySize=128;
  this.vClass=chronicleMapBuilder.valueBuilder.eClass;
  this.kClass=chronicleMapBuilder.keyBuilder.eClass;
  this.name=config.name();
  attemptConnect(config.remoteAddress());
  outBuffer=allocateDirect(maxEntrySize).order(ByteOrder.nativeOrder());
  outBytes=new ByteBufferBytes(outBuffer.slice());
  inBuffer=allocateDirect(maxEntrySize).order(ByteOrder.nativeOrder());
  inBytes=new ByteBufferBytes(outBuffer.slice());
}

Fixed version (ground truth):
StatelessChronicleMap(@NotNull final StatelessMapConfig config,@NotNull final ChronicleMapBuilder chronicleMapBuilder) throws IOException {
  this.config=config;
  keyReaderWithSize=new ReaderWithSize<>(chronicleMapBuilder.keyBuilder);
  keyWriterWithSize=new WriterWithSize<>(chronicleMapBuilder.keyBuilder);
  valueReaderWithSize=new ReaderWithSize<>(chronicleMapBuilder.valueBuilder);
  valueWriterWithSize=new WriterWithSize<>(chronicleMapBuilder.valueBuilder);
  this.putReturnsNull=chronicleMapBuilder.putReturnsNull();
  this.removeReturnsNull=chronicleMapBuilder.removeReturnsNull();
  this.maxEntrySize=chronicleMapBuilder.entrySize(true);
  if (maxEntrySize < 128)   maxEntrySize=128;
  this.vClass=chronicleMapBuilder.valueBuilder.eClass;
  this.kClass=chronicleMapBuilder.keyBuilder.eClass;
  this.name=config.name();
  attemptConnect(config.remoteAddress());
  outBuffer=allocateDirect(maxEntrySize).order(ByteOrder.nativeOrder());
  outBytes=new ByteBufferBytes(outBuffer.slice());
  inBuffer=allocateDirect(maxEntrySize).order(ByteOrder.nativeOrder());
  inBytes=new ByteBufferBytes(inBuffer.slice());
}
Program: 163008
Project: 163008
Buggy source:
private Bytes blockingFetchReadOnly(long timeoutTime,final long transactionId){
  try {
    return blockingFetchThrowable(timeoutTime,transactionId);
  }
 catch (  IOException e) {
    close();
    throw new IORuntimeException(e);
  }
catch (  RuntimeException e) {
    close();
    throw e;
  }
catch (  Exception e) {
    close();
    throw new RuntimeException(e);
  }
catch (  AssertionError e) {
    LOG.error("String_Node_Str",e);
    throw e;
  }
}

Fixed version (ground truth):
private Bytes blockingFetchReadOnly(long timeoutTime,final long transactionId){
  try {
    return blockingFetchThrowable(timeoutTime,transactionId);
  }
 catch (  IOException e) {
    close();
    throw new IORuntimeException(e);
  }
catch (  RuntimeException e) {
    close();
    throw e;
  }
catch (  Exception e) {
    close();
    throw new RuntimeException(e);
  }
catch (  AssertionError e) {
    LOG.error("String_Node_Str" + name,e);
    throw e;
  }
}
Program: 163009
Project: 163009
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  ProposedNodes that=(ProposedNodes)o;
  if (identifier != that.identifier)   return false;
  if (!addressAndPort.equals(that.addressAndPort))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || ProposedNodes.class != o.getClass())   return false;
  ProposedNodes that=(ProposedNodes)o;
  if (identifier != that.identifier)   return false;
  if (!addressAndPort.equals(that.addressAndPort))   return false;
  return true;
}
Program: 163010
Project: 163010
Buggy source:
RV readValue(@NotNull ThreadLocalCopies copies,Bytes entry,RV usingValue,long valueSize);

Fixed version (ground truth):
/** 
 * Updates the entry position by valueSize.
 */
RV readValue(@NotNull ThreadLocalCopies copies,Bytes entry,RV usingValue,long valueSize);
Program: 163011
Project: 163011
Buggy source:
@Override Bytes bytes(long valueSize){
  if (lazyBytes != null) {
    if (lazyBytes.capacity() < valueSize) {
      DirectStore store=(DirectStore)lazyBytes.store();
      store.resize(valueSize,false);
      lazyBytes=store.bytes();
    }
    lazyBytes.clear();
    return lazyBytes;
  }
  return lazyBytes=new DirectStore(valueSize).bytes();
}

Fixed version (ground truth):
@Override Bytes bytes(long valueSize){
  valueSize=valueSizeMarshaller.sizeEncodingSize(valueSize) + valueSize;
  if (lazyBytes != null) {
    if (lazyBytes.capacity() < valueSize) {
      DirectStore store=(DirectStore)lazyBytes.store();
      store.resize(valueSize,false);
      lazyBytes=store.bytes();
    }
    lazyBytes.clear();
    return lazyBytes;
  }
  return lazyBytes=new DirectStore(valueSize).bytes();
}
Program: 163012
Project: 163012
Buggy source:
@Test @Ignore("String_Node_Str") public void testRemoteNotifyRemove() throws IOException, InterruptedException {
{
    ChronicleMapBuilder<Integer,CharSequence> map1Builder=serverBuilder();
    map1=map1Builder.create();
  }
{
    map2=clientBuilder().create();
    map2.put(5,"String_Node_Str");
  }
  waitTillReplicated();
  putWasCalled.set(false);
  map1.remove(5);
  waitTillReplicated();
  Assert.assertTrue(!putWasCalled.get());
  Assert.assertTrue(wasRemoved.get());
  Assert.assertEquals("String_Node_Str",valueRemoved.get());
  Assert.assertEquals(null,map2.get(5));
}

Fixed version (ground truth):
@Test public void testRemoteNotifyRemove() throws IOException, InterruptedException {
{
    ChronicleMapBuilder<Integer,CharSequence> map1Builder=serverBuilder();
    map1=map1Builder.create();
  }
{
    map2=clientBuilder().create();
    map2.put(5,"String_Node_Str");
  }
  waitTillReplicated();
  putWasCalled.set(false);
  map1.remove(5);
  waitTillReplicated();
  Assert.assertTrue(!putWasCalled.get());
  Assert.assertTrue(wasRemoved.get());
  Assert.assertEquals("String_Node_Str",valueRemoved.get());
  Assert.assertEquals(null,map2.get(5));
}
Program: 163014
Project: 163014
Buggy source:
/** 
 * called from a remote node as part of replication
 */
private void remoteRemove(@NotNull ThreadLocalCopies copies,@NotNull SegmentState segmentState,Bytes keyBytes,long hash2,final long timestamp,final byte identifier){
  writeLock(null);
  try {
    Boolean removed=(Boolean)removeWithoutLock(copies,segmentState,DelegatingMetaBytesInterop.<Bytes,BytesInterop<Bytes>>instance(),BytesBytesInterop.INSTANCE,keyBytes,keyBytes.remaining(),keyBytesToInstance,null,null,null,hash2,true,timestamp,identifier,true,true);
    if (!removed && LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + keyBytes.toString().trim() + "String_Node_Str");
    }
  }
  finally {
    writeUnlock();
  }
}

Fixed version (ground truth):
/** 
 * called from a remote node as part of replication
 */
private void remoteRemove(@NotNull ThreadLocalCopies copies,@NotNull SegmentState segmentState,Bytes keyBytes,long hash2,final long timestamp,final byte identifier){
  writeLock(null);
  try {
    ReadValueToBytes readValueToLazyBytes=segmentState.readValueToLazyBytes;
    readValueToLazyBytes.valueSizeMarshaller(valueSizeMarshaller);
    Boolean removed=(Boolean)removeWithoutLock(copies,segmentState,DelegatingMetaBytesInterop.<Bytes,BytesInterop<Bytes>>instance(),BytesBytesInterop.INSTANCE,keyBytes,keyBytes.remaining(),keyBytesToInstance,null,null,outputValueBytesToInstance,hash2,readValueToLazyBytes,true,timestamp,identifier,true,true);
    if (!removed && LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + keyBytes.toString().trim() + "String_Node_Str");
    }
  }
  finally {
    writeUnlock();
  }
}
Program: 163015
Project: 163015
Buggy source:
@Override <KB,KBI,MKBI extends MetaBytesInterop<KB,? super KBI>,VB,VBI,MVBI extends MetaBytesInterop<? super VB,? super VBI>>Object remove(@Nullable ThreadLocalCopies copies,@Nullable SegmentState segmentState,MKBI metaKeyInterop,KBI keyInterop,KB key,long keySize,InstanceOrBytesToInstance<KB,K> toKey,GetValueInterops<VB,VBI,MVBI> getValueInterops,VB expectedValue,InstanceOrBytesToInstance<? super VB,V> toValue,long hash2,boolean resultUnused){
  writeLock(null);
  try {
    return removeWithoutLock(copies,segmentState,metaKeyInterop,keyInterop,key,keySize,toKey,getValueInterops,expectedValue,toValue,hash2,resultUnused,currentTime(),localIdentifier,false,expectedValue != null);
  }
  finally {
    if (segmentState != null)     segmentState.close();
    writeUnlock();
  }
}

Fixed version (ground truth):
@Override <KB,KBI,MKBI extends MetaBytesInterop<KB,? super KBI>,RV,VB extends RV,VBI,MVBI extends MetaBytesInterop<? super VB,? super VBI>>Object remove(@Nullable ThreadLocalCopies copies,@Nullable SegmentState segmentState,MKBI metaKeyInterop,KBI keyInterop,KB key,long keySize,InstanceOrBytesToInstance<KB,K> toKey,GetValueInterops<VB,VBI,MVBI> getValueInterops,VB expectedValue,InstanceOrBytesToInstance<RV,V> toValue,long hash2,ReadValue<RV> readValue,boolean resultUnused){
  writeLock(null);
  try {
    return removeWithoutLock(copies,segmentState,metaKeyInterop,keyInterop,key,keySize,toKey,getValueInterops,expectedValue,toValue,hash2,readValue,resultUnused,currentTime(),localIdentifier,false,expectedValue != null);
  }
  finally {
    if (segmentState != null)     segmentState.close();
    writeUnlock();
  }
}
Program: 163016
Project: 163016
Buggy source:
/** 
 * - if expectedValue is not null, returns Boolean.TRUE (removed) or Boolean.FALSE (entry not found), regardless the expectedValue object is Bytes instance (RPC call) or the value instance - if expectedValue is null: - if resultUnused is false, null or removed value is returned - if resultUnused is true, null is always returned
 */
<KB,KBI,MKBI extends MetaBytesInterop<KB,? super KBI>,VB,VBI,MVBI extends MetaBytesInterop<? super VB,? super VBI>>Object removeWithoutLock(@Nullable ThreadLocalCopies copies,final @Nullable SegmentState segmentState,MKBI metaKeyInterop,KBI keyInterop,KB key,long keySize,InstanceOrBytesToInstance<KB,K> toKey,GetValueInterops<VB,VBI,MVBI> getValueInterops,VB expectedValue,InstanceOrBytesToInstance<? super VB,V> toValue,long hash2,boolean resultUnused,long timestamp,byte identifier,boolean remote,boolean booleanResult){
}

Fixed version (ground truth):
/** 
 * - if expectedValue is not null, returns Boolean.TRUE (removed) or Boolean.FALSE (entry not found), regardless the expectedValue object is Bytes instance (RPC call) or the value instance - if expectedValue is null: - if resultUnused is false, null or removed value is returned - if resultUnused is true, null is always returned
 */
<KB,KBI,MKBI extends MetaBytesInterop<KB,? super KBI>,RV,VB extends RV,VBI,MVBI extends MetaBytesInterop<? super VB,? super VBI>>Object removeWithoutLock(@Nullable ThreadLocalCopies copies,final @Nullable SegmentState segmentState,MKBI metaKeyInterop,KBI keyInterop,KB key,long keySize,InstanceOrBytesToInstance<KB,K> toKey,GetValueInterops<VB,VBI,MVBI> getValueInterops,VB expectedValue,InstanceOrBytesToInstance<RV,V> toValue,long hash2,ReadValue<RV> readValue,boolean resultUnused,long timestamp,byte identifier,boolean remote,boolean booleanResult){
}
Program: 163017
Project: 163017
Buggy source:
/** 
 * Only for testing.
 * @param identifier id
 * @return map
 */
ChronicleMap<K,V> createReplicated(byte identifier) throws IOException {
  VanillaChronicleMap<K,?,?,V,?,?> map=new ReplicatedChronicleMap<K,Object,MetaBytesInterop<K,Object>,V,Object,MetaBytesWriter<V,Object>>(this,identifier);
  BytesStore bytesStore=new DirectStore(JDKObjectSerializer.INSTANCE,map.sizeInBytes(),true);
  map.createMappedStoreAndSegments(bytesStore);
  return map;
}

Fixed version (ground truth):
/** 
 * Only for testing.
 * @param identifier id
 * @return map
 */
ChronicleMap<K,V> createReplicated(byte identifier) throws IOException {
  preMapConstruction(true);
  VanillaChronicleMap<K,?,?,V,?,?> map=new ReplicatedChronicleMap<K,Object,MetaBytesInterop<K,Object>,V,Object,MetaBytesWriter<V,Object>>(this,identifier);
  BytesStore bytesStore=new DirectStore(JDKObjectSerializer.INSTANCE,map.sizeInBytes(),true);
  map.createMappedStoreAndSegments(bytesStore);
  return map;
}
Program: 163018
Project: 163018
Buggy source:
/** 
 * Shortcut for   {@code replication(SimpleReplication.builder().tcpTransportAndNetwork(tcpTransportAndNetwork).create(identifier))}.
 * @param identifier the network-wide identifier of the containers, created by this builder
 * @param tcpTransportAndNetwork configuration of tcp connection and network
 * @return this builder back
 * @see #replication(SimpleReplication)
 * @see ChronicleHashInstanceConfig#replicated(byte,TcpConfig)
 */
B replication(byte identifier,TcpConfig tcpTransportAndNetwork);

Fixed version (ground truth):
/** 
 * Shortcut for   {@code replication(SimpleReplication.builder().tcpTransportAndNetwork(tcpTransportAndNetwork).create(identifier))}.
 * @param identifier the network-wide identifier of the containers, created by this builder
 * @param tcpTransportAndNetwork configuration of tcp connection and network
 * @return this builder back
 * @see #replication(SingleChronicleHashReplication)
 * @see ChronicleHashInstanceConfig#replicated(byte,TcpTransportAndNetworkConfig)
 */
B replication(byte identifier,TcpTransportAndNetworkConfig tcpTransportAndNetwork);
Program: 163019
Project: 163019
Buggy source:
/** 
 * Configures a time provider, used by hash containers, created by this builder, for needs of replication consensus protocol (conflicting data updates resolution). <p>Default time provider is   {@link TimeProvider#SYSTEM}.
 * @param timeProvider a new time provider for replication needs
 * @return this builder back
 * @see #replication(SimpleReplication)
 */
B timeProvider(TimeProvider timeProvider);

Fixed version (ground truth):
/** 
 * Configures a time provider, used by hash containers, created by this builder, for needs of replication consensus protocol (conflicting data updates resolution). <p>Default time provider is   {@link TimeProvider#SYSTEM}.
 * @param timeProvider a new time provider for replication needs
 * @return this builder back
 * @see #replication(SingleChronicleHashReplication)
 */
B timeProvider(TimeProvider timeProvider);
Program: 163020
Project: 163020
Buggy source:
/** 
 * Configures replication of the hash containers, created by this builder, via so called "channels". See <a href="https://github.com/OpenHFT/Chronicle-Map#channels-and-channelprovider">the section about Channels and ChannelProvider in ChronicleMap manual</a> for more information. <p>Another way to establish replication is   {@link #replicated(SimpleReplication)} methodor it's shortcut:  {@link #replicated(byte,TcpConfig)}. <p>By default, hash containers, created by this builder doesn't replicate their data. <p>This method call overrides all previous replication configurations of this builder, made either by means of this method,   {@link #replicated(SimpleReplication)}or   {@link #replicated(byte,TcpConfig)} method calls.
 * @param channel the channel responsible for gathering updates of hash containers,created by this builder, and replicating them over network
 * @return this builder object back
 * @see #replicated(SimpleReplication)
 */
ChronicleHashInstanceConfig<C> replicatedViaChannel(ReplicationChannel channel);

Fixed version (ground truth):
/** 
 * Configures replication of the hash containers, created by this builder, via so called "channels". See <a href="https://github.com/OpenHFT/Chronicle-Map#channels-and-channelprovider">the section about Channels and ChannelProvider in ChronicleMap manual</a> for more information. <p>Another way to establish replication is   {@link #replicated(SingleChronicleHashReplication)} methodor it's shortcut:  {@link #replicated(byte,TcpTransportAndNetworkConfig)}. <p>By default, hash containers, created by this builder doesn't replicate their data. <p>This method call overrides all previous replication configurations of this builder, made either by means of this method,   {@link #replicated(SingleChronicleHashReplication)}or   {@link #replicated(byte,TcpTransportAndNetworkConfig)} method calls.
 * @param channel the channel responsible for gathering updates of hash containers,created by this builder, and replicating them over network
 * @return this builder object back
 * @see #replicated(SingleChronicleHashReplication)
 */
ChronicleHashInstanceConfig<C> replicatedViaChannel(ReplicationChannel channel);
Program: 163021
Project: 163021
Buggy source:
ChronicleHashInstanceConfig<C> replicated(SimpleReplication replication);

Fixed version (ground truth):
ChronicleHashInstanceConfig<C> replicated(SingleChronicleHashReplication replication);
Program: 163022
Project: 163022
Buggy source:
public B udpTransport(UdpConfig udpConfig){
  this.udpConfig=udpConfig;
  return (B)this;
}

Fixed version (ground truth):
public B udpTransport(UdpTransportConfig udpConfig){
  this.udpConfig=udpConfig;
  return (B)this;
}
Program: 163023
Project: 163023
Buggy source:
public B tcpTransportAndNetwork(TcpConfig tcpConfig){
  this.tcpConfig=tcpConfig;
  return (B)this;
}

Fixed version (ground truth):
public B tcpTransportAndNetwork(TcpTransportAndNetworkConfig tcpConfig){
  this.tcpConfig=tcpConfig;
  return (B)this;
}
Program: 163024
Project: 163024
Buggy source:
@Override public Builder udpTransport(UdpConfig udpConfig){
  return super.udpTransport(udpConfig);
}

Fixed version (ground truth):
@Override public Builder udpTransport(UdpTransportConfig udpConfig){
  return super.udpTransport(udpConfig);
}
Program: 163025
Project: 163025
Buggy source:
@Override public Builder tcpTransportAndNetwork(TcpConfig tcpConfig){
  return super.tcpTransportAndNetwork(tcpConfig);
}

Fixed version (ground truth):
@Override public Builder tcpTransportAndNetwork(TcpTransportAndNetworkConfig tcpConfig){
  return super.tcpTransportAndNetwork(tcpConfig);
}
Program: 163026
Project: 163026
Buggy source:
public synchronized V remove(Object key){
  long sizeLocation=writeEvent(REMOVE);
  writeKey((K)key);
  return readKey(sizeLocation);
}

Fixed version (ground truth):
public synchronized V remove(Object key){
  if (key == null)   throw new NullPointerException("String_Node_Str");
  long sizeLocation=writeEvent(REMOVE);
  writeKey((K)key);
  return readKey(sizeLocation);
}