Buggy code:
if ( creator != null ) { InstanceFactory < Filter > instanceFactory = UndertowDeploymentInfoService . createInstanceFactory ( creator ) ; f = new FilterInfo ( filter . getName ( ) , filterClass , instanceFactory ) ; } else { f = new FilterInfo ( filter . getName ( ) , filterClass ) ; } f . setAsyncSupported ( filter . isAsyncSupported ( ) ) ; d . addFilter ( f ) ; if ( ( filter . getInitParam ( ) ) != null ) { for ( ParamValueMetaData initParam : filter . getInitParam ( ) ) { f . addInitParam ( initParam . getParamName ( ) , initParam . getParamValue ( ) ) ; } } } } if ( ( mergedMetaData . getFilterMappings ( ) ) != null ) { for ( final FilterMappingMetaData mapping : mergedMetaData . getFilterMappings ( ) ) { if ( ( mapping . getUrlPatterns ( ) ) != null ) { for ( String url : mapping . getUrlPatterns ( ) ) { if ( ( is22OrOlder && ( ! ( url . startsWith ( "*" ) ) ) ) && ( ! ( url . startsWith ( "//" ) ) ) ) { url = "//" + url ; } if ( ( ( mapping . getDispatchers ( ) ) != null ) && ( ! ( mapping . getDispatchers ( ) . isEmpty ( ) ) ) ) { for ( DispatcherType dispatcher : mapping . getDispatchers ( ) ) { d . addFilterUrlMapping ( mapping . getFilterName ( ) , url , javax . servlet . DispatcherType . valueOf ( dispatcher . name ( ) ) ) ; } } else { d . addFilterUrlMapping ( mapping . getFilterName ( ) , url , REQUEST ) ; } } } if ( ( mapping . getServletNames ( ) ) != null ) { for ( String servletName : mapping . getServletNames ( ) ) { if ( ( ( mapping . getDispatchers ( ) ) != null ) && ( ! ( mapping . getDispatchers ( ) . isEmpty ( ) ) ) ) { for ( DispatcherType dispatcher : mapping . getDispatchers ( ) ) { d . addFilterServletNameMapping ( mapping . getFilterName ( ) , servletName , javax . servlet . DispatcherType . valueOf ( dispatcher . name ( ) ) ) ; } } else { d . addFilterServletNameMapping ( mapping . getFilterName ( ) , servletName , REQUEST ) ; } } } } } if ( ( ( scisMetaData ) != null ) && ( ( scisMetaData . getHandlesTypes ( ) ) != null ) ) { for ( final Map . Entry < ServletContainerInitializer , Set < Class < ? > > > sci : scisMetaData . getHandlesTypes ( ) . entrySet ( ) ) { final ImmediateInstanceFactory < ServletContainerInitializer > instanceFactory = new ImmediateInstanceFactory ( sci . getKey ( ) ) ; d . addServletContainerInitalizer ( new io . undertow . servlet . api . ServletContainerInitializerInfo ( sci . getKey ( ) . getClass ( ) , instanceFactory , sci . getValue ( ) ) ) ; } } if ( ( mergedMetaData . getListeners ( ) ) != null ) { for ( ListenerMetaData listener : mergedMetaData . getListeners ( ) ) { UndertowDeploymentInfoService . addListener ( classReflectionIndex , componentRegistry , d , listener ) ; } } if ( ( mergedMetaData . getContextParams ( ) ) != null ) { for ( ParamValueMetaData param : mergedMetaData . getContextParams ( ) ) { d . addInitParameter ( param . getParamName ( ) , param . getParamValue ( ) ) ; } } if ( ( ( mergedMetaData . getWelcomeFileList ( ) ) != null ) && ( ( mergedMetaData . getWelcomeFileList ( ) . getWelcomeFiles ( ) ) != null ) ) { List < String > welcomeFiles = mergedMetaData . getWelcomeFileList ( ) . getWelcomeFiles ( ) ; for ( String file : welcomeFiles ) { if ( file . startsWith ( "//" ) ) { d . addWelcomePages ( file . substring ( 1 ) ) ; } else { <START_BUG> d . addWelcomePages ( welcomeFiles ) ; <END_BUG> } } } else { d . addWelcomePages ( "index.html" , "index.htm" , "index.jsp" ) ; } if ( ( mergedMetaData . getErrorPages ( ) ) != null ) { for ( final ErrorPageMetaData page : mergedMetaData . getErrorPages ( ) ) { final ErrorPage errorPage ; if ( ( ( page . getExceptionType ( ) ) == null ) || ( page . getExceptionType ( ) . isEmpty ( ) ) ) { errorPage = new ErrorPage ( page . getLocation ( ) , Integer . parseInt ( page . getErrorCode ( ) ) ) ; } else { errorPage = new ErrorPage ( page . getLocation ( ) , ( ( Class < ? extends Throwable > ) ( classReflectionIndex . classIndex ( page . getExceptionType ( ) ) . getModuleClass ( ) ) ) ) ; } d . addErrorPages ( errorPage ) ; } } if ( ( mergedMetaData . getMimeMappings ( ) ) != null ) { for ( final MimeMappingMetaData mapping : mergedMetaData . getMimeMappings ( ) ) { d . addMimeMapping ( new io . undertow . servlet . api . MimeMapping ( mapping . getExtension ( ) , mapping . getMimeType ( ) ) ) ; } } Set < String > securityRoleNames = mergedMetaData . getSecurityRoleNames ( ) ; if ( ( mergedMetaData . getSecurityConstraints ( ) ) != null ) { for ( SecurityConstraintMetaData constraint : mergedMetaData . getSecurityConstraints ( ) ) { SecurityConstraint securityConstraint = new SecurityConstraint ( ) . setTransportGuaranteeType ( UndertowDeploymentInfoService . transportGuaranteeType ( constraint . getTransportGuarantee ( ) ) ) ; List < String > roleNames = constraint . getRoleNames ( ) ; if ( ( constraint . getAuthConstraint ( ) ) == null ) { securityConstraint . setEmptyRoleSemantic ( EmptyRoleSemantic . PERMIT ) ; }

Fix:
d . addWelcomePages ( file ) ;