See BVAL-597: the type of a getter and the corresponding field may differ (e.g. Integer vs. Optional<Integer>. We should make sure to prefer the getter based metadata in this case.