indeed "!(B || C)" is wrong, should have been written !(B && C) but the final result is correct, i.e your statement is equivalent to: (shouldInvokeRemoteTxCommand && !prepareSent) || (shouldInvokeRemoteTxCommand && !isOnePhaseCommit)

"...does not look correct to me.. " - you're right again :-)

Now the only thing I still don't understand is  in this expression: " (shouldInvokeRemoteTxCommand && !prepareSent)" -> why not to allow the sending of rollback if the prepare has been sent (prepareSent==true)?