Program: 50019
Project: 50019
Buggy source:
private Object txnalPut(ClusterOperation operation,String name,Object key,Object value,long timeout,long ttl){
  ThreadContext threadContext=ThreadContext.get();
  TransactionImpl txn=threadContext.getCallContext().getTransaction();
  if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
    if (!txn.has(name,key)) {
      MLock mlock=new MLock();
      boolean locked=mlock.lockAndGetValue(name,key,DEFAULT_TXN_TIMEOUT);
      if (!locked)       throwCME(key);
      Object oldObject=null;
      Data oldValue=mlock.oldValue;
      if (oldValue != null) {
        oldObject=toObject(oldValue);
      }
      if (operation == ClusterOperation.CONCURRENT_MAP_PUT_IF_ABSENT && oldObject != null) {
        txn.attachPutOp(name,key,oldObject,0,ttl,false);
      }
 else {
        txn.attachPutOp(name,key,value,0,ttl,(oldObject == null));
      }
      return threadContext.isClient() ? oldValue : oldObject;
    }
 else {
      if (operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
        Object existingValue=txn.get(name,key);
        if (existingValue != null) {
          return existingValue;
        }
      }
      return txn.attachPutOp(name,key,value,false);
    }
  }
 else {
    setLocal(operation,name,key,value,timeout,ttl);
    request.longValue=(request.value == null) ? Integer.MIN_VALUE : request.value.hashCode();
    setIndexValues(request,value);
    if (operation == CONCURRENT_MAP_TRY_PUT) {
      request.setBooleanRequest();
      doOp();
      Boolean returnObject=getResultAsBoolean();
      if (returnObject) {
        backup(CONCURRENT_MAP_BACKUP_PUT);
      }
      return returnObject;
    }
 else {
      request.setObjectRequest();
      doOp();
      Object returnObject=getResultAsObject();
      if (operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL && returnObject == null) {
        return null;
      }
      if (returnObject instanceof AddressAwareException) {
        rethrowException(operation,(AddressAwareException)returnObject);
      }
      request.longValue=Long.MIN_VALUE;
      backup(CONCURRENT_MAP_BACKUP_PUT);
      return returnObject;
    }
  }
}

Fixed version (ground truth):
private Object txnalPut(ClusterOperation operation,String name,Object key,Object value,long timeout,long ttl){
  ThreadContext threadContext=ThreadContext.get();
  TransactionImpl txn=threadContext.getCallContext().getTransaction();
  if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
    if (!txn.has(name,key)) {
      MLock mlock=new MLock();
      boolean locked=mlock.lockAndGetValue(name,key,DEFAULT_TXN_TIMEOUT);
      if (!locked)       throwCME(key);
      Object oldObject=null;
      Data oldValue=mlock.oldValue;
      if (oldValue != null) {
        oldObject=threadContext.isClient() ? oldValue : threadContext.toObject(oldValue);
      }
      if (operation == ClusterOperation.CONCURRENT_MAP_PUT_IF_ABSENT && oldObject != null) {
        txn.attachPutOp(name,key,oldObject,0,ttl,false);
      }
 else {
        txn.attachPutOp(name,key,value,0,ttl,(oldObject == null));
      }
      return oldObject;
    }
 else {
      if (operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
        Object existingValue=txn.get(name,key);
        if (existingValue != null) {
          return existingValue;
        }
      }
      return txn.attachPutOp(name,key,value,false);
    }
  }
 else {
    setLocal(operation,name,key,value,timeout,ttl);
    request.longValue=(request.value == null) ? Integer.MIN_VALUE : request.value.hashCode();
    setIndexValues(request,value);
    if (operation == CONCURRENT_MAP_TRY_PUT) {
      request.setBooleanRequest();
      doOp();
      Boolean returnObject=getResultAsBoolean();
      if (returnObject) {
        backup(CONCURRENT_MAP_BACKUP_PUT);
      }
      return returnObject;
    }
 else {
      request.setObjectRequest();
      doOp();
      Object returnObject=getResultAsObject();
      if (operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL && returnObject == null) {
        return null;
      }
      if (returnObject instanceof AddressAwareException) {
        rethrowException(operation,(AddressAwareException)returnObject);
      }
      request.longValue=Long.MIN_VALUE;
      backup(CONCURRENT_MAP_BACKUP_PUT);
      return returnObject;
    }
  }
}