[
https://jira.jboss.org/browse/JBIDE-6957?page=com.atlassian.jira.plugin.s...
]
Alexey Kazakov commented on JBIDE-6957:
---------------------------------------
Pete, are you sure that "the delegate type must be one of the decorated types, not
all of them"?
JSR-299 says that it must implement or extend every decorated type:
8.1.3. Decorated types of a decorator
The delegate type of a decorator must implement or extend every decorated type (with
exactly the same type parameters).
If the delegate type does not implement or extend a decorated type of the decorator (or
specifies different type parameters),
the container automatically detects the problem and treats it as a definition error.
But this is a bug anyway but because of 8.1:
8.1. Decorator beans
A decorator is a managed bean. The set of decorated types of a decorator includes all bean
types of the managed bean
which are Java interfaces, except for java.io.Serializable.
So in your example we should check that codeFragmentManager() returns the type which
implements or extends all the decorated types but Serializable is not a decorator type, so
we should check only CodeFragmentManager. Is this correct? Or I got it wrong?
Erroneous error about decorators and delegate types
---------------------------------------------------
Key: JBIDE-6957
URL:
https://jira.jboss.org/browse/JBIDE-6957
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: cdi (jsr-299)
Affects Versions: 3.2.0.M1
Reporter: Pete Muir
Assignee: Alexey Kazakov
Fix For: 3.2.0.Beta
Given a decorator like
@Decorator
public abstract class FloodingDecorator implements CodeFragmentManager, Serializable
{
private static final long serialVersionUID = -4615837206290420112L;
@Inject @Delegate
private CodeFragmentManager codeFragmentManager;
}
JBoss Tools errors, telling me "The delegate type must implement or extend the
decorated type Serializable [JSR-299 ยง8.1.3]"
However, it doesn't have to implement serializable - the delegate type must be one of
the decorated types, not all of them
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira