Program: 162962
Project: 162962
Buggy source:
final <KB,RV,VB extends RV,VBI,MVBI extends MetaBytesInterop<RV,? super VBI>>RV replaceValueAndNotifyPut(ThreadLocalCopies copies,SegmentState segmentState,KB key,long keySize,InstanceOrBytesToInstance<KB,K> toKey,GetValueInterops<VB,VBI,MVBI> getValueInterops,VB value,InstanceOrBytesToInstance<? super VB,V> toValue,MultiStoreBytes entry,long pos,long offset,MultiMap searchedHashLookup,ReadValue<RV> readValue,boolean resultUnused,boolean entryIsDeleted,boolean remote){
  VBI valueInterop=getValueInterops.getValueInterop(copies);
  MVBI metaValueInterop=getValueInterops.getMetaValueInterop(copies,valueInterop,value);
  long valueSize=metaValueInterop.size(valueInterop,value);
  long valueSizePos=entry.position();
  long prevValueSize=readValueSize(entry);
  long valueAddr=entry.positionAddr();
  long entryEndAddr=valueAddr + prevValueSize;
  RV prevValue=null;
  V prevValueInstance=null;
  if (!resultUnused && !entryIsDeleted)   prevValue=readValue.readValue(copies,entry,null,prevValueSize);
  if (eventListener != null && !entryIsDeleted) {
    entry.positionAddr(valueAddr);
    prevValueInstance=readValue(copies,entry,null,prevValueSize);
  }
  putValue(pos,offset,entry,valueSizePos,entryEndAddr,segmentState,metaValueInterop,valueInterop,value,valueSize,searchedHashLookup);
  onPutMaybeRemote(segmentState.pos,remote);
  if (bytesEventListener != null)   bytesEventListener.onPut(entry,0L,metaDataBytes,valueSizePos,false);
  if (eventListener != null) {
    eventListener.onPut(toKey.toInstance(copies,key,keySize),toValue.toInstance(copies,value,valueSize),prevValueInstance);
  }
  return resultUnused ? null : prevValue;
}

Fixed version (ground truth):
final <KB,RV,VB extends RV,VBI,MVBI extends MetaBytesInterop<RV,? super VBI>>RV replaceValueAndNotifyPut(ThreadLocalCopies copies,SegmentState segmentState,KB key,long keySize,InstanceOrBytesToInstance<KB,K> toKey,GetValueInterops<VB,VBI,MVBI> getValueInterops,VB value,InstanceOrBytesToInstance<? super VB,V> toValue,MultiStoreBytes entry,long pos,long offset,MultiMap searchedHashLookup,ReadValue<RV> readValue,boolean resultUnused,boolean entryIsDeleted,boolean remote){
  VBI valueInterop=getValueInterops.getValueInterop(copies);
  MVBI metaValueInterop=getValueInterops.getMetaValueInterop(copies,valueInterop,value);
  long valueSize=metaValueInterop.size(valueInterop,value);
  long valueSizePos=entry.position();
  long prevValueSize=valueSizeMarshaller.readSize(entry);
  long sizeOfEverythingBeforeValue=entry.position();
  alignment.alignPositionAddr(entry);
  long valueAddr=entry.positionAddr();
  long entryEndAddr=valueAddr + prevValueSize;
  RV prevValue=null;
  V prevValueInstance=null;
  if (!resultUnused && !entryIsDeleted)   prevValue=readValue.readValue(copies,entry,null,prevValueSize);
  if (eventListener != null && !entryIsDeleted) {
    entry.positionAddr(valueAddr);
    prevValueInstance=readValue(copies,entry,null,prevValueSize);
  }
  putValue(pos,offset,entry,valueSizePos,entryEndAddr,segmentState,metaValueInterop,valueInterop,value,valueSize,searchedHashLookup,sizeOfEverythingBeforeValue);
  onPutMaybeRemote(segmentState.pos,remote);
  if (bytesEventListener != null)   bytesEventListener.onPut(entry,0L,metaDataBytes,valueSizePos,false);
  if (eventListener != null) {
    eventListener.onPut(toKey.toInstance(copies,key,keySize),toValue.toInstance(copies,value,valueSize),prevValueInstance);
  }
  return resultUnused ? null : prevValue;
}