[weld-commits] Weld SVN: r5518 - in core/trunk/impl/src/main: resources/org/jboss/weld/messages and 1 other directory.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Tue Jan 19 12:28:12 EST 2010
Author: pete.muir at jboss.org
Date: 2010-01-19 12:28:12 -0500 (Tue, 19 Jan 2010)
New Revision: 5518
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties
Log:
Add validation of messages and add missing messages
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-01-19 17:26:05 UTC (rev 5517)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-01-19 17:28:12 UTC (rev 5518)
@@ -567,7 +567,7 @@
* @param enabledDeploymentTypes The enabled deployment types
* @return The filtered beans
*/
- public static <T extends Bean<?>> Set<T> retainEnabledAlternatives(Set<T> beans, Collection<Class<?>> enabledAlternativeClasses, Collection<Class<? extends Annotation>> enabledAlternativeSterotypes)
+ public static <T extends Bean<?>> Set<T> removeDisabledAndSpecializedBeans(Set<T> beans, Collection<Class<?>> enabledAlternativeClasses, Collection<Class<? extends Annotation>> enabledAlternativeSterotypes, Map<Contextual<?>, Contextual<?>> specializedBeans)
{
if (beans.size() == 0)
{
@@ -575,15 +575,15 @@
}
else
{
- Set<T> enabledBeans = new HashSet<T>();
+ Set<T> result = new HashSet<T>();
for (T bean : beans)
{
- if (isBeanEnabled(bean, enabledAlternativeClasses, enabledAlternativeSterotypes))
+ if (isBeanEnabled(bean, enabledAlternativeClasses, enabledAlternativeSterotypes) && !isSpecialized(bean, beans, specializedBeans))
{
- enabledBeans.add(bean);
+ result.add(bean);
}
}
- return enabledBeans;
+ return result;
}
}
@@ -651,7 +651,7 @@
* @param specializedBeans
* @return
*/
- public static boolean isSpecialized(Bean<?> bean, Set<Bean<?>> beans, Map<Contextual<?>, Contextual<?>> specializedBeans)
+ public static <T extends Bean<?>> boolean isSpecialized(T bean, Set<T> beans, Map<Contextual<?>, Contextual<?>> specializedBeans)
{
if (specializedBeans.containsKey(bean))
{
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties 2010-01-19 17:26:05 UTC (rev 5517)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties 2010-01-19 17:28:12 UTC (rev 5518)
@@ -12,6 +12,8 @@
INJECTION_POINT_HAS_NULLABLE_DEPENDENCIES=Injection point {0} has nullable dependencies
NON_SERIALIZABLE_BEAN_INJECTED_INTO_PASSIVATING_BEAN=The bean {0} declares passivating scope but the producer returned a non-serializable bean for injection: {1}
INJECTION_POINT_HAS_NON_SERIALIZABLE_DEPENDENCY=The bean {0} declares passivating scope but has non-serializable dependency {1}
+AMBIGUOUS_EL_NAME=Bean name is ambiguous. Name {0} resolves to beans {1}
+BEAN_NAME_IS_PREFIX=Bean name is identical to a bean name prefix used elsewhere. Name {0}
INTERCEPTOR_SPECIFIED_TWICE=Enabled interceptor class {0} specified twice
INTERCEPTOR_NOT_ANNOTATED_OR_REGISTERED=Enabled interceptor class {0} is neither annotated @Interceptor nor registered through a portable extension
DECORATOR_SPECIFIED_TWICE=Enabled decorator class {0} specified twice
@@ -23,3 +25,4 @@
DISPOSAL_METHODS_WITHOUT_PRODUCER=The following disposal methods were declared but did not resolve to a producer method: {0}
INJECTION_POINT_HAS_WILDCARD=An injection point of type {0} cannot have a wildcard type parameter: {0}
INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER=An injection point of type {0} must have a type parameter: {1}
+
More information about the weld-commits
mailing list