Source:
<code>private void validateEnabledAlternativeClasses(BeanManagerImpl beanManager, BeanDeployment deployment) { BeansXml beansXml = deployment.getBeanDeploymentArchive().getBeansXml(); if (beansXml != null && !beansXml.getEnabledAlternativeClasses().isEmpty()) { Map<String, Class<?>> loadedClasses = buildClassNameMap(beanManager.getEnabled().getAlternativeClasses()); Multimap<Class<?>, Bean<?>> beansByClass = SetMultimap.newSetMultimap(); for (Bean<?> bean : beanManager.getDynamicAccessibleBeans()) { if (!(bean instanceof NewBean)) { beansByClass.put(bean.getBeanClass(), bean); } } for (Metadata<String> definition : beansXml.getEnabledAlternativeClasses()) { Class<?> enabledClass = loadedClasses.get(definition.getValue()); if (enabledClass.isAnnotation() || enabledClass.isInterface()) { throw ValidatorLogger.LOG.alternativeBeanClassNotClass(definition); } else { final WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class); boolean allowExcludedAlternatives = configuration.getBooleanProperty(ConfigurationKey.ALLOW_EXCLUDED_ALTERNATIVES); if (! allowExcludedAlternatives) { boolean alternativeBeanFound = false; for (Bean<?> bean : beansByClass.get(enabledClass)) { if (bean.isAlternative()) { alternativeBeanFound = true; } <START> } <END> if (!alternativeBeanFound) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotatedOrVetoed(definition.getValue(), definition.getLocation()); } } else if (allowExcludedAlternatives && !isAlternativeBean(enabledClass, beansByClass) && !isAlternativeCandidate(enabledClass, beanManager)) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotated(definition.getValue(), definition.getLocation()); } } } } }</code><technical_language>For this for cycle newly created method isAlternativeBean right</technical_language>

Target:
private void validateEnabledAlternativeClasses(BeanManagerImpl beanManager, BeanDeployment deployment) { BeansXml beansXml = deployment.getBeanDeploymentArchive().getBeansXml(); if (beansXml != null && !beansXml.getEnabledAlternativeClasses().isEmpty()) { Map<String, Class<?>> loadedClasses = buildClassNameMap(beanManager.getEnabled().getAlternativeClasses()); Multimap<Class<?>, Bean<?>> beansByClass = SetMultimap.newSetMultimap(); for (Bean<?> bean : beanManager.getDynamicAccessibleBeans()) { if (!(bean instanceof NewBean)) { beansByClass.put(bean.getBeanClass(), bean); } } for (Metadata<String> definition : beansXml.getEnabledAlternativeClasses()) { Class<?> enabledClass = loadedClasses.get(definition.getValue()); if (enabledClass.isAnnotation() || enabledClass.isInterface()) { throw ValidatorLogger.LOG.alternativeBeanClassNotClass(definition); } else { final WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class); boolean allowExcludedAlternatives = configuration.getBooleanProperty(ConfigurationKey.ALLOW_VETOED_ALTERNATIVES); if (!isAlternativeBean(enabledClass, beansByClass)) { if (! allowExcludedAlternatives) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotatedOrVetoed(definition.getValue(), definition.getLocation()); } else if (! isAlternativeCandidate(enabledClass, beanManager)) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotated(definition.getValue(), definition.getLocation()); } } } } } }