nus-yam/ex-repair huggingface dataset:
Program: 91413
Project: 91413
Buggy source:
public void sendBootstrap(@NotNull final SocketChannel socketChannel,final long timeStampOfLastMessage,final int localIdentifier1) throws IOException {
  bytes.clear();
  byteBuffer.clear();
  bytes.writeByte(localIdentifier1);
  bytes.writeLong(timeStampOfLastMessage);
  byteBuffer.limit((int)bytes.position());
  socketChannel.write(byteBuffer);
  if (byteBuffer.remaining() == 0) {
    byteBuffer.clear();
    bytes.clear();
  }
 else {
    byteBuffer.compact();
    byteBuffer.flip();
    bytes.limit(bytes.capacity());
    byteBuffer.limit(byteBuffer.capacity());
  }
}

Fixed version (ground truth):
public void sendBootstrap(@NotNull final SocketChannel socketChannel,final long timeStampOfLastMessage,final int localIdentifier) throws IOException {
  bytes.clear();
  byteBuffer.clear();
  bytes.writeByte(localIdentifier);
  bytes.writeLong(timeStampOfLastMessage);
  byteBuffer.limit((int)bytes.position());
  socketChannel.write(byteBuffer);
  if (byteBuffer.remaining() == 0) {
    byteBuffer.clear();
    bytes.clear();
  }
 else {
    byteBuffer.compact();
    byteBuffer.flip();
    bytes.limit(bytes.capacity());
    byteBuffer.limit(byteBuffer.capacity());
  }
}
Program: 91414
Project: 91414
Buggy source:
@Test public void test() throws IOException, InterruptedException {
  map1.put(1,"String_Node_Str");
  map2.put(2,"String_Node_Str");
  map3.put(3,"String_Node_Str");
  map4.put(4,"String_Node_Str");
  waitTillEqual(1000);
  assertEquals("String_Node_Str",new TreeMap(map1),new TreeMap(map2));
  assertEquals("String_Node_Str",new TreeMap(map1),new TreeMap(map3));
  assertEquals("String_Node_Str",new TreeMap(map1),new TreeMap(map4));
  assertTrue("String_Node_Str",!map2.isEmpty());
}

Fixed version (ground truth):
@Test public void test() throws IOException, InterruptedException {
  Thread.sleep(1000);
  map1.put(1,"String_Node_Str");
  map2.put(2,"String_Node_Str");
  map3.put(3,"String_Node_Str");
  map4.remove(3);
  waitTillEqual(1000);
  assertEquals("String_Node_Str",new TreeMap(map1),new TreeMap(map2));
  assertEquals("String_Node_Str",new TreeMap(map1),new TreeMap(map3));
  assertEquals("String_Node_Str",new TreeMap(map1),new TreeMap(map4));
  assertTrue("String_Node_Str",!map2.isEmpty());
}
Program: 91415
Project: 91415
Buggy source:
/** 
 * @return the maximum size that an entry can be, this includes over sized entries
 */
int maxEntrySize(){
  return entrySize;
}

Fixed version (ground truth):
/** 
 * @return the maximum size that an entry can be, this includes over sized entries
 */
int maxEntrySize(){
  return entrySize * 2;
}
Program: 91417
Project: 91417
Buggy source:
/** 
 * @see net.openhft.collections.VanillaSharedHashMap.Segment#remove(net.openhft.lang.io.Bytes,Object,Object,int)
 */
public V replace(Bytes keyBytes,K key,V expectedValue,V newValue,int hash2,long timestamp){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookupLiveOnly.startSearch(hash2);
    int pos;
    while ((pos=hashLookupLiveOnly.nextPos()) >= 0) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      if (canReplicate && shouldTerminate(entry,timestamp,localIdentifier)) {
        return null;
      }
      entry.skip(1);
      return onKeyPresentOnReplace(key,expectedValue,newValue,pos,offset,entry);
    }
    return null;
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * @see net.openhft.collections.VanillaSharedHashMap.Segment#remove(net.openhft.lang.io.Bytes,Object,Object,int)
 */
public V replace(Bytes keyBytes,K key,V expectedValue,V newValue,int hash2,long timestamp){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookupLiveOnly.startSearch(hash2);
    for (int pos; (pos=hashLookupLiveOnly.nextPos()) >= 0; ) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      if (canReplicate) {
        if (shouldTerminate(entry,timestamp,localIdentifier))         return null;
        entry.skip(1);
      }
      return onKeyPresentOnReplace(key,expectedValue,newValue,pos,offset,entry);
    }
    return null;
  }
  finally {
    unlock();
  }
}
Program: 91418
Project: 91418
Buggy source:
/** 
 * @see net.openhft.collections.VanillaSharedHashMap.Segment#acquire(net.openhft.lang.io.Bytes,Object,Object,int,boolean)
 */
V acquire(Bytes keyBytes,K key,V usingValue,int hash2,boolean create,long timestamp){
  lock();
  try {
    MultiStoreBytes entry=tmpBytes;
    long offset=searchKey(keyBytes,hash2,entry,hashLookupLiveOnly);
    if (offset >= 0) {
      if (canReplicate && shouldTerminate(entry,timestamp,localIdentifier))       return null;
      entry.skip(1);
      return onKeyPresentOnAcquire(key,usingValue,offset,entry);
    }
 else {
      usingValue=tryObtainUsingValueOnAcquire(keyBytes,key,usingValue,create);
      if (usingValue != null) {
        offset=putEntryConsideringByteableValue(keyBytes,hash2,usingValue);
        incrementSize();
        notifyPut(offset,true,key,usingValue,posFromOffset(offset));
        return usingValue;
      }
 else {
        return null;
      }
    }
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * @see net.openhft.collections.VanillaSharedHashMap.Segment#acquire(net.openhft.lang.io.Bytes,Object,Object,int,boolean)
 */
V acquire(Bytes keyBytes,K key,V usingValue,int hash2,boolean create,long timestamp){
  lock();
  try {
    MultiStoreBytes entry=tmpBytes;
    long offset=searchKey(keyBytes,hash2,entry,hashLookupLiveOnly);
    if (offset >= 0) {
      if (canReplicate) {
        if (shouldTerminate(entry,timestamp,localIdentifier))         return null;
        entry.skip(1);
      }
      return onKeyPresentOnAcquire(key,usingValue,offset,entry);
    }
 else {
      usingValue=tryObtainUsingValueOnAcquire(keyBytes,key,usingValue,create);
      if (usingValue != null) {
        offset=putEntryConsideringByteableValue(keyBytes,hash2,usingValue);
        incrementSize();
        notifyPut(offset,true,key,usingValue,posFromOffset(offset));
        return usingValue;
      }
 else {
        return null;
      }
    }
  }
  finally {
    unlock();
  }
}
Program: 91420
Project: 91420
Buggy source:
/** 
 * @see net.openhft.collections.VanillaSharedHashMap.Segment#remove(net.openhft.lang.io.Bytes,Object,Object,int)
 */
public V remove(Bytes keyBytes,K key,V expectedValue,int hash2,final long timestamp,final byte identifier){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookupLiveOnly.startSearch(hash2);
    int pos;
    while ((pos=hashLookupLiveOnly.nextPos()) >= 0) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      long timeStampPos=0;
      if (canReplicate) {
        timeStampPos=entry.position();
        if (shouldTerminate(entry,timestamp,identifier))         return null;
        entry.skip(1);
      }
      long valueLen=readValueLen(entry);
      long entryEndAddr=entry.positionAddr() + valueLen;
      V valueRemoved=expectedValue != null || !removeReturnsNull ? readValue(entry,null,valueLen) : null;
      if (expectedValue != null && !expectedValue.equals(valueRemoved)) {
        return null;
      }
      hashLookupLiveOnly.removePrevPos();
      decrementSize();
      if (canReplicate) {
        entry.position(timeStampPos);
        entry.writeLong(timestamp);
        entry.writeByte(identifier);
        entry.writeBoolean(true);
      }
 else {
        free(pos,inBlocks(entryEndAddr - entryStartAddr(offset)));
      }
      notifyRemoved(offset,key,valueRemoved,pos);
      return valueRemoved;
    }
    return null;
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * @see net.openhft.collections.VanillaSharedHashMap.Segment#remove(net.openhft.lang.io.Bytes,Object,Object,int)
 */
public V remove(Bytes keyBytes,K key,V expectedValue,int hash2,final long timestamp,final byte identifier){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookupLiveOnly.startSearch(hash2);
    for (int pos; (pos=hashLookupLiveOnly.nextPos()) >= 0; ) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      long timeStampPos=0;
      if (canReplicate) {
        timeStampPos=entry.position();
        if (shouldTerminate(entry,timestamp,identifier))         return null;
        entry.skip(1);
      }
      long valueLen=readValueLen(entry);
      long entryEndAddr=entry.positionAddr() + valueLen;
      V valueRemoved=expectedValue != null || !removeReturnsNull ? readValue(entry,null,valueLen) : null;
      if (expectedValue != null && !expectedValue.equals(valueRemoved)) {
        return null;
      }
      hashLookupLiveOnly.removePrevPos();
      decrementSize();
      if (canReplicate) {
        entry.position(timeStampPos);
        entry.writeLong(timestamp);
        entry.writeByte(identifier);
        entry.writeBoolean(true);
      }
 else {
        free(pos,inBlocks(entryEndAddr - entryStartAddr(offset)));
      }
      notifyRemoved(offset,key,valueRemoved,pos);
      return valueRemoved;
    }
    return null;
  }
  finally {
    unlock();
  }
}
Program: 91421
Project: 91421
Buggy source:
@Override public void onUpdate(AbstractBytes entry){
  if (!canReplicate)   throw new IllegalStateException("String_Node_Str");
  final long keyLen=entry.readStopBit();
  final Bytes keyBytes=entry.createSlice(0,keyLen);
  entry.skip(keyLen);
  final long timeStamp=entry.readLong();
  final byte identifier=entry.readByte();
  final boolean isDeleted=entry.readBoolean();
  long hash=Hasher.hash(keyBytes);
  int segmentNum=hasher.getSegment(hash);
  int segmentHash=hasher.segmentHash(hash);
  if (isDeleted)   segment(segmentNum).remoteRemove(keyBytes,segmentHash,timeStamp,identifier);
 else {
    long valueLen=entry.readStopBit();
    final Bytes value=entry.createSlice(0,valueLen);
    segment(segmentNum).replicatingPut(keyBytes,value,segmentHash,identifier,timeStamp,valueLen,this.entrySize);
  }
}

Fixed version (ground truth):
@Override public void onUpdate(AbstractBytes entry){
  if (!canReplicate)   throw new IllegalStateException("String_Node_Str");
  final long keyLen=entry.readStopBit();
  final Bytes keyBytes=entry.createSlice(0,keyLen);
  entry.skip(keyLen);
  final long timeStamp=entry.readLong();
  final byte identifier=entry.readByte();
  final boolean isDeleted=entry.readBoolean();
  long hash=Hasher.hash(keyBytes);
  int segmentNum=hasher.getSegment(hash);
  int segmentHash=hasher.segmentHash(hash);
  if (isDeleted)   segment(segmentNum).remoteRemove(keyBytes,segmentHash,timeStamp,identifier);
 else {
    long valueLen=entry.readStopBit();
    final Bytes value=entry.createSlice(0,valueLen);
    segment(segmentNum).replicatingPut(keyBytes,value,segmentHash,identifier,timeStamp);
  }
}
Program: 91422
Project: 91422
Buggy source:
/** 
 * called from a remote node as part of replication
 * @param keyBytes
 * @param hash2
 * @param timestamp
 * @param identifier
 * @return
 */
private void remoteRemove(Bytes keyBytes,int hash2,final long timestamp,final byte identifier){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookupLiveOnly.startSearch(hash2);
    int pos;
    while ((pos=hashLookupLiveOnly.nextPos()) >= 0) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      long timeStampPos=entry.position();
      if (shouldTerminate(entry,timestamp,identifier))       return;
      entry.skip(1);
      hashLookupLiveOnly.removePrevPos();
      decrementSize();
      entry.position(timeStampPos);
      entry.writeLong(timestamp);
      entry.writeByte(identifier);
      entry.writeBoolean(true);
    }
    return;
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * called from a remote node as part of replication
 * @param keyBytes
 * @param hash2
 * @param timestamp
 * @param identifier
 * @return
 */
private void remoteRemove(Bytes keyBytes,int hash2,final long timestamp,final byte identifier){
  lock();
  try {
    MultiStoreBytes entry=tmpBytes;
    if (searchKey(keyBytes,hash2,entry,hashLookupLiveOnly) >= 0L) {
      long timeStampPos=entry.position();
      if (shouldTerminate(entry,timestamp,identifier))       return;
      entry.skip(1);
      hashLookupLiveOnly.removePrevPos();
      decrementSize();
      entry.position(timeStampPos);
      entry.writeLong(timestamp);
      entry.writeByte(identifier);
      entry.writeBoolean(true);
    }
  }
  finally {
    unlock();
  }
}
Program: 91423
Project: 91423
Buggy source:
long searchKey(Bytes keyBytes,int hash2,MultiStoreBytes entry,IntIntMultiMap hashLookup){
  long keyLen=keyBytes.remaining();
  hashLookup.startSearch(hash2);
  for (int pos; (pos=hashLookup.nextPos()) >= 0; ) {
    long offset=offsetFromPos(pos);
    reuse(entry,offset);
    if (!keyEqualsForAcquire(keyBytes,keyLen,entry))     continue;
    entry.skip(keyLen);
    return offset;
  }
  return -1L;
}

Fixed version (ground truth):
long searchKey(Bytes keyBytes,int hash2,MultiStoreBytes entry,IntIntMultiMap hashLookup){
  long keyLen=keyBytes.remaining();
  hashLookup.startSearch(hash2);
  for (int pos; (pos=hashLookup.nextPos()) >= 0; ) {
    long offset=offsetFromPos(pos);
    reuse(entry,offset);
    if (!keyEquals(keyBytes,keyLen,entry))     continue;
    entry.skip(keyLen);
    return offset;
  }
  return -1L;
}
Program: 91424
Project: 91424
Buggy source:
/** 
 * Check there is no garbage in freeList.
 */
void checkConsistency(){
  lock();
  try {
    int pos=0;
    while ((pos=(int)freeList.nextSetBit(pos)) >= 0) {
      PosPresentOnce check=new PosPresentOnce(pos);
      hashLookup.forEach(check);
      if (check.count != 1)       throw new AssertionError();
      long offset=offsetFromPos(pos);
      Bytes entry=entry(offset);
      long keyLen=entry.readStopBit();
      entry.skip(keyLen);
      long valueLen=entry.readStopBit();
      long sizeInBytes=entrySize(keyLen,valueLen);
      int entrySizeInBlocks=inBlocks(sizeInBytes);
      if (!freeList.allSet(pos,pos + entrySizeInBlocks))       throw new AssertionError();
      pos+=entrySizeInBlocks;
    }
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * Check there is no garbage in freeList.
 */
void checkConsistency(){
  lock();
  try {
    for (int pos=0; (pos=(int)freeList.nextSetBit(pos)) >= 0; ) {
      PosPresentOnce check=new PosPresentOnce(pos);
      hashLookup.forEach(check);
      if (check.count != 1)       throw new AssertionError();
      long offset=offsetFromPos(pos);
      Bytes entry=entry(offset);
      long keyLen=entry.readStopBit();
      entry.skip(keyLen);
      long valueLen=entry.readStopBit();
      long sizeInBytes=entrySize(keyLen,valueLen);
      int entrySizeInBlocks=inBlocks(sizeInBytes);
      if (!freeList.allSet(pos,pos + entrySizeInBlocks))       throw new AssertionError();
      pos+=entrySizeInBlocks;
    }
  }
  finally {
    unlock();
  }
}
Program: 91425
Project: 91425
Buggy source:
/** 
 * Replaces the specified value for the key with the given value. <p/>  {@code newValue} is set only if the existing value correspondingto the specified key is equal to  {@code expectedValue}or   {@code expectedValue == null}.
 * @param hash2 a hash code related to the {@code keyBytes}
 * @return the replaced value or {@code null} if the value was not replaced
 */
V replace(Bytes keyBytes,K key,V expectedValue,V newValue,int hash2){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookup.startSearch(hash2);
    int pos;
    while ((pos=hashLookup.nextPos()) >= 0) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      long valueLenPos=entry.position();
      long valueLen=readValueLen(entry);
      long entryEndAddr=entry.positionAddr() + valueLen;
      V valueRead=readValue(entry,null,valueLen);
      if (valueRead == null)       return null;
      if (expectedValue == null || expectedValue.equals(valueRead)) {
        offset=putValue(pos,offset,entry,valueLenPos,entryEndAddr,getValueAsBytes(newValue));
        notifyPut(offset,false,key,newValue,pos);
        return valueRead;
      }
      return null;
    }
    return null;
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * Replaces the specified value for the key with the given value. <p/>  {@code newValue} is set only if the existing value correspondingto the specified key is equal to  {@code expectedValue}or   {@code expectedValue == null}.
 * @param hash2 a hash code related to the {@code keyBytes}
 * @return the replaced value or {@code null} if the value was not replaced
 */
V replace(Bytes keyBytes,K key,V expectedValue,V newValue,int hash2){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookup.startSearch(hash2);
    for (int pos; (pos=hashLookup.nextPos()) >= 0; ) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      long valueLenPos=entry.position();
      long valueLen=readValueLen(entry);
      long entryEndAddr=entry.positionAddr() + valueLen;
      V valueRead=readValue(entry,null,valueLen);
      if (valueRead == null)       return null;
      if (expectedValue == null || expectedValue.equals(valueRead)) {
        offset=putValue(pos,offset,entry,valueLenPos,entryEndAddr,getValueAsBytes(newValue));
        notifyPut(offset,false,key,newValue,posFromOffset(offset));
        return valueRead;
      }
      return null;
    }
    return null;
  }
  finally {
    unlock();
  }
}
Program: 91426
Project: 91426
Buggy source:
V put(Bytes keyBytes,K key,V value,int hash2,boolean replaceIfPresent){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookup.startSearch(hash2);
    int pos;
    while ((pos=hashLookup.nextPos()) >= 0) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      if (replaceIfPresent) {
        long valueLenPos=entry.position();
        long valueLen=readValueLen(entry);
        long entryEndAddr=entry.positionAddr() + valueLen;
        V prevValue=null;
        if (!putReturnsNull)         prevValue=readValue(entry,null,valueLen);
        offset=putValue(pos,offset,entry,valueLenPos,entryEndAddr,getValueAsBytes(value));
        notifyPut(offset,false,key,value,pos);
        return prevValue;
      }
 else {
        return putReturnsNull ? null : readValue(entry,null);
      }
    }
    long offset=putEntry(keyBytes,value);
    incrementSize();
    notifyPut(offset,true,key,value,posFromOffset(offset));
    return null;
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
V put(Bytes keyBytes,K key,V value,int hash2,boolean replaceIfPresent){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookup.startSearch(hash2);
    for (int pos; (pos=hashLookup.nextPos()) >= 0; ) {
      long offset=offsetFromPos(pos);
      NativeBytes entry=entry(offset);
      if (!keyEquals(keyBytes,keyLen,entry))       continue;
      entry.skip(keyLen);
      if (replaceIfPresent) {
        long valueLenPos=entry.position();
        long valueLen=readValueLen(entry);
        long entryEndAddr=entry.positionAddr() + valueLen;
        V prevValue=null;
        if (!putReturnsNull)         prevValue=readValue(entry,null,valueLen);
        offset=putValue(pos,offset,entry,valueLenPos,entryEndAddr,getValueAsBytes(value));
        notifyPut(offset,false,key,value,posFromOffset(offset));
        return prevValue;
      }
 else {
        return putReturnsNull ? null : readValue(entry,null);
      }
    }
    long offset=putEntry(keyBytes,value);
    incrementSize();
    notifyPut(offset,true,key,value,posFromOffset(offset));
    return null;
  }
  finally {
    unlock();
  }
}
Program: 91427
Project: 91427
Buggy source:
boolean containsKey(Bytes keyBytes,int hash2){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookup.startSearch(hash2);
    int pos;
    while ((pos=hashLookup.nextPos()) >= 0) {
      Bytes entry=entry(offsetFromPos(pos));
      if (keyEquals(keyBytes,keyLen,entry))       return true;
    }
    return false;
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
boolean containsKey(Bytes keyBytes,int hash2){
  lock();
  try {
    long keyLen=keyBytes.remaining();
    hashLookup.startSearch(hash2);
    for (int pos; (pos=hashLookup.nextPos()) >= 0; ) {
      Bytes entry=entry(offsetFromPos(pos));
      if (keyEquals(keyBytes,keyLen,entry))       return true;
    }
    return false;
  }
  finally {
    unlock();
  }
}
Program: 91429
Project: 91429
Buggy source:
public VanillaSharedReplicatedHashMap(VanillaSharedReplicatedHashMapBuilder builder,File file,Class<K> kClass,Class<V> vClass) throws IOException {
  super(builder,file,kClass,vClass);
  this.canReplicate=builder.canReplicate();
  this.timeProvider=builder.timeProvider();
  this.localIdentifier=builder.identifier();
}

Fixed version (ground truth):
public VanillaSharedReplicatedHashMap(VanillaSharedReplicatedHashMapBuilder builder,File file,Class<K> kClass,Class<V> vClass) throws IOException {
  super(builder,kClass,vClass);
  this.canReplicate=builder.canReplicate();
  this.timeProvider=builder.timeProvider();
  this.localIdentifier=builder.identifier();
  createMappedStoreAndSegments(file);
}
Program: 91430
Project: 91430
Buggy source:
void notifyGet(long offset,K key,V value){
  if (eventListener != SharedMapEventListeners.NOP) {
    tmpBytes.storePositionAndSize(bytes,offset,entrySize);
    eventListener.onGetFound(VanillaSharedHashMap.this,tmpBytes,metaDataBytes,key,value);
  }
}

Fixed version (ground truth):
void notifyGet(long offset,K key,V value){
  if (eventListener != SharedMapEventListeners.NOP) {
    tmpBytes.storePositionAndSize(bytes,offset,entrySize);
    eventListener.onGetFound(AbstractVanillaSharedHashMap.this,tmpBytes,metaDataBytes,key,value);
  }
}
Program: 91431
Project: 91431
Buggy source:
public boolean contains(Object o){
  if (!(o instanceof Map.Entry))   return false;
  Map.Entry<?,?> e=(Map.Entry<?,?>)o;
  try {
    V v=VanillaSharedHashMap.this.get(e.getKey());
    return v != null && v.equals(e.getValue());
  }
 catch (  ClassCastException ex) {
    return false;
  }
catch (  NullPointerException ex) {
    return false;
  }
}

Fixed version (ground truth):
public boolean contains(Object o){
  if (!(o instanceof Map.Entry))   return false;
  Map.Entry<?,?> e=(Map.Entry<?,?>)o;
  try {
    V v=AbstractVanillaSharedHashMap.this.get(e.getKey());
    return v != null && v.equals(e.getValue());
  }
 catch (  ClassCastException ex) {
    return false;
  }
catch (  NullPointerException ex) {
    return false;
  }
}
Program: 91432
Project: 91432
Buggy source:
public int size(){
  return VanillaSharedHashMap.this.size();
}

Fixed version (ground truth):
public int size(){
  return AbstractVanillaSharedHashMap.this.size();
}
Program: 91433
Project: 91433
Buggy source:
void notifyPut(long offset,boolean added,K key,V value,final long pos){
  if (eventListener != SharedMapEventListeners.NOP) {
    tmpBytes.storePositionAndSize(bytes,offset,entrySize);
    eventListener.onPut(VanillaSharedHashMap.this,tmpBytes,metaDataBytes,added,key,value,pos,this);
  }
}

Fixed version (ground truth):
void notifyPut(long offset,boolean added,K key,V value,final long pos){
  if (eventListener != SharedMapEventListeners.NOP) {
    tmpBytes.storePositionAndSize(bytes,offset,entrySize);
    eventListener.onPut(AbstractVanillaSharedHashMap.this,tmpBytes,metaDataBytes,added,key,value,pos,this);
  }
}
Program: 91434
Project: 91434
Buggy source:
V notifyMissed(Bytes keyBytes,K key,V usingValue){
  if (eventListener != SharedMapEventListeners.NOP) {
    return eventListener.onGetMissing(VanillaSharedHashMap.this,keyBytes,key,usingValue);
  }
  return null;
}

Fixed version (ground truth):
V notifyMissed(Bytes keyBytes,K key,V usingValue){
  if (eventListener != SharedMapEventListeners.NOP) {
    return eventListener.onGetMissing(AbstractVanillaSharedHashMap.this,keyBytes,key,usingValue);
  }
  return null;
}
Program: 91435
Project: 91435
Buggy source:
public VanillaSharedHashMap(SharedHashMapBuilder builder,File file,Class<K> kClass,Class<V> vClass) throws IOException {
  bufferAllocationFactor=figureBufferAllocationFactor(builder);
  this.kClass=kClass;
  this.vClass=vClass;
  lockTimeOutNS=builder.lockTimeOutMS() * 1000000;
  this.replicas=builder.replicas();
  this.entrySize=builder.alignedEntrySize();
  this.alignment=builder.entryAndValueAlignment();
  this.errorListener=builder.errorListener();
  this.generatedKeyType=builder.generatedKeyType();
  this.generatedValueType=builder.generatedValueType();
  this.putReturnsNull=builder.putReturnsNull();
  this.removeReturnsNull=builder.removeReturnsNull();
  int segments=builder.actualSegments();
  int entriesPerSegment=builder.actualEntriesPerSegment();
  this.entriesPerSegment=entriesPerSegment;
  this.metaDataBytes=builder.metaDataBytes();
  this.eventListener=builder.eventListener();
  this.hashMask=entriesPerSegment > (1 << 16) ? ~0 : 0xFFFF;
  this.hasher=new Hasher(segments,hashMask);
  @SuppressWarnings("String_Node_Str") Segment[] ss=(VanillaSharedHashMap.Segment[])new VanillaSharedHashMap.Segment[segments];
  this.segments=ss;
  this.ms=new MappedStore(file,FileChannel.MapMode.READ_WRITE,sizeInBytes());
  long offset=SharedHashMapBuilder.HEADER_SIZE;
  long segmentSize=segmentSize();
  for (int i=0; i < this.segments.length; i++) {
    this.segments[i]=createSegment(ms.createSlice(offset,segmentSize),i);
    offset+=segmentSize;
  }
}

Fixed version (ground truth):
public VanillaSharedHashMap(SharedHashMapBuilder builder,File file,Class<K> kClass,Class<V> vClass) throws IOException {
  super(builder,kClass,vClass);
  createMappedStoreAndSegments(file);
}
Program: 91436
Project: 91436
Buggy source:
void notifyRemoved(long offset,K key,V value,final int pos){
  if (eventListener != SharedMapEventListeners.NOP) {
    tmpBytes.storePositionAndSize(bytes,offset,entrySize);
    eventListener.onRemove(VanillaSharedHashMap.this,tmpBytes,metaDataBytes,key,value,pos,this);
  }
}

Fixed version (ground truth):
void notifyRemoved(long offset,K key,V value,final int pos){
  if (eventListener != SharedMapEventListeners.NOP) {
    tmpBytes.storePositionAndSize(bytes,offset,entrySize);
    eventListener.onRemove(AbstractVanillaSharedHashMap.this,tmpBytes,metaDataBytes,key,value,pos,this);
  }
}
Program: 91437
Project: 91437
Buggy source:
public boolean remove(Object o){
  if (!(o instanceof Map.Entry))   return false;
  Map.Entry<?,?> e=(Map.Entry<?,?>)o;
  try {
    Object key=e.getKey();
    Object value=e.getValue();
    return VanillaSharedHashMap.this.remove(key,value);
  }
 catch (  ClassCastException ex) {
    return false;
  }
catch (  NullPointerException ex) {
    return false;
  }
}

Fixed version (ground truth):
public boolean remove(Object o){
  if (!(o instanceof Map.Entry))   return false;
  Map.Entry<?,?> e=(Map.Entry<?,?>)o;
  try {
    Object key=e.getKey();
    Object value=e.getValue();
    return AbstractVanillaSharedHashMap.this.remove(key,value);
  }
 catch (  ClassCastException ex) {
    return false;
  }
catch (  NullPointerException ex) {
    return false;
  }
}
Program: 91438
Project: 91438
Buggy source:
public VanillaSharedHashMap.Segment[] getSegments(){
  return segments;
}

Fixed version (ground truth):
public SharedSegment[] getSegments(){
  return segments;
}
Program: 91439
Project: 91439
Buggy source:
public void clear(){
  VanillaSharedHashMap.this.clear();
}

Fixed version (ground truth):
public void clear(){
  AbstractVanillaSharedHashMap.this.clear();
}
Program: 91440
Project: 91440
Buggy source:
public boolean isEmpty(){
  return VanillaSharedHashMap.this.isEmpty();
}

Fixed version (ground truth):
public boolean isEmpty(){
  return AbstractVanillaSharedHashMap.this.isEmpty();
}
Program: 91441
Project: 91441
Buggy source:
/** 
 * /
 * @param readLocation we want to minimize the number of volatile reads, so we read the readLocation just once, and pass it in
 * @return
 */
int blockForReadSpace(int readLocation){
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  while (locator.getWriteLocation() == readLocation)   blockAtTake();
  return nextReadLocation;
}

Fixed version (ground truth):
/** 
 * /
 * @param readLocation we want to minimize the number of volatile reads, so we read the readLocation just once, and pass it in
 * @return
 */
int blockForReadSpace(int readLocation){
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  while (locator.getWriterLocation() == readLocation)   blockAtTake();
  return nextReadLocation;
}
Program: 91442
Project: 91442
Buggy source:
/** 
 * The items will be cleared correctly only if nothing was added or removed from the queue at the time it was called
 * @return an approximation of the size
 */
public void clear(){
  setReadLocation(locator.getWriteLocation());
}

Fixed version (ground truth):
/** 
 * The items will be cleared correctly only if nothing was added or removed from the queue at the time it was called
 * @return an approximation of the size
 */
public void clear(){
  setReadLocation(locator.getWriterLocation());
}
Program: 91443
Project: 91443
Buggy source:
/** 
 * This method does not lock, it therefore only provides and approximation of isEmpty(), it will be correct, if nothing was added or removed from the queue at the time it was called.
 * @return an approximation of isEmpty()
 */
public boolean isEmpty(){
  return locator.getReadLocation() == locator.getWriteLocation();
}

Fixed version (ground truth):
/** 
 * This method does not lock, it therefore only provides and approximation of isEmpty(), it will be correct, if nothing was added or removed from the queue at the time it was called.
 * @return an approximation of isEmpty()
 */
public boolean isEmpty(){
  return locator.getReadLocation() == locator.getWriterLocation();
}
Program: 91444
Project: 91444
Buggy source:
void setWriteLocation(int nextWriteLocation){
  this.producerWriteLocation=nextWriteLocation;
  locator.setWriteLocation(nextWriteLocation);
}

Fixed version (ground truth):
void setWriteLocation(int nextWriteLocation){
  this.producerWriteLocation=nextWriteLocation;
  locator.setWriterLocation(nextWriteLocation);
}
Program: 91445
Project: 91445
Buggy source:
/** 
 * /
 * @param readLocation we want to minimize the number of volatile reads, so we read the readLocation just once, and pass it in
 * @return
 */
int blockForReadSpaceThrowNoSuchElementException(int readLocation){
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  while (locator.getWriteLocation() == readLocation)   throw new NoSuchElementException();
  return nextReadLocation;
}

Fixed version (ground truth):
/** 
 * /
 * @param readLocation we want to minimize the number of volatile reads, so we read the readLocation just once, and pass it in
 * @return
 */
int blockForReadSpaceThrowNoSuchElementException(int readLocation){
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  while (locator.getWriterLocation() == readLocation)   throw new NoSuchElementException();
  return nextReadLocation;
}
Program: 91446
Project: 91446
Buggy source:
/** 
 * This method is not thread safe it therefore only provides and approximation of the size, the size will be corrected if nothing was added or removed from the queue at the time it was called
 * @return an approximation of the size
 */
public int size(){
  int read=locator.getReadLocation();
  int write=locator.getWriteLocation();
  if (write < read)   write+=dataLocator.getCapacity();
  return write - read;
}

Fixed version (ground truth):
/** 
 * This method is not thread safe it therefore only provides and approximation of the size, the size will be corrected if nothing was added or removed from the queue at the time it was called
 * @return an approximation of the size
 */
public int size(){
  int read=locator.getReadLocation();
  int write=locator.getWriterLocation();
  if (write < read)   write+=dataLocator.getCapacity();
  return write - read;
}
Program: 91447
Project: 91447
Buggy source:
/** 
 * Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking, or <tt>Integer.MAX_VALUE</tt> if there is no intrinsic limit. <p/> <p>Note that you <em>cannot</em> always tell if an attempt to insert an element will succeed by inspecting <tt>remainingdataLocator.getCapacity()</tt> because it may be the case that another thread is about to insert or remove an element.
 * @return the remaining capacity
 */
public int remainingCapacity(){
  int readLocation=locator.getReadLocation();
  int writeLocation=locator.getWriteLocation();
  if (writeLocation < readLocation)   writeLocation+=dataLocator.getCapacity();
  return (dataLocator.getCapacity() - 1) - (writeLocation - readLocation);
}

Fixed version (ground truth):
/** 
 * Returns the number of additional elements that this queue can ideally (in the absence of memory or resource constraints) accept without blocking, or <tt>Integer.MAX_VALUE</tt> if there is no intrinsic limit. <p/> <p>Note that you <em>cannot</em> always tell if an attempt to insert an element will succeed by inspecting <tt>remainingdataLocator.getCapacity()</tt> because it may be the case that another thread is about to insert or remove an element.
 * @return the remaining capacity
 */
public int remainingCapacity(){
  int readLocation=locator.getReadLocation();
  int writeLocation=locator.getWriterLocation();
  if (writeLocation < readLocation)   writeLocation+=dataLocator.getCapacity();
  return (dataLocator.getCapacity() - 1) - (writeLocation - readLocation);
}
Program: 91448
Project: 91448
Buggy source:
@Override public boolean containsAll(Collection<?> items){
  final int read=locator.getReadLocation();
  final int write=locator.getWriteLocation();
  if (items.size() == 0)   return true;
  if (read == write)   return false;
  for (  Object o : items) {
    if (!contains(o))     return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean containsAll(Collection<?> items){
  final int read=locator.getReadLocation();
  final int write=locator.getWriterLocation();
  if (items.size() == 0)   return true;
  if (read == write)   return false;
  for (  Object o : items) {
    if (!contains(o))     return false;
  }
  return true;
}
Program: 91449
Project: 91449
Buggy source:
/** 
 * Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
 * @return the head of this queue, or <tt>null</tt> if thespecified waiting time elapses before an element is available
 */
public E poll(){
  final int readLocation=this.consumerReadLocation;
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  if (locator.getWriteLocation() == readLocation)   return null;
  final E value=dataLocator.getData(readLocation);
  setReadLocation(nextReadLocation);
  return value;
}

Fixed version (ground truth):
/** 
 * Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.
 * @return the head of this queue, or <tt>null</tt> if thespecified waiting time elapses before an element is available
 */
public E poll(){
  final int readLocation=this.consumerReadLocation;
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  if (locator.getWriterLocation() == readLocation)   return null;
  final E value=dataLocator.getData(readLocation);
  setReadLocation(nextReadLocation);
  return value;
}
Program: 91451
Project: 91451
Buggy source:
@Override public boolean removeAll(Collection<?> c){
  final E[] newData=(E[])new Object[dataLocator.getCapacity()];
  boolean hasRemovedItem=false;
  int read=this.locator.getReadLocation();
  int write=this.locator.getWriteLocation();
  if (read == write)   return false;
  int i=0;
  if (read < write) {
    for (int location=read; location < write; location++) {
      if (c.contains(dataLocator.getData(location))) {
        hasRemovedItem=true;
      }
 else {
        newData[i++]=dataLocator.getData(location);
      }
    }
  }
 else {
    for (int location=read; location < dataLocator.getCapacity(); location++) {
      if (!c.contains(dataLocator.getData(location))) {
        hasRemovedItem=true;
      }
 else {
        newData[i++]=dataLocator.getData(location);
      }
    }
    for (int location=0; location <= write; location++) {
      if (!c.contains(dataLocator.getData(location))) {
        hasRemovedItem=true;
      }
 else {
        newData[i++]=dataLocator.getData(location);
      }
    }
  }
  if (!hasRemovedItem)   return false;
  this.locator.setReadLocation(0);
  this.locator.setWriteLocation(i);
  dataLocator.writeAll(newData,i);
  return true;
}

Fixed version (ground truth):
@Override public boolean removeAll(Collection<?> c){
  final E[] newData=(E[])new Object[dataLocator.getCapacity()];
  boolean hasRemovedItem=false;
  int read=this.locator.getReadLocation();
  int write=this.locator.getWriterLocation();
  if (read == write)   return false;
  int i=0;
  if (read < write) {
    for (int location=read; location < write; location++) {
      if (c.contains(dataLocator.getData(location))) {
        hasRemovedItem=true;
      }
 else {
        newData[i++]=dataLocator.getData(location);
      }
    }
  }
 else {
    for (int location=read; location < dataLocator.getCapacity(); location++) {
      if (!c.contains(dataLocator.getData(location))) {
        hasRemovedItem=true;
      }
 else {
        newData[i++]=dataLocator.getData(location);
      }
    }
    for (int location=0; location <= write; location++) {
      if (!c.contains(dataLocator.getData(location))) {
        hasRemovedItem=true;
      }
 else {
        newData[i++]=dataLocator.getData(location);
      }
    }
  }
  if (!hasRemovedItem)   return false;
  this.locator.setReadLocation(0);
  this.locator.setWriterLocation(i);
  dataLocator.writeAll(newData,i);
  return true;
}
Program: 91452
Project: 91452
Buggy source:
/** 
 * Returns <tt>true</tt> if this queue contains the specified element. More formally, returns <tt>true</tt> if and only if this queue contains at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>. The behavior of this operation is undefined if modified while the operation is in progress.
 * @param o object to be checked for containment in this queue
 * @return <tt>true</tt> if this queue contains the specified element
 * @throws ClassCastException   if the class of the specified elementis incompatible with this queue (<a href="../Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null(<a href="../Collection.html#optional-restrictions">optional</a>)
 */
public boolean contains(Object o){
  if (o == null)   throw new NullPointerException("String_Node_Str");
  int read=this.locator.getReadLocation();
  int write=this.locator.getWriteLocation();
  if (read == write)   return false;
  if (read < write) {
    for (int location=read; location < write; location++) {
      if (o.equals(dataLocator.getData(location)))       return true;
    }
    return false;
  }
  for (int location=read; location < dataLocator.getCapacity(); location++) {
    if (o.equals(dataLocator.getData(location)))     return true;
  }
  for (int location=0; location < write; location++) {
    if (o.equals(dataLocator.getData(location)))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns <tt>true</tt> if this queue contains the specified element. More formally, returns <tt>true</tt> if and only if this queue contains at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>. The behavior of this operation is undefined if modified while the operation is in progress.
 * @param o object to be checked for containment in this queue
 * @return <tt>true</tt> if this queue contains the specified element
 * @throws ClassCastException   if the class of the specified elementis incompatible with this queue (<a href="../Collection.html#optional-restrictions">optional</a>)
 * @throws NullPointerException if the specified element is null(<a href="../Collection.html#optional-restrictions">optional</a>)
 */
public boolean contains(Object o){
  if (o == null)   throw new NullPointerException("String_Node_Str");
  int read=this.locator.getReadLocation();
  int write=this.locator.getWriterLocation();
  if (read == write)   return false;
  if (read < write) {
    for (int location=read; location < write; location++) {
      if (o.equals(dataLocator.getData(location)))       return true;
    }
    return false;
  }
  for (int location=read; location < dataLocator.getCapacity(); location++) {
    if (o.equals(dataLocator.getData(location)))     return true;
  }
  for (int location=0; location < write; location++) {
    if (o.equals(dataLocator.getData(location)))     return true;
  }
  return false;
}
Program: 91453
Project: 91453
Buggy source:
@Override public <T>T[] toArray(T[] result){
  final int read=locator.getReadLocation();
  int write=locator.getWriteLocation();
  if (result.length == 0)   return result;
  if (read > write)   write+=dataLocator.getCapacity();
  int size=write - read;
  if (size > result.length)   result=(T[])java.lang.reflect.Array.newInstance(result.getClass().getComponentType(),size + 1);
  int i=0;
  for (int location=read; location < write; location++) {
    result[i++]=(T)dataLocator.getData(location);
  }
  if (i < result.length - 1) {
    Arrays.fill((Object[])result,i,result.length,null);
  }
  return result;
}

Fixed version (ground truth):
@Override public <T>T[] toArray(T[] result){
  final int read=locator.getReadLocation();
  int write=locator.getWriterLocation();
  if (result.length == 0)   return result;
  if (read > write)   write+=dataLocator.getCapacity();
  int size=write - read;
  if (size > result.length)   result=(T[])java.lang.reflect.Array.newInstance(result.getClass().getComponentType(),size + 1);
  int i=0;
  for (int location=read; location < write; location++) {
    result[i++]=(T)dataLocator.getData(location);
  }
  if (i < result.length - 1) {
    Arrays.fill((Object[])result,i,result.length,null);
  }
  return result;
}
Program: 91454
Project: 91454
Buggy source:
@Override public String toString(){
  final int read=locator.getReadLocation();
  int write=locator.getWriteLocation();
  if (read == write) {
    return "String_Node_Str";
  }
  if (read > write)   write+=dataLocator.getCapacity();
  int size=write - read;
  StringBuilder builder=new StringBuilder("String_Node_Str");
  int i=0;
  for (int location=read; location < write; location++) {
    builder.append(dataLocator.getData(location)).append(',');
  }
  builder.deleteCharAt(builder.length() - 1);
  builder.append("String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  final int read=locator.getReadLocation();
  int write=locator.getWriterLocation();
  if (read == write) {
    return "String_Node_Str";
  }
  if (read > write)   write+=dataLocator.getCapacity();
  int size=write - read;
  StringBuilder builder=new StringBuilder("String_Node_Str");
  int i=0;
  for (int location=read; location < write; location++) {
    builder.append(dataLocator.getData(location)).append(',');
  }
  builder.deleteCharAt(builder.length() - 1);
  builder.append("String_Node_Str");
  return builder.toString();
}
Program: 91455
Project: 91455
Buggy source:
@Override public boolean retainAll(Collection<?> c){
  final E[] newData=(E[])new Object[dataLocator.getCapacity()];
  boolean changed=false;
  int read=this.locator.getReadLocation();
  int write=this.locator.getWriteLocation();
  if (read == write)   return false;
  int i=0;
  if (read < write) {
    for (int location=read; location < write; location++) {
      if (c.contains(dataLocator.getData(location))) {
        newData[i++]=dataLocator.getData(location);
      }
 else {
        changed=true;
      }
    }
  }
 else {
    for (int location=read; location < dataLocator.getCapacity(); location++) {
      if (c.contains(dataLocator.getData(location))) {
        newData[i++]=dataLocator.getData(location);
      }
 else {
        changed=true;
      }
    }
    for (int location=0; location <= write; location++) {
      if (c.contains(dataLocator.getData(location))) {
        newData[i++]=dataLocator.getData(location);
      }
 else {
        changed=true;
      }
    }
  }
  if (changed) {
    this.locator.setReadLocation(0);
    this.locator.setWriteLocation(i);
    dataLocator.writeAll(newData,i);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean retainAll(Collection<?> c){
  final E[] newData=(E[])new Object[dataLocator.getCapacity()];
  boolean changed=false;
  int read=this.locator.getReadLocation();
  int write=this.locator.getWriterLocation();
  if (read == write)   return false;
  int i=0;
  if (read < write) {
    for (int location=read; location < write; location++) {
      if (c.contains(dataLocator.getData(location))) {
        newData[i++]=dataLocator.getData(location);
      }
 else {
        changed=true;
      }
    }
  }
 else {
    for (int location=read; location < dataLocator.getCapacity(); location++) {
      if (c.contains(dataLocator.getData(location))) {
        newData[i++]=dataLocator.getData(location);
      }
 else {
        changed=true;
      }
    }
    for (int location=0; location <= write; location++) {
      if (c.contains(dataLocator.getData(location))) {
        newData[i++]=dataLocator.getData(location);
      }
 else {
        changed=true;
      }
    }
  }
  if (changed) {
    this.locator.setReadLocation(0);
    this.locator.setWriterLocation(i);
    dataLocator.writeAll(newData,i);
    return true;
  }
  return false;
}
Program: 91456
Project: 91456
Buggy source:
@Override public E element(){
  final int readLocation=this.consumerReadLocation;
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  if (locator.getWriteLocation() == readLocation)   throw new NoSuchElementException();
  final E value=dataLocator.getData(readLocation);
  setReadLocation(nextReadLocation);
  return value;
}

Fixed version (ground truth):
@Override public E element(){
  final int readLocation=this.consumerReadLocation;
  final int nextReadLocation=(readLocation + 1 == dataLocator.getCapacity()) ? 0 : readLocation + 1;
  if (locator.getWriterLocation() == readLocation)   throw new NoSuchElementException();
  final E value=dataLocator.getData(readLocation);
  setReadLocation(nextReadLocation);
  return value;
}
Program: 91457
Project: 91457
Buggy source:
@Override public int getReadLocation(){
  return directBytes.readInt(READ_OFFSET);
}

Fixed version (ground truth):
@Override public int getReadLocation(){
  return directBytes.readVolatileInt(READ_OFFSET);
}
Program: 91458
Project: 91458
Buggy source:
@Override public void setReadLocation(int nextReadLocation){
  directBytes.writeInt(READ_OFFSET,nextReadLocation);
}

Fixed version (ground truth):
@Override public void setReadLocation(int nextReadLocation){
  directBytes.writeOrderedInt(READ_OFFSET,nextReadLocation);
}