> Users of `Message` API should always check `hasKey()` before trying to
do `getKey()`. (A better API would have been to return an
`Optional`).
> In any case, I'd rather not change the behavior of this right now, but
leave it in the same form as 2.7 and earlier versions.
Make sense
Thanks,
Pengh
Il Mar 18 Mag 2021, 18:15 Matteo Merli ha scritto:
> I believe this is a by-product of the protobuf changes. Google
> Protobuf returns an empty string if you're trying to access an
> optional field with no default value associated with it. This can lead
> to subtle bugs..
>
> Users of `Message` A
I believe this is a by-product of the protobuf changes. Google
Protobuf returns an empty string if you're trying to access an
optional field with no default value associated with it. This can lead
to subtle bugs..
Users of `Message` API should always check `hasKey()` before trying to
do `getKey()`