Buggy code:
public class PersistenceUnitParseProcessor implements DeploymentUnitProcessor { private static final String WEB_PERSISTENCE_XML = "WEB-INF//classes//META-INF//persistence.xml" ; private static final String META_INF_PERSISTENCE_XML = "META-INF//persistence.xml" ; private static final String JAR_FILE_EXTENSION = ".jar" ; private static final String LIB_FOLDER = "lib" ; private final boolean appClientContainerMode ; public PersistenceUnitParseProcessor ( boolean appclient ) { } @ 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 { } private void handleEarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; <START_BUG> if ( ( ! ( appClientContainerMode ) ) && ( PersistenceUnitParseProcessor . isEarDeployment ( deploymentUnit ) ) ) { <END_BUG> int puCount = 0 ; List < PersistenceUnitMetadataHolder > listPUHolders = new ArrayList < PersistenceUnitMetadataHolder > ( 1 ) ; final ResourceRoot deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; VirtualFile persistence_xml = deploymentRoot . getRoot ( ) . getChild ( PersistenceUnitParseProcessor . META_INF_PERSISTENCE_XML ) ; parse ( persistence_xml , listPUHolders , deploymentUnit ) ; PersistenceUnitMetadataHolder holder = normalize ( listPUHolders ) ; deploymentRoot . putAttachment ( PERSISTENCE_UNITS , holder ) ; addApplicationDependenciesOnProvider ( deploymentUnit , holder ) ; markDU ( holder , deploymentUnit ) ; puCount = holder . getPersistenceUnits ( ) . size ( ) ; List < ResourceRoot > resourceRoots = deploymentUnit . getAttachmentList ( RESOURCE_ROOTS ) ; for ( ResourceRoot resourceRoot : resourceRoots ) { if ( ( ( ! ( SubDeploymentMarker . isSubDeployment ( resourceRoot ) ) ) && ( resourceRoot . getRoot ( ) . getName ( ) . toLowerCase ( Locale . ENGLISH ) . endsWith ( PersistenceUnitParseProcessor . JAR_FILE_EXTENSION ) ) ) && ( resourceRoot . getRoot ( ) . getParent ( ) . getName ( ) . equals ( PersistenceUnitParseProcessor . LIB_FOLDER ) ) ) { listPUHolders = new ArrayList < PersistenceUnitMetadataHolder > ( 1 ) ; persistence_xml = resourceRoot . getRoot ( ) . getChild ( PersistenceUnitParseProcessor . META_INF_PERSISTENCE_XML ) ; parse ( persistence_xml , listPUHolders , deploymentUnit ) ; holder = normalize ( listPUHolders ) ; resourceRoot . putAttachment ( PERSISTENCE_UNITS , holder ) ; addApplicationDependenciesOnProvider ( deploymentUnit , holder ) ; markDU ( holder , deploymentUnit ) ; puCount += holder . getPersistenceUnits ( ) . size ( ) ; } } JPA_LOGGER . tracef ( "parsed<seq2seq4repair_space>persistence<seq2seq4repair_space>unit<seq2seq4repair_space>definitions<seq2seq4repair_space>for<seq2seq4repair_space>ear<seq2seq4repair_space>%s" , deploymentRoot . getRootName ( ) ) ; incrementPersistenceUnitCount ( deploymentUnit , puCount ) ; } } private void parse ( final VirtualFile persistence_xml , final List < PersistenceUnitMetadataHolder > listPUHolders , final DeploymentUnit deploymentUnit ) throws DeploymentUnitProcessingException { } private void postParseSteps ( final VirtualFile persistence_xml , final PersistenceUnitMetadataHolder puHolder , final DeploymentUnit deploymentUnit ) { } private static URL getRelativeURL ( VirtualFile persistence_xml , String jar ) { } private URL getPersistenceUnitURL ( VirtualFile persistence_xml ) { } private PersistenceUnitMetadataHolder normalize ( List < PersistenceUnitMetadataHolder > listPUHolders ) { } static boolean isEarDeployment ( final DeploymentUnit context ) { } static boolean isWarDeployment ( final DeploymentUnit context ) { } private static String getScopedDeploymentUnitPath ( DeploymentUnit deploymentUnit ) { } public static String createBeanName ( DeploymentUnit deploymentUnit , String persistenceUnitName ) { } private void markDU ( PersistenceUnitMetadataHolder holder , DeploymentUnit deploymentUnit ) { } private void incrementPersistenceUnitCount ( DeploymentUnit topDeploymentUnit , int persistenceUnitCount ) { } private void addApplicationDependenciesOnProvider ( DeploymentUnit topDeploymentUnit , PersistenceUnitMetadataHolder holder ) { } private PersistenceUnitsInApplication getPersistenceUnitsInApplication ( DeploymentUnit topDeploymentUnit ) { } }

Fix:
if ( PersistenceUnitParseProcessor . isEarDeployment ( deploymentUnit ) ) {