Description
Function private BeanManager lookupBeanManagerFromJndi() in FacesInitializerImpl (specifically line 594 of the current version looks incorrect to me.
The logic in the function is:
- Try to retrieve beanManager as java:comp/BeanManager in InitialContext
- If this succeeds (i.e. beanManager is non-null), try to retrieve beanManager as java:comp/env/BeanManager in InitialContext
The second step should be done if the first attempt to retrieve beanManager fails, not if it succeeds. (If my interpretation is wrong, I think an explanatory comment is warranted here!)