Buggy code:
@ Listener public class DistributedCacheManager < T extends OutgoingDistributableSessionData , K extends SessionKey > implements SessionOwnershipSupport , org . jboss . as . clustering . web . DistributedCacheManager < T > { static String mask ( String sessionId ) { } private static final Random random = new Random ( ) ; private static Map < SharedLocalYieldingClusterLockManager . LockResult , LockResult > results = DistributedCacheManager . lockResultMap ( ) ; private static Map < SharedLocalYieldingClusterLockManager . LockResult , LockResult > lockResultMap ( ) { } final SessionAttributeStorage < T > attributeStorage ; private final LocalDistributableSessionManager manager ; private final SharedLocalYieldingClusterLockManager lockManager ; private final Cache < K , Map < Object , Object > > sessionCache ; private final DistributedCacheManager . ForceSynchronousCacheInvoker invoker ; private final BatchingManager batchingManager ; private final boolean passivationEnabled ; private final boolean requiresPurge ; private final DistributedCacheManager . JvmRouteHandler jvmRouteHandler ; private final SessionKeyFactory < K > keyFactory ; public DistributedCacheManager ( LocalDistributableSessionManager manager , Cache < K , Map < Object , Object > > sessionCache , Cache < Address , String > jvmRouteCache , SharedLocalYieldingClusterLockManager lockManager , SessionAttributeStorage < T > attributeStorage , BatchingManager batchingManager , SessionKeyFactory < K > keyFactory , CacheInvoker invoker ) { } @ Override public void start ( ) { } private void purge ( ) { } @ Override public void stop ( ) { } @ Override public BatchingManager getBatchingManager ( ) { } @ Override public void sessionCreated ( String sessionId ) { } @ Override public void storeSessionData ( final T sessionData ) { } @ Override public IncomingDistributableSessionData getSessionData ( String sessionId , boolean initialLoad ) { } @ Override public IncomingDistributableSessionData getSessionData ( final String sessionId , String dataOwner , boolean includeAttributes ) { } private IncomingDistributableSessionData getData ( String sessionId , final boolean includeAttributes ) { } @ Override public void removeSession ( final String sessionId ) { } @ Override public void removeSessionLocal ( final String sessionId ) { } private void removeSession ( final String sessionId , final boolean local ) { } @ Override public void removeSessionLocal ( String sessionId , String dataOwner ) { } @ Override public void evictSession ( String sessionId ) { } @ Override public void evictSession ( String sessionId , String dataOwner ) { } @ Override public Map < String , String > getSessionIds ( ) { } @ Override public boolean isPassivationEnabled ( ) { } @ Override public void setForceSynchronous ( boolean forceSynchronous ) { } @ Override public SessionOwnershipSupport getSessionOwnershipSupport ( ) { } @ Override public LockResult acquireSessionOwnership ( String sessionId , boolean newLock ) throws InterruptedException , TimeoutException { InfinispanWebLogger . ROOT_LOGGER . tracef ( "acquireSessionOwnership(%s,<seq2seq4repair_space>%s)" , sessionId , newLock ) ; EmbeddedCacheManager container = ( ( EmbeddedCacheManager ) ( this . sessionCache . getCacheManager ( ) ) ) ; <START_BUG> LockResult result = DistributedCacheManager . results . get ( this . lockManager . lock ( this . keyFactory . createKey ( sessionId ) . toString ( ) , container . getGlobalConfiguration ( ) . getDistributedSyncTimeout ( ) , newLock ) ) ; <END_BUG> InfinispanWebLogger . ROOT_LOGGER . tracef ( "acquireSessionOwnership(%s,<seq2seq4repair_space>%s)<seq2seq4repair_space>=<seq2seq4repair_space>%s" , sessionId , newLock , result ) ; return result != null ? result : LockResult . UNSUPPORTED ; } @ Override public void relinquishSessionOwnership ( String sessionId , boolean remove ) { } @ Override public boolean isLocal ( String sessionId ) { } @ Override public String locate ( String sessionId ) { } @ CacheEntryRemoved public void removed ( CacheEntryRemovedEvent < K , Map < Object , Object > > event ) { } @ CacheEntryModified public void modified ( CacheEntryModifiedEvent < K , Map < Object , Object > > event ) { } @ CacheEntryActivated public void activated ( CacheEntryActivatedEvent < K , Map < Object , Object > > event ) { } private < R > R batch ( DistributedCacheManager < T , K > . Operation < R > operation ) { } @ Listener ( sync = false ) public static class JvmRouteHandler { static interface Operation < R > extends CacheInvoker . Operation < Address , String , R > { } private final LocalDistributableSessionManager manager ; private final Cache < Address , String > cache ; JvmRouteHandler ( Cache < Address , String > cache , LocalDistributableSessionManager manager ) { } Cache < Address , String > getCache ( ) { } < R > R batch ( DistributedCacheManager . JvmRouteHandler . Operation < R > operation ) { } @ ViewChanged public void viewChanged ( final ViewChangedEvent event ) { } } abstract class Operation < R > implements CacheInvoker . Operation < K , Map < Object , Object > , R > { } static class ForceSynchronousCacheInvoker implements CacheInvoker { private static final ThreadLocal < Boolean > forceThreadSynchronous = new ThreadLocal < Boolean > ( ) { @ Override protected Boolean initialValue ( ) { } } ; private final CacheInvoker invoker ; private volatile boolean forceSynchronous = false ; ForceSynchronousCacheInvoker ( CacheInvoker invoker ) { } void setForceSynchronous ( boolean forceSynchronous ) { } void forceThreadSynchronous ( ) { } @ Override public < K , V , R > R invoke ( Cache < K , V > cache , Operation < K , V , R > operation ) { } } }

Fix:
LockResult result = DistributedCacheManager . results . get ( this . lockManager . lock ( this . keyFactory . createKey ( sessionId ) . toString ( ) , container . getCacheManagerConfiguration ( ) . transport ( ) . distributedSyncTimeout ( ) , newLock ) ) ;