lcytzk / 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 fails if spaces in String values #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. test.proto

message TestItem{
     required string  name  = 1;
}
2. Java code

Testproto.TestItem.Builder itemBuilder =  Testproto.TestItem.newBuilder();
itemBuilder.setName("name with spaces");
String itemTxt = XmlFormat.printToString(itemBuilder.build());
itemBuilder = Testproto.TestItem.newBuilder();
XmlFormat.merge(itemTxt,  itemBuilder);
System.out.println("success");

What is the expected output? 
success

What do you see instead?
com.google.protobuf.XmlFormat$ParseException: 1:27: Expected ">".

What version of the product are you using? On what operating system?
protobuf 2.2.0
protobuf-java-format 1.1
OS: win32

Please provide any additional information below.
Tokenizer works not correctly.
Way of fix in attached patch.

Original issue reported on code.google.com by Vitaly.R...@gmail.com on 18 Dec 2009 at 8:55

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r27.

Original comment by aant...@gmail.com on 23 Feb 2010 at 6:31