Buggy code:
public abstract class CacheAdd extends AbstractAddStepHandler { private static final Logger log = Logger . getLogger ( CacheAdd . class . getPackage ( ) . getName ( ) ) ; private static final String DEFAULTS = "infinispan-defaults.xml" ; private static volatile Map < CacheMode , Configuration > defaults = null ; public static synchronized Configuration getDefaultConfiguration ( CacheMode cacheMode ) { } private static ConfigurationBuilderHolder load ( String resource ) { } private static URL find ( String resource , ClassLoader ... loaders ) { } final CacheMode mode ; CacheAdd ( CacheMode mode ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private < T > void addDependency ( ServiceBuilder < ? > builder , CacheAdd . Dependency < T > dependency ) { } abstract void populateCacheMode ( ModelNode fromModel , ModelNode toModel ) throws OperationFailedException { } void populate ( ModelNode fromModel , ModelNode toModel ) { } void processModelNode ( String containerName , ModelNode cache , ConfigurationBuilder builder , List < CacheAdd . Dependency < ? > > dependencies ) { builder . classLoader ( this . getClass ( ) . getClassLoader ( ) ) ; <START_BUG> builder . clustering ( ) . cacheMode ( CacheMode . valueOf ( cache . require ( CACHE_MODE ) . asString ( ) ) ) ; <END_BUG> if ( cache . hasDefined ( INDEXING ) ) { Indexing indexing = Indexing . valueOf ( cache . get ( INDEXING ) . asString ( ) ) ; builder . indexing ( ) . enabled ( indexing . isEnabled ( ) ) . indexLocalOnly ( indexing . isLocalOnly ( ) ) ; } if ( cache . hasDefined ( QUEUE_SIZE ) ) { int size = cache . get ( QUEUE_SIZE ) . asInt ( ) ; builder . clustering ( ) . async ( ) . replQueueMaxElements ( size ) . useReplQueue ( ( size > 0 ) ) ; } if ( cache . hasDefined ( QUEUE_FLUSH_INTERVAL ) ) { builder . clustering ( ) . async ( ) . replQueueInterval ( cache . get ( QUEUE_FLUSH_INTERVAL ) . asLong ( ) ) ; } if ( cache . hasDefined ( REMOTE_TIMEOUT ) ) { builder . clustering ( ) . sync ( ) . replTimeout ( cache . get ( REMOTE_TIMEOUT ) . asLong ( ) ) ; } if ( cache . hasDefined ( OWNERS ) ) { builder . clustering ( ) . hash ( ) . numOwners ( cache . get ( OWNERS ) . asInt ( ) ) ; } if ( cache . hasDefined ( VIRTUAL_NODES ) ) { builder . clustering ( ) . hash ( ) . numVirtualNodes ( cache . get ( VIRTUAL_NODES ) . asInt ( ) ) ; } if ( cache . hasDefined ( L1_LIFESPAN ) ) { long lifespan = cache . get ( L1_LIFESPAN ) . asLong ( ) ; if ( lifespan > 0 ) { builder . clustering ( ) . l1 ( ) . enable ( ) . lifespan ( lifespan ) ; } else { builder . clustering ( ) . l1 ( ) . disable ( ) ; } } if ( ( cache . hasDefined ( LOCKING ) ) && ( cache . get ( LOCKING , LOCKING_NAME ) . isDefined ( ) ) ) { ModelNode locking = cache . get ( LOCKING , LOCKING_NAME ) ; if ( locking . hasDefined ( ISOLATION ) ) { builder . locking ( ) . isolationLevel ( IsolationLevel . valueOf ( locking . get ( ISOLATION ) . asString ( ) ) ) ; } if ( locking . hasDefined ( STRIPING ) ) { builder . locking ( ) . useLockStriping ( locking . get ( STRIPING ) . asBoolean ( ) ) ; } if ( locking . hasDefined ( ACQUIRE_TIMEOUT ) ) { builder . locking ( ) . lockAcquisitionTimeout ( locking . get ( ACQUIRE_TIMEOUT ) . asLong ( ) ) ; } if ( locking . hasDefined ( CONCURRENCY_LEVEL ) ) { builder . locking ( ) . concurrencyLevel ( locking . get ( CONCURRENCY_LEVEL ) . asInt ( ) ) ; } } TransactionMode txMode = TransactionMode . NONE ; LockingMode lockingMode = LockingMode . OPTIMISTIC ; if ( ( cache . hasDefined ( TRANSACTION ) ) && ( cache . get ( TRANSACTION , TRANSACTION_NAME ) . isDefined ( ) ) ) { ModelNode transaction = cache . get ( TRANSACTION , TRANSACTION_NAME ) ; if ( transaction . hasDefined ( STOP_TIMEOUT ) ) { builder . transaction ( ) . cacheStopTimeout ( transaction . get ( STOP_TIMEOUT ) . asLong ( ) ) ; } if ( transaction . hasDefined ( MODE ) ) { txMode = TransactionMode . valueOf ( transaction . get ( MODE ) . asString ( ) ) ; } if ( transaction . hasDefined ( LOCKING ) ) { lockingMode = LockingMode . valueOf ( transaction . get ( LOCKING ) . asString ( ) ) ; } } builder . transaction ( ) . transactionMode ( txMode . getMode ( ) ) . lockingMode ( lockingMode ) . useSynchronization ( ( ! ( txMode . isXAEnabled ( ) ) ) ) . recovery ( ) . enabled ( txMode . isRecoveryEnabled ( ) ) ; if ( txMode . isRecoveryEnabled ( ) ) { builder . transaction ( ) . syncCommitPhase ( true ) . syncRollbackPhase ( true ) ; } if ( cache . hasDefined ( BATCHING ) ) { if ( cache . get ( BATCHING ) . asBoolean ( ) ) { builder . transaction ( ) . transactionMode ( TRANSACTIONAL ) . invocationBatching ( ) . enable ( ) ; }

Fix:
builder . clustering ( ) . cacheMode ( CacheMode . valueOf ( cache . require ( MODE ) . asString ( ) ) ) ;