Source:
<code>public final void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX); PropertyReplacer propertyReplacer = EJBAnnotationPropertyReplacement.propertyReplacer(deploymentUnit); if (index == null || eeModuleDescription == null) { return; } final List<ClassAnnotationInformationFactory> factories = annotationInformationFactories(); for (final ClassAnnotationInformationFactory factory : factories) { final Map<String, ClassAnnotationInformation<?, ?>> data = factory.createAnnotationInformation(index, propertyReplacer); for (Map.Entry<String, ClassAnnotationInformation<?, ?>> entry : data.entrySet()) { <START> EEModuleClassDescription clazz = eeModuleDescription.addOrGetLocalClassDescription(entry.getKey()); <END> clazz.addAnnotationInformation(entry.getValue()); if(entry.getValue()!=null && entry.getValue().getAnnotationType()!=null && entry.getValue().getAnnotationType().toString().contains("Startup") && deploymentUnit.getParent()!=null) { List<String> startupBeanModules = deploymentUnit.getParent().getAttachmentList(org.jboss.as.ee.component.Attachments.DEPLOYMENT_STARTUP_MODULES); if(startupBeanModules!=null && !startupBeanModules.contains(deploymentUnit.getName())) deploymentUnit.getParent().addToAttachmentList(Attachments.DEPLOYMENT_STARTUP_MODULES, deploymentUnit.getName()); } } } afterAnnotationsProcessed(phaseContext, deploymentUnit); }</code><technical_language>entry.getValue() is multiple times suggest introduce a variable shorten statements. for deploymentUnit.getParent()</technical_language>

Target:
public final void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX); PropertyReplacer propertyReplacer = EJBAnnotationPropertyReplacement.propertyReplacer(deploymentUnit); if (index == null || eeModuleDescription == null) { return; } final List<ClassAnnotationInformationFactory> factories = annotationInformationFactories(); for (final ClassAnnotationInformationFactory factory : factories) { final Map<String, ClassAnnotationInformation<?, ?>> data = factory.createAnnotationInformation(index, propertyReplacer); for (Map.Entry<String, ClassAnnotationInformation<?, ?>> entry : data.entrySet()) { EEModuleClassDescription clazz = eeModuleDescription.addOrGetLocalClassDescription(entry.getKey()); ClassAnnotationInformation annotationInfo = entry.getValue(); clazz.addAnnotationInformation(annotationInfo); DeploymentUnit parent = deploymentUnit.getParent(); if(parent!=null && annotationInfo!=null && annotationInfo.getAnnotationType()!=null && annotationInfo.getAnnotationType().toString().contains("javax.ejb.Startup")) { List<String> startupBeanModules = parent.getAttachmentList(org.jboss.as.ee.component.Attachments.DEPLOYMENT_STARTUP_MODULES); if(!startupBeanModules.contains(deploymentUnit.getName())) parent.addToAttachmentList(Attachments.DEPLOYMENT_STARTUP_MODULES, deploymentUnit.getName()); } } } afterAnnotationsProcessed(phaseContext, deploymentUnit); }