Buggy code:
public class DeploymentHandlerUtil { static class ContentItem { private byte [ ] hash ; private String path ; private String relativeTo ; private boolean isArchive ; ContentItem ( final byte [ ] hash ) { } ContentItem ( final String path , final String relativeTo , final boolean isArchive ) { } } private DeploymentHandlerUtil ( ) { } public static void deploy ( final OperationContext context , final String deploymentUnitName , final String managementName , final DeploymentHandlerUtil . ContentItem ... contents ) throws OperationFailedException { assert contents != null : "contents<seq2seq4repair_space>is<seq2seq4repair_space>null" ; if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { final DeploymentModelUtils model = DeploymentModelUtils . create ( context , EMPTY_ADDRESS ) ; context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) { final ServiceName deploymentUnitServiceName = Services . deploymentUnitName ( deploymentUnitName ) ; <START_BUG> final ServiceRegistry serviceRegistry = context . getServiceRegistry ( false ) ; <END_BUG> final ServiceController < ? > deploymentController = serviceRegistry . getService ( deploymentUnitServiceName ) ; if ( deploymentController != null ) { final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; deploymentController . addListener ( verificationHandler ) ; deploymentController . setMode ( ACTIVE ) ; context . addStep ( verificationHandler , VERIFY ) ; if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { deploymentController . setMode ( NEVER ) ; } } else { final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; final Collection < ServiceController < ? > > controllers = DeploymentHandlerUtil . doDeploy ( context , deploymentUnitName , managementName , verificationHandler , model , contents ) ; context . addStep ( verificationHandler , VERIFY ) ; if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { for ( ServiceController < ? > controller : controllers ) { context . removeService ( controller . getName ( ) ) ; } } } } } , RUNTIME ) ; } } private static Collection < ServiceController < ? > > doDeploy ( final OperationContext context , final String deploymentUnitName , final String managementName , final ServiceVerificationHandler verificationHandler , final DeploymentModelUtils model , final DeploymentHandlerUtil . ContentItem ... contents ) { } public static void redeploy ( final OperationContext operationContext , final String deploymentUnitName , final String managementName , final DeploymentHandlerUtil . ContentItem ... contents ) throws OperationFailedException { } public static void replace ( final OperationContext operationContext , final ModelNode originalDeployment , final String deploymentUnitName , final String managementName , final String replacedDeploymentUnitName , final DeploymentHandlerUtil . ContentItem ... contents ) throws OperationFailedException { } public static void undeploy ( final OperationContext context , final String deploymentUnitName ) { } }

Fix:
final ServiceRegistry serviceRegistry = context . getServiceRegistry ( true ) ;