Martin Kouba commented on Bug WELD-1597

First, I don't think this hack (return "this" from a bean instance method) is quite correct. The CDI spec does not define what you obtain, i.e. it's implementation specific. It might seem obvious - you should obtain a contextual instance of a bean. However things are more complicated...

A contextual instance of any of the built-in kinds of bean defined in Chapter 3 is considered an internal container construct, and it is therefore not strictly required that a contextual instance of a built-in kind of bean directly implement the bean types of the bean.

In Weld an instance of an enhanced subclass is stored in the context for a bean which has interceptors or decorators associated. It may be different for other implementations. So at least your code will not be portable.

For normal scoped beans you should always work with client proxies (see 5.4 Client proxies for more info).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
weld-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/weld-issues

Reply via email to