-
Bug
-
Resolution: Fixed
-
Normal
-
6.0.2
-
None
-
None
-
None
Example:
class A { @WireVariable private MyClass var; } class B extends A { @WireVariable private MyClass var; }
When using wiring variables for B, field var in superclass A will not be wired (will be null). This is documented in Reflections.forFields() method which is used in Selectors.Wirer.wireVariables(). But such a solution is counter-object-oriented - subclass B it breaks class's A contract by mere declaration of a field with the same name. That way, class A depends on its subclasses and not the other way around - class A works only if the subclass does not wire a field with the same name. Furthermore, it requires the programmer to know about class's A private member when implementing subclass B, thus breaking class's A encapsulation.
All fields annotated with @WireVariable should be wired in the whole class hierarchy.