From 37ac79028de3d1cd8c215ba54fdf31e4eeca4b2c Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Tue, 24 Sep 2013 20:52:54 -0700 Subject: Fix roundtrip failure with groups when unknown fields are enabled. When parsing a group, the group's end tag should not be stored within the message's unknownFieldData. Not only does this waste space, it is also output the next time the group is serialized, resulting in two end tags for that group. The resulting bytes are not always a valid protocol buffer and may fail to parse. This change ensures that group end tags do not result in an unknownFieldData entry, and that messages with groups can be roundtripped without corruption. Change-Id: I240f858a7217a7652b756598c34aacad5dcc3363 Conflicts: java/src/test/java/com/google/protobuf/NanoTest.java --- src/google/protobuf/unittest_extension_nano.proto | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/google/protobuf/unittest_extension_nano.proto b/src/google/protobuf/unittest_extension_nano.proto index f2906f0..104cfa7 100644 --- a/src/google/protobuf/unittest_extension_nano.proto +++ b/src/google/protobuf/unittest_extension_nano.proto @@ -42,3 +42,9 @@ message ContainerMessage { optional bool another_thing = 100; } } + +message MessageWithGroup { + optional group Group = 1 { + optional int32 a = 2; + } +} -- cgit v1.1