While verifying the behavior of decorated dependent scoped beans on OpenWebBeans, Gurkan mentioned that he observed the same behavior on WELD. While verifying myself I noticed two behaviors that seem to conflict with the spec.<br>
<br>1) Non-normal scoped beans don't have any restrictions on public fields. A quick test showed that changes made to public fields directly are not reflected when a call to a getter method that returns that value of the public field is made. Presumably this is because there is an proxy like object in the middle.<br>
<br>For example<br><br>@Inject MyBean myBean;<br><br>myBean.number = 7;<br>myBean.getNumber(); //would return the default value for number and not 7 which it was just set to.<br><br>2) Non-normal scoped beans don't require a public no-args constructor. If the dependent scoped bean instead had a constructor annotated with @Inject (as per 3.1.1), an InstantiationException was thrown.<br>
<br>Are these expected restrictions once that dependent scoped bean is Decorated?<br><br>Sincerely,<br><br>Joe<br>