Buggy code:
public class EarStructureProcessor implements DeploymentUnitProcessor { private static final String JAR_EXTENSION = ".jar" ; private static final String WAR_EXTENSION = ".war" ; private static final Set < String > CHILD_ARCHIVE_EXTENSIONS = new HashSet < String > ( ) ; private static final SuffixMatchFilter CHILD_ARCHIVE_FILTER = new SuffixMatchFilter ( EarStructureProcessor . CHILD_ARCHIVE_EXTENSIONS , new VisitorAttributes ( ) { public boolean isLeavesOnly ( ) { } } ) ; private static final String DEFAULT_LIB_DIR = "lib" ; private static Closeable NO_OP_CLOSEABLE = new Closeable ( ) { public void close ( ) throws IOException { } } ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( EarDeploymentMarker . isEarDeployment ( deploymentUnit ) ) ) { return ; } final ResourceRoot resourceRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile virtualFile = resourceRoot . getRoot ( ) ; resourceRoot . putAttachment ( INDEX_RESOURCE_ROOT , false ) ; ModuleRootMarker . markRoot ( resourceRoot , false ) ; deploymentUnit . putAttachment ( PROCESS_CHILD_ANNOTATION_INDEX , false ) ; deploymentUnit . putAttachment ( COMPUTE_COMPOSITE_ANNOTATION_INDEX , false ) ; String libDirName = EarStructureProcessor . DEFAULT_LIB_DIR ; final EarConfig earConfig = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; if ( earConfig != null ) { final EarMetaData earMetaData = earConfig . getEarMetaData ( ) ; if ( earMetaData instanceof Ear6xMetaData ) { final String xmlLibDirName = Ear6xMetaData . class . cast ( earMetaData ) . getLibraryDirectory ( ) ; if ( xmlLibDirName != null ) { libDirName = xmlLibDirName ; } } } try { final List < VirtualFile > childArchives = new ArrayList < VirtualFile > ( virtualFile . getChildren ( EarStructureProcessor . CHILD_ARCHIVE_FILTER ) ) ; if ( ! ( libDirName . isEmpty ( ) ) ) { final VirtualFile libDir = virtualFile . getChild ( libDirName ) ; if ( libDir . exists ( ) ) { childArchives . addAll ( libDir . getChildren ( EarStructureProcessor . CHILD_ARCHIVE_FILTER ) ) ; } } for ( final VirtualFile child : childArchives ) { final Closeable closable = ( child . isFile ( ) ) ? VFS . mountZip ( child , child , TempFileProviderService . provider ( ) ) : EarStructureProcessor . NO_OP_CLOSEABLE ; final MountHandle mountHandle = new MountHandle ( closable ) ; <START_BUG> final ResourceRoot childResource = new ResourceRoot ( child , mountHandle , false ) ; <END_BUG> if ( child . getName ( ) . toLowerCase ( ) . endsWith ( EarStructureProcessor . JAR_EXTENSION ) ) { ModuleRootMarker . markRoot ( childResource ) ; } else { childResource . putAttachment ( INDEX_RESOURCE_ROOT , false ) ; SubDeploymentMarker . markRoot ( childResource ) ; } deploymentUnit . addToAttachmentList ( RESOURCE_ROOTS , childResource ) ; } } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>children<seq2seq4repair_space>for<seq2seq4repair_space>EAR<seq2seq4repair_space>[" + virtualFile ) + "]" ) , e ) ; } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final ResourceRoot childResource = new ResourceRoot ( child , mountHandle ) ;