-
Clarification
-
Resolution: Obsolete
-
Major
-
None
-
1.2.Final
-
None
Initializer and observer methods may be private. In Java, private members are not inherited. However, the spec is not entirely clear in this area.
"4. Inheritance and specialization"
Member-level metadata is not inherited. However, injected fields, initializer methods, lifecycle callback methods and non-static observer methods are inherited by beans from their superclasses.
"4.2. Inheritance of member-level metadata" (simplified):
- If X declares an initializer or non-static observer method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x().
There is no mention we strictly follow the JSL here. At first glance, it seems the private members should not be inherited. However, these may be part of a bean initialization. And what happens if we specialize a bean with such private members?