Buggy code:
public class PersistenceUnitDeploymentProcessor implements DeploymentUnitProcessor { public static final String JNDI_PROPERTY = "jboss.entity.manager.factory.jndi.name" ; private static final AttachmentKey < Map < String , PersistenceProviderAdaptor > > providerAdaptorMapKey = AttachmentKey . create ( Map . class ) ; private final PersistenceUnitRegistryImpl persistenceUnitRegistry ; public PersistenceUnitDeploymentProcessor ( final PersistenceUnitRegistryImpl persistenceUnitRegistry ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( DeploymentUnit context ) { } private void handleJarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void handleWarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ( PersistenceUnitDeploymentProcessor . isWarDeployment ( deploymentUnit ) ) && ( JPADeploymentMarker . isJPADeployment ( deploymentUnit ) ) ) { final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; PersistenceUnitMetadataHolder holder ; ArrayList < PersistenceUnitMetadataHolder > puList = new ArrayList < PersistenceUnitMetadataHolder > ( 1 ) ; if ( ( ( deploymentRoot != null ) && ( ( holder = deploymentRoot . getAttachment ( PERSISTENCE_UNITS ) ) != null ) ) && ( ( holder . getPersistenceUnits ( ) . size ( ) ) > 0 ) ) { puList . add ( holder ) ; } List < ResourceRoot > resourceRoots = deploymentUnit . getAttachment ( RESOURCE_ROOTS ) ; assert resourceRoots != null ; for ( ResourceRoot resourceRoot : resourceRoots ) { <START_BUG> if ( resourceRoot . getRoot ( ) . getLowerCaseName ( ) . endsWith ( ".jar" ) ) { <END_BUG> if ( ( ( holder = resourceRoot . getAttachment ( PERSISTENCE_UNITS ) ) != null ) && ( ( holder . getPersistenceUnits ( ) . size ( ) ) > 0 ) ) { puList . add ( holder ) ; } } } final WarMetaData warMetaData = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; if ( ( warMetaData != null ) && ( ( warMetaData . getMergedJBossWebMetaData ( ) ) != null ) ) { List < ValveMetaData > valves = warMetaData . getMergedJBossWebMetaData ( ) . getValves ( ) ; if ( valves == null ) { valves = new ArrayList < ValveMetaData > ( ) ; warMetaData . getMergedJBossWebMetaData ( ) . setValves ( valves ) ; } ValveMetaData valve = new ValveMetaData ( ) ; valve . setModule ( "org.jboss.as.jpa" ) ; valve . setValveClass ( "org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve" ) ; valves . add ( valve ) ; } JpaLogger . JPA_LOGGER . tracef ( "install<seq2seq4repair_space>persistence<seq2seq4repair_space>unit<seq2seq4repair_space>definitions<seq2seq4repair_space>for<seq2seq4repair_space>war<seq2seq4repair_space>%s" , deploymentRoot . getRootName ( ) ) ; addPuService ( phaseContext , puList ) ; } } private void handleEarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void addPuService ( DeploymentPhaseContext phaseContext , ArrayList < PersistenceUnitMetadataHolder > puList ) throws DeploymentUnitProcessingException { } private void setAnnotationIndexes ( final PersistenceUnitMetadataHolder puHolder , DeploymentUnit deploymentUnit ) { } private String adjustJndi ( String dataSourceName ) { } private PersistenceProviderAdaptor getPersistenceProviderAdaptor ( final PersistenceUnitMetadata pu , final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder , final DeploymentUnit deploymentUnit ) throws DeploymentUnitProcessingException { } private PersistenceProviderAdaptor savePerDeploymentSharedPersistenceProviderAdaptor ( DeploymentUnit deploymentUnit , String adaptorModule , PersistenceProviderAdaptor adaptor ) { } private PersistenceProviderAdaptor getPerDeploymentSharedPersistenceProviderAdaptor ( DeploymentUnit deploymentUnit , String adaptorModule ) { } private PersistenceProvider lookupProvider ( PersistenceUnitMetadata pu ) throws DeploymentUnitProcessingException { } private PersistenceProvider getProviderByName ( PersistenceUnitMetadata pu , String persistenceProviderModule ) { } private boolean isHibernate3 ( PersistenceProvider provider ) { } static boolean isEarDeployment ( final DeploymentUnit context ) { } static boolean isWarDeployment ( final DeploymentUnit context ) { } private static class ManagedReferenceFactoryInjector implements Injector < ManagedReferenceFactory > { private volatile ManagedReference reference ; private final Injector < DataSource > dataSourceInjector ; public ManagedReferenceFactoryInjector ( Injector < DataSource > dataSourceInjector ) { } @ Override public void inject ( final ManagedReferenceFactory value ) throws InjectionException { } @ Override public void uninject ( ) { } } private void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final ServiceName puServiceName ) { } private void addManagementConsole ( final DeploymentUnit deploymentUnit , final PersistenceUnitMetadata pu , final PersistenceUnitService persistenceUnitService , final PersistenceProviderAdaptor adaptor ) { } private static Resource getOrCreateResource ( final Resource parent , final PathElement element ) { } private static class PersistenceAdaptorRemoval { final PersistenceUnitMetadata pu ; final PersistenceProviderAdaptor adaptor ; public PersistenceAdaptorRemoval ( PersistenceUnitMetadata pu , PersistenceProviderAdaptor adaptor ) { } private void cleanup ( ) { } } private static AttachmentKey < AttachmentList < PersistenceUnitDeploymentProcessor . PersistenceAdaptorRemoval > > REMOVAL_KEY = AttachmentKey . createList ( PersistenceUnitDeploymentProcessor . PersistenceAdaptorRemoval . class ) ; }

Fix:
if ( resourceRoot . getRoot ( ) . getName ( ) . toLowerCase ( ) . endsWith ( ".jar" ) ) {