Buggy code:
@ Immutable public abstract class HotRodOperation implements HotRodConstants { static final AtomicLong MSG_ID = new AtomicLong ( ) ; private static final Log log = LogFactory . getLog ( HotRodOperation . class , Log . class ) ; protected final Flag [ ] flags ; protected final byte [ ] cacheName ; protected final AtomicInteger topologyId ; private static final byte NO_TX = 0 ; private static final byte XA_TX = 1 ; protected HotRodOperation ( Flag [ ] flags , byte [ ] cacheName , AtomicInteger topologyId ) { } public abstract Object execute ( ) { } protected final long writeHeader ( Transport transport , short operationCode ) { } protected short readHeaderAndValidate ( Transport transport , long messageId , short opRespCode ) { short magic = transport . readByte ( ) ; if ( magic != ( HotRodConstants . RESPONSE_MAGIC ) ) { String message = "Invalid<seq2seq4repair_space>magic<seq2seq4repair_space>number.<seq2seq4repair_space>Expected<seq2seq4repair_space>%#x<seq2seq4repair_space>and<seq2seq4repair_space>received<seq2seq4repair_space>%#x" ; <START_BUG> HotRodOperation . log . invalidMagicNumber ( message , RESPONSE_MAGIC , magic ) ; <END_BUG> throw new InvalidResponseException ( String . format ( message , RESPONSE_MAGIC , magic ) ) ; } long receivedMessageId = transport . readVLong ( ) ; if ( receivedMessageId != messageId ) { String message = "Invalid<seq2seq4repair_space>message<seq2seq4repair_space>id.<seq2seq4repair_space>Expected<seq2seq4repair_space>%d<seq2seq4repair_space>and<seq2seq4repair_space>received<seq2seq4repair_space>%d" ; HotRodOperation . log . invalidMessageId ( messageId , receivedMessageId ) ; throw new InvalidResponseException ( String . format ( message , messageId , receivedMessageId ) ) ; } if ( HotRodOperation . log . isTraceEnabled ( ) ) { HotRodOperation . log . tracef ( "Received<seq2seq4repair_space>response<seq2seq4repair_space>for<seq2seq4repair_space>message<seq2seq4repair_space>id:<seq2seq4repair_space>%d" , receivedMessageId ) ; } short receivedOpCode = transport . readByte ( ) ; if ( receivedOpCode != opRespCode ) { if ( receivedOpCode == ( HotRodConstants . ERROR_RESPONSE ) ) { checkForErrorsInResponseStatus ( transport . readByte ( ) , messageId , transport ) ; } throw new InvalidResponseException ( String . format ( "Invalid<seq2seq4repair_space>response<seq2seq4repair_space>operation.<seq2seq4repair_space>Expected<seq2seq4repair_space>%#x<seq2seq4repair_space>and<seq2seq4repair_space>received<seq2seq4repair_space>%#x" , opRespCode , receivedOpCode ) ) ; } if ( HotRodOperation . log . isTraceEnabled ( ) ) { HotRodOperation . log . tracef ( "Received<seq2seq4repair_space>operation<seq2seq4repair_space>code<seq2seq4repair_space>is:<seq2seq4repair_space>%#04x" , receivedOpCode ) ; } short status = transport . readByte ( ) ; readNewTopologyIfPresent ( transport ) ; return status ; } protected void checkForErrorsInResponseStatus ( short status , long messageId , Transport transport ) { } private void readNewTopologyIfPresent ( Transport transport ) { } private void readNewTopologyAndHash ( Transport transport , AtomicInteger topologyId ) { } }

Fix:
HotRodOperation . log . invalidMagicNumber ( RESPONSE_MAGIC , magic ) ;