Buggy code:
public class CommandAwareRpcDispatcher extends RpcDispatcher { private final ExecutorService asyncExecutor ; private static final Log log = LogFactory . getLog ( CommandAwareRpcDispatcher . class ) ; private static final boolean trace = CommandAwareRpcDispatcher . log . isTraceEnabled ( ) ; private static final boolean FORCE_MCAST = Boolean . getBoolean ( "infinispan.unsafe.force_multicast" ) ; private final JGroupsTransport transport ; private final GlobalComponentRegistry gcr ; private final InboundInvocationHandler handler ; public CommandAwareRpcDispatcher ( Channel channel , JGroupsTransport transport , ExecutorService asyncExecutor , GlobalComponentRegistry gcr , InboundInvocationHandler globalHandler ) { } private boolean isValid ( Message req ) { } @ Deprecated public RspList < Object > invokeRemoteCommands ( final List < Address > recipients , final ReplicableCommand command , final ResponseMode mode , final long timeout , final boolean oob , final RspFilter filter , boolean asyncMarshalling , final boolean ignoreLeavers , final boolean totalOrder ) throws InterruptedException { } public RspList < Object > invokeRemoteCommands ( final List < Address > recipients , final ReplicableCommand command , final ResponseMode mode , final long timeout , final RspFilter filter , final DeliverOrder deliverOrder , boolean asyncMarshalling , final boolean ignoreLeavers ) throws InterruptedException { } @ Deprecated public Response invokeRemoteCommand ( final Address recipient , final ReplicableCommand command , final ResponseMode mode , final long timeout , final boolean oob , boolean asyncMarshalling ) throws InterruptedException { } public Response invokeRemoteCommand ( final Address recipient , final ReplicableCommand command , final ResponseMode mode , final long timeout , final DeliverOrder deliverOrder , boolean asyncMarshalling ) throws InterruptedException { } @ Deprecated public RspList < Object > broadcastRemoteCommands ( ReplicableCommand command , ResponseMode mode , long timeout , boolean oob , RspFilter filter , boolean asyncMarshalling , boolean ignoreLeavers , boolean totalOrder ) throws InterruptedException { } public RspList < Object > broadcastRemoteCommands ( ReplicableCommand command , ResponseMode mode , long timeout , RspFilter filter , DeliverOrder deliverOrder , boolean asyncMarshalling , boolean ignoreLeavers ) throws InterruptedException { } private boolean containsOnlyNulls ( RspList < Object > l ) { } @ Override public void handle ( Message req , org . jgroups . blocks . Response response ) throws Exception { } private void executeCommandFromRemoteSite ( final ReplicableCommand cmd , final Message req , final org . jgroups . blocks . Response response ) throws Throwable { } private void executeCommandFromLocalCluster ( final ReplicableCommand cmd , final Message req , final org . jgroups . blocks . Response response ) throws Throwable { } private static DeliverOrder decodeDeliverMode ( Message request ) { } private static void encodeDeliverMode ( Message request , DeliverOrder deliverOrder ) { } @ Override public String toString ( ) { } private void reply ( org . jgroups . blocks . Response response , Object retVal ) { } protected static Message constructMessage ( Buffer buf , Address recipient , boolean oob , ResponseMode mode , boolean rsvp , boolean totalOrder ) { } protected static Message constructMessage ( Buffer buf , Address recipient , ResponseMode mode , boolean rsvp , DeliverOrder deliverOrder ) { Message msg = new Message ( ) ; msg . setBuffer ( buf ) ; CommandAwareRpcDispatcher . encodeDeliverMode ( msg , deliverOrder ) ; <START_BUG> if ( mode != ( ResponseMode . GET_NONE ) ) <END_BUG> msg . setFlag ( DONT_BUNDLE ) ; if ( rsvp ) msg . setFlag ( RSVP ) ; if ( recipient != null ) msg . setDest ( recipient ) ; return msg ; } static Buffer marshallCall ( Marshaller marshaller , ReplicableCommand command ) { } private static Response processSingleCall ( ReplicableCommand command , long timeout , Address destination , ResponseMode mode , DeliverOrder deliverOrder , Marshaller marshaller , CommandAwareRpcDispatcher card , JGroupsTransport transport ) throws Exception { } private static RspList < Object > processCalls ( ReplicableCommand command , boolean broadcast , long timeout , RspFilter filter , List < Address > dests , ResponseMode mode , DeliverOrder deliverOrder , Marshaller marshaller , CommandAwareRpcDispatcher card , boolean ignoreLeavers ) throws Exception { } private static Exception wrapThrowableInException ( Throwable t ) { } private static boolean isRsvpCommand ( ReplicableCommand command ) { } static class SenderContainer { final Address address ; volatile boolean processed = false ; SenderContainer ( Address address ) { } @ Override public String toString ( ) { } } static final class FutureCollator implements FutureListener < Object > { final RspFilter filter ; final Map < Future < Object > , CommandAwareRpcDispatcher . SenderContainer > futures = new HashMap < > ( 4 ) ; final long timeout ; @ GuardedBy ( "this" ) private RspList < Object > retval ; @ GuardedBy ( "this" ) private Exception exception ; @ GuardedBy ( "this" ) private int expectedResponses ; private final TimeService timeService ; FutureCollator ( RspFilter filter , int expectedResponses , long timeout , TimeService timeService ) { } public void watchFuture ( NotifyingFuture < Object > f , Address address ) { } public synchronized RspList < Object > getResponseList ( ) throws Exception { } @ Override @ SuppressWarnings ( "unchecked" ) public synchronized void futureDone ( Future < Object > objectFuture ) { } } }

Fix:
if ( ( deliverOrder == ( DeliverOrder . NONE ) ) || ( mode != ( ResponseMode . GET_NONE ) ) )