Buggy code:
public class ServletContainerInitializerDeploymentProcessor implements DeploymentUnitProcessor { public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ServiceModuleLoader loader = deploymentUnit . getAttachment ( SERVICE_MODULE_LOADER ) ; if ( ! ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) ) { return ; } WarMetaData warMetaData = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; assert warMetaData != null ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( module == null ) { throw new DeploymentUnitProcessingException ( ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>module<seq2seq4repair_space>for<seq2seq4repair_space>" + deploymentUnit ) ) ; } final ClassLoader classLoader = module . getClassLoader ( ) ; ScisMetaData scisMetaData = deploymentUnit . getAttachment ( ScisMetaData . ATTACHMENT_KEY ) ; if ( scisMetaData == null ) { scisMetaData = new ScisMetaData ( ) ; deploymentUnit . putAttachment ( ScisMetaData . ATTACHMENT_KEY , scisMetaData ) ; } Set < ServletContainerInitializer > scis = scisMetaData . getScis ( ) ; if ( scis == null ) { scis = new HashSet < ServletContainerInitializer > ( ) ; scisMetaData . setScis ( scis ) ; } Map < ServletContainerInitializer , Set < Class < ? > > > handlesTypes = scisMetaData . getHandlesTypes ( ) ; if ( handlesTypes == null ) { handlesTypes = new HashMap < ServletContainerInitializer , Set < Class < ? > > > ( ) ; scisMetaData . setHandlesTypes ( handlesTypes ) ; } <START_BUG> for ( ModuleDependency dependency : moduleSpecification . getDependencies ( ) ) { <END_BUG> ServiceLoader < ServletContainerInitializer > serviceLoader ; try { Module depModule = loader . loadModule ( dependency . getIdentifier ( ) ) ; serviceLoader = depModule . loadService ( ServletContainerInitializer . class ) ; for ( ServletContainerInitializer service : serviceLoader ) { scis . add ( service ) ; } } catch ( ModuleLoadException e ) { throw new DeploymentUnitProcessingException ( ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>SCI<seq2seq4repair_space>from<seq2seq4repair_space>module:<seq2seq4repair_space>" + ( dependency . getIdentifier ( ) ) ) , e ) ; } } List < String > order = warMetaData . getOrder ( ) ; Map < String , VirtualFile > localScis = warMetaData . getScis ( ) ; if ( ( order != null ) && ( localScis != null ) ) { for ( String jar : order ) { VirtualFile sci = localScis . get ( jar ) ; if ( sci != null ) { ServletContainerInitializer service = loadSci ( classLoader , sci , jar , true ) ; if ( service != null ) { scis . add ( service ) ; } } } } Map < Class < ? > , Set < ServletContainerInitializer > > typesMap = new HashMap < Class < ? > , Set < ServletContainerInitializer > > ( ) ; for ( ServletContainerInitializer service : scis ) { if ( service . getClass ( ) . isAnnotationPresent ( HandlesTypes . class ) ) { HandlesTypes handlesTypesAnnotation = service . getClass ( ) . getAnnotation ( HandlesTypes . class ) ; Class < ? > [ ] typesArray = handlesTypesAnnotation . value ( ) ; if ( typesArray != null ) { for ( Class < ? > type : typesArray ) { Set < ServletContainerInitializer > servicesSet = typesMap . get ( type ) ; if ( servicesSet == null ) { servicesSet = new HashSet < ServletContainerInitializer > ( ) ; typesMap . put ( type , servicesSet ) ; } servicesSet . add ( service ) ; handlesTypes . put ( service , new HashSet < Class < ? > > ( ) ) ; } } } } Class < ? > [ ] typesArray = typesMap . keySet ( ) . toArray ( new Class < ? > [ 0 ] ) ; final CompositeIndex index = deploymentUnit . getAttachment ( COMPOSITE_ANNOTATION_INDEX ) ; if ( index == null ) { throw new DeploymentUnitProcessingException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>annotation<seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>deployment<seq2seq4repair_space>unit<seq2seq4repair_space>" + deploymentUnit ) ) ; } for ( Class < ? > type : typesArray ) { DotName className = DotName . createSimple ( type . getName ( ) ) ; Set < ClassInfo > classInfos = processHandlesType ( className , type , index ) ; Set < Class < ? > > classes = loadClassInfoSet ( classInfos , classLoader ) ; Set < ServletContainerInitializer > sciSet = typesMap . get ( type ) ; for ( ServletContainerInitializer sci : sciSet ) { handlesTypes . get ( sci ) . addAll ( classes ) ; } } } public void undeploy ( final DeploymentUnit context ) { } private ServletContainerInitializer loadSci ( ClassLoader classLoader , VirtualFile sci , String jar , boolean error ) throws DeploymentUnitProcessingException { } private Set < ClassInfo > processHandlesType ( DotName typeName , Class < ? > type , CompositeIndex index ) throws DeploymentUnitProcessingException { } private Set < Class < ? > > loadClassInfoSet ( Set < ClassInfo > classInfos , ClassLoader classLoader ) throws DeploymentUnitProcessingException { } }

Fix:
for ( ModuleDependency dependency : moduleSpecification . getSystemDependencies ( ) ) {