Program: 46696
Project: 46696
Buggy source:
protected void updateRecord(Data key,R record,Object value,long expiryTime,long now,boolean disableWriteThrough,int completionId,String source,String origin){
  Data dataOldValue=null;
  Data dataValue=null;
  Object recordValue=value;
  try {
    record.setExpirationTime(expiryTime);
    if (isExpiredAt(expiryTime,now)) {
      if (!disableWriteThrough) {
        writeThroughCache(key,value);
      }
    }
 else {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
        recordValue=toData(value);
      dataValue=(Data)recordValue;
    dataOldValue=toData(record);
  break;
case OBJECT:
if (value instanceof Data) {
  recordValue=dataToValue((Data)value);
  dataValue=(Data)value;
}
 else {
  dataValue=valueToData(value);
}
dataOldValue=toData(record);
break;
case NATIVE:
recordValue=toData(value);
dataValue=(Data)recordValue;
dataOldValue=toData(record);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
if (!disableWriteThrough) {
writeThroughCache(key,value);
}
Data eventDataKey=toEventData(key);
Data eventDataValue=toEventData(dataValue);
Data eventDataOldValue=toEventData(dataOldValue);
updateRecordValue(record,recordValue);
onUpdateRecord(key,record,value,dataOldValue);
invalidateEntry(key,source);
if (isEventsEnabled()) {
publishEvent(createCacheUpdatedEvent(eventDataKey,eventDataValue,eventDataOldValue,record.getExpirationTime(),record.getAccessTime(),record.getAccessHit(),origin,completionId));
}
}
}
 catch (Throwable error) {
onUpdateRecordError(key,record,value,dataValue,dataOldValue,error);
throw ExceptionUtil.rethrow(error);
}
}

Fixed version (ground truth):
protected void updateRecord(Data key,R record,Object value,long expiryTime,long now,boolean disableWriteThrough,int completionId,String source,String origin){
  Data dataOldValue=null;
  Data dataValue=null;
  Object recordValue=value;
  try {
    if (expiryTime != CacheRecord.TIME_NOT_AVAILABLE) {
      record.setExpirationTime(expiryTime);
    }
    if (isExpiredAt(expiryTime,now)) {
      if (!disableWriteThrough) {
        writeThroughCache(key,value);
      }
    }
 else {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
        recordValue=toData(value);
      dataValue=(Data)recordValue;
    dataOldValue=toData(record);
  break;
case OBJECT:
if (value instanceof Data) {
  recordValue=dataToValue((Data)value);
  dataValue=(Data)value;
}
 else {
  dataValue=valueToData(value);
}
dataOldValue=toData(record);
break;
case NATIVE:
recordValue=toData(value);
dataValue=(Data)recordValue;
dataOldValue=toData(record);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
if (!disableWriteThrough) {
writeThroughCache(key,value);
}
Data eventDataKey=toEventData(key);
Data eventDataValue=toEventData(dataValue);
Data eventDataOldValue=toEventData(dataOldValue);
updateRecordValue(record,recordValue);
onUpdateRecord(key,record,value,dataOldValue);
invalidateEntry(key,source);
if (isEventsEnabled()) {
publishEvent(createCacheUpdatedEvent(eventDataKey,eventDataValue,eventDataOldValue,record.getExpirationTime(),record.getAccessTime(),record.getAccessHit(),origin,completionId));
}
}
}
 catch (Throwable error) {
onUpdateRecordError(key,record,value,dataValue,dataOldValue,error);
throw ExceptionUtil.rethrow(error);
}
}