@SuppressWarnings( "unchecked" )
protected static ChannelBuffer handleRequest( Master realMaster,
ChannelBuffer buffer ) throws IOException
{
RequestType type = RequestType.values()[buffer.readByte()];
<BUG>final SlaveContext context = readSlaveContext( buffer );
Response<?> response = type.caller.callMaster( realMaster, context, buffer );</BUG>
ChannelBuffer targetBuffer = ChannelBuffers.dynamicBuffer();
type.serializer.write( response.response(), targetBuffer );
writeTransactionStreams( response.transactions(), targetBuffer );

@SuppressWarnings( "unchecked" )
protected static ChannelBuffer handleRequest( Master realMaster,
ChannelBuffer buffer ) throws IOException
{
RequestType type = RequestType.values()[buffer.readByte()];
SlaveContext context = type.includesSlaveContext() ? readSlaveContext( buffer ) : null;
Response<?> response = type.caller.callMaster( realMaster, context, buffer );
ChannelBuffer targetBuffer = ChannelBuffers.dynamicBuffer();
type.serializer.write( response.response(), targetBuffer );
writeTransactionStreams( response.transactions(), targetBuffer );
