Buggy code:
public class PersistenceUnitServiceHandler { 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 static final String SCOPED_UNIT_NAME = "scoped-unit-name" ; public static void deploy ( DeploymentPhaseContext phaseContext , boolean startEarly ) throws DeploymentUnitProcessingException { } public static void undeploy ( DeploymentUnit context ) { } private static void handleJarDeployment ( DeploymentPhaseContext phaseContext , boolean startEarly ) throws DeploymentUnitProcessingException { } private static void handleWarDeployment ( DeploymentPhaseContext phaseContext , boolean startEarly ) throws DeploymentUnitProcessingException { } private static void handleEarDeployment ( DeploymentPhaseContext phaseContext , boolean startEarly ) throws DeploymentUnitProcessingException { } private static void addPuService ( DeploymentPhaseContext phaseContext , ArrayList < PersistenceUnitMetadataHolder > puList , boolean startEarly ) throws DeploymentUnitProcessingException { } private static void deployPersistenceUnit ( DeploymentPhaseContext phaseContext , DeploymentUnit deploymentUnit , EEModuleDescription eeModuleDescription , Collection < ComponentDescription > components , ServiceTarget serviceTarget , ModuleClassLoader classLoader , PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder , PersistenceUnitMetadata pu , boolean startEarly ) throws DeploymentUnitProcessingException { } private static void setAnnotationIndexes ( final PersistenceUnitMetadataHolder puHolder , DeploymentUnit deploymentUnit ) { final Map < URL , Index > annotationIndexes = new HashMap < URL , Index > ( ) ; <START_BUG> boolean convertVFS = false ; <END_BUG> for ( PersistenceUnitMetadata pu : puHolder . getPersistenceUnits ( ) ) { String enableVFS = pu . getProperties ( ) . getProperty ( JPA_ENABLE_VFS_URLS ) ; if ( ( enableVFS != null ) && ( ( Boolean . parseBoolean ( enableVFS ) ) == false ) ) { convertVFS = true ; } } do { for ( ResourceRoot root : DeploymentUtils . allResourceRoots ( deploymentUnit ) ) { final Index index = root . getAttachment ( ANNOTATION_INDEX ) ; if ( index != null ) { try { JpaLogger . JPA_LOGGER . tracef ( "adding<seq2seq4repair_space>'%s'<seq2seq4repair_space>to<seq2seq4repair_space>annotation<seq2seq4repair_space>index<seq2seq4repair_space>map" , root . getRoot ( ) . toURL ( ) ) ; annotationIndexes . put ( root . getRoot ( ) . toURL ( ) , index ) ; if ( convertVFS ) { annotationIndexes . put ( root . getRoot ( ) . getPhysicalFile ( ) . toURI ( ) . toURL ( ) , index ) ; } } catch ( MalformedURLException e ) { throw new RuntimeException ( e ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } deploymentUnit = deploymentUnit . getParent ( ) ; } while ( deploymentUnit != null ) ; for ( PersistenceUnitMetadata pu : puHolder . getPersistenceUnits ( ) ) { pu . setAnnotationIndex ( annotationIndexes ) ; } } private static String adjustJndi ( String dataSourceName ) { } private static PersistenceProviderAdaptor getPersistenceProviderAdaptor ( final PersistenceUnitMetadata pu , final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder , final DeploymentUnit deploymentUnit ) throws DeploymentUnitProcessingException { } private static PersistenceProviderAdaptor savePerDeploymentSharedPersistenceProviderAdaptor ( DeploymentUnit deploymentUnit , String adaptorModule , PersistenceProviderAdaptor adaptor ) { } private static PersistenceProviderAdaptor getPerDeploymentSharedPersistenceProviderAdaptor ( DeploymentUnit deploymentUnit , String adaptorModule ) { } private static PersistenceProvider lookupProvider ( PersistenceUnitMetadata pu ) throws DeploymentUnitProcessingException { } private static PersistenceProvider getProviderByName ( PersistenceUnitMetadata pu , String persistenceProviderModule ) { } private static 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 static void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final ServiceName puServiceName ) { } private static void addManagementConsole ( final DeploymentUnit deploymentUnit , final PersistenceUnitMetadata pu , final PersistenceProviderAdaptor adaptor ) { } private static Resource getOrCreateResource ( final Resource parent , final PathElement element ) { } private static PersistenceProviderDeploymentHolder getPersistenceProviderDeploymentHolder ( DeploymentUnit deploymentUnit ) { } private static class PersistenceAdaptorRemoval { final PersistenceUnitMetadata pu ; final PersistenceProviderAdaptor adaptor ; public PersistenceAdaptorRemoval ( PersistenceUnitMetadata pu , PersistenceProviderAdaptor adaptor ) { } private void cleanup ( ) { } } private static AttachmentKey < AttachmentList < PersistenceUnitServiceHandler . PersistenceAdaptorRemoval > > REMOVAL_KEY = AttachmentKey . createList ( PersistenceUnitServiceHandler . PersistenceAdaptorRemoval . class ) ; }

Fix:
boolean convertVFS = false == ( JPAService . isDefaultVFS ( ) ) ;