vsemenov / protobuf-java-format

Automatically exported from code.google.com/p/protobuf-java-format
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

XmlFormat.merge(...) should merge and not clobber... #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a builder and set a field on an inner message to a non-default 
value
2. Create the appropriate XML that you would use to populate the builder 
above with.  Leave the field changed above in it's default state - which 
means that the field does not appear in the XML.
3. Invoke merge(xml, builder) with the two and notice that a merge does not 
occur because the inner message overwrites the one on the builder.  
Consequently, the value in the builder that you wished to "merge" with the 
XML is gone.

What is the expected output? What do you see instead?  I expect that the 
values from the XML are merged into the builder - with xml values 
overwriting those that are set in the builder.  This behavior is consistent 
with the mergefrom methods in PB.  Instead, the XML is serialized into a PB 
, destroying any prior PB state that you wanted merged in.

Admittedly, this may not be the intended functionality - but it would have 
been nice to have named the method appropriately if it is not.

What version of the product are you using? On what operating system?
1.1, JDK 1.6, Windows

Please provide any additional information below.

Original issue reported on code.google.com by amoffet@gmail.com on 10 Mar 2010 at 5:35

GoogleCodeExporter commented 8 years ago

Original comment by eliran.bivas on 3 May 2011 at 1:36