Buggy code:
public class JdbcDriverAdd extends AbstractAddStepHandler { static final JdbcDriverAdd INSTANCE = new JdbcDriverAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { final ModelNode address = operation . require ( OP_ADDR ) ; final String driverName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; if ( ( operation . get ( Constants . DRIVER_NAME . getName ( ) ) . isDefined ( ) ) && ( ! ( driverName . equals ( operation . get ( Constants . DRIVER_NAME . getName ( ) ) . asString ( ) ) ) ) ) { throw MESSAGES . driverNameAndResourceNameNotEquals ( operation . get ( Constants . DRIVER_NAME . getName ( ) ) . asString ( ) , driverName ) ; } String moduleName = operation . require ( Constants . DRIVER_MODULE_NAME . getName ( ) ) . asString ( ) ; final Integer majorVersion = ( operation . hasDefined ( Constants . DRIVER_MAJOR_VERSION . getName ( ) ) ) ? operation . get ( Constants . DRIVER_MAJOR_VERSION . getName ( ) ) . asInt ( ) : null ; final Integer minorVersion = ( operation . hasDefined ( Constants . DRIVER_MINOR_VERSION . getName ( ) ) ) ? operation . get ( Constants . DRIVER_MINOR_VERSION . getName ( ) ) . asInt ( ) : null ; final String driverClassName = ( operation . hasDefined ( Constants . DRIVER_CLASS_NAME . getName ( ) ) ) ? operation . get ( Constants . DRIVER_CLASS_NAME . getName ( ) ) . asString ( ) : null ; final String dataSourceClassName = ( operation . hasDefined ( Constants . DRIVER_DATASOURCE_CLASS_NAME . getName ( ) ) ) ? operation . get ( Constants . DRIVER_DATASOURCE_CLASS_NAME . getName ( ) ) . asString ( ) : null ; final String xaDataSourceClassName = ( operation . hasDefined ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME . getName ( ) ) ) ? operation . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME . getName ( ) ) . asString ( ) : null ; final ServiceTarget target = context . getServiceTarget ( ) ; final ModuleIdentifier moduleId ; final Module module ; <START_BUG> String slot = ( operation . hasDefined ( Constants . MODULE_SLOT ) ) ? operation . get ( Constants . MODULE_SLOT ) . asString ( ) : null ; <END_BUG> if ( moduleName . contains ( ":" ) ) { slot = moduleName . substring ( ( ( moduleName . indexOf ( ":" ) ) + 1 ) ) ; moduleName = moduleName . substring ( 0 , moduleName . indexOf ( ":" ) ) ; } else { if ( slot != null ) { model . get ( Constants . DRIVER_MODULE_NAME . getName ( ) ) . set ( ( ( moduleName + ":" ) + slot ) ) ; } } try { moduleId = ModuleIdentifier . create ( moduleName , slot ) ; module = Module . getCallerModuleLoader ( ) . loadModule ( moduleId ) ; } catch ( ModuleLoadException e ) { throw new OperationFailedException ( MESSAGES . failedToLoadModuleDriver ( moduleName ) , e ) ; } if ( driverClassName == null ) { final ServiceLoader < Driver > serviceLoader = module . loadService ( Driver . class ) ; if ( serviceLoader != null ) for ( Driver driver : serviceLoader ) { JdbcDriverAdd . startDriverServices ( target , moduleId , driver , driverName , majorVersion , minorVersion , dataSourceClassName , xaDataSourceClassName ) ; } } else { try { final Class < ? extends Driver > driverClass = module . getClassLoader ( ) . loadClass ( driverClassName ) . asSubclass ( Driver . class ) ; final Constructor < ? extends Driver > constructor = driverClass . getConstructor ( ) ; final Driver driver = constructor . newInstance ( ) ; JdbcDriverAdd . startDriverServices ( target , moduleId , driver , driverName , majorVersion , minorVersion , dataSourceClassName , xaDataSourceClassName ) ; } catch ( Exception e ) { SUBSYSTEM_DATASOURCES_LOGGER . cannotInstantiateDriverClass ( driverClassName , e ) ; throw new OperationFailedException ( new ModelNode ( ) . set ( MESSAGES . cannotInstantiateDriverClass ( driverClassName ) ) ) ; } } } public static void startDriverServices ( final ServiceTarget target , final ModuleIdentifier moduleId , Driver driver , final String driverName , final Integer majorVersion , final Integer minorVersion , final String dataSourceClassName , final String xaDataSourceClassName ) throws IllegalStateException { } }

Fix:
String slot = ( operation . hasDefined ( Constants . MODULE_SLOT . getName ( ) ) ) ? operation . get ( Constants . MODULE_SLOT . getName ( ) ) . asString ( ) : null ;