Skip to content

Commit

Permalink
WELD-1024
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Dec 12, 2011
1 parent 0cae120 commit e6a7355
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
Expand Up @@ -62,6 +62,7 @@
import static org.jboss.weld.logging.messages.BeanMessage.USING_DEFAULT_QUALIFIER;
import static org.jboss.weld.logging.messages.BeanMessage.USING_NAME;
import static org.jboss.weld.logging.messages.BeanMessage.USING_SCOPE_FROM_STEREOTYPE;
import static org.jboss.weld.logging.messages.BeanMessage.SPECIALIZING_BEAN_MISSING_SPECIALIZED_TYPE;

/**
* An abstract bean representation common for all beans
Expand Down Expand Up @@ -284,6 +285,11 @@ protected void postSpecialize() {
if (getWeldAnnotated().isAnnotationPresent(Named.class) && getSpecializedBean().getWeldAnnotated().isAnnotationPresent(Named.class)) {
throw new DefinitionException(NAME_NOT_ALLOWED_ON_SPECIALIZATION, getWeldAnnotated());
}
for (Type type : getSpecializedBean().getTypes()) {
if (!getTypes().contains(type)) {
throw new DefinitionException(SPECIALIZING_BEAN_MISSING_SPECIALIZED_TYPE, this, type, getSpecializedBean());
}
}
this.qualifiers.addAll(getSpecializedBean().getQualifiers());
if (isSpecializing() && getSpecializedBean().getWeldAnnotated().isAnnotationPresent(Named.class)) {
this.name = getSpecializedBean().getName();
Expand Down
Expand Up @@ -143,6 +143,7 @@ public enum BeanMessage {
@MessageId("001507")LOOKED_UP_CLIENT_PROXY,
@MessageId("001508")INJECTION_TARGET_CANNOT_BE_CREATED_FOR_INTERFACE,
@MessageId("001509")BEAN_NOT_PASIVATION_CAPABLE_IN_SERIALIZATION,
@MessageId("001510")PROXY_HANDLER_SERIALIZED_FOR_NON_SERIALIZABLE_BEAN;
@MessageId("001510")PROXY_HANDLER_SERIALIZED_FOR_NON_SERIALIZABLE_BEAN,
@MessageId("001511")SPECIALIZING_BEAN_MISSING_SPECIALIZED_TYPE;

}
Expand Up @@ -106,4 +106,5 @@ FINAL_INTERCEPTED_BEAN_METHOD_NOT_ALLOWED=Intercepted bean method {0} (intercept
FAILED_TO_SET_THREAD_LOCAL_ON_PROXY=Failed to set ThreadLocal for serialization on proxy using reflection {0}
CREATED_NEW_CLIENT_PROXY_TYPE=Created new client proxy of type {0} for bean {1} with ID {2}
LOOKED_UP_CLIENT_PROXY=Located client proxy of type {0} for bean {1}
INJECTION_TARGET_CANNOT_BE_CREATED_FOR_INTERFACE=Cannot create an InjectionTarget from {0} as it is an interface
INJECTION_TARGET_CANNOT_BE_CREATED_FOR_INTERFACE=Cannot create an InjectionTarget from {0} as it is an interface
SPECIALIZING_BEAN_MISSING_SPECIALIZED_TYPE=Specializing bean {0} does not have bean type {1} of specialized bean {2}

0 comments on commit e6a7355

Please sign in to comment.