Labels: Type-Defect Priority-Medium
New issue 249 by osfan6313: Default values are not assumed to be filled in.
What steps will reproduce the problem?
1. Create a protocol buffer file with a required field that has a default
2. Compile this protocol buffer, and attempt to make a new protocol buffer
via the builder, i.e. newBuilder().build()
3. A runtime exception will be thrown(Java), not sure what happens in other
What is the expected output? What do you see instead?
Even if no required fields are explicitly set when creating the protocol
buffer, since the fields have default values you should not have to set the
values of the fields. Instead, an exception is thrown because the fields,
while they have a default value, have not explicitly been set in user-level
What version of the product are you using? On what operating system?
Please provide any additional information below.
required string text = 1 [default = "hello"];
Information protocol = Information.newBuilder().setText("google").build();
Information protocol = Information.newBuilder().build(); //required fields
are not set, an exception is raised.
You received this message because you are subscribed to the Google Groups "Protocol
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at