-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
None
-
None
CDI detects and rejects proxyable beans if they expose a public field. However protected and package private fields are silently accepted. In the following example the method returns 0 instead of the correct value of 8:
@ApplicationScoped public class Car { @Inject private Engine engine; public int numberOfEngineCylinders() { return engine.cylinders; } } @RequestScoped public class Engine { protected int cylinders; @PostConstruct public void init() { cylinders = 8; } }