Program: 50134
Project: 50134
Buggy source:
public void put(Request req){
  long now=System.currentTimeMillis();
  if (req.value == null) {
    req.value=new Data();
  }
  Record record=getRecord(req.key);
  if (record != null && !record.isValid(now)) {
    record.setValue(null);
    record.setMultiValues(null);
  }
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    if (record != null && record.isActive() && record.isValid(now) && record.getValue() != null) {
      req.clearForResponse();
      req.response=record.getValue();
      return;
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    if (record == null || !record.isActive() || !record.isValid(now) || record.getValue() == null) {
      return;
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_SAME) {
    if (record == null || !record.isActive() || !record.isValid(now)) {
      req.response=Boolean.FALSE;
      return;
    }
    MultiData multiData=(MultiData)toObject(req.value);
    if (multiData == null || multiData.size() != 2) {
      throw new RuntimeException("String_Node_Str" + multiData);
    }
    Data expectedOldValue=multiData.getData(0);
    req.value=multiData.getData(1);
    if (!record.getValue().equals(expectedOldValue)) {
      req.response=Boolean.FALSE;
      return;
    }
  }
  Data oldValue=null;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    mapRecords.put(req.key,record);
  }
 else {
    markAsActive(record);
    oldValue=(record.isValid(now)) ? record.getValue() : null;
    record.setValue(req.value);
    record.incrementVersion();
    record.setLastUpdated();
  }
  if (req.ttl > 0) {
    record.setExpirationTime(req.ttl);
    ttlPerRecord=true;
  }
  if (oldValue == null) {
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_ADDED,record,req.caller);
  }
 else {
    fireInvalidation(record);
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_UPDATED,oldValue,record,req.caller);
  }
  if (req.txnId != -1) {
    unlock(record);
  }
  record.setIndexes(req.indexes,req.indexTypes);
  updateIndexes(record);
  markAsDirty(record);
  req.clearForResponse();
  req.version=record.getVersion();
  req.longValue=record.getCopyCount();
  if (req.operation == CONCURRENT_MAP_REPLACE_IF_SAME) {
    req.response=Boolean.TRUE;
  }
 else {
    req.response=oldValue;
  }
}

Fixed version (ground truth):
public void put(Request req){
  long now=System.currentTimeMillis();
  if (req.value == null) {
    req.value=new Data();
  }
  Record record=getRecord(req.key);
  if (record != null && !record.isValid(now)) {
    record.setValue(null);
    record.setMultiValues(null);
  }
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    if (record != null && record.isActive() && record.isValid(now) && record.getValue() != null) {
      req.clearForResponse();
      req.response=record.getValue();
      return;
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    if (record == null || !record.isActive() || !record.isValid(now) || record.getValue() == null) {
      return;
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_SAME) {
    if (record == null || !record.isActive() || !record.isValid(now)) {
      req.response=Boolean.FALSE;
      return;
    }
    MultiData multiData=(MultiData)toObject(req.value);
    if (multiData == null || multiData.size() != 2) {
      throw new RuntimeException("String_Node_Str" + multiData);
    }
    Data expectedOldValue=multiData.getData(0);
    req.value=multiData.getData(1);
    if (!record.getValue().equals(expectedOldValue)) {
      req.response=Boolean.FALSE;
      return;
    }
  }
  Data oldValue=null;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    mapRecords.put(req.key,record);
  }
 else {
    markAsActive(record);
    oldValue=(record.isValid(now)) ? record.getValue() : null;
    record.setValue(req.value);
    record.incrementVersion();
    record.setLastUpdated();
  }
  if (req.ttl > 0 && req.ttl < Long.MAX_VALUE) {
    record.setExpirationTime(req.ttl);
    ttlPerRecord=true;
  }
  if (oldValue == null) {
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_ADDED,record,req.caller);
  }
 else {
    fireInvalidation(record);
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_UPDATED,oldValue,record,req.caller);
  }
  if (req.txnId != -1) {
    unlock(record);
  }
  record.setIndexes(req.indexes,req.indexTypes);
  updateIndexes(record);
  markAsDirty(record);
  req.clearForResponse();
  req.version=record.getVersion();
  req.longValue=record.getCopyCount();
  if (req.operation == CONCURRENT_MAP_REPLACE_IF_SAME) {
    req.response=Boolean.TRUE;
  }
 else {
    req.response=oldValue;
  }
}