Merge pull request #6199 from haon4/201905301330

Down integrate to GitHub
pull/6201/head
Hao Nguyen 6 years ago committed by GitHub
commit da5d02bced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Makefile.am
  2. 11
      conformance/conformance_objc.m
  3. 6
      java/pom.xml
  4. 5
      java/util/pom.xml
  5. 65
      java/util/src/main/java/com/google/protobuf/util/Structs.java
  6. 85
      java/util/src/main/java/com/google/protobuf/util/Values.java
  7. 59
      java/util/src/test/java/com/google/protobuf/util/StructsTest.java
  8. 102
      java/util/src/test/java/com/google/protobuf/util/ValuesTest.java
  9. 2
      python/google/protobuf/descriptor_pool.py
  10. 2
      python/google/protobuf/internal/message_test.py
  11. 53
      python/google/protobuf/pyext/map_container.cc
  12. 6
      src/google/protobuf/any.pb.cc
  13. 2
      src/google/protobuf/any.pb.h
  14. 26
      src/google/protobuf/api.pb.cc
  15. 6
      src/google/protobuf/api.pb.h
  16. 2
      src/google/protobuf/compiler/cpp/cpp_field.cc
  17. 13
      src/google/protobuf/compiler/cpp/cpp_helpers.cc
  18. 4
      src/google/protobuf/compiler/cpp/cpp_message.cc
  19. 20
      src/google/protobuf/compiler/cpp/cpp_message_field.cc
  20. 2
      src/google/protobuf/compiler/cpp/cpp_string_field.cc
  21. 16
      src/google/protobuf/compiler/parser.cc
  22. 43
      src/google/protobuf/compiler/parser_unittest.cc
  23. 34
      src/google/protobuf/compiler/plugin.pb.cc
  24. 8
      src/google/protobuf/compiler/plugin.pb.h
  25. 314
      src/google/protobuf/descriptor.pb.cc
  26. 54
      src/google/protobuf/descriptor.pb.h
  27. 1
      src/google/protobuf/descriptor.proto
  28. 2
      src/google/protobuf/duration.pb.cc
  29. 2
      src/google/protobuf/duration.pb.h
  30. 2
      src/google/protobuf/empty.pb.cc
  31. 2
      src/google/protobuf/empty.pb.h
  32. 2
      src/google/protobuf/field_mask.pb.cc
  33. 2
      src/google/protobuf/field_mask.pb.h
  34. 2
      src/google/protobuf/map_test.cc
  35. 4
      src/google/protobuf/source_context.pb.cc
  36. 2
      src/google/protobuf/source_context.pb.h
  37. 18
      src/google/protobuf/struct.pb.cc
  38. 6
      src/google/protobuf/struct.pb.h
  39. 16
      src/google/protobuf/text_format.cc
  40. 5
      src/google/protobuf/text_format.h
  41. 2
      src/google/protobuf/timestamp.pb.cc
  42. 2
      src/google/protobuf/timestamp.pb.h
  43. 44
      src/google/protobuf/type.pb.cc
  44. 10
      src/google/protobuf/type.pb.h
  45. 52
      src/google/protobuf/util/internal/json_objectwriter_test.cc
  46. 22
      src/google/protobuf/wrappers.pb.cc
  47. 18
      src/google/protobuf/wrappers.pb.h

@ -493,11 +493,15 @@ java_EXTRA_DIST=
java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \ java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \
java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \ java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \
java/util/src/main/java/com/google/protobuf/util/TimeUtil.java \ java/util/src/main/java/com/google/protobuf/util/TimeUtil.java \
java/util/src/main/java/com/google/protobuf/util/Structs.java \
java/util/src/main/java/com/google/protobuf/util/Timestamps.java \ java/util/src/main/java/com/google/protobuf/util/Timestamps.java \
java/util/src/main/java/com/google/protobuf/util/Values.java \
java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \
java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \
java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \
java/util/src/test/java/com/google/protobuf/util/StructsTest.java \
java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \
java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \
java/util/src/test/proto/com/google/protobuf/util/json_test.proto java/util/src/test/proto/com/google/protobuf/util/json_test.proto
objectivec_EXTRA_DIST= \ objectivec_EXTRA_DIST= \

@ -68,8 +68,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
switch (request.payloadOneOfCase) { switch (request.payloadOneOfCase) {
case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase:
response.runtimeError = Die(@"Request didn't have a payload: %@", request);
[NSString stringWithFormat:@"Request didn't have a payload: %@", request];
break; break;
case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: {
@ -79,10 +78,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
} else if ([request.messageType isEqual:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) { } else if ([request.messageType isEqual:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) {
msgClass = [TestAllTypesProto2 class]; msgClass = [TestAllTypesProto2 class];
} else { } else {
response.runtimeError = Die(@"Protobuf request had an unknown message_type: %@", request.messageType);
[NSString stringWithFormat:
@"Protobuf request had an unknown message_type: %@", request.messageType];
break;
} }
NSError *error = nil; NSError *error = nil;
testMessage = [msgClass parseFromData:request.protobufPayload error:&error]; testMessage = [msgClass parseFromData:request.protobufPayload error:&error];
@ -112,8 +108,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
switch (request.requestedOutputFormat) { switch (request.requestedOutputFormat) {
case WireFormat_GPBUnrecognizedEnumeratorValue: case WireFormat_GPBUnrecognizedEnumeratorValue:
case WireFormat_Unspecified: case WireFormat_Unspecified:
response.runtimeError = Die(@"Unrecognized/unspecified output format: %@", request);
[NSString stringWithFormat:@"Unrecognized/unspecified output format: %@", request];
break; break;
case WireFormat_Protobuf: case WireFormat_Protobuf:

@ -101,6 +101,12 @@
<version>26.0-jre</version> <version>26.0-jre</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>0.45</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

@ -49,6 +49,11 @@
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId> <artifactId>easymockclassextension</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<properties> <properties>

@ -0,0 +1,65 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.protobuf.util;
import com.google.protobuf.Struct;
import com.google.protobuf.Value;
/** Utilities to help create {@code google.protobuf.Struct} messages. */
public final class Structs {
/**
* Returns a struct containing the key-value pair.
*/
public static Struct of(String k1, Value v1) {
return Struct.newBuilder().putFields(k1, v1).build();
}
/**
* Returns a struct containing each of the key-value pairs.
*
* <p>Providing duplicate keys is undefined behavior.
*/
public static Struct of(String k1, Value v1, String k2, Value v2) {
return Struct.newBuilder().putFields(k1, v1).putFields(k2, v2).build();
}
/**
* Returns a struct containing each of the key-value pairs.
*
* <p>Providing duplicate keys is undefined behavior.
*/
public static Struct of(String k1, Value v1, String k2, Value v2, String k3, Value v3) {
return Struct.newBuilder().putFields(k1, v1).putFields(k2, v2).putFields(k3, v3).build();
}
private Structs() {}
}

@ -0,0 +1,85 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.protobuf.util;
import com.google.protobuf.ListValue;
import com.google.protobuf.NullValue;
import com.google.protobuf.Struct;
import com.google.protobuf.Value;
/** Utilities to help create {@code google.protobuf.Value} messages. */
public final class Values {
private static final Value NULL_VALUE =
Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build();
public static Value ofNull() {
return NULL_VALUE;
}
/** Returns a Value object with number set to value. */
public static Value of(boolean value) {
return Value.newBuilder().setBoolValue(value).build();
}
/** Returns a Value object with number set to value. */
public static Value of(double value) {
return Value.newBuilder().setNumberValue(value).build();
}
/** Returns a Value object with string set to value. */
public static Value of(String value) {
return Value.newBuilder().setStringValue(value).build();
}
/** Returns a Value object with struct set to value. */
public static Value of(Struct value) {
return Value.newBuilder().setStructValue(value).build();
}
/** Returns a Value with ListValue set to value. */
public static Value of(ListValue value) {
return Value.newBuilder().setListValue(value).build();
}
/**
* Returns a Value with ListValue set to the appending the result of calling {@link #of(Object)}
* on each element in the iterable.
*/
public static Value of(Iterable<Value> values) {
Value.Builder valueBuilder = Value.newBuilder();
ListValue.Builder listValue = valueBuilder.getListValueBuilder();
listValue.addAllValues(values);
return valueBuilder.build();
}
private Values() {}
}

@ -0,0 +1,59 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.protobuf.util;
import static com.google.common.truth.Truth.assertThat;
import com.google.protobuf.Struct;
import junit.framework.TestCase;
public final class StructsTest extends TestCase {
public void test1pair_constructsObject() throws Exception {
Struct.Builder expected = Struct.newBuilder();
JsonFormat.parser().merge("{\"k1\": 1}", expected);
assertThat(Structs.of("k1", Values.of(1))).isEqualTo(expected.build());
}
public void test2pair_constructsObject() throws Exception {
Struct.Builder expected = Struct.newBuilder();
JsonFormat.parser().merge("{\"k1\": 1, \"k2\": 2}", expected);
assertThat(Structs.of("k1", Values.of(1), "k2", Values.of(2))).isEqualTo(expected.build());
}
public void test3pair_constructsObject() throws Exception {
Struct.Builder expected = Struct.newBuilder();
JsonFormat.parser().merge("{\"k1\": 1, \"k2\": 2, \"k3\": 3}", expected);
assertThat(Structs.of("k1", Values.of(1), "k2", Values.of(2), "k3", Values.of(3)))
.isEqualTo(expected.build());
}
}

@ -0,0 +1,102 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.protobuf.util;
import static com.google.common.truth.Truth.assertThat;
import com.google.protobuf.ListValue;
import com.google.protobuf.NullValue;
import com.google.protobuf.Struct;
import com.google.protobuf.Value;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
public final class ValuesTest extends TestCase {
public void testOfNull_IsNullValue() throws Exception {
assertThat(Values.ofNull())
.isEqualTo(Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build());
}
public void testOfBoolean_ConstructsValue() {
assertThat(Values.of(true)).isEqualTo(Value.newBuilder().setBoolValue(true).build());
assertThat(Values.of(false)).isEqualTo(Value.newBuilder().setBoolValue(false).build());
}
public void testOfNumeric_ConstructsValue() {
assertThat(Values.of(100)).isEqualTo(Value.newBuilder().setNumberValue(100).build());
assertThat(Values.of(1000L)).isEqualTo(Value.newBuilder().setNumberValue(1000).build());
assertThat(Values.of(1000.23f)).isEqualTo(Value.newBuilder().setNumberValue(1000.23f).build());
assertThat(Values.of(10000.23)).isEqualTo(Value.newBuilder().setNumberValue(10000.23).build());
}
public void testOfString_ConstructsValue() {
assertThat(Values.of("")).isEqualTo(Value.newBuilder().setStringValue("").build());
assertThat(Values.of("foo")).isEqualTo(Value.newBuilder().setStringValue("foo").build());
}
public void testOfStruct_ConstructsValue() {
Struct.Builder builder = Struct.newBuilder();
builder.putFields("a", Values.of("a"));
builder.putFields("b", Values.of("b"));
assertThat(Values.of(builder.build()))
.isEqualTo(Value.newBuilder().setStructValue(builder.build()).build());
}
public void testOfListValue_ConstructsInstance() {
ListValue.Builder builder = ListValue.newBuilder();
builder.addValues(Values.of(1));
builder.addValues(Values.of(2));
assertThat(Values.of(builder.build()))
.isEqualTo(Value.newBuilder().setListValue(builder.build()).build());
}
public void testOfIterable_ReturnsTheValue() {
ListValue.Builder builder = ListValue.newBuilder();
builder.addValues(Values.of(1));
builder.addValues(Values.of(2));
builder.addValues(Values.of(true));
builder.addValues(Value.newBuilder().setListValue(builder.build()).build());
List<Value> list = new ArrayList<>();
list.add(Values.of(1));
list.add(Values.of(2));
list.add(Values.of(true));
List<Value> copyList = new ArrayList<>(list);
list.add(Values.of(copyList));
assertThat(Values.of(list)).isEqualTo(Value.newBuilder().setListValue(builder).build());
assertThat(Values.of(new ArrayList<Value>()))
.isEqualTo(Value.newBuilder().setListValue(ListValue.getDefaultInstance()).build());
}
}

@ -99,8 +99,6 @@ def _IsMessageSetExtension(field):
field.label == descriptor.FieldDescriptor.LABEL_OPTIONAL) field.label == descriptor.FieldDescriptor.LABEL_OPTIONAL)
class DescriptorPool(object): class DescriptorPool(object):
"""A collection of protobufs dynamically constructed by descriptor protos.""" """A collection of protobufs dynamically constructed by descriptor protos."""

@ -1725,6 +1725,7 @@ class Proto3Test(unittest.TestCase):
self.assertIsNone(msg.map_int32_int32.get(5)) self.assertIsNone(msg.map_int32_int32.get(5))
self.assertEqual(10, msg.map_int32_int32.get(5, 10)) self.assertEqual(10, msg.map_int32_int32.get(5, 10))
self.assertEqual(10, msg.map_int32_int32.get(key=5, default=10))
self.assertIsNone(msg.map_int32_int32.get(5)) self.assertIsNone(msg.map_int32_int32.get(5))
msg.map_int32_int32[5] = 15 msg.map_int32_int32[5] = 15
@ -1735,6 +1736,7 @@ class Proto3Test(unittest.TestCase):
self.assertIsNone(msg.map_int32_foreign_message.get(5)) self.assertIsNone(msg.map_int32_foreign_message.get(5))
self.assertEqual(10, msg.map_int32_foreign_message.get(5, 10)) self.assertEqual(10, msg.map_int32_foreign_message.get(5, 10))
self.assertEqual(10, msg.map_int32_foreign_message.get(key=5, default=10))
submsg = msg.map_int32_foreign_message[5] submsg = msg.map_int32_foreign_message[5]
self.assertIs(submsg, msg.map_int32_foreign_message.get(5)) self.assertIs(submsg, msg.map_int32_foreign_message.get(5))

@ -464,10 +464,13 @@ int MapReflectionFriend::ScalarMapSetItem(PyObject* _self, PyObject* key,
} }
} }
static PyObject* ScalarMapGet(PyObject* self, PyObject* args) { static PyObject* ScalarMapGet(PyObject* self, PyObject* args,
PyObject* kwargs) {
static char* kwlist[] = {"key", "default", nullptr};
PyObject* key; PyObject* key;
PyObject* default_value = NULL; PyObject* default_value = NULL;
if (PyArg_ParseTuple(args, "O|O", &key, &default_value) < 0) { if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist, &key,
&default_value)) {
return NULL; return NULL;
} }
@ -532,16 +535,16 @@ static void ScalarMapDealloc(PyObject* _self) {
} }
static PyMethodDef ScalarMapMethods[] = { static PyMethodDef ScalarMapMethods[] = {
{ "__contains__", MapReflectionFriend::Contains, METH_O, {"__contains__", MapReflectionFriend::Contains, METH_O,
"Tests whether a key is a member of the map." }, "Tests whether a key is a member of the map."},
{ "clear", (PyCFunction)Clear, METH_NOARGS, {"clear", (PyCFunction)Clear, METH_NOARGS,
"Removes all elements from the map." }, "Removes all elements from the map."},
{ "get", ScalarMapGet, METH_VARARGS, {"get", (PyCFunction)ScalarMapGet, METH_VARARGS | METH_KEYWORDS,
"Gets the value for the given key if present, or otherwise a default" }, "Gets the value for the given key if present, or otherwise a default"},
{ "GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS, {"GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS,
"Return the class used to build Entries of (key, value) pairs." }, "Return the class used to build Entries of (key, value) pairs."},
{ "MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O, {"MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O,
"Merges a map into the current map." }, "Merges a map into the current map."},
/* /*
{ "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS, { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
"Makes a deep copy of the class." }, "Makes a deep copy of the class." },
@ -773,10 +776,12 @@ PyObject* MapReflectionFriend::MessageMapToStr(PyObject* _self) {
return PyObject_Repr(dict.get()); return PyObject_Repr(dict.get());
} }
PyObject* MessageMapGet(PyObject* self, PyObject* args) { PyObject* MessageMapGet(PyObject* self, PyObject* args, PyObject* kwargs) {
static char* kwlist[] = {"key", "default", nullptr};
PyObject* key; PyObject* key;
PyObject* default_value = NULL; PyObject* default_value = NULL;
if (PyArg_ParseTuple(args, "O|O", &key, &default_value) < 0) { if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist, &key,
&default_value)) {
return NULL; return NULL;
} }
@ -810,18 +815,18 @@ static void MessageMapDealloc(PyObject* _self) {
} }
static PyMethodDef MessageMapMethods[] = { static PyMethodDef MessageMapMethods[] = {
{ "__contains__", (PyCFunction)MapReflectionFriend::Contains, METH_O, {"__contains__", (PyCFunction)MapReflectionFriend::Contains, METH_O,
"Tests whether the map contains this element."}, "Tests whether the map contains this element."},
{ "clear", (PyCFunction)Clear, METH_NOARGS, {"clear", (PyCFunction)Clear, METH_NOARGS,
"Removes all elements from the map."}, "Removes all elements from the map."},
{ "get", MessageMapGet, METH_VARARGS, {"get", (PyCFunction)MessageMapGet, METH_VARARGS | METH_KEYWORDS,
"Gets the value for the given key if present, or otherwise a default" }, "Gets the value for the given key if present, or otherwise a default"},
{ "get_or_create", MapReflectionFriend::MessageMapGetItem, METH_O, {"get_or_create", MapReflectionFriend::MessageMapGetItem, METH_O,
"Alias for getitem, useful to make explicit that the map is mutated." }, "Alias for getitem, useful to make explicit that the map is mutated."},
{ "GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS, {"GetEntryClass", (PyCFunction)GetEntryClass, METH_NOARGS,
"Return the class used to build Entries of (key, value) pairs." }, "Return the class used to build Entries of (key, value) pairs."},
{ "MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O, {"MergeFrom", (PyCFunction)MapReflectionFriend::MergeFrom, METH_O,
"Merges a map into the current map." }, "Merges a map into the current map."},
/* /*
{ "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS, { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
"Makes a deep copy of the class." }, "Makes a deep copy of the class." },

@ -111,7 +111,7 @@ bool Any::ParseAnyTypeUrl(const string& type_url,
full_type_name); full_type_name);
} }
class Any::HasBitSetters { class Any::_Internal {
public: public:
}; };
@ -131,11 +131,11 @@ Any::Any(const Any& from)
_any_metadata_(&type_url_, &value_) { _any_metadata_(&type_url_, &value_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.type_url().size() > 0) { if (!from.type_url().empty()) {
type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url_); type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url_);
} }
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.value().size() > 0) { if (!from.value().empty()) {
value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_);
} }
// @@protoc_insertion_point(copy_constructor:google.protobuf.Any) // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)

@ -217,7 +217,7 @@ class PROTOBUF_EXPORT Any :
// @@protoc_insertion_point(class_scope:google.protobuf.Any) // @@protoc_insertion_point(class_scope:google.protobuf.Any)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_;

@ -178,13 +178,13 @@ void Api::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Api_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>( PROTOBUF_NAMESPACE_ID::_Api_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>(
PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance()); PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance());
} }
class Api::HasBitSetters { class Api::_Internal {
public: public:
static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg); static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg);
}; };
const PROTOBUF_NAMESPACE_ID::SourceContext& const PROTOBUF_NAMESPACE_ID::SourceContext&
Api::HasBitSetters::source_context(const Api* msg) { Api::_Internal::source_context(const Api* msg) {
return *msg->source_context_; return *msg->source_context_;
} }
void Api::clear_options() { void Api::clear_options() {
@ -219,11 +219,11 @@ Api::Api(const Api& from)
mixins_(from.mixins_) { mixins_(from.mixins_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
} }
version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.version().size() > 0) { if (!from.version().empty()) {
version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_); version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
} }
if (from.has_source_context()) { if (from.has_source_context()) {
@ -542,7 +542,7 @@ void Api::SerializeWithCachedSizes(
// .google.protobuf.SourceContext source_context = 5; // .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) { if (this->has_source_context()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
5, HasBitSetters::source_context(this), output); 5, _Internal::source_context(this), output);
} }
// repeated .google.protobuf.Mixin mixins = 6; // repeated .google.protobuf.Mixin mixins = 6;
@ -615,7 +615,7 @@ void Api::SerializeWithCachedSizes(
if (this->has_source_context()) { if (this->has_source_context()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
5, HasBitSetters::source_context(this), target); 5, _Internal::source_context(this), target);
} }
// repeated .google.protobuf.Mixin mixins = 6; // repeated .google.protobuf.Mixin mixins = 6;
@ -804,7 +804,7 @@ void Api::InternalSwap(Api* other) {
void Method::InitAsDefaultInstance() { void Method::InitAsDefaultInstance() {
} }
class Method::HasBitSetters { class Method::_Internal {
public: public:
}; };
@ -832,15 +832,15 @@ Method::Method(const Method& from)
options_(from.options_) { options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
} }
request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.request_type_url().size() > 0) { if (!from.request_type_url().empty()) {
request_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.request_type_url_); request_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.request_type_url_);
} }
response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.response_type_url().size() > 0) { if (!from.response_type_url().empty()) {
response_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_type_url_); response_type_url_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_type_url_);
} }
::memcpy(&request_streaming_, &from.request_streaming_, ::memcpy(&request_streaming_, &from.request_streaming_,
@ -1402,7 +1402,7 @@ void Method::InternalSwap(Method* other) {
void Mixin::InitAsDefaultInstance() { void Mixin::InitAsDefaultInstance() {
} }
class Mixin::HasBitSetters { class Mixin::_Internal {
public: public:
}; };
@ -1421,11 +1421,11 @@ Mixin::Mixin(const Mixin& from)
_internal_metadata_(nullptr) { _internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
} }
root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.root().size() > 0) { if (!from.root().empty()) {
root_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.root_); root_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.root_);
} }
// @@protoc_insertion_point(copy_constructor:google.protobuf.Mixin) // @@protoc_insertion_point(copy_constructor:google.protobuf.Mixin)

@ -262,7 +262,7 @@ class PROTOBUF_EXPORT Api :
// @@protoc_insertion_point(class_scope:google.protobuf.Api) // @@protoc_insertion_point(class_scope:google.protobuf.Api)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method > methods_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method > methods_;
@ -454,7 +454,7 @@ class PROTOBUF_EXPORT Method :
// @@protoc_insertion_point(class_scope:google.protobuf.Method) // @@protoc_insertion_point(class_scope:google.protobuf.Method)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_;
@ -604,7 +604,7 @@ class PROTOBUF_EXPORT Mixin :
// @@protoc_insertion_point(class_scope:google.protobuf.Mixin) // @@protoc_insertion_point(class_scope:google.protobuf.Mixin)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;

@ -77,7 +77,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor,
(*variables)["clear_hasbit"] = ""; (*variables)["clear_hasbit"] = "";
if (HasFieldPresence(descriptor->file())) { if (HasFieldPresence(descriptor->file())) {
(*variables)["set_hasbit_io"] = (*variables)["set_hasbit_io"] =
"HasBitSetters::set_has_" + FieldName(descriptor) + "(&_has_bits_);"; "_Internal::set_has_" + FieldName(descriptor) + "(&_has_bits_);";
} else { } else {
(*variables)["set_hasbit_io"] = ""; (*variables)["set_hasbit_io"] = "";
} }

@ -1381,7 +1381,7 @@ class ParseLoopGenerator {
// For now only optimize small hasbits. // For now only optimize small hasbits.
if (hasbits_size != 1) hasbits_size = 0; if (hasbits_size != 1) hasbits_size = 0;
if (hasbits_size) { if (hasbits_size) {
format_("HasBitSetters::HasBits has_bits{};\n"); format_("_Internal::HasBits has_bits{};\n");
format_.Set("has_bits", "has_bits"); format_.Set("has_bits", "has_bits");
} else { } else {
format_.Set("has_bits", "_has_bits_"); format_.Set("has_bits", "_has_bits_");
@ -1420,7 +1420,7 @@ class ParseLoopGenerator {
field_name = ", kFieldName"; field_name = ", kFieldName";
} }
if (HasFieldPresence(field->file())) { if (HasFieldPresence(field->file())) {
format_("HasBitSetters::set_has_$1$(&$has_bits$);\n", FieldName(field)); format_("_Internal::set_has_$1$(&$has_bits$);\n", FieldName(field));
} }
string default_string = string default_string =
field->default_value_string().empty() field->default_value_string().empty()
@ -1536,7 +1536,7 @@ class ParseLoopGenerator {
FieldName(field), field->containing_oneof()->name()); FieldName(field), field->containing_oneof()->name());
} else if (HasFieldPresence(field->file())) { } else if (HasFieldPresence(field->file())) {
format_( format_(
"HasBitSetters::set_has_$1$(&$has_bits$);\n" "_Internal::set_has_$1$(&$has_bits$);\n"
"ptr = ctx->ParseMessage(&$1$_, ptr);\n", "ptr = ctx->ParseMessage(&$1$_, ptr);\n",
FieldName(field)); FieldName(field));
} else { } else {
@ -1546,7 +1546,7 @@ class ParseLoopGenerator {
} else if (IsImplicitWeakField(field, options_, scc_analyzer_)) { } else if (IsImplicitWeakField(field, options_, scc_analyzer_)) {
if (!field->is_repeated()) { if (!field->is_repeated()) {
format_( format_(
"ptr = ctx->ParseMessage(HasBitSetters::mutable_$1$(this), " "ptr = ctx->ParseMessage(_Internal::mutable_$1$(this), "
"ptr);\n", "ptr);\n",
FieldName(field)); FieldName(field));
} else { } else {
@ -1633,7 +1633,7 @@ class ParseLoopGenerator {
prefix, FieldName(field), zigzag); prefix, FieldName(field), zigzag);
} else { } else {
if (HasFieldPresence(field->file())) { if (HasFieldPresence(field->file())) {
format_("HasBitSetters::set_has_$1$(&$has_bits$);\n", format_("_Internal::set_has_$1$(&$has_bits$);\n",
FieldName(field)); FieldName(field));
} }
format_( format_(
@ -1655,8 +1655,7 @@ class ParseLoopGenerator {
prefix, FieldName(field), type); prefix, FieldName(field), type);
} else { } else {
if (HasFieldPresence(field->file())) { if (HasFieldPresence(field->file())) {
format_("HasBitSetters::set_has_$1$(&$has_bits$);\n", format_("_Internal::set_has_$1$(&$has_bits$);\n", FieldName(field));
FieldName(field));
} }
format_( format_(
"$1$_ = $pi_ns$::UnalignedLoad<$2$>(ptr);\n" "$1$_ = $pi_ns$::UnalignedLoad<$2$>(ptr);\n"

@ -1392,7 +1392,7 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) {
format(" private:\n"); format(" private:\n");
format.Indent(); format.Indent();
// TODO(seongkim): Remove hack to track field access and remove this class. // TODO(seongkim): Remove hack to track field access and remove this class.
format("class HasBitSetters;\n"); format("class _Internal;\n");
for (auto field : FieldRange(descriptor_)) { for (auto field : FieldRange(descriptor_)) {
@ -1990,7 +1990,7 @@ void MessageGenerator::GenerateClassMethods(io::Printer* printer) {
} }
format( format(
"class $classname$::HasBitSetters {\n" "class $classname$::_Internal {\n"
" public:\n"); " public:\n");
format.Indent(); format.Indent();
if (HasFieldPresence(descriptor_->file()) && HasBitsSize() != 0) { if (HasFieldPresence(descriptor_->file()) && HasBitsSize() != 0) {

@ -269,7 +269,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDeclarations(
void MessageFieldGenerator::GenerateInternalAccessorDefinitions( void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
io::Printer* printer) const { io::Printer* printer) const {
// In theory, these accessors could be inline in HasBitSetters. However, in // In theory, these accessors could be inline in _Internal. However, in
// practice, the linker is then not able to throw them out making implicit // practice, the linker is then not able to throw them out making implicit
// weak dependencies not work at all. // weak dependencies not work at all.
Formatter format(printer, variables_); Formatter format(printer, variables_);
@ -278,7 +278,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
// MergePartialFromCodedStream, and their purpose is to provide access to // MergePartialFromCodedStream, and their purpose is to provide access to
// the field without creating a strong dependency on the message type. // the field without creating a strong dependency on the message type.
format( format(
"const ::$proto_ns$::MessageLite& $classname$::HasBitSetters::$name$(\n" "const ::$proto_ns$::MessageLite& $classname$::_Internal::$name$(\n"
" const $classname$* msg) {\n" " const $classname$* msg) {\n"
" if (msg->$name$_ != nullptr) {\n" " if (msg->$name$_ != nullptr) {\n"
" return *msg->$name$_;\n" " return *msg->$name$_;\n"
@ -293,7 +293,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
if (SupportsArenas(descriptor_)) { if (SupportsArenas(descriptor_)) {
format( format(
"::$proto_ns$::MessageLite*\n" "::$proto_ns$::MessageLite*\n"
"$classname$::HasBitSetters::mutable_$name$($classname$* msg) {\n"); "$classname$::_Internal::mutable_$name$($classname$* msg) {\n");
if (HasFieldPresence(descriptor_->file())) { if (HasFieldPresence(descriptor_->file())) {
format(" msg->$set_hasbit$\n"); format(" msg->$set_hasbit$\n");
} }
@ -315,7 +315,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
} else { } else {
format( format(
"::$proto_ns$::MessageLite*\n" "::$proto_ns$::MessageLite*\n"
"$classname$::HasBitSetters::mutable_$name$($classname$* msg) {\n"); "$classname$::_Internal::mutable_$name$($classname$* msg) {\n");
if (HasFieldPresence(descriptor_->file())) { if (HasFieldPresence(descriptor_->file())) {
format(" msg->$set_hasbit$\n"); format(" msg->$set_hasbit$\n");
} }
@ -339,7 +339,7 @@ void MessageFieldGenerator::GenerateInternalAccessorDefinitions(
// message fields under serialize. // message fields under serialize.
format( format(
"const $type$&\n" "const $type$&\n"
"$classname$::HasBitSetters::$name$(const $classname$* msg) {\n" "$classname$::_Internal::$name$(const $classname$* msg) {\n"
" return *msg->$field_member$;\n" " return *msg->$field_member$;\n"
"}\n"); "}\n");
} }
@ -382,8 +382,8 @@ void MessageFieldGenerator::GenerateMergingCode(io::Printer* printer) const {
Formatter format(printer, variables_); Formatter format(printer, variables_);
if (implicit_weak_field_) { if (implicit_weak_field_) {
format( format(
"HasBitSetters::mutable_$name$(this)->CheckTypeAndMergeFrom(\n" "_Internal::mutable_$name$(this)->CheckTypeAndMergeFrom(\n"
" HasBitSetters::$name$(&from));\n"); " _Internal::$name$(&from));\n");
} else { } else {
format("mutable_$name$()->$type$::MergeFrom(from.$name$());\n"); format("mutable_$name$()->$type$::MergeFrom(from.$name$());\n");
} }
@ -430,7 +430,7 @@ void MessageFieldGenerator::GenerateMergeFromCodedStream(
if (implicit_weak_field_) { if (implicit_weak_field_) {
format( format(
"DO_(::$proto_ns$::internal::WireFormatLite::ReadMessage(\n" "DO_(::$proto_ns$::internal::WireFormatLite::ReadMessage(\n"
" input, HasBitSetters::mutable_$name$(this)));\n"); " input, _Internal::mutable_$name$(this)));\n");
} else if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE) { } else if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE) {
format( format(
"DO_(::$proto_ns$::internal::WireFormatLite::ReadMessage(\n" "DO_(::$proto_ns$::internal::WireFormatLite::ReadMessage(\n"
@ -447,7 +447,7 @@ void MessageFieldGenerator::GenerateSerializeWithCachedSizes(
Formatter format(printer, variables_); Formatter format(printer, variables_);
format( format(
"::$proto_ns$::internal::WireFormatLite::Write$stream_writer$(\n" "::$proto_ns$::internal::WireFormatLite::Write$stream_writer$(\n"
" $number$, HasBitSetters::$name$(this), output);\n"); " $number$, _Internal::$name$(this), output);\n");
} }
void MessageFieldGenerator::GenerateSerializeWithCachedSizesToArray( void MessageFieldGenerator::GenerateSerializeWithCachedSizesToArray(
@ -456,7 +456,7 @@ void MessageFieldGenerator::GenerateSerializeWithCachedSizesToArray(
format( format(
"target = ::$proto_ns$::internal::WireFormatLite::\n" "target = ::$proto_ns$::internal::WireFormatLite::\n"
" InternalWrite$declared_type$ToArray(\n" " InternalWrite$declared_type$ToArray(\n"
" $number$, HasBitSetters::$name$(this), target);\n"); " $number$, _Internal::$name$(this), target);\n");
} }
void MessageFieldGenerator::GenerateByteSize(io::Printer* printer) const { void MessageFieldGenerator::GenerateByteSize(io::Printer* printer) const {

@ -519,7 +519,7 @@ void StringFieldGenerator::GenerateCopyConstructorCode(
if (HasFieldPresence(descriptor_->file())) { if (HasFieldPresence(descriptor_->file())) {
format("if (from.has_$name$()) {\n"); format("if (from.has_$name$()) {\n");
} else { } else {
format("if (from.$name$().size() > 0) {\n"); format("if (!from.$name$().empty()) {\n");
} }
format.Indent(); format.Indent();

@ -157,6 +157,16 @@ bool IsLowerUnderscore(const string& name) {
return true; return true;
} }
bool IsNumberFollowUnderscore(const string& name) {
for (int i = 1; i < name.length(); i++) {
const char c = name[i];
if (IsNumber(c) && name[i - 1] == '_') {
return true;
}
}
return false;
}
} // anonymous namespace } // anonymous namespace
// Makes code slightly more readable. The meaning of "DO(foo)" is // Makes code slightly more readable. The meaning of "DO(foo)" is
@ -1004,6 +1014,12 @@ bool Parser::ParseMessageFieldNoLabel(
"Field name should be lowercase. Found: " + field->name() + "Field name should be lowercase. Found: " + field->name() +
". See: https://developers.google.com/protocol-buffers/docs/style"); ". See: https://developers.google.com/protocol-buffers/docs/style");
} }
if (IsNumberFollowUnderscore(field->name())) {
AddWarning(
"Number should not come right after an underscore. Found: " +
field->name() +
". See: https://developers.google.com/protocol-buffers/docs/style");
}
} }
DO(Consume("=", "Missing field number.")); DO(Consume("=", "Missing field number."));

@ -65,9 +65,15 @@ class MockErrorCollector : public io::ErrorCollector {
MockErrorCollector() = default; MockErrorCollector() = default;
~MockErrorCollector() override = default; ~MockErrorCollector() override = default;
std::string warning_;
std::string text_; std::string text_;
// implements ErrorCollector --------------------------------------- // implements ErrorCollector ---------------------------------------
void AddWarning(int line, int column, const std::string& message) override {
strings::SubstituteAndAppend(&warning_, "$0:$1: $2\n", line, column,
message);
}
void AddError(int line, int column, const std::string& message) override { void AddError(int line, int column, const std::string& message) override {
strings::SubstituteAndAppend(&text_, "$0:$1: $2\n", line, column, message); strings::SubstituteAndAppend(&text_, "$0:$1: $2\n", line, column, message);
} }
@ -223,6 +229,43 @@ TEST_F(ParserTest, WarnIfSyntaxIdentifierOmmitted) {
string::npos); string::npos);
} }
TEST_F(ParserTest, WarnIfFieldNameIsNotUpperCamel) {
SetupParser(
"syntax = \"proto2\";"
"message abc {}");
FileDescriptorProto file;
EXPECT_TRUE(parser_->Parse(input_.get(), &file));
EXPECT_TRUE(error_collector_.warning_.find(
"Message name should be in UpperCamelCase. Found: abc.") !=
string::npos);
}
TEST_F(ParserTest, WarnIfFieldNameIsNotLowerUnderscore) {
SetupParser(
"syntax = \"proto2\";"
"message A {"
" optional string SongName = 1;"
"}");
FileDescriptorProto file;
EXPECT_TRUE(parser_->Parse(input_.get(), &file));
EXPECT_TRUE(error_collector_.warning_.find(
"Field name should be lowercase. Found: SongName") !=
string::npos);
}
TEST_F(ParserTest, WarnIfFieldNameContainsNumberImmediatelyFollowUnderscore) {
SetupParser(
"syntax = \"proto2\";"
"message A {"
" optional string song_name_1 = 1;"
"}");
FileDescriptorProto file;
EXPECT_TRUE(parser_->Parse(input_.get(), &file));
EXPECT_TRUE(error_collector_.warning_.find(
"Number should not come right after an underscore. Found: "
"song_name_1.") != string::npos);
}
// =================================================================== // ===================================================================
typedef ParserTest ParseMessageTest; typedef ParserTest ParseMessageTest;

@ -208,7 +208,7 @@ namespace compiler {
void Version::InitAsDefaultInstance() { void Version::InitAsDefaultInstance() {
} }
class Version::HasBitSetters { class Version::_Internal {
public: public:
using HasBits = decltype(std::declval<Version>()._has_bits_); using HasBits = decltype(std::declval<Version>()._has_bits_);
static void set_has_major(HasBits* has_bits) { static void set_has_major(HasBits* has_bits) {
@ -300,7 +300,7 @@ void Version::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
HasBitSetters::HasBits has_bits{}; _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) { while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag; ::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
@ -309,7 +309,7 @@ const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
// optional int32 major = 1; // optional int32 major = 1;
case 1: case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
HasBitSetters::set_has_major(&has_bits); _Internal::set_has_major(&has_bits);
major_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); major_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr); CHK_(ptr);
} else goto handle_unusual; } else goto handle_unusual;
@ -317,7 +317,7 @@ const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
// optional int32 minor = 2; // optional int32 minor = 2;
case 2: case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
HasBitSetters::set_has_minor(&has_bits); _Internal::set_has_minor(&has_bits);
minor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); minor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr); CHK_(ptr);
} else goto handle_unusual; } else goto handle_unusual;
@ -325,7 +325,7 @@ const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in
// optional int32 patch = 3; // optional int32 patch = 3;
case 3: case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
HasBitSetters::set_has_patch(&has_bits); _Internal::set_has_patch(&has_bits);
patch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); patch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
CHK_(ptr); CHK_(ptr);
} else goto handle_unusual; } else goto handle_unusual;
@ -371,7 +371,7 @@ bool Version::MergePartialFromCodedStream(
// optional int32 major = 1; // optional int32 major = 1;
case 1: { case 1: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
HasBitSetters::set_has_major(&_has_bits_); _Internal::set_has_major(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &major_))); input, &major_)));
@ -384,7 +384,7 @@ bool Version::MergePartialFromCodedStream(
// optional int32 minor = 2; // optional int32 minor = 2;
case 2: { case 2: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
HasBitSetters::set_has_minor(&_has_bits_); _Internal::set_has_minor(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &minor_))); input, &minor_)));
@ -397,7 +397,7 @@ bool Version::MergePartialFromCodedStream(
// optional int32 patch = 3; // optional int32 patch = 3;
case 3: { case 3: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
HasBitSetters::set_has_patch(&_has_bits_); _Internal::set_has_patch(&_has_bits_);
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
input, &patch_))); input, &patch_)));
@ -657,7 +657,7 @@ void CodeGeneratorRequest::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_._instance.get_mutable()->compiler_version_ = const_cast< PROTOBUF_NAMESPACE_ID::compiler::Version*>( PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_._instance.get_mutable()->compiler_version_ = const_cast< PROTOBUF_NAMESPACE_ID::compiler::Version*>(
PROTOBUF_NAMESPACE_ID::compiler::Version::internal_default_instance()); PROTOBUF_NAMESPACE_ID::compiler::Version::internal_default_instance());
} }
class CodeGeneratorRequest::HasBitSetters { class CodeGeneratorRequest::_Internal {
public: public:
using HasBits = decltype(std::declval<CodeGeneratorRequest>()._has_bits_); using HasBits = decltype(std::declval<CodeGeneratorRequest>()._has_bits_);
static void set_has_parameter(HasBits* has_bits) { static void set_has_parameter(HasBits* has_bits) {
@ -670,7 +670,7 @@ class CodeGeneratorRequest::HasBitSetters {
}; };
const PROTOBUF_NAMESPACE_ID::compiler::Version& const PROTOBUF_NAMESPACE_ID::compiler::Version&
CodeGeneratorRequest::HasBitSetters::compiler_version(const CodeGeneratorRequest* msg) { CodeGeneratorRequest::_Internal::compiler_version(const CodeGeneratorRequest* msg) {
return *msg->compiler_version_; return *msg->compiler_version_;
} }
void CodeGeneratorRequest::clear_proto_file() { void CodeGeneratorRequest::clear_proto_file() {
@ -757,7 +757,7 @@ void CodeGeneratorRequest::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* CodeGeneratorRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { const char* CodeGeneratorRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
HasBitSetters::HasBits has_bits{}; _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) { while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag; ::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
@ -936,7 +936,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes(
// optional .google.protobuf.compiler.Version compiler_version = 3; // optional .google.protobuf.compiler.Version compiler_version = 3;
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000002u) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
3, HasBitSetters::compiler_version(this), output); 3, _Internal::compiler_version(this), output);
} }
// repeated .google.protobuf.FileDescriptorProto proto_file = 15; // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
@ -987,7 +987,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes(
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000002u) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
3, HasBitSetters::compiler_version(this), target); 3, _Internal::compiler_version(this), target);
} }
// repeated .google.protobuf.FileDescriptorProto proto_file = 15; // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
@ -1139,7 +1139,7 @@ void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) {
void CodeGeneratorResponse_File::InitAsDefaultInstance() { void CodeGeneratorResponse_File::InitAsDefaultInstance() {
} }
class CodeGeneratorResponse_File::HasBitSetters { class CodeGeneratorResponse_File::_Internal {
public: public:
using HasBits = decltype(std::declval<CodeGeneratorResponse_File>()._has_bits_); using HasBits = decltype(std::declval<CodeGeneratorResponse_File>()._has_bits_);
static void set_has_name(HasBits* has_bits) { static void set_has_name(HasBits* has_bits) {
@ -1236,7 +1236,7 @@ void CodeGeneratorResponse_File::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* CodeGeneratorResponse_File::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { const char* CodeGeneratorResponse_File::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
HasBitSetters::HasBits has_bits{}; _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) { while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag; ::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
@ -1576,7 +1576,7 @@ void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other)
void CodeGeneratorResponse::InitAsDefaultInstance() { void CodeGeneratorResponse::InitAsDefaultInstance() {
} }
class CodeGeneratorResponse::HasBitSetters { class CodeGeneratorResponse::_Internal {
public: public:
using HasBits = decltype(std::declval<CodeGeneratorResponse>()._has_bits_); using HasBits = decltype(std::declval<CodeGeneratorResponse>()._has_bits_);
static void set_has_error(HasBits* has_bits) { static void set_has_error(HasBits* has_bits) {
@ -1648,7 +1648,7 @@ void CodeGeneratorResponse::Clear() {
#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* CodeGeneratorResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { const char* CodeGeneratorResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
HasBitSetters::HasBits has_bits{}; _Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) { while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag; ::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);

@ -240,7 +240,7 @@ class PROTOC_EXPORT Version :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version) // @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
@ -423,7 +423,7 @@ class PROTOC_EXPORT CodeGeneratorRequest :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest) // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
@ -593,7 +593,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File) // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
@ -750,7 +750,7 @@ class PROTOC_EXPORT CodeGeneratorResponse :
// @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse) // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;

File diff suppressed because it is too large Load Diff

@ -472,7 +472,7 @@ class PROTOBUF_EXPORT FileDescriptorSet :
// @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet) // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -795,7 +795,7 @@ class PROTOBUF_EXPORT FileDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -975,7 +975,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange :
// @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange) // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1134,7 +1134,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange :
// @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange) // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1417,7 +1417,7 @@ class PROTOBUF_EXPORT DescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1582,7 +1582,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ExtensionRangeOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ExtensionRangeOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions) // @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -1971,7 +1971,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -2157,7 +2157,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -2315,7 +2315,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto.EnumReservedRange) // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto.EnumReservedRange)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -2537,7 +2537,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -2725,7 +2725,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -2916,7 +2916,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -3153,7 +3153,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto :
// @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto) // @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -3636,7 +3636,7 @@ class PROTOBUF_EXPORT FileOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.FileOptions) // @@protoc_insertion_point(class_scope:google.protobuf.FileOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -3842,7 +3842,7 @@ class PROTOBUF_EXPORT MessageOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions) // @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -4110,7 +4110,7 @@ class PROTOBUF_EXPORT FieldOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions) // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -4274,7 +4274,7 @@ class PROTOBUF_EXPORT OneofOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(OneofOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(OneofOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions) // @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -4446,7 +4446,7 @@ class PROTOBUF_EXPORT EnumOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions) // @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -4613,7 +4613,7 @@ class PROTOBUF_EXPORT EnumValueOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions) // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -4779,7 +4779,7 @@ class PROTOBUF_EXPORT ServiceOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions) // @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -4984,7 +4984,7 @@ class PROTOBUF_EXPORT MethodOptions :
GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions) GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions)
// @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions) // @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
@ -5160,7 +5160,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart :
// @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart) // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart)
private: private:
class HasBitSetters; class _Internal;
// helper for ByteSizeLong() // helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const; size_t RequiredFieldsByteSizeFallback() const;
@ -5408,7 +5408,7 @@ class PROTOBUF_EXPORT UninterpretedOption :
// @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption) // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -5643,7 +5643,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location :
// @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location) // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -5806,7 +5806,7 @@ class PROTOBUF_EXPORT SourceCodeInfo :
// @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo) // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -5997,7 +5997,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation :
// @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation) // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -6158,7 +6158,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo :
// @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo) // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -428,6 +428,7 @@ message FileOptions {
// determining the ruby package. // determining the ruby package.
optional string ruby_package = 45; optional string ruby_package = 45;
// The parser stores options it doesn't recognize here. // The parser stores options it doesn't recognize here.
// See the documentation for the "Options" section above. // See the documentation for the "Options" section above.
repeated UninterpretedOption uninterpreted_option = 999; repeated UninterpretedOption uninterpreted_option = 999;

@ -86,7 +86,7 @@ PROTOBUF_NAMESPACE_OPEN
void Duration::InitAsDefaultInstance() { void Duration::InitAsDefaultInstance() {
} }
class Duration::HasBitSetters { class Duration::_Internal {
public: public:
}; };

@ -201,7 +201,7 @@ class PROTOBUF_EXPORT Duration :
// @@protoc_insertion_point(class_scope:google.protobuf.Duration) // @@protoc_insertion_point(class_scope:google.protobuf.Duration)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -83,7 +83,7 @@ PROTOBUF_NAMESPACE_OPEN
void Empty::InitAsDefaultInstance() { void Empty::InitAsDefaultInstance() {
} }
class Empty::HasBitSetters { class Empty::_Internal {
public: public:
}; };

@ -189,7 +189,7 @@ class PROTOBUF_EXPORT Empty :
// @@protoc_insertion_point(class_scope:google.protobuf.Empty) // @@protoc_insertion_point(class_scope:google.protobuf.Empty)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -85,7 +85,7 @@ PROTOBUF_NAMESPACE_OPEN
void FieldMask::InitAsDefaultInstance() { void FieldMask::InitAsDefaultInstance() {
} }
class FieldMask::HasBitSetters { class FieldMask::_Internal {
public: public:
}; };

@ -207,7 +207,7 @@ class PROTOBUF_EXPORT FieldMask :
// @@protoc_insertion_point(class_scope:google.protobuf.FieldMask) // @@protoc_insertion_point(class_scope:google.protobuf.FieldMask)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -3083,11 +3083,13 @@ static std::string DeterministicSerialization(const T& t) {
const int size = t.ByteSize(); const int size = t.ByteSize();
std::string result(size, '\0'); std::string result(size, '\0');
io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&result), size); io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&result), size);
{
io::CodedOutputStream output_stream(&array_stream); io::CodedOutputStream output_stream(&array_stream);
output_stream.SetSerializationDeterministic(true); output_stream.SetSerializationDeterministic(true);
t.SerializeWithCachedSizes(&output_stream); t.SerializeWithCachedSizes(&output_stream);
EXPECT_FALSE(output_stream.HadError()); EXPECT_FALSE(output_stream.HadError());
EXPECT_EQ(size, output_stream.ByteCount()); EXPECT_EQ(size, output_stream.ByteCount());
}
EXPECT_EQ(result, DeterministicSerializationWithSerializeToCodedStream(t)); EXPECT_EQ(result, DeterministicSerializationWithSerializeToCodedStream(t));
EXPECT_EQ(result, EXPECT_EQ(result,
DeterministicSerializationWithSerializePartialToCodedStream(t)); DeterministicSerializationWithSerializePartialToCodedStream(t));

@ -86,7 +86,7 @@ PROTOBUF_NAMESPACE_OPEN
void SourceContext::InitAsDefaultInstance() { void SourceContext::InitAsDefaultInstance() {
} }
class SourceContext::HasBitSetters { class SourceContext::_Internal {
public: public:
}; };
@ -104,7 +104,7 @@ SourceContext::SourceContext(const SourceContext& from)
_internal_metadata_(nullptr) { _internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
file_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); file_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.file_name().size() > 0) { if (!from.file_name().empty()) {
file_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.file_name_); file_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.file_name_);
} }
// @@protoc_insertion_point(copy_constructor:google.protobuf.SourceContext) // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceContext)

@ -189,7 +189,7 @@ class PROTOBUF_EXPORT SourceContext :
// @@protoc_insertion_point(class_scope:google.protobuf.SourceContext) // @@protoc_insertion_point(class_scope:google.protobuf.SourceContext)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr file_name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr file_name_;

@ -195,7 +195,7 @@ void Struct_FieldsEntry_DoNotUse::MergeFrom(
void Struct::InitAsDefaultInstance() { void Struct::InitAsDefaultInstance() {
} }
class Struct::HasBitSetters { class Struct::_Internal {
public: public:
}; };
@ -578,18 +578,18 @@ void Value::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Value_default_instance_.list_value_ = const_cast< PROTOBUF_NAMESPACE_ID::ListValue*>( PROTOBUF_NAMESPACE_ID::_Value_default_instance_.list_value_ = const_cast< PROTOBUF_NAMESPACE_ID::ListValue*>(
PROTOBUF_NAMESPACE_ID::ListValue::internal_default_instance()); PROTOBUF_NAMESPACE_ID::ListValue::internal_default_instance());
} }
class Value::HasBitSetters { class Value::_Internal {
public: public:
static const PROTOBUF_NAMESPACE_ID::Struct& struct_value(const Value* msg); static const PROTOBUF_NAMESPACE_ID::Struct& struct_value(const Value* msg);
static const PROTOBUF_NAMESPACE_ID::ListValue& list_value(const Value* msg); static const PROTOBUF_NAMESPACE_ID::ListValue& list_value(const Value* msg);
}; };
const PROTOBUF_NAMESPACE_ID::Struct& const PROTOBUF_NAMESPACE_ID::Struct&
Value::HasBitSetters::struct_value(const Value* msg) { Value::_Internal::struct_value(const Value* msg) {
return *msg->kind_.struct_value_; return *msg->kind_.struct_value_;
} }
const PROTOBUF_NAMESPACE_ID::ListValue& const PROTOBUF_NAMESPACE_ID::ListValue&
Value::HasBitSetters::list_value(const Value* msg) { Value::_Internal::list_value(const Value* msg) {
return *msg->kind_.list_value_; return *msg->kind_.list_value_;
} }
void Value::set_allocated_struct_value(PROTOBUF_NAMESPACE_ID::Struct* struct_value) { void Value::set_allocated_struct_value(PROTOBUF_NAMESPACE_ID::Struct* struct_value) {
@ -979,13 +979,13 @@ void Value::SerializeWithCachedSizes(
// .google.protobuf.Struct struct_value = 5; // .google.protobuf.Struct struct_value = 5;
if (has_struct_value()) { if (has_struct_value()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
5, HasBitSetters::struct_value(this), output); 5, _Internal::struct_value(this), output);
} }
// .google.protobuf.ListValue list_value = 6; // .google.protobuf.ListValue list_value = 6;
if (has_list_value()) { if (has_list_value()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
6, HasBitSetters::list_value(this), output); 6, _Internal::list_value(this), output);
} }
if (_internal_metadata_.have_unknown_fields()) { if (_internal_metadata_.have_unknown_fields()) {
@ -1032,14 +1032,14 @@ void Value::SerializeWithCachedSizes(
if (has_struct_value()) { if (has_struct_value()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
5, HasBitSetters::struct_value(this), target); 5, _Internal::struct_value(this), target);
} }
// .google.protobuf.ListValue list_value = 6; // .google.protobuf.ListValue list_value = 6;
if (has_list_value()) { if (has_list_value()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
6, HasBitSetters::list_value(this), target); 6, _Internal::list_value(this), target);
} }
if (_internal_metadata_.have_unknown_fields()) { if (_internal_metadata_.have_unknown_fields()) {
@ -1216,7 +1216,7 @@ void Value::InternalSwap(Value* other) {
void ListValue::InitAsDefaultInstance() { void ListValue::InitAsDefaultInstance() {
} }
class ListValue::HasBitSetters { class ListValue::_Internal {
public: public:
}; };

@ -271,7 +271,7 @@ class PROTOBUF_EXPORT Struct :
// @@protoc_insertion_point(class_scope:google.protobuf.Struct) // @@protoc_insertion_point(class_scope:google.protobuf.Struct)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -498,7 +498,7 @@ class PROTOBUF_EXPORT Value :
KindCase kind_case() const; KindCase kind_case() const;
// @@protoc_insertion_point(class_scope:google.protobuf.Value) // @@protoc_insertion_point(class_scope:google.protobuf.Value)
private: private:
class HasBitSetters; class _Internal;
void set_has_null_value(); void set_has_null_value();
void set_has_number_value(); void set_has_number_value();
void set_has_string_value(); void set_has_string_value();
@ -664,7 +664,7 @@ class PROTOBUF_EXPORT ListValue :
// @@protoc_insertion_point(class_scope:google.protobuf.ListValue) // @@protoc_insertion_point(class_scope:google.protobuf.ListValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -208,6 +208,11 @@ const FieldDescriptor* DefaultFinderFindExtension(Message* message,
name); name);
} }
const FieldDescriptor* DefaultFinderFindExtensionByNumber(
const Descriptor* descriptor, int number) {
return descriptor->file()->pool()->FindExtensionByNumber(descriptor, number);
}
const Descriptor* DefaultFinderFindAnyType(const Message& message, const Descriptor* DefaultFinderFindAnyType(const Message& message,
const std::string& prefix, const std::string& prefix,
const std::string& name) { const std::string& name) {
@ -459,8 +464,10 @@ class TextFormat::Parser::ParserImpl {
if (allow_field_number_ && if (allow_field_number_ &&
safe_strto32(field_name, &field_number)) { safe_strto32(field_name, &field_number)) {
if (descriptor->IsExtensionNumber(field_number)) { if (descriptor->IsExtensionNumber(field_number)) {
field = descriptor->file()->pool()->FindExtensionByNumber( field = finder_
descriptor, field_number); ? finder_->FindExtensionByNumber(descriptor, field_number)
: DefaultFinderFindExtensionByNumber(descriptor,
field_number);
} else if (descriptor->IsReservedNumber(field_number)) { } else if (descriptor->IsReservedNumber(field_number)) {
reserved_field = true; reserved_field = true;
} else { } else {
@ -1354,6 +1361,11 @@ const FieldDescriptor* TextFormat::Finder::FindExtension(
return DefaultFinderFindExtension(message, name); return DefaultFinderFindExtension(message, name);
} }
const FieldDescriptor* TextFormat::Finder::FindExtensionByNumber(
const Descriptor* descriptor, int number) const {
return DefaultFinderFindExtensionByNumber(descriptor, number);
}
const Descriptor* TextFormat::Finder::FindAnyType( const Descriptor* TextFormat::Finder::FindAnyType(
const Message& message, const std::string& prefix, const Message& message, const std::string& prefix,
const std::string& name) const { const std::string& name) const {

@ -208,6 +208,11 @@ class PROTOBUF_EXPORT TextFormat {
virtual const FieldDescriptor* FindExtension(Message* message, virtual const FieldDescriptor* FindExtension(Message* message,
const std::string& name) const; const std::string& name) const;
// Similar to FindExtension, but uses a Descriptor and the extension number
// instead of using a Message and the name when doing the look up.
virtual const FieldDescriptor* FindExtensionByNumber(
const Descriptor* descriptor, int number) const;
// Find the message type for an Any proto. // Find the message type for an Any proto.
// Returns NULL if no message is known for this name. // Returns NULL if no message is known for this name.
// The base implementation only accepts prefixes of type.googleprod.com/ or // The base implementation only accepts prefixes of type.googleprod.com/ or

@ -86,7 +86,7 @@ PROTOBUF_NAMESPACE_OPEN
void Timestamp::InitAsDefaultInstance() { void Timestamp::InitAsDefaultInstance() {
} }
class Timestamp::HasBitSetters { class Timestamp::_Internal {
public: public:
}; };

@ -201,7 +201,7 @@ class PROTOBUF_EXPORT Timestamp :
// @@protoc_insertion_point(class_scope:google.protobuf.Timestamp) // @@protoc_insertion_point(class_scope:google.protobuf.Timestamp)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -360,13 +360,13 @@ void Type::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Type_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>( PROTOBUF_NAMESPACE_ID::_Type_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>(
PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance()); PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance());
} }
class Type::HasBitSetters { class Type::_Internal {
public: public:
static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Type* msg); static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Type* msg);
}; };
const PROTOBUF_NAMESPACE_ID::SourceContext& const PROTOBUF_NAMESPACE_ID::SourceContext&
Type::HasBitSetters::source_context(const Type* msg) { Type::_Internal::source_context(const Type* msg) {
return *msg->source_context_; return *msg->source_context_;
} }
void Type::unsafe_arena_set_allocated_source_context( void Type::unsafe_arena_set_allocated_source_context(
@ -420,7 +420,7 @@ Type::Type(const Type& from)
options_(from.options_) { options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(), name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
@ -728,7 +728,7 @@ void Type::SerializeWithCachedSizes(
// .google.protobuf.SourceContext source_context = 5; // .google.protobuf.SourceContext source_context = 5;
if (this->has_source_context()) { if (this->has_source_context()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
5, HasBitSetters::source_context(this), output); 5, _Internal::source_context(this), output);
} }
// .google.protobuf.Syntax syntax = 6; // .google.protobuf.Syntax syntax = 6;
@ -791,7 +791,7 @@ void Type::SerializeWithCachedSizes(
if (this->has_source_context()) { if (this->has_source_context()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
5, HasBitSetters::source_context(this), target); 5, _Internal::source_context(this), target);
} }
// .google.protobuf.Syntax syntax = 6; // .google.protobuf.Syntax syntax = 6;
@ -970,7 +970,7 @@ void Type::InternalSwap(Type* other) {
void Field::InitAsDefaultInstance() { void Field::InitAsDefaultInstance() {
} }
class Field::HasBitSetters { class Field::_Internal {
public: public:
}; };
@ -1006,22 +1006,22 @@ Field::Field(const Field& from)
options_(from.options_) { options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(), name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.type_url().size() > 0) { if (!from.type_url().empty()) {
type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url(), type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_url(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); json_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.json_name().size() > 0) { if (!from.json_name().empty()) {
json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_name(), json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_name(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); default_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.default_value().size() > 0) { if (!from.default_value().empty()) {
default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.default_value(), default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.default_value(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
@ -1751,13 +1751,13 @@ void Enum::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Enum_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>( PROTOBUF_NAMESPACE_ID::_Enum_default_instance_._instance.get_mutable()->source_context_ = const_cast< PROTOBUF_NAMESPACE_ID::SourceContext*>(
PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance()); PROTOBUF_NAMESPACE_ID::SourceContext::internal_default_instance());
} }
class Enum::HasBitSetters { class Enum::_Internal {
public: public:
static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Enum* msg); static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Enum* msg);
}; };
const PROTOBUF_NAMESPACE_ID::SourceContext& const PROTOBUF_NAMESPACE_ID::SourceContext&
Enum::HasBitSetters::source_context(const Enum* msg) { Enum::_Internal::source_context(const Enum* msg) {
return *msg->source_context_; return *msg->source_context_;
} }
void Enum::unsafe_arena_set_allocated_source_context( void Enum::unsafe_arena_set_allocated_source_context(
@ -1808,7 +1808,7 @@ Enum::Enum(const Enum& from)
options_(from.options_) { options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(), name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
@ -2077,7 +2077,7 @@ void Enum::SerializeWithCachedSizes(
// .google.protobuf.SourceContext source_context = 4; // .google.protobuf.SourceContext source_context = 4;
if (this->has_source_context()) { if (this->has_source_context()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
4, HasBitSetters::source_context(this), output); 4, _Internal::source_context(this), output);
} }
// .google.protobuf.Syntax syntax = 5; // .google.protobuf.Syntax syntax = 5;
@ -2130,7 +2130,7 @@ void Enum::SerializeWithCachedSizes(
if (this->has_source_context()) { if (this->has_source_context()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
4, HasBitSetters::source_context(this), target); 4, _Internal::source_context(this), target);
} }
// .google.protobuf.Syntax syntax = 5; // .google.protobuf.Syntax syntax = 5;
@ -2299,7 +2299,7 @@ void Enum::InternalSwap(Enum* other) {
void EnumValue::InitAsDefaultInstance() { void EnumValue::InitAsDefaultInstance() {
} }
class EnumValue::HasBitSetters { class EnumValue::_Internal {
public: public:
}; };
@ -2328,7 +2328,7 @@ EnumValue::EnumValue(const EnumValue& from)
options_(from.options_) { options_(from.options_) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(), name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
@ -2710,13 +2710,13 @@ void Option::InitAsDefaultInstance() {
PROTOBUF_NAMESPACE_ID::_Option_default_instance_._instance.get_mutable()->value_ = const_cast< PROTOBUF_NAMESPACE_ID::Any*>( PROTOBUF_NAMESPACE_ID::_Option_default_instance_._instance.get_mutable()->value_ = const_cast< PROTOBUF_NAMESPACE_ID::Any*>(
PROTOBUF_NAMESPACE_ID::Any::internal_default_instance()); PROTOBUF_NAMESPACE_ID::Any::internal_default_instance());
} }
class Option::HasBitSetters { class Option::_Internal {
public: public:
static const PROTOBUF_NAMESPACE_ID::Any& value(const Option* msg); static const PROTOBUF_NAMESPACE_ID::Any& value(const Option* msg);
}; };
const PROTOBUF_NAMESPACE_ID::Any& const PROTOBUF_NAMESPACE_ID::Any&
Option::HasBitSetters::value(const Option* msg) { Option::_Internal::value(const Option* msg) {
return *msg->value_; return *msg->value_;
} }
void Option::unsafe_arena_set_allocated_value( void Option::unsafe_arena_set_allocated_value(
@ -2760,7 +2760,7 @@ Option::Option(const Option& from)
_internal_metadata_(nullptr) { _internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) { if (!from.name().empty()) {
name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(), name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
@ -2937,7 +2937,7 @@ void Option::SerializeWithCachedSizes(
// .google.protobuf.Any value = 2; // .google.protobuf.Any value = 2;
if (this->has_value()) { if (this->has_value()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2, HasBitSetters::value(this), output); 2, _Internal::value(this), output);
} }
if (_internal_metadata_.have_unknown_fields()) { if (_internal_metadata_.have_unknown_fields()) {
@ -2968,7 +2968,7 @@ void Option::SerializeWithCachedSizes(
if (this->has_value()) { if (this->has_value()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessageToArray( InternalWriteMessageToArray(
2, HasBitSetters::value(this), target); 2, _Internal::value(this), target);
} }
if (_internal_metadata_.have_unknown_fields()) { if (_internal_metadata_.have_unknown_fields()) {

@ -383,7 +383,7 @@ class PROTOBUF_EXPORT Type :
// @@protoc_insertion_point(class_scope:google.protobuf.Type) // @@protoc_insertion_point(class_scope:google.protobuf.Type)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -747,7 +747,7 @@ class PROTOBUF_EXPORT Field :
// @@protoc_insertion_point(class_scope:google.protobuf.Field) // @@protoc_insertion_point(class_scope:google.protobuf.Field)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -954,7 +954,7 @@ class PROTOBUF_EXPORT Enum :
// @@protoc_insertion_point(class_scope:google.protobuf.Enum) // @@protoc_insertion_point(class_scope:google.protobuf.Enum)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1132,7 +1132,7 @@ class PROTOBUF_EXPORT EnumValue :
// @@protoc_insertion_point(class_scope:google.protobuf.EnumValue) // @@protoc_insertion_point(class_scope:google.protobuf.EnumValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1302,7 +1302,7 @@ class PROTOBUF_EXPORT Option :
// @@protoc_insertion_point(class_scope:google.protobuf.Option) // @@protoc_insertion_point(class_scope:google.protobuf.Option)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

@ -49,10 +49,12 @@ class JsonObjectWriterTest : public ::testing::Test {
out_stream_(new CodedOutputStream(str_stream_)), out_stream_(new CodedOutputStream(str_stream_)),
ow_(nullptr) {} ow_(nullptr) {}
virtual ~JsonObjectWriterTest() { ~JsonObjectWriterTest() override { delete ow_; }
delete ow_;
std::string CloseStreamAndGetString() {
delete out_stream_; delete out_stream_;
delete str_stream_; delete str_stream_;
return output_;
} }
std::string output_; std::string output_;
@ -64,7 +66,7 @@ class JsonObjectWriterTest : public ::testing::Test {
TEST_F(JsonObjectWriterTest, EmptyRootObject) { TEST_F(JsonObjectWriterTest, EmptyRootObject) {
ow_ = new JsonObjectWriter("", out_stream_); ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->EndObject(); ow_->StartObject("")->EndObject();
EXPECT_EQ("{}", output_.substr(0, out_stream_->ByteCount())); EXPECT_EQ("{}", CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, EmptyObject) { TEST_F(JsonObjectWriterTest, EmptyObject) {
@ -74,14 +76,13 @@ TEST_F(JsonObjectWriterTest, EmptyObject) {
->StartObject("empty") ->StartObject("empty")
->EndObject() ->EndObject()
->EndObject(); ->EndObject();
EXPECT_EQ("{\"test\":\"value\",\"empty\":{}}", EXPECT_EQ("{\"test\":\"value\",\"empty\":{}}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, EmptyRootList) { TEST_F(JsonObjectWriterTest, EmptyRootList) {
ow_ = new JsonObjectWriter("", out_stream_); ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartList("")->EndList(); ow_->StartList("")->EndList();
EXPECT_EQ("[]", output_.substr(0, out_stream_->ByteCount())); EXPECT_EQ("[]", CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, EmptyList) { TEST_F(JsonObjectWriterTest, EmptyList) {
@ -91,14 +92,13 @@ TEST_F(JsonObjectWriterTest, EmptyList) {
->StartList("empty") ->StartList("empty")
->EndList() ->EndList()
->EndObject(); ->EndObject();
EXPECT_EQ("{\"test\":\"value\",\"empty\":[]}", EXPECT_EQ("{\"test\":\"value\",\"empty\":[]}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, EmptyObjectKey) { TEST_F(JsonObjectWriterTest, EmptyObjectKey) {
ow_ = new JsonObjectWriter("", out_stream_); ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->RenderString("", "value")->EndObject(); ow_->StartObject("")->RenderString("", "value")->EndObject();
EXPECT_EQ("{\"\":\"value\"}", output_.substr(0, out_stream_->ByteCount())); EXPECT_EQ("{\"\":\"value\"}", CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, ObjectInObject) { TEST_F(JsonObjectWriterTest, ObjectInObject) {
@ -108,8 +108,7 @@ TEST_F(JsonObjectWriterTest, ObjectInObject) {
->RenderString("field", "value") ->RenderString("field", "value")
->EndObject() ->EndObject()
->EndObject(); ->EndObject();
EXPECT_EQ("{\"nested\":{\"field\":\"value\"}}", EXPECT_EQ("{\"nested\":{\"field\":\"value\"}}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, ListInObject) { TEST_F(JsonObjectWriterTest, ListInObject) {
@ -119,8 +118,7 @@ TEST_F(JsonObjectWriterTest, ListInObject) {
->RenderString("", "value") ->RenderString("", "value")
->EndList() ->EndList()
->EndObject(); ->EndObject();
EXPECT_EQ("{\"nested\":[\"value\"]}", EXPECT_EQ("{\"nested\":[\"value\"]}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, ObjectInList) { TEST_F(JsonObjectWriterTest, ObjectInList) {
@ -130,8 +128,7 @@ TEST_F(JsonObjectWriterTest, ObjectInList) {
->RenderString("field", "value") ->RenderString("field", "value")
->EndObject() ->EndObject()
->EndList(); ->EndList();
EXPECT_EQ("[{\"field\":\"value\"}]", EXPECT_EQ("[{\"field\":\"value\"}]", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, ListInList) { TEST_F(JsonObjectWriterTest, ListInList) {
@ -141,7 +138,7 @@ TEST_F(JsonObjectWriterTest, ListInList) {
->RenderString("", "value") ->RenderString("", "value")
->EndList() ->EndList()
->EndList(); ->EndList();
EXPECT_EQ("[[\"value\"]]", output_.substr(0, out_stream_->ByteCount())); EXPECT_EQ("[[\"value\"]]", CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, RenderPrimitives) { TEST_F(JsonObjectWriterTest, RenderPrimitives) {
@ -171,7 +168,7 @@ TEST_F(JsonObjectWriterTest, RenderPrimitives) {
"\"string\":\"string\"," "\"string\":\"string\","
"\"emptybytes\":\"\"," "\"emptybytes\":\"\","
"\"emptystring\":\"\"}", "\"emptystring\":\"\"}",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, BytesEncodesAsNonWebSafeBase64) { TEST_F(JsonObjectWriterTest, BytesEncodesAsNonWebSafeBase64) {
@ -181,8 +178,7 @@ TEST_F(JsonObjectWriterTest, BytesEncodesAsNonWebSafeBase64) {
ow_ = new JsonObjectWriter("", out_stream_); ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->RenderBytes("bytes", s)->EndObject(); ow_->StartObject("")->RenderBytes("bytes", s)->EndObject();
// Non-web-safe would encode this as "/+8=" // Non-web-safe would encode this as "/+8="
EXPECT_EQ("{\"bytes\":\"/+8=\"}", EXPECT_EQ("{\"bytes\":\"/+8=\"}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, PrettyPrintList) { TEST_F(JsonObjectWriterTest, PrettyPrintList) {
@ -205,7 +201,7 @@ TEST_F(JsonObjectWriterTest, PrettyPrintList) {
" ],\n" " ],\n"
" \"empty\": []\n" " \"empty\": []\n"
"}\n", "}\n",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, PrettyPrintObject) { TEST_F(JsonObjectWriterTest, PrettyPrintObject) {
@ -228,7 +224,7 @@ TEST_F(JsonObjectWriterTest, PrettyPrintObject) {
" },\n" " },\n"
" \"empty\": {}\n" " \"empty\": {}\n"
"}\n", "}\n",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, PrettyPrintEmptyObjectInEmptyList) { TEST_F(JsonObjectWriterTest, PrettyPrintEmptyObjectInEmptyList) {
@ -245,7 +241,7 @@ TEST_F(JsonObjectWriterTest, PrettyPrintEmptyObjectInEmptyList) {
" {}\n" " {}\n"
" ]\n" " ]\n"
"}\n", "}\n",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, PrettyPrintDoubleIndent) { TEST_F(JsonObjectWriterTest, PrettyPrintDoubleIndent) {
@ -259,14 +255,14 @@ TEST_F(JsonObjectWriterTest, PrettyPrintDoubleIndent) {
" \"bool\": true,\n" " \"bool\": true,\n"
" \"int\": 42\n" " \"int\": 42\n"
"}\n", "}\n",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, StringsEscapedAndEnclosedInDoubleQuotes) { TEST_F(JsonObjectWriterTest, StringsEscapedAndEnclosedInDoubleQuotes) {
ow_ = new JsonObjectWriter("", out_stream_); ow_ = new JsonObjectWriter("", out_stream_);
ow_->StartObject("")->RenderString("string", "'<>&amp;\\\"\r\n")->EndObject(); ow_->StartObject("")->RenderString("string", "'<>&amp;\\\"\r\n")->EndObject();
EXPECT_EQ("{\"string\":\"'\\u003c\\u003e&amp;\\\\\\\"\\r\\n\"}", EXPECT_EQ("{\"string\":\"'\\u003c\\u003e&amp;\\\\\\\"\\r\\n\"}",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, Stringification) { TEST_F(JsonObjectWriterTest, Stringification) {
@ -286,7 +282,7 @@ TEST_F(JsonObjectWriterTest, Stringification) {
"\"float_pos\":\"Infinity\"," "\"float_pos\":\"Infinity\","
"\"double_neg\":\"-Infinity\"," "\"double_neg\":\"-Infinity\","
"\"float_neg\":\"-Infinity\"}", "\"float_neg\":\"-Infinity\"}",
output_.substr(0, out_stream_->ByteCount())); CloseStreamAndGetString());
} }
TEST_F(JsonObjectWriterTest, TestRegularByteEncoding) { TEST_F(JsonObjectWriterTest, TestRegularByteEncoding) {
@ -297,8 +293,7 @@ TEST_F(JsonObjectWriterTest, TestRegularByteEncoding) {
// Test that we get regular (non websafe) base64 encoding on byte fields by // Test that we get regular (non websafe) base64 encoding on byte fields by
// default. // default.
EXPECT_EQ("{\"bytes\":\"A+/A\"}", EXPECT_EQ("{\"bytes\":\"A+/A\"}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
TEST_F(JsonObjectWriterTest, TestWebsafeByteEncoding) { TEST_F(JsonObjectWriterTest, TestWebsafeByteEncoding) {
@ -309,8 +304,7 @@ TEST_F(JsonObjectWriterTest, TestWebsafeByteEncoding) {
->EndObject(); ->EndObject();
// Test that we get websafe base64 encoding when explicitly asked. // Test that we get websafe base64 encoding when explicitly asked.
EXPECT_EQ("{\"bytes\":\"A-_AEA==\"}", EXPECT_EQ("{\"bytes\":\"A-_AEA==\"}", CloseStreamAndGetString());
output_.substr(0, out_stream_->ByteCount()));
} }
} // namespace converter } // namespace converter

@ -307,7 +307,7 @@ PROTOBUF_NAMESPACE_OPEN
void DoubleValue::InitAsDefaultInstance() { void DoubleValue::InitAsDefaultInstance() {
} }
class DoubleValue::HasBitSetters { class DoubleValue::_Internal {
public: public:
}; };
@ -592,7 +592,7 @@ void DoubleValue::InternalSwap(DoubleValue* other) {
void FloatValue::InitAsDefaultInstance() { void FloatValue::InitAsDefaultInstance() {
} }
class FloatValue::HasBitSetters { class FloatValue::_Internal {
public: public:
}; };
@ -877,7 +877,7 @@ void FloatValue::InternalSwap(FloatValue* other) {
void Int64Value::InitAsDefaultInstance() { void Int64Value::InitAsDefaultInstance() {
} }
class Int64Value::HasBitSetters { class Int64Value::_Internal {
public: public:
}; };
@ -1164,7 +1164,7 @@ void Int64Value::InternalSwap(Int64Value* other) {
void UInt64Value::InitAsDefaultInstance() { void UInt64Value::InitAsDefaultInstance() {
} }
class UInt64Value::HasBitSetters { class UInt64Value::_Internal {
public: public:
}; };
@ -1451,7 +1451,7 @@ void UInt64Value::InternalSwap(UInt64Value* other) {
void Int32Value::InitAsDefaultInstance() { void Int32Value::InitAsDefaultInstance() {
} }
class Int32Value::HasBitSetters { class Int32Value::_Internal {
public: public:
}; };
@ -1738,7 +1738,7 @@ void Int32Value::InternalSwap(Int32Value* other) {
void UInt32Value::InitAsDefaultInstance() { void UInt32Value::InitAsDefaultInstance() {
} }
class UInt32Value::HasBitSetters { class UInt32Value::_Internal {
public: public:
}; };
@ -2025,7 +2025,7 @@ void UInt32Value::InternalSwap(UInt32Value* other) {
void BoolValue::InitAsDefaultInstance() { void BoolValue::InitAsDefaultInstance() {
} }
class BoolValue::HasBitSetters { class BoolValue::_Internal {
public: public:
}; };
@ -2310,7 +2310,7 @@ void BoolValue::InternalSwap(BoolValue* other) {
void StringValue::InitAsDefaultInstance() { void StringValue::InitAsDefaultInstance() {
} }
class StringValue::HasBitSetters { class StringValue::_Internal {
public: public:
}; };
@ -2335,7 +2335,7 @@ StringValue::StringValue(const StringValue& from)
_internal_metadata_(nullptr) { _internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.value().size() > 0) { if (!from.value().empty()) {
value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value(), value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }
@ -2617,7 +2617,7 @@ void StringValue::InternalSwap(StringValue* other) {
void BytesValue::InitAsDefaultInstance() { void BytesValue::InitAsDefaultInstance() {
} }
class BytesValue::HasBitSetters { class BytesValue::_Internal {
public: public:
}; };
@ -2642,7 +2642,7 @@ BytesValue::BytesValue(const BytesValue& from)
_internal_metadata_(nullptr) { _internal_metadata_(nullptr) {
_internal_metadata_.MergeFrom(from._internal_metadata_); _internal_metadata_.MergeFrom(from._internal_metadata_);
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from.value().size() > 0) { if (!from.value().empty()) {
value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value(), value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value(),
GetArenaNoVirtual()); GetArenaNoVirtual());
} }

@ -227,7 +227,7 @@ class PROTOBUF_EXPORT DoubleValue :
// @@protoc_insertion_point(class_scope:google.protobuf.DoubleValue) // @@protoc_insertion_point(class_scope:google.protobuf.DoubleValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -368,7 +368,7 @@ class PROTOBUF_EXPORT FloatValue :
// @@protoc_insertion_point(class_scope:google.protobuf.FloatValue) // @@protoc_insertion_point(class_scope:google.protobuf.FloatValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -509,7 +509,7 @@ class PROTOBUF_EXPORT Int64Value :
// @@protoc_insertion_point(class_scope:google.protobuf.Int64Value) // @@protoc_insertion_point(class_scope:google.protobuf.Int64Value)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -650,7 +650,7 @@ class PROTOBUF_EXPORT UInt64Value :
// @@protoc_insertion_point(class_scope:google.protobuf.UInt64Value) // @@protoc_insertion_point(class_scope:google.protobuf.UInt64Value)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -791,7 +791,7 @@ class PROTOBUF_EXPORT Int32Value :
// @@protoc_insertion_point(class_scope:google.protobuf.Int32Value) // @@protoc_insertion_point(class_scope:google.protobuf.Int32Value)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -932,7 +932,7 @@ class PROTOBUF_EXPORT UInt32Value :
// @@protoc_insertion_point(class_scope:google.protobuf.UInt32Value) // @@protoc_insertion_point(class_scope:google.protobuf.UInt32Value)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1073,7 +1073,7 @@ class PROTOBUF_EXPORT BoolValue :
// @@protoc_insertion_point(class_scope:google.protobuf.BoolValue) // @@protoc_insertion_point(class_scope:google.protobuf.BoolValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1229,7 +1229,7 @@ class PROTOBUF_EXPORT StringValue :
// @@protoc_insertion_point(class_scope:google.protobuf.StringValue) // @@protoc_insertion_point(class_scope:google.protobuf.StringValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
@ -1385,7 +1385,7 @@ class PROTOBUF_EXPORT BytesValue :
// @@protoc_insertion_point(class_scope:google.protobuf.BytesValue) // @@protoc_insertion_point(class_scope:google.protobuf.BytesValue)
private: private:
class HasBitSetters; class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;

Loading…
Cancel
Save