-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in 3.12: toString() returns incorrect ascii when there are duplicate keys in a map #7505
Comments
What is the output of the |
I was able to reproduce, I see the output:
|
I think the subtraction here is overflowing: If I change this to use Thanks for the report. I'll make sure this is fixed before 3.12.0 is released. |
The fix is released in 3.12.0. |
* Added background information about proto3 presence. (#7501) * Fixed bug in map key sorting for Java TextFormat. (#7508) Fixes: protocolbuffers/protobuf#7505 * Update protobuf version * Added a changelog entry about the Java fix. (#7516)
Prior to protobuf 3.12, when parsing a map using TextFormat:
In 3.12.0-rc-1 and 3.12.0-rc-2:
toString
results in a different message.In other words,
m.toString()
is producing a text representation that when parsed does not give the originalm
back.What version of protobuf and what language are you using?
Version: 3.12.0-rc-2
Language: Java
What operating system (Linux, Windows, ...) and version?
Ubuntu 19.10
What did you do?
np.proto:
Main.java:
What did you expect to see
Either a failure to parse, or:
What did you see instead?
The text was updated successfully, but these errors were encountered: