Source:
<code>public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!EjbDeploymentMarker.isEjbDeployment(deploymentUnit)) { return; } final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); <START> HashMap<String,HashSet<String>> ejbClassTypes = new HashMap(); <END> ejbClassTypes.put("isStateful",new HashSet<>()); ejbClassTypes.put("isStateless",new HashSet<>()); ejbClassTypes.put("isSingleton",new HashSet<>()); if (componentDescriptions != null) { for (ComponentDescription componentDescription : componentDescriptions) { if (componentDescription instanceof SessionBeanComponentDescription) { if(!checkBeanTypeSpecViolation(ejbClassTypes,(SessionBeanComponentDescription)componentDescription)) this.setupJNDIBindings((EJBComponentDescription) componentDescription, deploymentUnit); else EjbLogger.DEPLOYMENT_LOGGER.typeSpecViolation(((EJBComponentDescription)componentDescription).getEJBClassName()); } } } if (appclient) { for (final ComponentDescription component : deploymentUnit.getAttachmentList(Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) { this.setupJNDIBindings((EJBComponentDescription) component, deploymentUnit); } } }</code><technical_language>This is more efficiently stored as: java Map<Class<? extends Annotation>, Set<String>> ejbTypes = new IdentityHashMap<>(); ejbTypes.put(javax.ejb.Stateful.class, new HashSet<>()); ejbTypes.put(javax.ejb.Stateless.class, new HashSet<>()); ejbTypes.put(javax.ejb.Singleton.class, new HashSet<>());</technical_language>

Target:
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!EjbDeploymentMarker.isEjbDeployment(deploymentUnit)) { return; } final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); Map<String, SessionBeanComponentDescription> sessionBeanComponentDescriptions = new HashMap<>(); if (componentDescriptions != null) { for (ComponentDescription componentDescription : componentDescriptions) { if (componentDescription instanceof SessionBeanComponentDescription) { SessionBeanComponentDescription sessionBeanComponentDescription = (SessionBeanComponentDescription) componentDescription; String ejbClassName = sessionBeanComponentDescription.getEJBClassName(); SessionBeanComponentDescription existingDescription = sessionBeanComponentDescriptions.putIfAbsent(ejbClassName, sessionBeanComponentDescription); if ((existingDescription == null) || existingDescription.getSessionBeanType() == sessionBeanComponentDescription.getSessionBeanType()) { this.setupJNDIBindings(sessionBeanComponentDescription, deploymentUnit); } else { EjbLogger.DEPLOYMENT_LOGGER.typeSpecViolation(ejbClassName); } } } } if (appclient) { for (final ComponentDescription component : deploymentUnit.getAttachmentList(Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) { this.setupJNDIBindings((EJBComponentDescription) component, deploymentUnit); } } }