Buggy code:
if ( params != null ) { Iterator < ParamValueMetaData > it = params . iterator ( ) ; while ( it . hasNext ( ) ) { final ParamValueMetaData param = it . next ( ) ; if ( param . getParamName ( ) . equals ( JaxrsIntegrationProcessor . RESTEASY_SCAN ) ) { it . remove ( ) ; } else if ( param . getParamName ( ) . equals ( JaxrsIntegrationProcessor . RESTEASY_SCAN_RESOURCES ) ) { it . remove ( ) ; } else if ( param . getParamName ( ) . equals ( JaxrsIntegrationProcessor . RESTEASY_SCAN_PROVIDERS ) ) { it . remove ( ) ; } else if ( param . getParamName ( ) . equals ( RESTEASY_EXPAND_ENTITY_REFERENCES ) ) { entityExpandEnabled = true ; } } } if ( ! entityExpandEnabled ) { JaxrsIntegrationProcessor . setContextParameter ( webdata , RESTEASY_EXPAND_ENTITY_REFERENCES , "false" ) ; } final Map < ModuleIdentifier , ResteasyDeploymentData > attachmentMap = parent . getAttachment ( ADDITIONAL_RESTEASY_DEPLOYMENT_DATA ) ; final List < ResteasyDeploymentData > additionalData = new ArrayList < ResteasyDeploymentData > ( ) ; final ModuleSpecification moduleSpec = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; if ( ( moduleSpec != null ) && ( attachmentMap != null ) ) { final Set < ModuleIdentifier > identifiers = new HashSet < ModuleIdentifier > ( ) ; for ( ModuleDependency dep : moduleSpec . getAllDependencies ( ) ) { if ( ! ( identifiers . contains ( dep . getIdentifier ( ) ) ) ) { identifiers . add ( dep . getIdentifier ( ) ) ; if ( attachmentMap . containsKey ( dep . getIdentifier ( ) ) ) { additionalData . add ( attachmentMap . get ( dep . getIdentifier ( ) ) ) ; } } } resteasy . merge ( additionalData ) ; } if ( ! ( resteasy . getScannedResourceClasses ( ) . isEmpty ( ) ) ) { StringBuffer buf = null ; for ( String resource : resteasy . getScannedResourceClasses ( ) ) { if ( buf == null ) { buf = new StringBuffer ( ) ; buf . append ( resource ) ; } else { buf . append ( "," ) . append ( resource ) ; } } String resources = buf . toString ( ) ; JAXRS_LOGGER . debugf ( "Adding<seq2seq4repair_space>JAX-RS<seq2seq4repair_space>resource<seq2seq4repair_space>classes:<seq2seq4repair_space>%s" , resources ) ; JaxrsIntegrationProcessor . setContextParameter ( webdata , RESTEASY_SCANNED_RESOURCES , resources ) ; } if ( ! ( resteasy . getScannedProviderClasses ( ) . isEmpty ( ) ) ) { StringBuffer buf = null ; for ( String provider : resteasy . getScannedProviderClasses ( ) ) { if ( buf == null ) { buf = new StringBuffer ( ) ; buf . append ( provider ) ; } else { buf . append ( "," ) . append ( provider ) ; } } String providers = buf . toString ( ) ; JAXRS_LOGGER . debugf ( "Adding<seq2seq4repair_space>JAX-RS<seq2seq4repair_space>provider<seq2seq4repair_space>classes:<seq2seq4repair_space>%s" , providers ) ; JaxrsIntegrationProcessor . setContextParameter ( webdata , RESTEASY_SCANNED_PROVIDERS , providers ) ; } if ( ! ( resteasy . getScannedJndiComponentResources ( ) . isEmpty ( ) ) ) { StringBuffer buf = null ; for ( String resource : resteasy . getScannedJndiComponentResources ( ) ) { if ( buf == null ) { buf = new StringBuffer ( ) ; buf . append ( resource ) ; } else { buf . append ( "," ) . append ( resource ) ; } } String providers = buf . toString ( ) ; JAXRS_LOGGER . debugf ( "Adding<seq2seq4repair_space>JAX-RS<seq2seq4repair_space>jndi<seq2seq4repair_space>component<seq2seq4repair_space>resource<seq2seq4repair_space>classes:<seq2seq4repair_space>%s" , providers ) ; JaxrsIntegrationProcessor . setContextParameter ( webdata , RESTEASY_SCANNED_JNDI_RESOURCES , providers ) ; } if ( ! ( resteasy . isUnwrappedExceptionsParameterSet ( ) ) ) { JaxrsIntegrationProcessor . setContextParameter ( webdata , RESTEASY_UNWRAPPED_EXCEPTIONS , "javax.ejb.EJBException" ) ; } if ( ( resteasy . hasBootClasses ( ) ) || ( resteasy . isDispatcherCreated ( ) ) ) return ; <START_BUG> Set < Class > applicationClassSet = new HashSet < > ( ) ; <END_BUG> for ( Class < ? extends Application > clazz : resteasy . getScannedApplicationClasses ( ) ) { if ( ( clazz . isAnnotationPresent ( ApplicationPath . class ) ) || ( JaxrsIntegrationProcessor . servletMappingsExist ( webdata , clazz . getName ( ) ) ) ) { applicationClassSet . add ( clazz ) ; } } if ( ( applicationClassSet . size ( ) ) == 0 ) { JBossServletMetaData servlet = new JBossServletMetaData ( ) ; servlet . setName ( JaxrsIntegrationProcessor . JAX_RS_SERVLET_NAME ) ; servlet . setServletClass ( HttpServlet30Dispatcher . class . getName ( ) ) ; servlet . setAsyncSupported ( true ) ; addServlet ( webdata , servlet ) ; setServletMappingPrefix ( webdata , JaxrsIntegrationProcessor . JAX_RS_SERVLET_NAME , servlet ) ; return ; } for ( Class < ? extends Application > applicationClass : applicationClassSet ) { String servletName = null ; servletName = applicationClass . getName ( ) ; JBossServletMetaData servlet = new JBossServletMetaData ( ) ; servlet . setLoadOnStartup ( ( "" + 0 ) ) ; servlet . setName ( servletName ) ; servlet . setServletClass ( HttpServlet30Dispatcher . class . getName ( ) ) ; servlet . setAsyncSupported ( true ) ; setServletInitParam ( servlet , JaxrsIntegrationProcessor . SERVLET_INIT_PARAM , applicationClass . getName ( ) ) ; addServlet ( webdata , servlet ) ; if ( ! ( JaxrsIntegrationProcessor . servletMappingsExist ( webdata , servletName ) ) ) { try { List < String > patterns = new ArrayList < String > ( ) ; String pathValue = URLDecoder . decode ( applicationClass . getAnnotation ( ApplicationPath . class ) . value ( ) . trim ( ) , "UTF-8" ) ; if ( ! ( pathValue . startsWith ( "//" ) ) ) { pathValue = "//" + pathValue ; } String prefix = pathValue ; if ( pathValue . endsWith ( "//" ) ) { pathValue += "*" ; } else { pathValue += "//*" ; } patterns . add ( pathValue ) ;

Fix:
Set < Class < ? extends Application > > applicationClassSet = new HashSet < > ( ) ;