Program: 49932
Project: 49932
Buggy source:
Object txnalPut(ClusterOperation operation,String name,Object key,Object value,long timeout,long ttl,long txnId){
  ThreadContext threadContext=ThreadContext.get();
  TransactionImpl txn=threadContext.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.txnId=txnId;
    request.longValue=(request.value == null) ? Integer.MIN_VALUE : request.value.hashCode();
    setIndexValues(request,value);
    if (operation == CONCURRENT_MAP_TRY_PUT || operation == CONCURRENT_MAP_SET || operation == CONCURRENT_MAP_PUT_AND_UNLOCK || operation == CONCURRENT_MAP_PUT_TRANSIENT) {
      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):
Object txnalPut(ClusterOperation operation,String name,Object key,Object value,long timeout,long ttl,long txnId){
  ThreadContext threadContext=ThreadContext.get();
  TransactionImpl txn=threadContext.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.txnId=txnId;
    request.longValue=(request.value == null) ? Integer.MIN_VALUE : request.value.hashCode();
    setIndexValues(request,value);
    if (operation == CONCURRENT_MAP_TRY_PUT || operation == CONCURRENT_MAP_SET || operation == CONCURRENT_MAP_PUT_AND_UNLOCK || operation == CONCURRENT_MAP_PUT_TRANSIENT) {
      request.setBooleanRequest();
      Data valueData=request.value;
      doOp();
      Boolean successful=getResultAsBoolean();
      if (successful) {
        request.value=valueData;
        backup(CONCURRENT_MAP_BACKUP_PUT);
      }
      return successful;
    }
 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;
    }
  }
}