> 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()`
Hello,
I have found this behaviour in the Java Client while switching from 2.7 to 2.8.
Short version of the story:
- on 2.7.2 a null key is received as an empty key
- on 2.8.0 a null key is received as a null key
The behaviour of 2.8 is better, because it is what you expect.
But if you migrate a