Re: [Java][Client] Important behaviour change on empty key from 2.7.x to 2.8.x

2021-05-19 Thread PengHui Li
> 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

Re: [Java][Client] Important behaviour change on empty key from 2.7.x to 2.8.x

2021-05-18 Thread Enrico Olivelli
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

Re: [Java][Client] Important behaviour change on empty key from 2.7.x to 2.8.x

2021-05-18 Thread Matteo Merli
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()`

[Java][Client] Important behaviour change on empty key from 2.7.x to 2.8.x

2021-05-18 Thread Enrico Olivelli
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