Buggy code:
} } } if ( ( fragmentMetaData . getOrdering ( ) . getBefore ( ) ) != null ) { for ( OrderingElementMetaData orderingElementMetaData : fragmentMetaData . getOrdering ( ) . getBefore ( ) . getOrdering ( ) ) { if ( orderingElementMetaData . isOthers ( ) ) { webOrdering . setBeforeOthers ( true ) ; } else { webOrdering . addBefore ( orderingElementMetaData . getName ( ) ) ; } } } } orderings . add ( webOrdering ) ; } for ( String jarName : jarsWithoutFragmentsSet ) { WarMetaDataProcessor . WebOrdering ordering = new WarMetaDataProcessor . WebOrdering ( ) ; ordering . setJar ( jarName ) ; orderings . add ( ordering ) ; } } if ( ! fragmentFound ) { orderings . clear ( ) ; } AbsoluteOrderingMetaData absoluteOrderingMetaData = null ; if ( ( ! isComplete ) && ( specMetaData instanceof Web30MetaData ) ) { absoluteOrderingMetaData = ( ( Web30MetaData ) ( specMetaData ) ) . getAbsoluteOrdering ( ) ; } if ( absoluteOrderingMetaData != null ) { int otherPos = - 1 ; int i = 0 ; for ( OrderingElementMetaData orderingElementMetaData : absoluteOrderingMetaData . getOrdering ( ) ) { if ( orderingElementMetaData . isOthers ( ) ) { if ( otherPos >= 0 ) { throw new DeploymentUnitProcessingException ( "Duplicate<seq2seq4repair_space>others<seq2seq4repair_space>in<seq2seq4repair_space>absolute<seq2seq4repair_space>ordering" ) ; } otherPos = i ; } else { boolean found = false ; for ( WarMetaDataProcessor . WebOrdering ordering : orderings ) { if ( orderingElementMetaData . getName ( ) . equals ( ordering . getName ( ) ) ) { order . add ( ordering . getJar ( ) ) ; jarsSet . remove ( ordering . getJar ( ) ) ; found = true ; break ; } } if ( ! found ) throw new DeploymentUnitProcessingException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>resolve<seq2seq4repair_space>name<seq2seq4repair_space>in<seq2seq4repair_space>absolute<seq2seq4repair_space>ordering:<seq2seq4repair_space>" + ( orderingElementMetaData . getName ( ) ) ) ) ; } i ++ ; } if ( otherPos >= 0 ) { order . addAll ( otherPos , jarsSet ) ; jarsSet . clear ( ) ; } } else if ( ( orderings . size ( ) ) > 0 ) { try { WarMetaDataProcessor . resolveOrder ( orderings , order ) ; } catch ( IllegalStateException e ) { throw new DeploymentUnitProcessingException ( "Invalid<seq2seq4repair_space>ordering" , e ) ; } jarsSet . clear ( ) ; } else { order . addAll ( jarsSet ) ; jarsSet . clear ( ) ; warMetaData . setNoOrder ( true ) ; } Logger log = Logger . getLogger ( "org.jboss.web" ) ; if ( log . isDebugEnabled ( ) ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( "Resolved<seq2seq4repair_space>order:<seq2seq4repair_space>[<seq2seq4repair_space>" ) ; for ( String jar : order ) { builder . append ( jar ) . append ( '<seq2seq4repair_space>' ) ; } builder . append ( ']' ) ; log . debug ( builder . toString ( ) ) ; } warMetaData . setOrder ( order ) ; warMetaData . setOverlays ( overlays ) ; warMetaData . setScis ( scis ) ; Map < String , WebMetaData > annotationsMetaData = warMetaData . getAnnotationsMetaData ( ) ; WebCommonMetaData mergedFragmentMetaData = new WebCommonMetaData ( ) ; if ( specMetaData == null ) { specMetaData = new Web30MetaData ( ) ; specMetaData . setVersion ( "3.0" ) ; } WebMetaData classesAnnotatedMetaData = annotationsMetaData . get ( "classes" ) ; if ( classesAnnotatedMetaData != null ) { if ( isComplete ) { classesAnnotatedMetaData . setFilters ( null ) ; classesAnnotatedMetaData . setFilterMappings ( null ) ; classesAnnotatedMetaData . setListeners ( null ) ; classesAnnotatedMetaData . setServlets ( null ) ; classesAnnotatedMetaData . setServletMappings ( null ) ; } WebCommonMetaDataMerger . augment ( specMetaData , classesAnnotatedMetaData , null , true ) ; } for ( String jar : order ) { WebFragmentMetaData webFragmentMetaData = webFragments . get ( jar ) ; <START_BUG> if ( webFragmentMetaData == null ) { <END_BUG> webFragmentMetaData = new WebFragmentMetaData ( ) ; webFragmentMetaData . setDistributable ( new EmptyMetaData ( ) ) ; } WebMetaData jarAnnotatedMetaData = annotationsMetaData . get ( jar ) ; if ( ( isComplete || ( webFragmentMetaData . isMetadataComplete ( ) ) ) && ( jarAnnotatedMetaData != null ) ) { jarAnnotatedMetaData . setFilters ( null ) ; jarAnnotatedMetaData . setFilterMappings ( null ) ; jarAnnotatedMetaData . setListeners ( null ) ; jarAnnotatedMetaData . setServlets ( null ) ; jarAnnotatedMetaData . setServletMappings ( null ) ; } if ( jarAnnotatedMetaData != null ) { WebCommonMetaDataMerger . augment ( webFragmentMetaData , jarAnnotatedMetaData , null , true ) ; } try { WebCommonMetaDataMerger . augment ( mergedFragmentMetaData , webFragmentMetaData , specMetaData , false ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( "Deployment<seq2seq4repair_space>error<seq2seq4repair_space>processing<seq2seq4repair_space>fragment<seq2seq4repair_space>for<seq2seq4repair_space>JAR:<seq2seq4repair_space>" + jar ) , e ) ; } } for ( String jar : jarsSet ) { WebFragmentMetaData webFragmentMetaData = new WebFragmentMetaData ( ) ; webFragmentMetaData . setDistributable ( new EmptyMetaData ( ) ) ; WebMetaData jarAnnotatedMetaData = annotationsMetaData . get ( jar ) ; if ( jarAnnotatedMetaData != null ) { jarAnnotatedMetaData . setFilters ( null ) ; jarAnnotatedMetaData . setFilterMappings ( null ) ; jarAnnotatedMetaData . setListeners ( null ) ; jarAnnotatedMetaData . setServlets ( null ) ; jarAnnotatedMetaData . setServletMappings ( null ) ; } if ( jarAnnotatedMetaData != null ) { WebCommonMetaDataMerger . augment ( webFragmentMetaData , jarAnnotatedMetaData , null , true ) ; } try { WebCommonMetaDataMerger . augment ( mergedFragmentMetaData , webFragmentMetaData , specMetaData , false ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( "Deployment<seq2seq4repair_space>error<seq2seq4repair_space>processing<seq2seq4repair_space>fragment<seq2seq4repair_space>for<seq2seq4repair_space>JAR:<seq2seq4repair_space>" + jar ) , e ) ; } } WebCommonMetaDataMerger . augment ( specMetaData , mergedFragmentMetaData , null , true ) ; JBossWebMetaData mergedMetaData = new JBossWebMetaData ( ) ; JBossWebMetaData metaData = warMetaData . getJbossWebMetaData ( ) ; JBossWebMetaDataMerger . merge ( mergedMetaData , metaData , specMetaData ) ; warMetaData . setMergedJBossWebMetaData ( mergedMetaData ) ; if ( mergedMetaData . isMetadataComplete ( ) ) { MetadataCompleteMarker . setMetadataComplete ( deploymentUnit , true ) ; }

Fix:
if ( ( webFragmentMetaData == null ) || isComplete ) {