Index: third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc b/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc |
index fa1047e874a553ce20132905eb8251faffab6c6c..e42ec2801fcb269a5f3de1d7d336549cdf4af8eb 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc |
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc |
@@ -61,7 +61,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, |
int builderBitIndex, |
const FieldGeneratorInfo* info, |
ClassNameResolver* name_resolver, |
- std::map<string, string>* variables) { |
+ map<string, string>* variables) { |
SetCommonFieldVariables(descriptor, info, variables); |
(*variables)["type"] = PrimitiveTypeName(GetJavaType(descriptor)); |
@@ -75,8 +75,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, |
"" : ("= " + ImmutableDefaultValue(descriptor, name_resolver)); |
(*variables)["capitalized_type"] = |
GetCapitalizedType(descriptor, /* immutable = */ true); |
- (*variables)["tag"] = |
- SimpleItoa(static_cast<int32>(WireFormat::MakeTag(descriptor))); |
+ (*variables)["tag"] = SimpleItoa(WireFormat::MakeTag(descriptor)); |
(*variables)["tag_size"] = SimpleItoa( |
WireFormat::TagSize(descriptor->number(), GetType(descriptor))); |
if (IsReferenceType(GetJavaType(descriptor))) { |
@@ -778,8 +777,8 @@ GenerateSerializationCode(io::Printer* printer) const { |
// That makes it safe to rely on the memoized size here. |
printer->Print(variables_, |
"if (get$capitalized_name$List().size() > 0) {\n" |
- " output.writeUInt32NoTag($tag$);\n" |
- " output.writeUInt32NoTag($name$MemoizedSerializedSize);\n" |
+ " output.writeRawVarint32($tag$);\n" |
+ " output.writeRawVarint32($name$MemoizedSerializedSize);\n" |
"}\n" |
"for (int i = 0; i < $name$_.size(); i++) {\n" |
" output.write$capitalized_type$NoTag($name$_.get(i));\n" |