rmannibucau commented on code in PR #89:
URL: https://github.com/apache/openwebbeans/pull/89#discussion_r1668116509


##########
webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java:
##########
@@ -88,6 +92,8 @@ protected AbstractOwbBean(WebBeansContext webBeansContext,
         this.webBeansType = webBeansType;
         this.beanClass = beanClass;
         this.webBeansContext = webBeansContext;
+
+        returnType = (Class<T>) 
WebBeansUtil.resolveReturnType(beanAttributes.getTypes());

Review Comment:
   Not sure thre is much ambiguity (for ex 5.1.4 speaks of `Bean` whatever the 
source is).
   So in CDI you have Beans, some specificities in the spec about producers 
(very old weld limitations) and be it.
   Synthetic beans are just `Bean` at the end and behave the same.
   You would note that the extension has a specific API (getSource) so 
`beanClass` is literally intended to behave as a managed bean.
   
   > Is there a requirement for OWB to use beanClass to determine which type to 
proxy.
   
   Requirement as "in the spec" no, as "in the impl" yes since types can not 
overlap enough and you can pick the wrong one if you don't use bean class.
   
   > Looking for the most specific 
[type](https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0#bean_types)
 in getTypes should also be sufficient I think
   
   Is there any requirement? :angel: 
   But this has some issues since you can not use a large enough type so will 
lead to broken cases as soon as types != union(typesOf(beanClass)) for a 
"standard"/simple bean case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@openwebbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to