Buggy code:
private static JndiName createJndiName ( String container , String cache ) { } private static BindInfo createCacheBinding ( JndiName name ) { } private static < T > void addDependency ( ServiceBuilder < ? > builder , CacheAddHandler . Dependency < T > dependency ) { } void processModelNode ( OperationContext context , String containerName , ModelNode containerModel , ModelNode cache , ConfigurationBuilder builder , CacheAddHandler . CacheConfigurationDependencies cacheConfigurationDependencies , CacheAddHandler . CacheDependencies cacheDependencies , List < CacheAddHandler . Dependency < ? > > dependencies ) throws OperationFailedException { if ( cache . hasDefined ( STATISTICS_ENABLED ) ) { builder . jmxStatistics ( ) . enabled ( CacheResourceDefinition . STATISTICS_ENABLED . resolveModelAttribute ( context , cache ) . asBoolean ( ) ) ; } else { builder . jmxStatistics ( ) . enabled ( CacheContainerResourceDefinition . STATISTICS_ENABLED . resolveModelAttribute ( context , containerModel ) . asBoolean ( ) ) ; } final Indexing indexing = Indexing . valueOf ( INDEXING . resolveModelAttribute ( context , cache ) . asString ( ) ) ; builder . clustering ( ) . cacheMode ( this . mode ) ; final ModelNode indexingPropertiesModel = INDEXING_PROPERTIES . resolveModelAttribute ( context , cache ) ; Properties indexingProperties = new Properties ( ) ; if ( ( indexing . isEnabled ( ) ) && ( indexingPropertiesModel . isDefined ( ) ) ) { for ( Property p : indexingPropertiesModel . asPropertyList ( ) ) { String value = p . getValue ( ) . asString ( ) ; indexingProperties . put ( p . getName ( ) , value ) ; } } builder . indexing ( ) . enabled ( indexing . isEnabled ( ) ) . indexLocalOnly ( indexing . isLocalOnly ( ) ) . withProperties ( indexingProperties ) ; IsolationLevel isolationLevel = CacheAddHandler . getDefaultConfiguration ( this . mode ) . locking ( ) . isolationLevel ( ) ; if ( ( cache . hasDefined ( LOCKING ) ) && ( cache . get ( LOCKING , LOCKING_NAME ) . isDefined ( ) ) ) { ModelNode locking = cache . get ( LOCKING , LOCKING_NAME ) ; isolationLevel = IsolationLevel . valueOf ( ISOLATION . resolveModelAttribute ( context , locking ) . asString ( ) ) ; final boolean striping = STRIPING . resolveModelAttribute ( context , locking ) . asBoolean ( ) ; final long acquireTimeout = ACQUIRE_TIMEOUT . resolveModelAttribute ( context , locking ) . asLong ( ) ; final int concurrencyLevel = CONCURRENCY_LEVEL . resolveModelAttribute ( context , locking ) . asInt ( ) ; builder . locking ( ) . isolationLevel ( isolationLevel ) . useLockStriping ( striping ) . lockAcquisitionTimeout ( acquireTimeout ) . concurrencyLevel ( concurrencyLevel ) ; } LockingMode lockingMode = CacheAddHandler . getDefaultConfiguration ( this . mode ) . transaction ( ) . lockingMode ( ) ; if ( ( cache . hasDefined ( TRANSACTION ) ) && ( cache . get ( TRANSACTION , TRANSACTION_NAME ) . isDefined ( ) ) ) { ModelNode transaction = cache . get ( TRANSACTION , TRANSACTION_NAME ) ; long stopTimeout = STOP_TIMEOUT . resolveModelAttribute ( context , transaction ) . asLong ( ) ; TransactionMode txMode = TransactionMode . valueOf ( MODE . resolveModelAttribute ( context , transaction ) . asString ( ) ) ; lockingMode = LockingMode . valueOf ( TransactionResourceDefinition . LOCKING . resolveModelAttribute ( context , transaction ) . asString ( ) ) ; boolean transactional = txMode != ( TransactionMode . NONE ) ; boolean batching = txMode == ( TransactionMode . BATCH ) ; boolean useSynchronization = txMode == ( TransactionMode . NON_XA ) ; boolean recoveryEnabled = txMode == ( TransactionMode . FULL_XA ) ; <START_BUG> builder . transaction ( ) . cacheStopTimeout ( stopTimeout ) . transactionMode ( ( transactional ? org . infinispan . transaction . TransactionMode . TRANSACTIONAL : org . infinispan . transaction . TransactionMode . TRANSACTIONAL ) ) . lockingMode ( lockingMode ) . useSynchronization ( useSynchronization ) . recovery ( ) . enabled ( recoveryEnabled ) . invocationBatching ( ) . enable ( transactional ) ; <END_BUG> if ( transactional ) { if ( batching ) { cacheConfigurationDependencies . getTransactionManagerInjector ( ) . inject ( BatchModeTransactionManager . getInstance ( ) ) ; } else { dependencies . add ( new CacheAddHandler . Dependency ( TxnServices . JBOSS_TXN_TRANSACTION_MANAGER , TransactionManager . class , cacheConfigurationDependencies . getTransactionManagerInjector ( ) ) ) ; if ( useSynchronization ) { dependencies . add ( new CacheAddHandler . Dependency ( TxnServices . JBOSS_TXN_SYNCHRONIZATION_REGISTRY , TransactionSynchronizationRegistry . class , cacheConfigurationDependencies . getTransactionSynchronizationRegistryInjector ( ) ) ) ; } else if ( recoveryEnabled ) { dependencies . add ( new CacheAddHandler . Dependency ( TxnServices . JBOSS_TXN_ARJUNA_RECOVERY_MANAGER , XAResourceRecoveryRegistry . class , cacheDependencies . getRecoveryRegistryInjector ( ) ) ) ; } } } } if ( ( ( ( lockingMode == ( LockingMode . OPTIMISTIC ) ) && ( isolationLevel == ( IsolationLevel . REPEATABLE_READ ) ) ) && ( this . mode . isSynchronous ( ) ) ) && ( ! ( this . mode . isInvalidation ( ) ) ) ) { builder . locking ( ) . writeSkewCheck ( true ) ; builder . versioning ( ) . enable ( ) . scheme ( SIMPLE ) ; } if ( ( cache . hasDefined ( EVICTION ) ) && ( cache . get ( EVICTION , EVICTION_NAME ) . isDefined ( ) ) ) { ModelNode eviction = cache . get ( EVICTION , EVICTION_NAME ) ; final EvictionStrategy strategy = EvictionStrategy . valueOf ( STRATEGY . resolveModelAttribute ( context , eviction ) . asString ( ) ) ; builder . eviction ( ) . strategy ( strategy ) ; if ( strategy . isEnabled ( ) ) { final int maxEntries = MAX_ENTRIES . resolveModelAttribute ( context , eviction ) . asInt ( ) ;

Fix:
builder . transaction ( ) . cacheStopTimeout ( stopTimeout ) . transactionMode ( ( transactional ? org . infinispan . transaction . TransactionMode . TRANSACTIONAL : org . infinispan . transaction . TransactionMode . NON_TRANSACTIONAL ) ) . lockingMode ( lockingMode ) . useSynchronization ( useSynchronization ) . recovery ( ) . enabled ( recoveryEnabled ) . invocationBatching ( ) . enable ( transactional ) ;