Buggy code:
serviceTarget . addDependency ( context . getController ( ) . getName ( ) ) ; final DelegatingServiceRegistry serviceRegistry = new DelegatingServiceRegistry ( container ) ; final Bootstrap . Configuration configuration = this . configuration ; final ServerEnvironment serverEnvironment = configuration . getServerEnvironment ( ) ; final int threads = ( ( int ) ( ( Runtime . getRuntime ( ) . availableProcessors ( ) ) * 1.5F ) ) ; final ExecutorService executor = new ThreadPoolExecutor ( threads , threads , Long . MAX_VALUE , TimeUnit . NANOSECONDS , new LinkedBlockingQueue < Runnable > ( ) ) ; container . setExecutor ( executor ) ; final ServerModel serverModel = new ServerModel ( serverEnvironment . getServerName ( ) , configuration . getPortOffset ( ) ) ; final ServerConfigurationPersister persister = configuration . getConfigurationPersister ( ) ; final ServerControllerImpl serverController = new ServerControllerImpl ( serverModel , container , serverEnvironment , persister , executor ) ; final List < AbstractServerModelUpdate < ? > > updates ; try { updates = persister . load ( serverController ) ; } catch ( Exception e ) { throw new StartException ( e ) ; } final EnumMap < Phase , SortedSet < ServerControllerService . RegisteredProcessor > > deployers = new EnumMap < Phase , SortedSet < ServerControllerService . RegisteredProcessor > > ( Phase . class ) ; for ( Phase phase : Phase . values ( ) ) { deployers . put ( phase , new ConcurrentSkipListSet < ServerControllerService . RegisteredProcessor > ( ) ) ; } final BootUpdateContext bootUpdateContext = new BootUpdateContext ( ) { public ServiceTarget getServiceTarget ( ) { return serviceTarget ; } public ServiceRegistry getServiceRegistry ( ) { return serviceRegistry ; } public void addDeploymentProcessor ( final Phase phase , final int priority , final DeploymentUnitProcessor processor ) { if ( phase == null ) { throw new IllegalArgumentException ( "phase<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } if ( processor == null ) { throw new IllegalArgumentException ( "processor<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ; } if ( priority < 0 ) { throw new IllegalArgumentException ( "priority<seq2seq4repair_space>is<seq2seq4repair_space>invalid<seq2seq4repair_space>(must<seq2seq4repair_space>be<seq2seq4repair_space>>=<seq2seq4repair_space>0)" ) ; } deployers . get ( phase ) . add ( new ServerControllerService . RegisteredProcessor ( priority , processor ) ) ; } } ; ServerControllerService . log . info ( "Activating<seq2seq4repair_space>core<seq2seq4repair_space>services" ) ; serviceTarget . addService ( SERVICE_NAME , new Service < ServerModel > ( ) { public void start ( StartContext context ) throws StartException { } public void stop ( StopContext context ) { } public ServerModel getValue ( ) throws IllegalArgumentException , IllegalStateException { return serverModel ; } } ) . install ( ) ; serverController . applyUpdates ( updates , false , true ) ; for ( AbstractServerModelUpdate < ? > update : updates ) { update . applyUpdateBootAction ( bootUpdateContext ) ; } final File [ ] extDirs = serverEnvironment . getJavaExtDirs ( ) ; final File [ ] newExtDirs = Arrays . copyOf ( extDirs , ( ( extDirs . length ) + 1 ) ) ; <START_BUG> newExtDirs [ extDirs . length ] = new File ( serverEnvironment . getServerBaseDir ( ) , "ext//lib" ) ; <END_BUG> serviceTarget . addService ( JBOSS_DEPLOYMENT_EXTENSION_INDEX , new ExtensionIndexService ( newExtDirs ) ) . setInitialMode ( ON_DEMAND ) ; serviceTarget . addService ( ServerDeploymentRepository . SERVICE_NAME , new org . jboss . as . server . deployment . impl . ServerDeploymentRepositoryImpl ( serverEnvironment . getServerDeployDir ( ) , serverEnvironment . getServerSystemDeployDir ( ) ) ) . install ( ) ; deploymentModuleLoader = new org . jboss . as . server . deployment . module . DeploymentModuleLoaderImpl ( configuration . getModuleLoader ( ) ) ; deployers . get ( STRUCTURE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . STRUCTURE_DEPLOYMENT_MODULE_LOADER , new DeploymentUnitProcessor ( ) { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { phaseContext . getDeploymentUnit ( ) . putAttachment ( DEPLOYMENT_MODULE_LOADER , deploymentModuleLoader ) ; } public void undeploy ( DeploymentUnit context ) { context . removeAttachment ( DEPLOYMENT_MODULE_LOADER ) ; } } ) ) ; deployers . get ( STRUCTURE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . STRUCTURE_MOUNT , new DeploymentRootMountProcessor ( ) ) ) ; deployers . get ( STRUCTURE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . STRUCTURE_MANIFEST , new ManifestAttachmentProcessor ( ) ) ) ; deployers . get ( STRUCTURE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . STRUCTURE_SUB_DEPLOYMENT , new SubDeploymentProcessor ( ) ) ) ; deployers . get ( STRUCTURE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . STRUCTURE_ANNOTATION_INDEX , new AnnotationIndexProcessor ( ) ) ) ; deployers . get ( PARSE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . PARSE_COMPOSITE_ANNOTATION_INDEX , new CompositeIndexProcessor ( ) ) ) ; deployers . get ( PARSE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . PARSE_CLASS_PATH , new ManifestClassPathProcessor ( ) ) ) ; deployers . get ( PARSE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . PARSE_EXTENSION_LIST , new ManifestExtensionListProcessor ( ) ) ) ; deployers . get ( DEPENDENCIES ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . DEPENDENCIES_MODULE , new ModuleDependencyProcessor ( ) ) ) ; deployers . get ( DEPENDENCIES ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . DEPENDENCIES_SAR_MODULE , new ServiceActivatorDependencyProcessor ( ) ) ) ; deployers . get ( DEPENDENCIES ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . DEPENDENCIES_CLASS_PATH , new ModuleClassPathProcessor ( ) ) ) ; deployers . get ( DEPENDENCIES ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . DEPENDENCIES_EXTENSION_LIST , new ModuleExtensionListProcessor ( ) ) ) ; deployers . get ( CONFIGURE_MODULE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . CONFIGURE_MODULE_SPEC , new ModuleSpecProcessor ( ) ) ) ; deployers . get ( MODULARIZE ) . add ( new ServerControllerService . RegisteredProcessor ( Phase . MODULARIZE_DEPLOYMENT , new ModuleDeploymentProcessor ( ) ) ) ;

Fix:
newExtDirs [ extDirs . length ] = new File ( serverEnvironment . getServerBaseDir ( ) , "lib//ext" ) ;