Buggy code:
class ServerDeploymentStartStopHandler { private static final Logger log = Logger . getLogger ( "org.jboss.as.deployment" ) ; < P > void deploy ( final String deploymentName , final String runtimeName , final byte [ ] deploymentHash , final ServiceContainer serviceContainer , final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } < P > void deploy ( final String deploymentName , final String runtimeName , final byte [ ] deploymentHash , final BatchBuilder batchBuilder , final ServiceContainer serviceContainer , final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } < P > void redeploy ( final String deploymentName , final String runtimeName , final byte [ ] deploymentHash , final ServiceContainer serviceContainer , final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } < P > void undeploy ( final String deploymentName , final ServiceContainer serviceContainer , final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } private void activate ( final String deploymentName , String runtimeName , final byte [ ] deploymentHash , final ServiceName deploymentServiceName , final ServiceActivatorContext context , final ServiceContainer serviceContainer ) { ServerDeploymentStartStopHandler . log . infof ( "Activating<seq2seq4repair_space>deployment:<seq2seq4repair_space>%s" , deploymentName ) ; Closeable handle = null ; try { final ServerDeploymentRepository deploymentRepo = getDeploymentRepository ( serviceContainer ) ; final VirtualFile deploymentRoot = VFS . getChild ( ( "deployments//" + runtimeName ) ) ; try { handle = deploymentRepo . mountDeploymentContent ( deploymentName , runtimeName , deploymentHash , deploymentRoot ) ; } catch ( IOException e ) { throw new RuntimeException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>mount<seq2seq4repair_space>deployment<seq2seq4repair_space>archive" , e ) ; } final BatchBuilder batchBuilder = context . getBatchBuilder ( ) ; DeploymentService deploymentService = new DeploymentService ( handle ) ; BatchServiceBuilder < Void > serviceBuilder = batchBuilder . addService ( deploymentServiceName , deploymentService ) ; final BatchBuilder deploymentSubBatch = batchBuilder . subBatchBuilder ( ) ; deploymentSubBatch . addDependency ( deploymentServiceName ) ; deploymentSubBatch . addListener ( new org . jboss . as . deployment . DeploymentFailureListener ( deploymentServiceName ) ) ; final DeploymentUnitContext deploymentUnitContext = new org . jboss . as . deployment . unit . DeploymentUnitContextImpl ( deploymentServiceName . getSimpleName ( ) , deploymentSubBatch , serviceBuilder ) ; attachVirtualFile ( deploymentUnitContext , deploymentRoot ) ; deploymentUnitContext . putAttachment ( ATTACHMENT_KEY , new MountHandle ( handle ) ) ; final DeploymentChainProvider deploymentChainProvider = DeploymentChainProvider . INSTANCE ; <START_BUG> final DeploymentChain deploymentChain = deploymentChainProvider . determineDeploymentChain ( deploymentRoot ) ; <END_BUG> ServerDeploymentStartStopHandler . log . debugf ( "Executing<seq2seq4repair_space>deployment<seq2seq4repair_space>'%s'<seq2seq4repair_space>with<seq2seq4repair_space>chain:<seq2seq4repair_space>%s" , deploymentName , deploymentChain ) ; if ( deploymentChain == null ) throw new RuntimeException ( ( "Failed<seq2seq4repair_space>determine<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>chain<seq2seq4repair_space>for<seq2seq4repair_space>deployment<seq2seq4repair_space>root:<seq2seq4repair_space>" + deploymentRoot ) ) ; try { deploymentChain . processDeployment ( deploymentUnitContext ) ; } catch ( DeploymentUnitProcessingException e ) { throw new RuntimeException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>deployment<seq2seq4repair_space>chain." , e ) ; } } catch ( Throwable t ) { VFSUtils . safeClose ( handle ) ; if ( t instanceof RuntimeException ) { throw ( ( RuntimeException ) ( t ) ) ; } throw new RuntimeException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>activate<seq2seq4repair_space>deployment<seq2seq4repair_space>unit<seq2seq4repair_space>" + deploymentName ) , t ) ; } } private ServerDeploymentRepository getDeploymentRepository ( ServiceContainer serviceContainer ) throws ServiceNotFoundException { } private static ServiceName getDeploymentServiceName ( String deploymentName ) { } private static class AbstractDeploymentServiceTracker < P > extends AbstractServiceListener < Object > { protected final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler ; protected final P param ; protected AbstractDeploymentServiceTracker ( final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } @ Override public void serviceFailed ( ServiceController < ? > controller , StartException reason ) { } protected void recordResult ( ServiceController < ? extends Object > controller ) { } } private static class DeploymentServiceTracker < P > extends ServerDeploymentStartStopHandler . AbstractDeploymentServiceTracker < P > { private DeploymentServiceTracker ( final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } @ Override public void serviceStarted ( ServiceController < ? > controller ) { } } private static class UndeploymentServiceTracker < P > extends ServerDeploymentStartStopHandler . AbstractDeploymentServiceTracker < P > { private UndeploymentServiceTracker ( final UpdateResultHandler < ? super ServerDeploymentActionResult , P > resultHandler , final P param ) { } @ Override public void serviceStopped ( ServiceController < ? > controller ) { } } private static class RedeploymentServiceTracker extends AbstractServiceListener < Object > { @ Override public void serviceRemoved ( ServiceController < ? extends Object > controller ) { } } }

Fix:
final DeploymentChain deploymentChain = deploymentChainProvider . determineDeploymentChain ( deploymentUnitContext ) ;