Buggy code:
public class DeploymentStructureDescriptorParser implements DeploymentUnitProcessor { public static final String [ ] DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS = new String [ ] { "META-INF//jboss-deployment-structure.xml" , "WEB-INF//jboss-deployment-structure.xml" } ; private static final QName ROOT_1_0 = new QName ( JBossDeploymentStructureParser10 . NAMESPACE_1_0 , "jboss-deployment-structure" ) ; private static final QName ROOT_1_1 = new QName ( JBossDeploymentStructureParser11 . NAMESPACE_1_1 , "jboss-deployment-structure" ) ; private static final QName ROOT_NO_NAMESPACE = new QName ( "jboss-deployment-structure" ) ; private static final XMLInputFactory INPUT_FACTORY = XMLInputFactory . newInstance ( ) ; private final AttachmentKey < ModuleStructureSpec > SUB_DEPLOYMENT_STRUCTURE = AttachmentKey . create ( ModuleStructureSpec . class ) ; private final XMLMapper mapper ; public DeploymentStructureDescriptorParser ( ) { } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void handleDeployment ( final DeploymentUnit deploymentUnit , final ModuleSpecification moduleSpec , final ModuleStructureSpec rootDeploymentSpecification ) throws DeploymentUnitProcessingException { final Map < VirtualFile , ResourceRoot > resourceRoots = resourceRoots ( deploymentUnit ) ; moduleSpec . addUserDependencies ( rootDeploymentSpecification . getModuleDependencies ( ) ) ; moduleSpec . addExclusions ( rootDeploymentSpecification . getExclusions ( ) ) ; moduleSpec . addAliases ( rootDeploymentSpecification . getAliases ( ) ) ; <START_BUG> moduleSpec . addModuleSystemDependencies ( rootDeploymentSpecification . getSytemDependencies ( ) ) ; <END_BUG> for ( final ResourceRoot additionalResourceRoot : rootDeploymentSpecification . getResourceRoots ( ) ) { final ResourceRoot existingRoot = resourceRoots . get ( additionalResourceRoot . getRoot ( ) ) ; if ( existingRoot != null ) { existingRoot . merge ( additionalResourceRoot ) ; } else { deploymentUnit . addToAttachmentList ( RESOURCE_ROOTS , additionalResourceRoot ) ; ResourceRootIndexer . indexResourceRoot ( additionalResourceRoot ) ; ModuleRootMarker . mark ( additionalResourceRoot ) ; } } for ( final String classFileTransformer : rootDeploymentSpecification . getClassFileTransformers ( ) ) { moduleSpec . addClassFileTransformer ( classFileTransformer ) ; } for ( final ModuleIdentifier dependency : rootDeploymentSpecification . getAnnotationModules ( ) ) { deploymentUnit . addToAttachmentList ( ADDITIONAL_ANNOTATION_INDEXES , dependency ) ; } moduleSpec . setLocalLast ( rootDeploymentSpecification . isLocalLast ( ) ) ; } private Map < VirtualFile , ResourceRoot > resourceRoots ( final DeploymentUnit deploymentUnit ) { } private DeploymentUnitProcessingException subDeploymentNotFound ( final String path , final Collection < String > subDeployments ) { } @ Override public void undeploy ( final DeploymentUnit context ) { } private ParseResult parse ( final File file , final DeploymentUnit deploymentUnit , final ModuleLoader moduleLoader ) throws DeploymentUnitProcessingException { } private void setIfSupported ( final XMLInputFactory inputFactory , final String property , final Object value ) { } private ParseResult parse ( final InputStream source , final File file , final DeploymentUnit deploymentUnit , final ModuleLoader moduleLoader ) throws DeploymentUnitProcessingException { } private static void safeClose ( final Closeable closeable ) { } private static void safeClose ( final XMLStreamReader streamReader ) { } }

Fix:
moduleSpec . addModuleSystemDependencies ( rootDeploymentSpecification . getSystemDependencies ( ) ) ;