Skip to content
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

XmlFormat.merge fails if spaces in String values #9

Closed
GoogleCodeExporter opened this issue Feb 25, 2016 · 1 comment
Closed

XmlFormat.merge fails if spaces in String values #9

GoogleCodeExporter opened this issue Feb 25, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

This issue was closed by revision r27.

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant