timefold-solver
timefold-solver copied to clipboard
In Quarkus, setters are not used if they are present
When using DSV in Quarkus, the updater returns a value and that value is directly stored into the field. It does not go through the setter, even though the setter exists. This is a bug, because the setter may have some additional logic which the updater will effectively ignore.
(This can be reproduced by putting a breakpoint in the updater, and then a breakpoint in the setter. The updater breakpoint will trigger, the setter breakpoint will not.)
In the past few months we've seen several problems with member accessors in Quarkus, so let's agree on and implement safe behavior, which will also fix this bug:
- If a getter exists, a setter must exist.
- If a setter exists, a getter must exist.
- If a getter/setter pair exists, any access to the field must go through the pair. (Not just in DSV.)
- Any access goes through member accessors in core; no special handling, ever.