You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ValueResolver and ValueExpressionResolver nullability is inconsistent #6280
I agree. Since ValueResolver has a pair: ValueExpressionResolver I think we should keep the two in-sync but since they are different now, we should change one of them:
Mark ValueResolver#resolve@Nullable, like ValueExpressionResolver#resolve is also @Nullable. We already do a null-check here:
Keep ValueResolver#resolve@NonNull but maybe we should also mark ValueExpressionResolver#resolve@NonNull (right now it's @Nullable).
If we decide to keep them out of sync as they are now returning "" instead of null should not cause an issue in Micrometer's codebase since we are already mapping null to "" (see above) and NoOpValueResolver is more like a "marker", it should not be called but we need to verify this across the codebase.
Since both ValueResolver and ValueExpressionResolver are defined as providing a KeyValue's value, and that cannot be null, I think we should do 2, which is, in some sense a breaking change on the specified nullability, but I think it's correcting a bug in the nullability.
Another inconsistency is the nullability of parameter - @Nullable in VER but not nullable in VR.
Activity
shakuzen commentedon May 22, 2025
Since both
ValueResolverandValueExpressionResolverare defined as providing a KeyValue's value, and that cannot be null, I think we should do 2, which is, in some sense a breaking change on the specified nullability, but I think it's correcting a bug in the nullability.Another inconsistency is the nullability of
parameter-@Nullablein VER but not nullable in VR.Make nullability of ValueResolver and ValueExpressionResolver consistent
Make nullability of ValueResolver and ValueExpressionResolver consist…