nus-yam/ex-repair huggingface dataset:
Program: 91459
Project: 91459
Buggy source:
/** 
 * reader and add, reader and writers on different threads
 * @throws Exception
 */
@Test @Ignore public void testWithFasterReader() throws Exception {
  final BlockingQueue<Integer> queue=new SharedConcurrentBlockingObjectQueue<Integer>();
  final int max=100;
  final CountDownLatch countDown=new CountDownLatch(1);
  final AtomicBoolean success=new AtomicBoolean(true);
  new Thread(new Runnable(){
    @Override public void run(){
      for (int i=1; i < max; i++) {
        try {
          queue.put(i);
          Thread.sleep((int)(Math.random() * 100));
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
).start();
  new Thread(new Runnable(){
    @Override public void run(){
      int value=0;
      for (int i=1; i < max; i++) {
        try {
          final int newValue=queue.take();
          junit.framework.Assert.assertEquals(i,newValue);
          if (newValue != value + 1) {
            success.set(false);
            return;
          }
          value=newValue;
          Thread.sleep((int)(Math.random() * 10));
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDown.countDown();
    }
  }
).start();
  countDown.await();
  Assert.assertTrue(success.get());
}

Fixed version (ground truth):
/** 
 * reader and add, reader and writers on different threads
 * @throws Exception
 */
@Test public void testWithFasterReader() throws Exception {
  final BlockingQueue<Integer> queue=new SharedConcurrentBlockingObjectQueue<Integer>();
  final int max=100;
  final CountDownLatch countDown=new CountDownLatch(1);
  final AtomicBoolean success=new AtomicBoolean(true);
  new Thread(new Runnable(){
    @Override public void run(){
      for (int i=1; i < max; i++) {
        try {
          queue.put(i);
          Thread.sleep((int)(Math.random() * 100));
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
).start();
  new Thread(new Runnable(){
    @Override public void run(){
      int value=0;
      for (int i=1; i < max; i++) {
        try {
          final int newValue=queue.take();
          junit.framework.Assert.assertEquals(i,newValue);
          if (newValue != value + 1) {
            success.set(false);
            return;
          }
          value=newValue;
          Thread.sleep((int)(Math.random() * 10));
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDown.countDown();
    }
  }
).start();
  countDown.await();
  Assert.assertTrue(success.get());
}
Program: 91460
Project: 91460
Buggy source:
@Test public void testDifferentHeaders() throws IOException {
  Random rand=new Random(1);
  for (int i=1; i <= 1000; i++) {
    rand.setSeed(i);
    File file=new File(System.getProperty("String_Node_Str"),"String_Node_Str" + i);
    file.deleteOnExit();
    SharedHashMapBuilder builder1=createBuilder(rand);
    SharedHashMap<String,String> map=builder1.create(file,String.class,String.class);
    SharedHashMapBuilder builder2=map.builder();
    map.close();
    SharedHashMapBuilder builder3=createBuilder(rand);
    SharedHashMap<String,String> map2=builder3.create(file,String.class,String.class);
    SharedHashMapBuilder builder4=map2.builder();
    assertEquals(builder2.toString(),builder4.toString());
    assertEquals(builder2,builder4);
    map2.close();
    file.delete();
  }
}

Fixed version (ground truth):
@Test @Ignore public void testDifferentHeaders() throws IOException {
  Random rand=new Random(1);
  for (int i=1; i <= 1000; i++) {
    rand.setSeed(i);
    File file=new File(System.getProperty("String_Node_Str"),"String_Node_Str" + i);
    file.deleteOnExit();
    SharedHashMapBuilder builder1=createBuilder(rand);
    SharedHashMap<String,String> map=builder1.create(file,String.class,String.class);
    SharedHashMapBuilder builder2=map.builder();
    map.close();
    SharedHashMapBuilder builder3=createBuilder(rand);
    SharedHashMap<String,String> map2=builder3.create(file,String.class,String.class);
    SharedHashMapBuilder builder4=map2.builder();
    assertEquals(builder2.toString(),builder4.toString());
    assertEquals(builder2,builder4);
    map2.close();
    file.delete();
  }
}
Program: 91461
Project: 91461
Buggy source:
public static LongValue nativeLongValue(){
  return new LongValue£native();
}

Fixed version (ground truth):
public static LongValue nativeLongValue(){
  return new LongValue$$Native();
}
Program: 91462
Project: 91462
Buggy source:
@Test public void testGetWithoutAcquireFirst() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.getUsing("String_Node_Str",new LongValue£native()));
  map.close();
}

Fixed version (ground truth):
@Test public void testGetWithoutAcquireFirst() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.getUsing("String_Node_Str",new LongValue$$Native()));
  map.close();
}
Program: 91463
Project: 91463
Buggy source:
@Test public void testAcquireFromMultipleThreads() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(1000 * 1000,128,24);
  CharSequence key=getUserCharSequence(0);
  map.acquireUsing(key,new LongValue£native());
  int iterations=1000;
  int noOfThreads=10;
  CyclicBarrier barrier=new CyclicBarrier(noOfThreads);
  Thread[] threads=new Thread[noOfThreads];
  for (int t=0; t < noOfThreads; t++) {
    threads[t]=new Thread(new IncrementRunnable(map,key,iterations,barrier));
    threads[t].start();
  }
  for (int t=0; t < noOfThreads; t++) {
    threads[t].join();
  }
  assertEquals(noOfThreads * iterations,map.acquireUsing(key,new LongValue£native()).getValue());
  map.close();
}

Fixed version (ground truth):
@Test public void testAcquireFromMultipleThreads() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(1000 * 1000,128,24);
  CharSequence key=getUserCharSequence(0);
  map.acquireUsing(key,new LongValue$$Native());
  int iterations=1000;
  int noOfThreads=10;
  CyclicBarrier barrier=new CyclicBarrier(noOfThreads);
  Thread[] threads=new Thread[noOfThreads];
  for (int t=0; t < noOfThreads; t++) {
    threads[t]=new Thread(new IncrementRunnable(map,key,iterations,barrier));
    threads[t].start();
  }
  for (int t=0; t < noOfThreads; t++) {
    threads[t].join();
  }
  assertEquals(noOfThreads * iterations,map.acquireUsing(key,new LongValue$$Native()).getValue());
  map.close();
}
Program: 91464
Project: 91464
Buggy source:
@Test public void testAcquireWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValue£native());
  assertEquals(0,map.acquireUsing("String_Node_Str",null).getValue());
  map.close();
}

Fixed version (ground truth):
@Test public void testAcquireWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValue$$Native());
  assertEquals(0,map.acquireUsing("String_Node_Str",null).getValue());
  map.close();
}
Program: 91465
Project: 91465
Buggy source:
@Test public void testAcquireAndGet() throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException {
  int entries=1000 * 1000;
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(entries,128,24);
  LongValue value=new LongValue£native();
  LongValue value2=new LongValue£native();
  LongValue value3=new LongValue£native();
  for (int j=1; j <= 3; j++) {
    for (int i=0; i < entries; i++) {
      CharSequence userCS=getUserCharSequence(i);
      if (j > 1) {
        assertNotNull(map.getUsing(userCS,value));
      }
 else {
        map.acquireUsing(userCS,value);
      }
      assertEquals(j - 1,value.getValue());
      value.addAtomicValue(1);
      assertEquals(value2,map.acquireUsing(userCS,value2));
      assertEquals(j,value2.getValue());
      assertEquals(value3,map.getUsing(userCS,value3));
      assertEquals(j,value3.getValue());
    }
  }
  map.close();
}

Fixed version (ground truth):
@Test public void testAcquireAndGet() throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException {
  int entries=1000 * 1000;
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(entries,128,24);
  LongValue value=new LongValue$$Native();
  LongValue value2=new LongValue$$Native();
  LongValue value3=new LongValue$$Native();
  for (int j=1; j <= 3; j++) {
    for (int i=0; i < entries; i++) {
      CharSequence userCS=getUserCharSequence(i);
      if (j > 1) {
        assertNotNull(map.getUsing(userCS,value));
      }
 else {
        map.acquireUsing(userCS,value);
      }
      assertEquals(j - 1,value.getValue());
      value.addAtomicValue(1);
      assertEquals(value2,map.acquireUsing(userCS,value2));
      assertEquals(j,value2.getValue());
      assertEquals(value3,map.getUsing(userCS,value3));
      assertEquals(j,value3.getValue());
    }
  }
  map.close();
}
Program: 91466
Project: 91466
Buggy source:
@Test public void testGetWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValue£native());
  assertEquals(0,map.getUsing("String_Node_Str",null).getValue());
  map.close();
}

Fixed version (ground truth):
@Test public void testGetWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValue$$Native());
  assertEquals(0,map.getUsing("String_Node_Str",null).getValue());
  map.close();
}
Program: 91467
Project: 91467
Buggy source:
Entry<K,V> getNextEntry(Bytes prevKeyBytes){
  int pos;
  if (prevKeyBytes == null) {
    pos=hashLookup.firstPos();
  }
 else {
    int hash=hasher.segmentHash(hasher.hash(prevKeyBytes));
    pos=hashLookup.nextKeyAfter(hash);
  }
  if (pos >= 0) {
    final long offset=entriesOffset + pos * entrySize + metaDataBytes;
    int length=entrySize - metaDataBytes;
    tmpBytes.storePositionAndSize(bytes,offset,length);
    tmpBytes.readStopBit();
    K key=tmpBytes.readInstance(kClass,null);
    tmpBytes.readStopBit();
    final long valueOffset=align(tmpBytes.position());
    tmpBytes.position(valueOffset);
    V value=readObjectUsing(null,offset + valueOffset);
    return new SimpleEntry<K,V>(key,value);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
Entry<K,V> getNextEntry(K prevKey){
  int pos;
  if (prevKey == null) {
    pos=hashLookup.firstPos();
  }
 else {
    int hash=hasher.segmentHash(hasher.hash(getKeyAsBytes(prevKey)));
    pos=hashLookup.nextKeyAfter(hash);
  }
  if (pos >= 0) {
    final long offset=entriesOffset + pos * entrySize + metaDataBytes;
    int length=entrySize - metaDataBytes;
    tmpBytes.storePositionAndSize(bytes,offset,length);
    tmpBytes.readStopBit();
    K key=tmpBytes.readInstance(kClass,null);
    tmpBytes.readStopBit();
    final long valueOffset=align(tmpBytes.position());
    tmpBytes.position(valueOffset);
    V value=readObjectUsing(null,offset + valueOffset);
    return new SimpleEntry<K,V>(key,value);
  }
 else {
    return null;
  }
}
Program: 91468
Project: 91468
Buggy source:
Entry<K,V> nextSegmentEntry(){
  while (segmentIndex >= 0) {
    Segment segment=segments[segmentIndex];
    Entry<K,V> entry=segment.getNextEntry(lastSegmentKeyBytes);
    if (entry == null) {
      segmentIndex--;
      lastSegmentKeyBytes=null;
    }
 else {
      lastSegmentKeyBytes=getKeyAsBytes(entry.getKey());
      return entry;
    }
  }
  return null;
}

Fixed version (ground truth):
Entry<K,V> nextSegmentEntry(){
  while (segmentIndex >= 0) {
    Segment segment=segments[segmentIndex];
    Entry<K,V> entry=segment.getNextEntry(lastSegmentKey);
    if (entry == null) {
      segmentIndex--;
      lastSegmentKey=null;
    }
 else {
      lastSegmentKey=entry.getKey();
      return entry;
    }
  }
  return null;
}
Program: 91469
Project: 91469
Buggy source:
public boolean putLimited(int key,int value,int limit){
  if (key == UNSET_KEY)   key=HASH_INSTEAD_OF_UNSET_KEY;
 else   if ((key & 0xFFFF) != key)   throw new IllegalArgumentException("String_Node_Str" + key);
  if ((value & 0xFFFF) != value)   throw new IllegalArgumentException("String_Node_Str" + value);
  int pos=(key & capacityMask) << 2;
  for (int i=0; i < limit; i++) {
    int entry=bytes.readInt(pos);
    int hash2=entry >>> 16;
    if (hash2 == UNSET_KEY) {
      bytes.writeInt(pos,((key << 16) | (value & 0xFFFF)));
      return true;
    }
    if (hash2 == key) {
      int value2=entry;
      if (value2 == value)       return true;
    }
    pos=(pos + ENTRY_SIZE) & capacityMask2;
  }
  return false;
}

Fixed version (ground truth):
public boolean putLimited(int key,int value,int limit){
  if (key == UNSET_KEY)   key=HASH_INSTEAD_OF_UNSET_KEY;
 else   if ((key & 0xFFFF) != key)   throw new IllegalArgumentException("String_Node_Str" + key);
  if ((value & 0xFFFF) != value)   throw new IllegalArgumentException("String_Node_Str" + value);
  int pos=(key & capacityMask) << 2;
  for (int i=0; i < limit; i++) {
    int entry=bytes.readInt(pos);
    int hash2=entry >>> 16;
    if (hash2 == UNSET_KEY) {
      bytes.writeInt(pos,((key << 16) | (value & 0xFFFF)));
      return true;
    }
    if (hash2 == key) {
      int value2=entry & 0xFFFF;
      if (value2 == value)       return true;
    }
    pos=(pos + ENTRY_SIZE) & capacityMask2;
  }
  return false;
}
Program: 91470
Project: 91470
Buggy source:
@Override public int nextKeyAfter(int key){
  startSearch(key);
  while (searchPos < capacity * ENTRY_SIZE) {
    int entry=bytes.readInt(searchPos);
    int hash2=entry >> 16;
    if (hash2 != UNSET_KEY && hash2 != searchHash) {
      return entry & 0xFFFF;
    }
    searchPos=searchPos + ENTRY_SIZE;
  }
  return -1;
}

Fixed version (ground truth):
@Override public int nextKeyAfter(int key){
  startSearch(key);
  while (searchPos < capacity * ENTRY_SIZE) {
    int entry=bytes.readInt(searchPos);
    int hash2=entry >>> 16;
    if (hash2 != UNSET_KEY && hash2 != searchHash) {
      return entry & 0xFFFF;
    }
    searchPos=searchPos + ENTRY_SIZE;
  }
  return -1;
}
Program: 91471
Project: 91471
Buggy source:
/** 
 * implementation for map.remove(Key,Value)
 * @param keyBytes      the key of the entry to remove
 * @param expectedValue the entry will only be removed if the {@param existingValue} equals null or the {@param existingValue} equals that of the entry.value
 * @param hash2         a hash code relating to the {@keyBytes} ( not the natural hash of {@keyBytes}  )
 * @return if the entry corresponding to the {@param keyBytes} exists and removeReturnsNull==false, returns the value of the entry that was removed, otherwise null is returned
 */
V remove(final DirectBytes keyBytes,final V expectedValue,int hash2){
  lock();
  try {
    hash2=hashLookup.startSearch(hash2);
    while (true) {
      final int pos=hashLookup.nextPos();
      if (pos < 0) {
        return null;
      }
 else {
        final long offset=entriesOffset + pos * entrySize;
        tmpBytes.storePositionAndSize(bytes,offset,entrySize);
        if (!keyEquals(keyBytes,tmpBytes))         continue;
        final long keyLength=align(keyBytes.remaining() + tmpBytes.position());
        tmpBytes.position(keyLength);
        V valueRemoved=expectedValue == null && removeReturnsNull ? null : readObjectUsing(null,offset + keyLength);
        if (expectedValue != null && !expectedValue.equals(valueRemoved))         return null;
        hashLookup.remove(hash2,pos);
        decrementSize();
        freeList.clear(pos);
        if (pos < nextSet)         nextSet=pos;
        return valueRemoved;
      }
    }
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * implementation for map.remove(Key,Value)
 * @param keyBytes      the key of the entry to remove
 * @param expectedValue the entry will only be removed if the {@param existingValue} equals null or the {@param existingValue} equals that of the entry.value
 * @param hash2         a hash code relating to the {@keyBytes} ( not the natural hash of {@keyBytes}  )
 * @return if the entry corresponding to the {@param keyBytes} exists and removeReturnsNull==false, returns the value of the entry that was removed, otherwise null is returned
 */
V remove(final DirectBytes keyBytes,final V expectedValue,int hash2){
  lock();
  try {
    hash2=hashLookup.startSearch(hash2);
    while (true) {
      final int pos=hashLookup.nextPos();
      if (pos < 0) {
        return null;
      }
 else {
        final long offset=entriesOffset + pos * entrySize;
        tmpBytes.storePositionAndSize(bytes,offset,entrySize);
        if (!keyEquals(keyBytes,tmpBytes))         continue;
        final long keyLength=keyBytes.remaining() + tmpBytes.position();
        tmpBytes.position(keyLength);
        tmpBytes.readStopBit();
        tmpBytes.alignPositionAddr(4);
        V valueRemoved=expectedValue == null && removeReturnsNull ? null : readObjectUsing(null,offset + keyLength);
        if (expectedValue != null && !expectedValue.equals(valueRemoved))         return null;
        hashLookup.remove(hash2,pos);
        decrementSize();
        freeList.clear(pos);
        if (pos < nextSet)         nextSet=pos;
        return valueRemoved;
      }
    }
  }
  finally {
    unlock();
  }
}
Program: 91472
Project: 91472
Buggy source:
public static void main(String[] args) throws Exception {
  int numTests=100;
  int size=36864;
  if (args.length == 0)   System.out.println("String_Node_Str");
  if (args.length > 1) {
    String et=args[1].toLowerCase();
    if (et.startsWith("String_Node_Str"))     eclass=java.lang.Integer.class;
 else     if (et.startsWith("String_Node_Str"))     eclass=java.lang.Float.class;
 else     if (et.startsWith("String_Node_Str"))     eclass=java.lang.String.class;
 else     if (et.startsWith("String_Node_Str"))     eclass=java.lang.Double.class;
  }
  if (eclass == null)   eclass=Object.class;
  if (args.length > 2)   numTests=Integer.parseInt(args[2]);
  if (args.length > 3)   size=Integer.parseInt(args[3]);
  boolean doSerializeTest=args.length > 4;
  while ((size & 3) != 0)   ++size;
  System.out.print("String_Node_Str" + eclass.getName());
  System.out.print("String_Node_Str" + numTests);
  System.out.print("String_Node_Str" + size);
  System.out.println();
  Object[] key=new Object[size];
  Object[] absent=new Object[size];
  initializeKeys(key,absent,size);
  precheck(size,key,absent);
  for (int rep=0; rep < numTests; ++rep) {
    mainTest(newMap(),key,absent);
    if ((rep & 3) == 3 && rep < numTests - 1) {
      shuffle(key);
    }
  }
  TestTimer.printStats();
  checkNullKey();
  if (doSerializeTest)   serTest(newMap(),size);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  int numTests=100;
  int size=36864;
  if (args.length == 0)   System.out.println("String_Node_Str");
  if (args.length > 1) {
    String et=args[1].toLowerCase();
    if (et.startsWith("String_Node_Str"))     eclass=java.lang.Integer.class;
 else     if (et.startsWith("String_Node_Str"))     eclass=java.lang.Float.class;
 else     if (et.startsWith("String_Node_Str"))     eclass=java.lang.String.class;
 else     if (et.startsWith("String_Node_Str"))     eclass=java.lang.Double.class;
  }
  if (eclass == null)   eclass=Integer.class;
  if (args.length > 2)   numTests=Integer.parseInt(args[2]);
  if (args.length > 3)   size=Integer.parseInt(args[3]);
  boolean doSerializeTest=args.length > 4;
  while ((size & 3) != 0)   ++size;
  System.out.print("String_Node_Str" + eclass.getName());
  System.out.print("String_Node_Str" + numTests);
  System.out.print("String_Node_Str" + size);
  System.out.println();
  Object[] key=new Object[size];
  Object[] absent=new Object[size];
  initializeKeys(key,absent,size);
  precheck(size,key,absent);
  for (int rep=0; rep < numTests; ++rep) {
    mainTest(newMap(),key,absent);
    if ((rep & 3) == 3 && rep < numTests - 1) {
      shuffle(key);
    }
  }
  TestTimer.printStats();
  checkNullKey();
  if (doSerializeTest)   serTest(newMap(),size);
}
Program: 91473
Project: 91473
Buggy source:
static void mainTest(Map s,Object[] key,Object[] absent){
  int size=key.length;
  putTest("String_Node_Str",size,s,key,size);
  reallyAssert(s.size() == size);
  getTest("String_Node_Str",size,s,key,size);
  getTest("String_Node_Str",size,s,absent,0);
  kitTest(s,size);
  vitTest(s,size);
  eitTest(s,size);
  putTest("String_Node_Str",size,s,key,0);
  reallyAssert(s.size() == size);
  untimedKeyTest("String_Node_Str",size,s,key,size);
  keyTest("String_Node_Str",size,s,absent,0);
  valTest(s,key);
  remTest("String_Node_Str",size,s,absent,0);
  reallyAssert(s.size() == size);
  remHalfTest("String_Node_Str",size,s,key,size / 2);
  reallyAssert(s.size() == size / 2);
  getTest("String_Node_Str",size,s,key,size / 2);
  putTest("String_Node_Str",size,s,key,size / 2);
  reallyAssert(s.size() == size);
  getTest("String_Node_Str",size,s,key,size);
  getTest("String_Node_Str",size,s,absent,0);
  itRemTest(s,size);
  putTest("String_Node_Str",size,s,key,size);
  reallyAssert(s.size() == size);
  getTest("String_Node_Str",size,s,key,size);
  untimedKeyTest("String_Node_Str",size,s,key,size);
  kitTest(s,size);
  vitTest(s,size);
  eitTest(s,size);
  twoMapTest1(s,key,absent);
  twoMapTest2(s,key,absent);
}

Fixed version (ground truth):
static void mainTest(Map s,Object[] key,Object[] absent){
  int size=key.length;
  putTest("String_Node_Str",size,s,key,size);
  reallyAssert(s.size() == size);
  getTest("String_Node_Str",size,s,key,size);
  getTest("String_Node_Str",size,s,absent,0);
  putTest("String_Node_Str",size,s,key,0);
  reallyAssert(s.size() == size);
  untimedKeyTest("String_Node_Str",size,s,key,size);
  keyTest("String_Node_Str",size,s,absent,0);
  remTest("String_Node_Str",size,s,absent,0);
  reallyAssert(s.size() == size);
  remHalfTest("String_Node_Str",size,s,key,size / 2);
  reallyAssert(s.size() == size / 2);
  getTest("String_Node_Str",size,s,key,size / 2);
  putTest("String_Node_Str",size,s,key,size / 2);
  reallyAssert(s.size() == size);
  getTest("String_Node_Str",size,s,key,size);
  getTest("String_Node_Str",size,s,absent,0);
  itRemTest(s,size);
  putTest("String_Node_Str",size,s,key,size);
  reallyAssert(s.size() == size);
  getTest("String_Node_Str",size,s,key,size);
  untimedKeyTest("String_Node_Str",size,s,key,size);
  kitTest(s,size);
  vitTest(s,size);
  eitTest(s,size);
  twoMapTest1(s,key,absent);
  twoMapTest2(s,key,absent);
}
Program: 91474
Project: 91474
Buggy source:
static Map newMap(){
  try {
    return new ConcurrentHashMap();
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
static Map newMap(){
  try {
    return new SharedHashMapBuilder().create(getPersistenceFile(),Object.class,Object.class);
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + e);
  }
}
Program: 91475
Project: 91475
Buggy source:
static void initializeKeys(Object[] key,Object[] absent,int size){
  if (eclass == Object.class) {
    for (int i=0; i < size; ++i)     key[i]=new Object();
    for (int i=0; i < size; ++i)     absent[i]=new Object();
  }
 else   if (eclass == Integer.class) {
    initInts(key,absent,size);
  }
 else   if (eclass == Float.class) {
    initFloats(key,absent,size);
  }
 else   if (eclass == Double.class) {
    initDoubles(key,absent,size);
  }
 else   if (eclass == String.class) {
    initWords(size,key,absent);
  }
 else   throw new Error("String_Node_Str");
}

Fixed version (ground truth):
static void initializeKeys(Object[] key,Object[] absent,int size){
  if (eclass == Object.class || eclass == Integer.class) {
    initInts(key,absent,size);
  }
 else   if (eclass == Float.class) {
    initFloats(key,absent,size);
  }
 else   if (eclass == Double.class) {
    initDoubles(key,absent,size);
  }
 else   if (eclass == String.class) {
    initWords(size,key,absent);
  }
 else   throw new Error("String_Node_Str");
}
Program: 91476
Project: 91476
Buggy source:
private static File getPersistenceFile(){
  String TMP=System.getProperty("String_Node_Str");
  File file=new File(TMP + "String_Node_Str" + counter++);
  file.delete();
  file.deleteOnExit();
  return file;
}

Fixed version (ground truth):
private static File getPersistenceFile(){
  String TMP=System.getProperty("String_Node_Str");
  File file=new File(TMP + "String_Node_Str" + System.nanoTime());
  file.delete();
  file.deleteOnExit();
  return file;
}
Program: 91477
Project: 91477
Buggy source:
@Test public void testAcquireWithNullKey() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.acquireUsing(null,new LongValueNative()));
}

Fixed version (ground truth):
@Test public void testAcquireWithNullKey() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.acquireUsing(null,new LongValueNative()));
  map.close();
}
Program: 91478
Project: 91478
Buggy source:
@Test public void testGetWithNullKey() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.getUsing(null,new LongValueNative()));
}

Fixed version (ground truth):
@Test public void testGetWithNullKey() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.getUsing(null,new LongValueNative()));
  map.close();
}
Program: 91479
Project: 91479
Buggy source:
@Test public void testGetWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValueNative());
  assertEquals(0,map.getUsing("String_Node_Str",null).getValue());
}

Fixed version (ground truth):
@Test public void testGetWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValueNative());
  assertEquals(0,map.getUsing("String_Node_Str",null).getValue());
  map.close();
}
Program: 91480
Project: 91480
Buggy source:
@Test public void testGetWithoutAcquireFirst() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.getUsing("String_Node_Str",new LongValueNative()));
}

Fixed version (ground truth):
@Test public void testGetWithoutAcquireFirst() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  assertNull(map.getUsing("String_Node_Str",new LongValueNative()));
  map.close();
}
Program: 91481
Project: 91481
Buggy source:
@Test public void testRemoveWithKeyAndRemoveReturnsNull() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).removeReturnsNull(true).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(2,map.size());
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final CharSequence result=map.remove("String_Node_Str");
  assertEquals(null,result);
  assertEquals(1,map.size());
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals(null,map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
}

Fixed version (ground truth):
@Test public void testRemoveWithKeyAndRemoveReturnsNull() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).removeReturnsNull(true).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(2,map.size());
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final CharSequence result=map.remove("String_Node_Str");
  assertEquals(null,result);
  assertEquals(1,map.size());
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals(null,map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
  map.close();
}
Program: 91482
Project: 91482
Buggy source:
@Test public void testAcquireWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValueNative());
  assertEquals(0,map.acquireUsing("String_Node_Str",null).getValue());
}

Fixed version (ground truth):
@Test public void testAcquireWithNullContainer() throws Exception {
  SharedHashMap<CharSequence,LongValue> map=getSharedMap(10 * 1000,128,24);
  map.acquireUsing("String_Node_Str",new LongValueNative());
  assertEquals(0,map.acquireUsing("String_Node_Str",null).getValue());
  map.close();
}
Program: 91484
Project: 91484
Buggy source:
@Test public void testRemoveWithKeyAndValue() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean wasRemoved1=map.remove("String_Node_Str","String_Node_Str");
  assertFalse(wasRemoved1);
  assertEquals(null,map.get("String_Node_Str"),"String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"),"String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  final boolean wasRemoved2=map.remove("String_Node_Str","String_Node_Str");
  assertFalse(wasRemoved2);
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testRemoveWithKeyAndValue() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean wasRemoved1=map.remove("String_Node_Str","String_Node_Str");
  assertFalse(wasRemoved1);
  assertEquals(null,map.get("String_Node_Str"),"String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"),"String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  final boolean wasRemoved2=map.remove("String_Node_Str","String_Node_Str");
  assertFalse(wasRemoved2);
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.close();
}
Program: 91485
Project: 91485
Buggy source:
@Test public void testSize() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(1024).removeReturnsNull(true).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  for (int i=1; i < 1024; i++) {
    map.put("String_Node_Str" + i,"String_Node_Str");
    assertEquals(i,map.size());
  }
  for (int i=1023; i >= 1; ) {
    map.remove("String_Node_Str" + i);
    i--;
    assertEquals(i,map.size());
  }
}

Fixed version (ground truth):
@Test public void testSize() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(1024).removeReturnsNull(true).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  for (int i=1; i < 1024; i++) {
    map.put("String_Node_Str" + i,"String_Node_Str");
    assertEquals(i,map.size());
  }
  for (int i=1023; i >= 1; ) {
    map.remove("String_Node_Str" + i);
    i--;
    assertEquals(i,map.size());
  }
  map.close();
}
Program: 91486
Project: 91486
Buggy source:
@Test public void testRemoveWithKey() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(2,map.size());
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final CharSequence result=map.remove("String_Node_Str");
  assertEquals(1,map.size());
  assertEquals("String_Node_Str",result);
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals(null,map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
}

Fixed version (ground truth):
@Test public void testRemoveWithKey() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(2,map.size());
  assertTrue(map.containsKey("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final CharSequence result=map.remove("String_Node_Str");
  assertEquals(1,map.size());
  assertEquals("String_Node_Str",result);
  assertFalse(map.containsKey("String_Node_Str"));
  assertEquals(null,map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertTrue(map.containsKey("String_Node_Str"));
  assertEquals(2,map.size());
  map.close();
}
Program: 91487
Project: 91487
Buggy source:
private static File getPersistenceFile(){
  String TMP=System.getProperty("String_Node_Str");
  File file=new File(TMP + "String_Node_Str" + counter++);
  file.delete();
  file.deleteOnExit();
  return file;
}

Fixed version (ground truth):
private static File getPersistenceFile(){
  String TMP=System.getProperty("String_Node_Str");
  File file=new File(TMP + "String_Node_Str" + System.nanoTime());
  file.delete();
  file.deleteOnExit();
  return file;
}
Program: 91488
Project: 91488
Buggy source:
@Test public void testReplaceWithKeyAnd2Params() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean result=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(true,result);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean result2=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(true,result2);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean result3=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(false,result3);
  final boolean result4=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(true,result4);
}

Fixed version (ground truth):
@Test public void testReplaceWithKeyAnd2Params() throws Exception {
  final SharedHashMap<CharSequence,CharSequence> map=new SharedHashMapBuilder().minSegments(2).create(getPersistenceFile(),CharSequence.class,CharSequence.class);
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean result=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(true,result);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean result2=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(true,result2);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  final boolean result3=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(false,result3);
  final boolean result4=map.replace("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(true,result4);
  map.close();
}
Program: 91489
Project: 91489
Buggy source:
@Override public long offset(){
  return _offset;
}

Fixed version (ground truth):
public long offset(){
  return _offset;
}
Program: 91490
Project: 91490
Buggy source:
private SharedHashMapBuilder readFile(File file) throws IOException {
  ByteBuffer bb=ByteBuffer.allocateDirect(HEADER_SIZE).order(ByteOrder.nativeOrder());
  FileInputStream fis=new FileInputStream(file);
  fis.getChannel().read(bb);
  fis.close();
  bb.flip();
  if (bb.remaining() <= 20)   throw new IOException("String_Node_Str" + file);
  byte[] bytes=new byte[8];
  bb.get(bytes);
  if (!Arrays.equals(bytes,MAGIC))   throw new IOException("String_Node_Str" + new String(bytes,0));
  SharedHashMapBuilder builder=new SharedHashMapBuilder();
  builder.segments(bb.getInt());
  builder.entries((long)(bb.getLong() * builder.segments() / INCREASE_ENTRIES_PER_SECTOR));
  builder.entrySize(bb.getInt());
  builder.replicas(bb.getInt());
  builder.transactional(bb.get() == 'Y');
  if (segments() <= 0 || entries() <= 0 || entrySize() <= 0)   throw new IOException("String_Node_Str" + file);
  return builder;
}

Fixed version (ground truth):
private static SharedHashMapBuilder readFile(File file) throws IOException {
  ByteBuffer bb=ByteBuffer.allocateDirect(HEADER_SIZE).order(ByteOrder.nativeOrder());
  FileInputStream fis=new FileInputStream(file);
  fis.getChannel().read(bb);
  fis.close();
  bb.flip();
  if (bb.remaining() <= 20)   throw new IOException("String_Node_Str" + file);
  byte[] bytes=new byte[8];
  bb.get(bytes);
  if (!Arrays.equals(bytes,MAGIC))   throw new IOException("String_Node_Str" + new String(bytes,0));
  SharedHashMapBuilder builder=new SharedHashMapBuilder();
  builder.segments(bb.getInt());
  builder.entries((long)(bb.getLong() * builder.segments() / INCREASE_ENTRIES_PER_SECTOR));
  builder.entrySize(bb.getInt());
  builder.replicas(bb.getInt());
  builder.transactional(bb.get() == 'Y');
  if (builder.segments() <= 0 || builder.entries() <= 0 || builder.entrySize() <= 0)   throw new IOException("String_Node_Str" + file);
  return builder;
}
Program: 91491
Project: 91491
Buggy source:
/** 
 * Remove a key/value combination.
 * @param key   to remove
 * @param value to remove
 * @return whether a match was found.
 */
public boolean remove(int key,int value){
  int pos=(key & capacityMask) << 3;
  int pos0=-1;
  boolean found=false;
  for (int i=0; i <= capacityMask; i++) {
    int key2=bytes.readInt(pos + KEY);
    if (key2 == key) {
      int value2=bytes.readInt(pos + VALUE);
      if (value2 == value) {
        found=true;
        pos0=pos;
      }
    }
 else     if (key2 == UNSET) {
      break;
    }
    pos=(pos + ENTRY_SIZE) & capacityMask2;
  }
  if (!found)   return false;
  size--;
  int pos2=pos;
  while (pos >= pos0) {
    pos=(pos - ENTRY_SIZE) & capacityMask2;
    int key2=bytes.readInt(pos + KEY);
    if (key2 == key) {
      if (pos != pos0) {
        int value2=bytes.readInt(pos + VALUE);
        bytes.writeInt(pos0 + VALUE,value2);
      }
      bytes.writeLong(pos,UNSET_ENTRY);
      break;
    }
  }
  pos=(pos + ENTRY_SIZE) & capacityMask2;
  while (pos < pos2) {
    int key2=bytes.readInt(pos + KEY);
    int value2=bytes.readInt(pos + VALUE);
    bytes.writeLong(pos,UNSET_ENTRY);
    size--;
    put(key2,value2);
    pos=(pos + ENTRY_SIZE) & capacityMask2;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Remove a key/value combination.
 * @param key   to remove
 * @param value to remove
 * @return whether a match was found.
 */
public boolean remove(int key,int value){
  int pos=(key & capacityMask) << 3;
  int pos0=-1;
  boolean found=false;
  for (int i=0; i <= capacityMask; i++) {
    int key2=bytes.readInt(pos + KEY);
    if (key2 == key) {
      int value2=bytes.readInt(pos + VALUE);
      if (value2 == value) {
        found=true;
        pos0=pos;
      }
    }
 else     if (key2 == UNSET) {
      break;
    }
    pos=(pos + ENTRY_SIZE) & capacityMask2;
  }
  if (!found)   return false;
  size--;
  int pos2=pos;
  while (pos != pos0) {
    pos=(pos - ENTRY_SIZE) & capacityMask2;
    int key2=bytes.readInt(pos + KEY);
    if (key2 == key) {
      if (pos != pos0) {
        int value2=bytes.readInt(pos + VALUE);
        bytes.writeInt(pos0 + VALUE,value2);
      }
      bytes.writeLong(pos,UNSET_ENTRY);
      break;
    }
  }
  pos=(pos + ENTRY_SIZE) & capacityMask2;
  while (pos < pos2) {
    int key2=bytes.readInt(pos + KEY);
    int value2=bytes.readInt(pos + VALUE);
    bytes.writeLong(pos,UNSET_ENTRY);
    size--;
    put(key2,value2);
    pos=(pos + ENTRY_SIZE) & capacityMask2;
  }
  return true;
}
Program: 91492
Project: 91492
Buggy source:
public synchronized boolean containsKey(long h,K key){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  boolean found=false;
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      return map.containsKey(key);
    }
    bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
    K key2=getKey();
    if (equals(key,key2)) {
      return true;
    }
  }
}

Fixed version (ground truth):
public synchronized boolean containsKey(long h,K key){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  boolean found=false;
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      Object key2=key instanceof CharSequence ? key.toString() : key;
      return map.containsKey(key2);
    }
    bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
    K key2=getKey();
    if (equals(key,key2)) {
      return true;
    }
  }
}
Program: 91494
Project: 91494
Buggy source:
public synchronized boolean remove(long h,K key){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  boolean found=false;
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      break;
    }
    bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
    K key2=getKey();
    if (equals(key,key2)) {
      usedSet.clear(pos);
      smallMap.remove(hash,pos);
      found=true;
      this.size--;
      break;
    }
  }
  DirectStore remove=map.remove(key);
  if (remove == null)   return found;
  offHeapUsed-=remove.size();
  remove.free();
  this.size--;
  return true;
}

Fixed version (ground truth):
public synchronized boolean remove(long h,K key){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  boolean found=false;
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      break;
    }
    bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
    K key2=getKey();
    if (equals(key,key2)) {
      usedSet.clear(pos);
      smallMap.remove(hash,pos);
      found=true;
      this.size--;
      break;
    }
  }
  Object key2=key instanceof CharSequence ? key.toString() : key;
  DirectStore remove=map.remove(key2);
  if (remove == null)   return found;
  offHeapUsed-=remove.size();
  remove.free();
  this.size--;
  return true;
}
Program: 91495
Project: 91495
Buggy source:
public synchronized V get(long h,K key,V value){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      final DirectStore store=map.get(key);
      if (store == null)       return null;
      bytes.storePositionAndSize(store,0,store.size());
      break;
    }
 else {
      bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
      K key2=getKey();
      if (equals(key,key2))       break;
    }
  }
  if (bytesMarshallable) {
    try {
      V v=value == null ? (V)NativeBytes.UNSAFE.allocateInstance(vClass) : value;
      ((BytesMarshallable)v).readMarshallable(bytes);
      return v;
    }
 catch (    InstantiationException e) {
      throw new AssertionError(e);
    }
  }
  return (V)bytes.readObject();
}

Fixed version (ground truth):
public synchronized V get(long h,K key,V value){
  int hash=intHashFor(h);
  smallMap.startSearch(hash);
  while (true) {
    int pos=smallMap.nextInt();
    if (pos == IntIntMultiMap.UNSET) {
      Object key2=key instanceof CharSequence ? key.toString() : key;
      final DirectStore store=map.get(key2);
      if (store == null)       return null;
      bytes.storePositionAndSize(store,0,store.size());
      break;
    }
 else {
      bytes.storePositionAndSize(store,pos * smallEntrySize,smallEntrySize);
      K key2=getKey();
      if (equals(key,key2))       break;
    }
  }
  if (bytesMarshallable) {
    try {
      V v=value == null ? (V)NativeBytes.UNSAFE.allocateInstance(vClass) : value;
      ((BytesMarshallable)v).readMarshallable(bytes);
      return v;
    }
 catch (    InstantiationException e) {
      throw new AssertionError(e);
    }
  }
  return (V)bytes.readObject();
}