Program: 50531
Project: 50531
Buggy source:
public Data put(Request req){
  if (ownedRecords.size() >= maxSize) {
    startEviction();
  }
  if (req.value == null) {
    req.value=new Data();
  }
  req.value.hash=(int)req.longValue;
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    Record record=getRecord(req.key);
    if (record != null && record.isActive() && record.getValue() != null) {
      return record.getValue();
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    Record record=getRecord(req.key);
    if (record == null || !record.isActive() || record.getValue() == null) {
      return null;
    }
  }
  Record record=getRecord(req.key);
  Data oldValue=null;
  boolean created=false;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    req.key=null;
    created=true;
  }
 else {
    markAsActive(record);
    oldValue=record.getValue();
    record.setValue(req.value);
    record.incrementVersion();
    touch(record);
    record.setLastUpdated();
  }
  markAsOwned(record);
  req.version=record.getVersion();
  req.longValue=record.getCopyCount();
  req.value=null;
  if (oldValue == null) {
    concurrentMapManager.fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record);
  }
 else {
    concurrentMapManager.fireMapEvent(mapListeners,name,EntryEvent.TYPE_UPDATED,record);
  }
  if (req.txnId != -1) {
    concurrentMapManager.unlock(record);
  }
  updateIndexes(created,req,record);
  markAsDirty(record);
  return oldValue;
}

Fixed version (ground truth):
public void put(Request req){
  if (ownedRecords.size() >= maxSize) {
    startEviction();
  }
  if (req.value == null) {
    req.value=new Data();
  }
  Record record=getRecord(req.key);
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    if (record != null && record.isActive() && record.getValue() != null) {
      req.response=record.getValue();
      return;
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    if (record == null || !record.isActive() || record.getValue() == null) {
      return;
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_SAME) {
    if (record == null || !record.isActive() || !record.isValid()) {
      req.response=Boolean.FALSE;
      req.value=null;
      req.key=null;
      return;
    }
    ConcurrentMapManager.MultiData multiData=(ConcurrentMapManager.MultiData)toObject(req.value);
    if (multiData == null || multiData.size() != 2) {
      throw new RuntimeException("String_Node_Str" + multiData);
    }
    Data expectedOldValue=multiData.getData(0);
    Data newValue=multiData.getData(1);
    req.value=newValue;
    if (!record.getValue().equals(expectedOldValue)) {
      req.response=Boolean.FALSE;
      return;
    }
  }
  req.value.hash=(int)req.longValue;
  Data oldValue=null;
  boolean created=false;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    req.key=null;
    created=true;
  }
 else {
    markAsActive(record);
    oldValue=record.getValue();
    record.setValue(req.value);
    record.incrementVersion();
    touch(record);
    record.setLastUpdated();
  }
  markAsOwned(record);
  req.version=record.getVersion();
  req.longValue=record.getCopyCount();
  req.value=null;
  if (oldValue == null) {
    concurrentMapManager.fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record);
  }
 else {
    concurrentMapManager.fireMapEvent(mapListeners,name,EntryEvent.TYPE_UPDATED,record);
  }
  if (req.txnId != -1) {
    concurrentMapManager.unlock(record);
  }
  updateIndexes(created,req,record);
  markAsDirty(record);
  if (req.operation == CONCURRENT_MAP_REPLACE_IF_SAME) {
    req.response=Boolean.TRUE;
  }
 else {
    req.response=oldValue;
  }
}