From f77065d4eb4a1a266d0ea6f3df544d0cce86281b Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 15 Jun 2020 11:48:47 -0700 Subject: [PATCH] Sync from Piper @316511779 PROTOBUF_SYNC_PIPER --- CHANGES.txt | 32 +- Protobuf.podspec | 2 +- conformance/failure_list_csharp.txt | 1 - conformance/failure_list_python.txt | 30 - conformance/failure_list_python_cpp.txt | 13 - csharp/Google.Protobuf.Tools.nuspec | 2 +- csharp/src/AddressBook/Addressbook.cs | 92 +- .../BenchmarkMessage1Proto3.cs | 286 +- .../Google.Protobuf.Benchmarks/Benchmarks.cs | 31 +- .../ParseMessagesBenchmark.cs | 39 + .../WrapperBenchmarkMessages.cs | 1773 +++++++-- .../Conformance.cs | 155 +- .../Google.Protobuf.Conformance/Program.cs | 52 +- .../MapUnittestProto3.cs | 288 +- .../TestMessagesProto2.cs | 778 +++- .../TestMessagesProto3.cs | 771 +++- .../Unittest.cs | 3539 ++++++++++++++++- .../UnittestCustomOptionsProto3.cs | 477 ++- .../UnittestImport.cs | 23 +- .../UnittestImportProto3.cs | 23 +- .../UnittestImportPublic.cs | 23 +- .../UnittestImportPublicProto3.cs | 23 +- .../UnittestIssue6936B.cs | 19 +- .../UnittestIssue6936C.cs | 26 +- .../UnittestIssues.cs | 359 +- .../UnittestProto3.cs | 1379 ++++++- .../UnittestProto3Optional.cs | 132 +- .../UnittestSelfreferentialOptions.cs | 29 +- .../UnittestWellKnownTypes.cs | 470 ++- .../Google.Protobuf.Test/ByteStringTest.cs | 16 + .../Collections/RepeatedFieldTest.cs | 89 + .../Google.Protobuf.Test/JsonFormatterTest.cs | 58 +- .../Google.Protobuf.Test/JsonParserTest.cs | 11 + .../ReadOnlySequenceFactory.cs | 4 +- .../RefStructCompatibilityTest.cs | 119 + csharp/src/Google.Protobuf/ByteString.cs | 19 +- .../Collections/RepeatedField.cs | 45 +- .../Google.Protobuf/Google.Protobuf.csproj | 1 + csharp/src/Google.Protobuf/JsonFormatter.cs | 37 +- .../Google.Protobuf/Reflection/Descriptor.cs | 1082 ++++- .../src/Google.Protobuf/WellKnownTypes/Any.cs | 27 +- .../src/Google.Protobuf/WellKnownTypes/Api.cs | 124 +- .../WellKnownTypes/Duration.cs | 27 +- .../Google.Protobuf/WellKnownTypes/Empty.cs | 19 +- .../WellKnownTypes/FieldMask.cs | 23 +- .../WellKnownTypes/SourceContext.cs | 23 +- .../Google.Protobuf/WellKnownTypes/Struct.cs | 100 +- .../WellKnownTypes/Timestamp.cs | 27 +- .../Google.Protobuf/WellKnownTypes/Type.cs | 208 +- .../WellKnownTypes/Wrappers.cs | 207 +- docs/third_party.md | 1 + java/bom/pom.xml | 2 +- java/core/pom.xml | 2 +- java/lite/pom.xml | 2 +- java/pom.xml | 2 +- java/util/pom.xml | 2 +- .../google/protobuf/util/FieldMaskTree.java | 47 +- .../google/protobuf/util/FieldMaskUtil.java | 10 + .../protobuf/util/FieldMaskTreeTest.java | 40 +- .../protobuf/util/FieldMaskUtilTest.java | 18 + .../objectivec_cocoapods_integration/build.sh | 1 + kokoro/macos/prepare_build_macos_rc | 63 +- kokoro/macos/python/build.sh | 1 + kokoro/macos/python_cpp/build.sh | 1 + kokoro/macos/ruby23/build.sh | 2 + kokoro/macos/ruby24/build.sh | 2 + kokoro/macos/ruby25/build.sh | 2 + kokoro/macos/ruby26/build.sh | 2 + kokoro/macos/ruby27/build.sh | 2 + objectivec/GPBDescriptor_PackagePrivate.h | 21 +- objectivec/README.md | 6 + php/composer.json | 4 +- php/ext/google/protobuf/message.c | 2 +- php/ext/google/protobuf/package.xml | 22 +- php/ext/google/protobuf/protobuf.h | 4 +- php/tests/compile_extension.sh | 5 +- php/tests/generate_protos.sh | 16 + php/tests/generated_class_test.php | 17 +- php/tests/test.sh | 20 +- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/internal/decoder.py | 32 +- python/google/protobuf/internal/encoder.py | 10 +- .../protobuf/internal/json_format_test.py | 54 +- .../google/protobuf/internal/message_test.py | 11 + .../protobuf/internal/python_message.py | 15 +- python/google/protobuf/json_format.py | 34 +- python/google/protobuf/pyext/descriptor.cc | 2 +- python/google/protobuf/pyext/descriptor.h | 3 + .../protobuf/pyext/descriptor_containers.cc | 34 +- .../google/protobuf/pyext/descriptor_pool.cc | 18 +- .../google/protobuf/pyext/extension_dict.cc | 4 +- python/google/protobuf/pyext/message.cc | 17 +- python/release.sh | 12 +- ruby/google-protobuf.gemspec | 2 +- src/google/protobuf/any.pb.h | 2 +- src/google/protobuf/api.pb.h | 6 +- .../compiler/command_line_interface.cc | 1 + .../command_line_interface_unittest.cc | 26 +- .../protobuf/compiler/cpp/cpp_message.cc | 2 +- .../compiler/csharp/csharp_field_base.cc | 6 + .../compiler/csharp/csharp_field_base.h | 1 + .../compiler/csharp/csharp_generator.cc | 2 +- .../compiler/csharp/csharp_generator.h | 2 +- .../compiler/csharp/csharp_map_field.cc | 8 +- .../compiler/csharp/csharp_map_field.h | 1 + .../compiler/csharp/csharp_message.cc | 43 +- .../protobuf/compiler/csharp/csharp_message.h | 1 + .../csharp/csharp_repeated_enum_field.cc | 8 +- .../csharp/csharp_repeated_enum_field.h | 1 + .../csharp/csharp_repeated_message_field.cc | 8 +- .../csharp/csharp_repeated_message_field.h | 1 + .../csharp/csharp_repeated_primitive_field.cc | 8 +- .../csharp/csharp_repeated_primitive_field.h | 1 + .../compiler/csharp/csharp_wrapper_field.cc | 25 +- .../compiler/csharp/csharp_wrapper_field.h | 2 + src/google/protobuf/compiler/main.cc | 6 +- .../compiler/objectivec/objectivec_file.cc | 57 +- .../compiler/objectivec/objectivec_file.h | 2 +- .../objectivec/objectivec_generator.cc | 7 + .../objectivec/objectivec_generator.h | 2 +- .../compiler/objectivec/objectivec_helpers.cc | 86 +- .../compiler/objectivec/objectivec_helpers.h | 11 +- src/google/protobuf/compiler/plugin.pb.h | 8 +- .../compiler/python/python_generator.cc | 11 +- .../protobuf/compiler/ruby/ruby_generator.h | 2 +- src/google/protobuf/descriptor.pb.h | 54 +- src/google/protobuf/duration.pb.h | 2 +- src/google/protobuf/empty.pb.h | 2 +- src/google/protobuf/field_mask.pb.h | 2 +- src/google/protobuf/map_entry_lite.h | 9 +- src/google/protobuf/map_type_handler.h | 6 +- src/google/protobuf/repeated_field.h | 64 +- .../protobuf/repeated_field_unittest.cc | 8 + src/google/protobuf/source_context.pb.h | 2 +- src/google/protobuf/struct.pb.h | 6 +- src/google/protobuf/timestamp.pb.h | 2 +- src/google/protobuf/type.pb.h | 10 +- .../util/internal/json_stream_parser.cc | 4 +- .../protobuf/util/internal/proto_writer.cc | 4 +- src/google/protobuf/util/internal/utility.cc | 9 +- src/google/protobuf/wrappers.pb.h | 18 +- tests.sh | 82 +- 142 files changed, 13217 insertions(+), 1116 deletions(-) create mode 100644 csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs create mode 100755 php/tests/generate_protos.sh diff --git a/CHANGES.txt b/CHANGES.txt index 43be322ca2..0f540f7752 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,12 +1,42 @@ Unreleased Changes C++: + * Removed deprecated unsafe arena string accessors * Enabled heterogeneous lookup for std::string keys in maps. - * Improved the randomness of map ordering. + * Removed implicit conversion from StringPiece to std::string + * Fix use-after-destroy bug when the Map is allocated in the arena. + * Improved the randomness of map ordering + * Added stack overflow protection for text format with unknown fields + * Use std::hash for proto maps to help with portability. + * Added more Windows macros to proto whitelist. + * Arena constructors for map entry messages are now marked "explicit" + (for regular messages they were already explicit). Python: + * Reject lowercase t for Timestamp json format. Fixes a conformance test. * Improved the error message when AttributeError is returned from __getattr__ in EnumTypeWrapper. + * Json format will print full_name directly for extensions. + + Java: + * Fixed a bug where setting optional proto3 enums with setFooValue() would + not mark the value as present. + + C#: + * Dropped support for netstandard1.0 (replaced by support for netstandard1.1). + This was required to modernize the parsing stack to use the `Span` + type internally. (#7351) + * Add `ParseFrom(ReadOnlySequence)` method to enable GC friendly + parsing with reduced allocations and buffer copies. (#7351) + * Add `GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE` define to make + generated code compatible with old C# compilers (pre-roslyn compilers + from .NET framework and old versions of mono) that do not support + ref structs. (#7490) + +2020-06-01 version 3.12.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Objective-C + * Tweak the union used for Extensions to support old generated code. #7573 2020-05-26 version 3.12.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) diff --git a/Protobuf.podspec b/Protobuf.podspec index a05b712326..3b7a716761 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '3.12.2' + s.version = '3.12.3' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/protocolbuffers/protobuf' s.license = '3-Clause BSD License' diff --git a/conformance/failure_list_csharp.txt b/conformance/failure_list_csharp.txt index f82f0f2d49..31bdf25ebf 100644 --- a/conformance/failure_list_csharp.txt +++ b/conformance/failure_list_csharp.txt @@ -1,4 +1,3 @@ Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator Recommended.Proto2.JsonInput.FieldNameExtension.Validator diff --git a/conformance/failure_list_python.txt b/conformance/failure_list_python.txt index 3f7a811874..e69de29bb2 100644 --- a/conformance/failure_list_python.txt +++ b/conformance/failure_list_python.txt @@ -1,30 +0,0 @@ -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[0].ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldTooSmall -Required.Proto3.JsonInput.FloatFieldTooLarge -Required.Proto3.JsonInput.FloatFieldTooSmall -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool diff --git a/conformance/failure_list_python_cpp.txt b/conformance/failure_list_python_cpp.txt index df16455ab5..9efb6cf8b7 100644 --- a/conformance/failure_list_python_cpp.txt +++ b/conformance/failure_list_python_cpp.txt @@ -6,16 +6,3 @@ # # TODO(haberman): insert links to corresponding bugs tracking the issue. # Should we use GitHub issues or the Google-internal bug tracker? - -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted -Required.Proto3.JsonInput.DoubleFieldTooSmall -Required.Proto3.JsonInput.FloatFieldTooLarge -Required.Proto3.JsonInput.FloatFieldTooSmall -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 50aca1b506..d0c088f2a1 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,7 +5,7 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.12.2 + 3.12.3 Google Inc. protobuf-packages https://github.com/protocolbuffers/protobuf/blob/master/LICENSE diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 3b1da4d613..1b1c1b6c1f 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -49,7 +49,11 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// [START messages] /// - public sealed partial class Person : pb::IMessage, pb::IBufferMessage { + public sealed partial class Person : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Person()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -256,9 +260,44 @@ namespace Google.Protobuf.Examples.AddressBook { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + Id = input.ReadInt32(); + break; + } + case 26: { + Email = input.ReadString(); + break; + } + case 34: { + phones_.AddEntriesFrom(input, _repeated_phones_codec); + break; + } + case 42: { + if (lastUpdated_ == null) { + LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(LastUpdated); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -293,6 +332,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } } + #endif #region Nested types /// Container for nested types declared in the Person message type. @@ -304,7 +344,11 @@ namespace Google.Protobuf.Examples.AddressBook { [pbr::OriginalName("WORK")] Work = 2, } - public sealed partial class PhoneNumber : pb::IMessage, pb::IBufferMessage { + public sealed partial class PhoneNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhoneNumber()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -441,9 +485,29 @@ namespace Google.Protobuf.Examples.AddressBook { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Number = input.ReadString(); + break; + } + case 16: { + Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -463,6 +527,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } } + #endif } @@ -474,7 +539,11 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// Our address book file is just one of these. /// - public sealed partial class AddressBook : pb::IMessage, pb::IBufferMessage { + public sealed partial class AddressBook : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -579,9 +648,25 @@ namespace Google.Protobuf.Examples.AddressBook { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + people_.AddEntriesFrom(input, _repeated_people_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -597,6 +682,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs index 291a585ca8..6a213346a6 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs @@ -64,7 +64,11 @@ namespace Benchmarks.Proto3 { } #region Messages - public sealed partial class GoogleMessage1 : pb::IMessage, pb::IBufferMessage { + public sealed partial class GoogleMessage1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1132,9 +1136,189 @@ namespace Benchmarks.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Field1 = input.ReadString(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 34: { + Field4 = input.ReadString(); + break; + } + case 42: + case 41: { + field5_.AddEntriesFrom(input, _repeated_field5_codec); + break; + } + case 48: { + Field6 = input.ReadInt32(); + break; + } + case 58: { + Field7 = input.ReadString(); + break; + } + case 74: { + Field9 = input.ReadString(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadBool(); + break; + } + case 112: { + Field14 = input.ReadBool(); + break; + } + case 122: { + if (field15_ == null) { + Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage(); + } + input.ReadMessage(Field15); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 136: { + Field17 = input.ReadBool(); + break; + } + case 146: { + Field18 = input.ReadString(); + break; + } + case 176: { + Field22 = input.ReadInt64(); + break; + } + case 184: { + Field23 = input.ReadInt32(); + break; + } + case 192: { + Field24 = input.ReadBool(); + break; + } + case 200: { + Field25 = input.ReadInt32(); + break; + } + case 232: { + Field29 = input.ReadInt32(); + break; + } + case 240: { + Field30 = input.ReadBool(); + break; + } + case 472: { + Field59 = input.ReadBool(); + break; + } + case 480: { + Field60 = input.ReadInt32(); + break; + } + case 536: { + Field67 = input.ReadInt32(); + break; + } + case 544: { + Field68 = input.ReadInt32(); + break; + } + case 624: { + Field78 = input.ReadBool(); + break; + } + case 640: { + Field80 = input.ReadBool(); + break; + } + case 648: { + Field81 = input.ReadBool(); + break; + } + case 800: { + Field100 = input.ReadInt32(); + break; + } + case 808: { + Field101 = input.ReadInt32(); + break; + } + case 818: { + Field102 = input.ReadString(); + break; + } + case 826: { + Field103 = input.ReadString(); + break; + } + case 832: { + Field104 = input.ReadInt32(); + break; + } + case 1024: { + Field128 = input.ReadInt32(); + break; + } + case 1034: { + Field129 = input.ReadString(); + break; + } + case 1040: { + Field130 = input.ReadInt32(); + break; + } + case 1048: { + Field131 = input.ReadInt32(); + break; + } + case 1200: { + Field150 = input.ReadInt32(); + break; + } + case 2168: { + Field271 = input.ReadInt32(); + break; + } + case 2176: { + Field272 = input.ReadInt32(); + break; + } + case 2240: { + Field280 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1314,10 +1498,15 @@ namespace Benchmarks.Proto3 { } } } + #endif } - public sealed partial class GoogleMessage1SubMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class GoogleMessage1SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1886,9 +2075,101 @@ namespace Benchmarks.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Field1 = input.ReadInt32(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadInt64(); + break; + } + case 112: { + Field14 = input.ReadInt64(); + break; + } + case 122: { + Field15 = input.ReadString(); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 152: { + Field19 = input.ReadInt32(); + break; + } + case 160: { + Field20 = input.ReadBool(); + break; + } + case 169: { + Field21 = input.ReadFixed64(); + break; + } + case 176: { + Field22 = input.ReadInt32(); + break; + } + case 184: { + Field23 = input.ReadBool(); + break; + } + case 224: { + Field28 = input.ReadBool(); + break; + } + case 1629: { + Field203 = input.ReadFixed32(); + break; + } + case 1632: { + Field204 = input.ReadInt32(); + break; + } + case 1642: { + Field205 = input.ReadString(); + break; + } + case 1648: { + Field206 = input.ReadBool(); + break; + } + case 1656: { + Field207 = input.ReadUInt64(); + break; + } + case 2400: { + Field300 = input.ReadUInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1980,6 +2261,7 @@ namespace Benchmarks.Proto3 { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs index 456edbf41c..ce2248aed6 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs @@ -38,7 +38,11 @@ namespace Benchmarks { } #region Messages - public sealed partial class BenchmarkDataset : pb::IMessage, pb::IBufferMessage { + public sealed partial class BenchmarkDataset : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BenchmarkDataset()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -219,9 +223,33 @@ namespace Benchmarks { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + MessageName = input.ReadString(); + break; + } + case 26: { + payload_.AddEntriesFrom(input, _repeated_payload_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -245,6 +273,7 @@ namespace Benchmarks { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs index 30f3e9ef37..92c3dbe5f0 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs @@ -37,6 +37,7 @@ using System.IO; using System.Linq; using System.Buffers; using Google.Protobuf.WellKnownTypes; +using Benchmarks.Proto3; namespace Google.Protobuf.Benchmarks { @@ -50,6 +51,7 @@ namespace Google.Protobuf.Benchmarks SubTest manyWrapperFieldsTest = new SubTest(CreateManyWrapperFieldsMessage(), ManyWrapperFieldsMessage.Parser, () => new ManyWrapperFieldsMessage(), MaxMessages); SubTest manyPrimitiveFieldsTest = new SubTest(CreateManyPrimitiveFieldsMessage(), ManyPrimitiveFieldsMessage.Parser, () => new ManyPrimitiveFieldsMessage(), MaxMessages); + SubTest repeatedFieldTest = new SubTest(CreateRepeatedFieldMessage(), GoogleMessage1.Parser, () => new GoogleMessage1(), MaxMessages); SubTest emptyMessageTest = new SubTest(new Empty(), Empty.Parser, () => new Empty(), MaxMessages); public IEnumerable MessageCountValues => new[] { 10, 100 }; @@ -83,6 +85,18 @@ namespace Google.Protobuf.Benchmarks return manyPrimitiveFieldsTest.ParseFromReadOnlySequence(); } + [Benchmark] + public IMessage RepeatedFieldMessage_ParseFromByteArray() + { + return repeatedFieldTest.ParseFromByteArray(); + } + + [Benchmark] + public IMessage RepeatedFieldMessage_ParseFromReadOnlySequence() + { + return repeatedFieldTest.ParseFromReadOnlySequence(); + } + [Benchmark] public IMessage EmptyMessage_ParseFromByteArray() { @@ -123,6 +137,20 @@ namespace Google.Protobuf.Benchmarks manyPrimitiveFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); } + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void RepeatedFieldMessage_ParseDelimitedMessagesFromByteArray(int messageCount) + { + repeatedFieldTest.ParseDelimitedMessagesFromByteArray(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void RepeatedFieldMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + repeatedFieldTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + private static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage() { // Example data match data of an internal benchmarks @@ -157,6 +185,17 @@ namespace Google.Protobuf.Benchmarks }; } + private static GoogleMessage1 CreateRepeatedFieldMessage() + { + // Message with a repeated fixed length item collection + var message = new GoogleMessage1(); + for (ulong i = 0; i < 1000; i++) + { + message.Field5.Add(i); + } + return message; + } + private class SubTest { private readonly IMessage message; diff --git a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs index 76e95d6edf..95f613e1ba 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs @@ -237,7 +237,11 @@ namespace Google.Protobuf.Benchmarks { /// a message that has a large number of wrapper fields /// obfuscated version of an internal message /// - public sealed partial class ManyWrapperFieldsMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class ManyWrapperFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyWrapperFieldsMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3303,439 +3307,437 @@ namespace Google.Protobuf.Benchmarks { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - double? value = _single_doubleField1_codec.Read(ref input); + double? value = _single_doubleField1_codec.Read(input); if (doubleField1_ == null || value != 0D) { DoubleField1 = value; } break; } case 18: { - long? value = _single_int64Field2_codec.Read(ref input); + long? value = _single_int64Field2_codec.Read(input); if (int64Field2_ == null || value != 0L) { Int64Field2 = value; } break; } case 26: { - long? value = _single_int64Field3_codec.Read(ref input); + long? value = _single_int64Field3_codec.Read(input); if (int64Field3_ == null || value != 0L) { Int64Field3 = value; } break; } case 34: { - long? value = _single_int64Field4_codec.Read(ref input); + long? value = _single_int64Field4_codec.Read(input); if (int64Field4_ == null || value != 0L) { Int64Field4 = value; } break; } case 58: { - double? value = _single_doubleField7_codec.Read(ref input); + double? value = _single_doubleField7_codec.Read(input); if (doubleField7_ == null || value != 0D) { DoubleField7 = value; } break; } case 66: { - double? value = _single_doubleField8_codec.Read(ref input); + double? value = _single_doubleField8_codec.Read(input); if (doubleField8_ == null || value != 0D) { DoubleField8 = value; } break; } case 74: { - double? value = _single_doubleField9_codec.Read(ref input); + double? value = _single_doubleField9_codec.Read(input); if (doubleField9_ == null || value != 0D) { DoubleField9 = value; } break; } case 82: { - double? value = _single_doubleField10_codec.Read(ref input); + double? value = _single_doubleField10_codec.Read(input); if (doubleField10_ == null || value != 0D) { DoubleField10 = value; } break; } case 90: { - double? value = _single_doubleField11_codec.Read(ref input); + double? value = _single_doubleField11_codec.Read(input); if (doubleField11_ == null || value != 0D) { DoubleField11 = value; } break; } case 114: { - double? value = _single_doubleField14_codec.Read(ref input); + double? value = _single_doubleField14_codec.Read(input); if (doubleField14_ == null || value != 0D) { DoubleField14 = value; } break; } case 122: { - double? value = _single_doubleField15_codec.Read(ref input); + double? value = _single_doubleField15_codec.Read(input); if (doubleField15_ == null || value != 0D) { DoubleField15 = value; } break; } case 154: { - long? value = _single_int64Field19_codec.Read(ref input); + long? value = _single_int64Field19_codec.Read(input); if (int64Field19_ == null || value != 0L) { Int64Field19 = value; } break; } case 162: { - double? value = _single_doubleField20_codec.Read(ref input); + double? value = _single_doubleField20_codec.Read(input); if (doubleField20_ == null || value != 0D) { DoubleField20 = value; } break; } case 170: { - double? value = _single_doubleField21_codec.Read(ref input); + double? value = _single_doubleField21_codec.Read(input); if (doubleField21_ == null || value != 0D) { DoubleField21 = value; } break; } case 178: { - double? value = _single_doubleField22_codec.Read(ref input); + double? value = _single_doubleField22_codec.Read(input); if (doubleField22_ == null || value != 0D) { DoubleField22 = value; } break; } case 202: { - double? value = _single_doubleField25_codec.Read(ref input); + double? value = _single_doubleField25_codec.Read(input); if (doubleField25_ == null || value != 0D) { DoubleField25 = value; } break; } case 210: { - long? value = _single_int64Field26_codec.Read(ref input); + long? value = _single_int64Field26_codec.Read(input); if (int64Field26_ == null || value != 0L) { Int64Field26 = value; } break; } case 226: { - double? value = _single_doubleField28_codec.Read(ref input); + double? value = _single_doubleField28_codec.Read(input); if (doubleField28_ == null || value != 0D) { DoubleField28 = value; } break; } case 234: { - double? value = _single_doubleField29_codec.Read(ref input); + double? value = _single_doubleField29_codec.Read(input); if (doubleField29_ == null || value != 0D) { DoubleField29 = value; } break; } case 242: { - double? value = _single_doubleField30_codec.Read(ref input); + double? value = _single_doubleField30_codec.Read(input); if (doubleField30_ == null || value != 0D) { DoubleField30 = value; } break; } case 250: { - double? value = _single_doubleField31_codec.Read(ref input); + double? value = _single_doubleField31_codec.Read(input); if (doubleField31_ == null || value != 0D) { DoubleField31 = value; } break; } case 258: { - long? value = _single_int64Field32_codec.Read(ref input); + long? value = _single_int64Field32_codec.Read(input); if (int64Field32_ == null || value != 0L) { Int64Field32 = value; } break; } case 298: { - long? value = _single_int64Field37_codec.Read(ref input); + long? value = _single_int64Field37_codec.Read(input); if (int64Field37_ == null || value != 0L) { Int64Field37 = value; } break; } case 306: { - double? value = _single_doubleField38_codec.Read(ref input); + double? value = _single_doubleField38_codec.Read(input); if (doubleField38_ == null || value != 0D) { DoubleField38 = value; } break; } case 314: { - long? value = _single_interactions_codec.Read(ref input); + long? value = _single_interactions_codec.Read(input); if (interactions_ == null || value != 0L) { Interactions = value; } break; } case 322: { - double? value = _single_doubleField40_codec.Read(ref input); + double? value = _single_doubleField40_codec.Read(input); if (doubleField40_ == null || value != 0D) { DoubleField40 = value; } break; } case 330: { - long? value = _single_int64Field41_codec.Read(ref input); + long? value = _single_int64Field41_codec.Read(input); if (int64Field41_ == null || value != 0L) { Int64Field41 = value; } break; } case 338: { - double? value = _single_doubleField42_codec.Read(ref input); + double? value = _single_doubleField42_codec.Read(input); if (doubleField42_ == null || value != 0D) { DoubleField42 = value; } break; } case 346: { - long? value = _single_int64Field43_codec.Read(ref input); + long? value = _single_int64Field43_codec.Read(input); if (int64Field43_ == null || value != 0L) { Int64Field43 = value; } break; } case 354: { - long? value = _single_int64Field44_codec.Read(ref input); + long? value = _single_int64Field44_codec.Read(input); if (int64Field44_ == null || value != 0L) { Int64Field44 = value; } break; } case 362: { - double? value = _single_doubleField45_codec.Read(ref input); + double? value = _single_doubleField45_codec.Read(input); if (doubleField45_ == null || value != 0D) { DoubleField45 = value; } break; } case 370: { - double? value = _single_doubleField46_codec.Read(ref input); + double? value = _single_doubleField46_codec.Read(input); if (doubleField46_ == null || value != 0D) { DoubleField46 = value; } break; } case 378: { - double? value = _single_doubleField47_codec.Read(ref input); + double? value = _single_doubleField47_codec.Read(input); if (doubleField47_ == null || value != 0D) { DoubleField47 = value; } break; } case 386: { - double? value = _single_doubleField48_codec.Read(ref input); + double? value = _single_doubleField48_codec.Read(input); if (doubleField48_ == null || value != 0D) { DoubleField48 = value; } break; } case 394: { - double? value = _single_doubleField49_codec.Read(ref input); + double? value = _single_doubleField49_codec.Read(input); if (doubleField49_ == null || value != 0D) { DoubleField49 = value; } break; } case 402: { - double? value = _single_doubleField50_codec.Read(ref input); + double? value = _single_doubleField50_codec.Read(input); if (doubleField50_ == null || value != 0D) { DoubleField50 = value; } break; } case 410: { - double? value = _single_doubleField51_codec.Read(ref input); + double? value = _single_doubleField51_codec.Read(input); if (doubleField51_ == null || value != 0D) { DoubleField51 = value; } break; } case 418: { - double? value = _single_doubleField52_codec.Read(ref input); + double? value = _single_doubleField52_codec.Read(input); if (doubleField52_ == null || value != 0D) { DoubleField52 = value; } break; } case 426: { - double? value = _single_doubleField53_codec.Read(ref input); + double? value = _single_doubleField53_codec.Read(input); if (doubleField53_ == null || value != 0D) { DoubleField53 = value; } break; } case 434: { - double? value = _single_doubleField54_codec.Read(ref input); + double? value = _single_doubleField54_codec.Read(input); if (doubleField54_ == null || value != 0D) { DoubleField54 = value; } break; } case 442: { - double? value = _single_doubleField55_codec.Read(ref input); + double? value = _single_doubleField55_codec.Read(input); if (doubleField55_ == null || value != 0D) { DoubleField55 = value; } break; } case 450: { - double? value = _single_doubleField56_codec.Read(ref input); + double? value = _single_doubleField56_codec.Read(input); if (doubleField56_ == null || value != 0D) { DoubleField56 = value; } break; } case 458: { - double? value = _single_doubleField57_codec.Read(ref input); + double? value = _single_doubleField57_codec.Read(input); if (doubleField57_ == null || value != 0D) { DoubleField57 = value; } break; } case 466: { - double? value = _single_doubleField58_codec.Read(ref input); + double? value = _single_doubleField58_codec.Read(input); if (doubleField58_ == null || value != 0D) { DoubleField58 = value; } break; } case 474: { - long? value = _single_int64Field59_codec.Read(ref input); + long? value = _single_int64Field59_codec.Read(input); if (int64Field59_ == null || value != 0L) { Int64Field59 = value; } break; } case 482: { - long? value = _single_int64Field60_codec.Read(ref input); + long? value = _single_int64Field60_codec.Read(input); if (int64Field60_ == null || value != 0L) { Int64Field60 = value; } break; } case 498: { - double? value = _single_doubleField62_codec.Read(ref input); + double? value = _single_doubleField62_codec.Read(input); if (doubleField62_ == null || value != 0D) { DoubleField62 = value; } break; } case 522: { - double? value = _single_doubleField65_codec.Read(ref input); + double? value = _single_doubleField65_codec.Read(input); if (doubleField65_ == null || value != 0D) { DoubleField65 = value; } break; } case 530: { - double? value = _single_doubleField66_codec.Read(ref input); + double? value = _single_doubleField66_codec.Read(input); if (doubleField66_ == null || value != 0D) { DoubleField66 = value; } break; } case 538: { - double? value = _single_doubleField67_codec.Read(ref input); + double? value = _single_doubleField67_codec.Read(input); if (doubleField67_ == null || value != 0D) { DoubleField67 = value; } break; } case 546: { - double? value = _single_doubleField68_codec.Read(ref input); + double? value = _single_doubleField68_codec.Read(input); if (doubleField68_ == null || value != 0D) { DoubleField68 = value; } break; } case 554: { - double? value = _single_doubleField69_codec.Read(ref input); + double? value = _single_doubleField69_codec.Read(input); if (doubleField69_ == null || value != 0D) { DoubleField69 = value; } break; } case 562: { - double? value = _single_doubleField70_codec.Read(ref input); + double? value = _single_doubleField70_codec.Read(input); if (doubleField70_ == null || value != 0D) { DoubleField70 = value; } break; } case 570: { - double? value = _single_doubleField71_codec.Read(ref input); + double? value = _single_doubleField71_codec.Read(input); if (doubleField71_ == null || value != 0D) { DoubleField71 = value; } break; } case 578: { - double? value = _single_doubleField72_codec.Read(ref input); + double? value = _single_doubleField72_codec.Read(input); if (doubleField72_ == null || value != 0D) { DoubleField72 = value; } break; } case 586: { - string value = _single_stringField73_codec.Read(ref input); + string value = _single_stringField73_codec.Read(input); if (stringField73_ == null || value != "") { StringField73 = value; } break; } case 594: { - string value = _single_stringField74_codec.Read(ref input); + string value = _single_stringField74_codec.Read(input); if (stringField74_ == null || value != "") { StringField74 = value; } break; } case 602: { - double? value = _single_doubleField75_codec.Read(ref input); + double? value = _single_doubleField75_codec.Read(input); if (doubleField75_ == null || value != 0D) { DoubleField75 = value; } break; } case 618: { - double? value = _single_doubleField77_codec.Read(ref input); + double? value = _single_doubleField77_codec.Read(input); if (doubleField77_ == null || value != 0D) { DoubleField77 = value; } break; } case 626: { - double? value = _single_doubleField78_codec.Read(ref input); + double? value = _single_doubleField78_codec.Read(input); if (doubleField78_ == null || value != 0D) { DoubleField78 = value; } break; } case 634: { - double? value = _single_doubleField79_codec.Read(ref input); + double? value = _single_doubleField79_codec.Read(input); if (doubleField79_ == null || value != 0D) { DoubleField79 = value; } @@ -3750,7 +3752,7 @@ namespace Google.Protobuf.Benchmarks { break; } case 658: { - long? value = _single_int64Field82_codec.Read(ref input); + long? value = _single_int64Field82_codec.Read(input); if (int64Field82_ == null || value != 0L) { Int64Field82 = value; } @@ -3761,112 +3763,112 @@ namespace Google.Protobuf.Benchmarks { break; } case 674: { - double? value = _single_doubleField84_codec.Read(ref input); + double? value = _single_doubleField84_codec.Read(input); if (doubleField84_ == null || value != 0D) { DoubleField84 = value; } break; } case 682: { - long? value = _single_int64Field85_codec.Read(ref input); + long? value = _single_int64Field85_codec.Read(input); if (int64Field85_ == null || value != 0L) { Int64Field85 = value; } break; } case 690: { - long? value = _single_int64Field86_codec.Read(ref input); + long? value = _single_int64Field86_codec.Read(input); if (int64Field86_ == null || value != 0L) { Int64Field86 = value; } break; } case 698: { - long? value = _single_int64Field87_codec.Read(ref input); + long? value = _single_int64Field87_codec.Read(input); if (int64Field87_ == null || value != 0L) { Int64Field87 = value; } break; } case 706: { - double? value = _single_doubleField88_codec.Read(ref input); + double? value = _single_doubleField88_codec.Read(input); if (doubleField88_ == null || value != 0D) { DoubleField88 = value; } break; } case 714: { - double? value = _single_doubleField89_codec.Read(ref input); + double? value = _single_doubleField89_codec.Read(input); if (doubleField89_ == null || value != 0D) { DoubleField89 = value; } break; } case 722: { - double? value = _single_doubleField90_codec.Read(ref input); + double? value = _single_doubleField90_codec.Read(input); if (doubleField90_ == null || value != 0D) { DoubleField90 = value; } break; } case 730: { - double? value = _single_doubleField91_codec.Read(ref input); + double? value = _single_doubleField91_codec.Read(input); if (doubleField91_ == null || value != 0D) { DoubleField91 = value; } break; } case 738: { - double? value = _single_doubleField92_codec.Read(ref input); + double? value = _single_doubleField92_codec.Read(input); if (doubleField92_ == null || value != 0D) { DoubleField92 = value; } break; } case 746: { - double? value = _single_doubleField93_codec.Read(ref input); + double? value = _single_doubleField93_codec.Read(input); if (doubleField93_ == null || value != 0D) { DoubleField93 = value; } break; } case 754: { - double? value = _single_doubleField94_codec.Read(ref input); + double? value = _single_doubleField94_codec.Read(input); if (doubleField94_ == null || value != 0D) { DoubleField94 = value; } break; } case 762: { - double? value = _single_doubleField95_codec.Read(ref input); + double? value = _single_doubleField95_codec.Read(input); if (doubleField95_ == null || value != 0D) { DoubleField95 = value; } break; } case 770: { - double? value = _single_doubleField96_codec.Read(ref input); + double? value = _single_doubleField96_codec.Read(input); if (doubleField96_ == null || value != 0D) { DoubleField96 = value; } break; } case 778: { - double? value = _single_doubleField97_codec.Read(ref input); + double? value = _single_doubleField97_codec.Read(input); if (doubleField97_ == null || value != 0D) { DoubleField97 = value; } break; } case 786: { - double? value = _single_doubleField98_codec.Read(ref input); + double? value = _single_doubleField98_codec.Read(input); if (doubleField98_ == null || value != 0D) { DoubleField98 = value; } break; } case 794: { - double? value = _single_doubleField99_codec.Read(ref input); + double? value = _single_doubleField99_codec.Read(input); if (doubleField99_ == null || value != 0D) { DoubleField99 = value; } @@ -3874,207 +3876,207 @@ namespace Google.Protobuf.Benchmarks { } case 802: case 800: { - repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec); + repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec); break; } case 810: { - double? value = _single_doubleField101_codec.Read(ref input); + double? value = _single_doubleField101_codec.Read(input); if (doubleField101_ == null || value != 0D) { DoubleField101 = value; } break; } case 818: { - double? value = _single_doubleField102_codec.Read(ref input); + double? value = _single_doubleField102_codec.Read(input); if (doubleField102_ == null || value != 0D) { DoubleField102 = value; } break; } case 826: { - double? value = _single_doubleField103_codec.Read(ref input); + double? value = _single_doubleField103_codec.Read(input); if (doubleField103_ == null || value != 0D) { DoubleField103 = value; } break; } case 834: { - double? value = _single_doubleField104_codec.Read(ref input); + double? value = _single_doubleField104_codec.Read(input); if (doubleField104_ == null || value != 0D) { DoubleField104 = value; } break; } case 842: { - double? value = _single_doubleField105_codec.Read(ref input); + double? value = _single_doubleField105_codec.Read(input); if (doubleField105_ == null || value != 0D) { DoubleField105 = value; } break; } case 850: { - double? value = _single_doubleField106_codec.Read(ref input); + double? value = _single_doubleField106_codec.Read(input); if (doubleField106_ == null || value != 0D) { DoubleField106 = value; } break; } case 858: { - long? value = _single_int64Field107_codec.Read(ref input); + long? value = _single_int64Field107_codec.Read(input); if (int64Field107_ == null || value != 0L) { Int64Field107 = value; } break; } case 866: { - double? value = _single_doubleField108_codec.Read(ref input); + double? value = _single_doubleField108_codec.Read(input); if (doubleField108_ == null || value != 0D) { DoubleField108 = value; } break; } case 874: { - double? value = _single_doubleField109_codec.Read(ref input); + double? value = _single_doubleField109_codec.Read(input); if (doubleField109_ == null || value != 0D) { DoubleField109 = value; } break; } case 882: { - long? value = _single_int64Field110_codec.Read(ref input); + long? value = _single_int64Field110_codec.Read(input); if (int64Field110_ == null || value != 0L) { Int64Field110 = value; } break; } case 890: { - double? value = _single_doubleField111_codec.Read(ref input); + double? value = _single_doubleField111_codec.Read(input); if (doubleField111_ == null || value != 0D) { DoubleField111 = value; } break; } case 898: { - long? value = _single_int64Field112_codec.Read(ref input); + long? value = _single_int64Field112_codec.Read(input); if (int64Field112_ == null || value != 0L) { Int64Field112 = value; } break; } case 906: { - double? value = _single_doubleField113_codec.Read(ref input); + double? value = _single_doubleField113_codec.Read(input); if (doubleField113_ == null || value != 0D) { DoubleField113 = value; } break; } case 914: { - long? value = _single_int64Field114_codec.Read(ref input); + long? value = _single_int64Field114_codec.Read(input); if (int64Field114_ == null || value != 0L) { Int64Field114 = value; } break; } case 922: { - long? value = _single_int64Field115_codec.Read(ref input); + long? value = _single_int64Field115_codec.Read(input); if (int64Field115_ == null || value != 0L) { Int64Field115 = value; } break; } case 930: { - double? value = _single_doubleField116_codec.Read(ref input); + double? value = _single_doubleField116_codec.Read(input); if (doubleField116_ == null || value != 0D) { DoubleField116 = value; } break; } case 938: { - long? value = _single_int64Field117_codec.Read(ref input); + long? value = _single_int64Field117_codec.Read(input); if (int64Field117_ == null || value != 0L) { Int64Field117 = value; } break; } case 946: { - double? value = _single_doubleField118_codec.Read(ref input); + double? value = _single_doubleField118_codec.Read(input); if (doubleField118_ == null || value != 0D) { DoubleField118 = value; } break; } case 954: { - double? value = _single_doubleField119_codec.Read(ref input); + double? value = _single_doubleField119_codec.Read(input); if (doubleField119_ == null || value != 0D) { DoubleField119 = value; } break; } case 962: { - double? value = _single_doubleField120_codec.Read(ref input); + double? value = _single_doubleField120_codec.Read(input); if (doubleField120_ == null || value != 0D) { DoubleField120 = value; } break; } case 970: { - double? value = _single_doubleField121_codec.Read(ref input); + double? value = _single_doubleField121_codec.Read(input); if (doubleField121_ == null || value != 0D) { DoubleField121 = value; } break; } case 978: { - double? value = _single_doubleField122_codec.Read(ref input); + double? value = _single_doubleField122_codec.Read(input); if (doubleField122_ == null || value != 0D) { DoubleField122 = value; } break; } case 986: { - double? value = _single_doubleField123_codec.Read(ref input); + double? value = _single_doubleField123_codec.Read(input); if (doubleField123_ == null || value != 0D) { DoubleField123 = value; } break; } case 994: { - double? value = _single_doubleField124_codec.Read(ref input); + double? value = _single_doubleField124_codec.Read(input); if (doubleField124_ == null || value != 0D) { DoubleField124 = value; } break; } case 1002: { - long? value = _single_int64Field125_codec.Read(ref input); + long? value = _single_int64Field125_codec.Read(input); if (int64Field125_ == null || value != 0L) { Int64Field125 = value; } break; } case 1010: { - long? value = _single_int64Field126_codec.Read(ref input); + long? value = _single_int64Field126_codec.Read(input); if (int64Field126_ == null || value != 0L) { Int64Field126 = value; } break; } case 1018: { - long? value = _single_int64Field127_codec.Read(ref input); + long? value = _single_int64Field127_codec.Read(input); if (int64Field127_ == null || value != 0L) { Int64Field127 = value; } break; } case 1026: { - double? value = _single_doubleField128_codec.Read(ref input); + double? value = _single_doubleField128_codec.Read(input); if (doubleField128_ == null || value != 0D) { DoubleField128 = value; } break; } case 1034: { - double? value = _single_doubleField129_codec.Read(ref input); + double? value = _single_doubleField129_codec.Read(input); if (doubleField129_ == null || value != 0D) { DoubleField129 = value; } @@ -4082,153 +4084,938 @@ namespace Google.Protobuf.Benchmarks { } } } + #endif } - } - - /// - /// same as ManyWrapperFieldsMessages, but with primitive fields - /// for comparison. - /// - public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage, pb::IBufferMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyPrimitiveFieldsMessage()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManyPrimitiveFieldsMessage() { - OnConstruction(); - } - - partial void OnConstruction(); - + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManyPrimitiveFieldsMessage(ManyPrimitiveFieldsMessage other) : this() { - doubleField95_ = other.doubleField95_; - doubleField1_ = other.doubleField1_; - doubleField79_ = other.doubleField79_; - int64Field2_ = other.int64Field2_; - doubleField96_ = other.doubleField96_; - int64Field3_ = other.int64Field3_; - int64Field4_ = other.int64Field4_; - doubleField97_ = other.doubleField97_; - doubleField65_ = other.doubleField65_; - doubleField66_ = other.doubleField66_; - doubleField7_ = other.doubleField7_; - doubleField62_ = other.doubleField62_; - doubleField118_ = other.doubleField118_; - doubleField119_ = other.doubleField119_; - doubleField67_ = other.doubleField67_; - doubleField120_ = other.doubleField120_; - doubleField121_ = other.doubleField121_; - doubleField122_ = other.doubleField122_; - doubleField123_ = other.doubleField123_; - doubleField124_ = other.doubleField124_; - doubleField8_ = other.doubleField8_; - doubleField9_ = other.doubleField9_; - doubleField98_ = other.doubleField98_; - doubleField10_ = other.doubleField10_; - doubleField11_ = other.doubleField11_; - doubleField99_ = other.doubleField99_; - doubleField84_ = other.doubleField84_; - doubleField14_ = other.doubleField14_; - doubleField77_ = other.doubleField77_; - doubleField15_ = other.doubleField15_; - int64Field19_ = other.int64Field19_; - int64Field115_ = other.int64Field115_; - doubleField116_ = other.doubleField116_; - int64Field117_ = other.int64Field117_; - doubleField20_ = other.doubleField20_; - doubleField21_ = other.doubleField21_; - stringField73_ = other.stringField73_; - stringField74_ = other.stringField74_; - doubleField22_ = other.doubleField22_; - doubleField69_ = other.doubleField69_; - doubleField70_ = other.doubleField70_; - doubleField71_ = other.doubleField71_; - doubleField72_ = other.doubleField72_; - doubleField25_ = other.doubleField25_; - int64Field26_ = other.int64Field26_; - doubleField68_ = other.doubleField68_; - doubleField28_ = other.doubleField28_; - doubleField106_ = other.doubleField106_; - doubleField29_ = other.doubleField29_; - doubleField30_ = other.doubleField30_; - doubleField101_ = other.doubleField101_; - doubleField102_ = other.doubleField102_; - doubleField103_ = other.doubleField103_; - doubleField104_ = other.doubleField104_; - doubleField105_ = other.doubleField105_; - doubleField31_ = other.doubleField31_; - int64Field32_ = other.int64Field32_; - doubleField75_ = other.doubleField75_; - doubleField129_ = other.doubleField129_; - enumField80_ = other.enumField80_; - enumField81_ = other.enumField81_; - int64Field82_ = other.int64Field82_; - enumField83_ = other.enumField83_; - int64Field85_ = other.int64Field85_; - int64Field86_ = other.int64Field86_; - int64Field87_ = other.int64Field87_; - int64Field125_ = other.int64Field125_; - int64Field37_ = other.int64Field37_; - doubleField38_ = other.doubleField38_; - interactions_ = other.interactions_; - repeatedIntField100_ = other.repeatedIntField100_.Clone(); - doubleField40_ = other.doubleField40_; - int64Field41_ = other.int64Field41_; - int64Field126_ = other.int64Field126_; - int64Field127_ = other.int64Field127_; - doubleField128_ = other.doubleField128_; - doubleField109_ = other.doubleField109_; - int64Field110_ = other.int64Field110_; - doubleField111_ = other.doubleField111_; - int64Field112_ = other.int64Field112_; - doubleField113_ = other.doubleField113_; - int64Field114_ = other.int64Field114_; - doubleField42_ = other.doubleField42_; - int64Field43_ = other.int64Field43_; - int64Field44_ = other.int64Field44_; - doubleField45_ = other.doubleField45_; - doubleField46_ = other.doubleField46_; - doubleField78_ = other.doubleField78_; - doubleField88_ = other.doubleField88_; - doubleField47_ = other.doubleField47_; - doubleField89_ = other.doubleField89_; - doubleField48_ = other.doubleField48_; - doubleField49_ = other.doubleField49_; - doubleField50_ = other.doubleField50_; - doubleField90_ = other.doubleField90_; - doubleField51_ = other.doubleField51_; - doubleField91_ = other.doubleField91_; - doubleField92_ = other.doubleField92_; - int64Field107_ = other.int64Field107_; - doubleField93_ = other.doubleField93_; - doubleField108_ = other.doubleField108_; - doubleField52_ = other.doubleField52_; - doubleField53_ = other.doubleField53_; - doubleField94_ = other.doubleField94_; - doubleField54_ = other.doubleField54_; - doubleField55_ = other.doubleField55_; - doubleField56_ = other.doubleField56_; - doubleField57_ = other.doubleField57_; - doubleField58_ = other.doubleField58_; - int64Field59_ = other.int64Field59_; - int64Field60_ = other.int64Field60_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + double? value = _single_doubleField1_codec.Read(ref input); + if (doubleField1_ == null || value != 0D) { + DoubleField1 = value; + } + break; + } + case 18: { + long? value = _single_int64Field2_codec.Read(ref input); + if (int64Field2_ == null || value != 0L) { + Int64Field2 = value; + } + break; + } + case 26: { + long? value = _single_int64Field3_codec.Read(ref input); + if (int64Field3_ == null || value != 0L) { + Int64Field3 = value; + } + break; + } + case 34: { + long? value = _single_int64Field4_codec.Read(ref input); + if (int64Field4_ == null || value != 0L) { + Int64Field4 = value; + } + break; + } + case 58: { + double? value = _single_doubleField7_codec.Read(ref input); + if (doubleField7_ == null || value != 0D) { + DoubleField7 = value; + } + break; + } + case 66: { + double? value = _single_doubleField8_codec.Read(ref input); + if (doubleField8_ == null || value != 0D) { + DoubleField8 = value; + } + break; + } + case 74: { + double? value = _single_doubleField9_codec.Read(ref input); + if (doubleField9_ == null || value != 0D) { + DoubleField9 = value; + } + break; + } + case 82: { + double? value = _single_doubleField10_codec.Read(ref input); + if (doubleField10_ == null || value != 0D) { + DoubleField10 = value; + } + break; + } + case 90: { + double? value = _single_doubleField11_codec.Read(ref input); + if (doubleField11_ == null || value != 0D) { + DoubleField11 = value; + } + break; + } + case 114: { + double? value = _single_doubleField14_codec.Read(ref input); + if (doubleField14_ == null || value != 0D) { + DoubleField14 = value; + } + break; + } + case 122: { + double? value = _single_doubleField15_codec.Read(ref input); + if (doubleField15_ == null || value != 0D) { + DoubleField15 = value; + } + break; + } + case 154: { + long? value = _single_int64Field19_codec.Read(ref input); + if (int64Field19_ == null || value != 0L) { + Int64Field19 = value; + } + break; + } + case 162: { + double? value = _single_doubleField20_codec.Read(ref input); + if (doubleField20_ == null || value != 0D) { + DoubleField20 = value; + } + break; + } + case 170: { + double? value = _single_doubleField21_codec.Read(ref input); + if (doubleField21_ == null || value != 0D) { + DoubleField21 = value; + } + break; + } + case 178: { + double? value = _single_doubleField22_codec.Read(ref input); + if (doubleField22_ == null || value != 0D) { + DoubleField22 = value; + } + break; + } + case 202: { + double? value = _single_doubleField25_codec.Read(ref input); + if (doubleField25_ == null || value != 0D) { + DoubleField25 = value; + } + break; + } + case 210: { + long? value = _single_int64Field26_codec.Read(ref input); + if (int64Field26_ == null || value != 0L) { + Int64Field26 = value; + } + break; + } + case 226: { + double? value = _single_doubleField28_codec.Read(ref input); + if (doubleField28_ == null || value != 0D) { + DoubleField28 = value; + } + break; + } + case 234: { + double? value = _single_doubleField29_codec.Read(ref input); + if (doubleField29_ == null || value != 0D) { + DoubleField29 = value; + } + break; + } + case 242: { + double? value = _single_doubleField30_codec.Read(ref input); + if (doubleField30_ == null || value != 0D) { + DoubleField30 = value; + } + break; + } + case 250: { + double? value = _single_doubleField31_codec.Read(ref input); + if (doubleField31_ == null || value != 0D) { + DoubleField31 = value; + } + break; + } + case 258: { + long? value = _single_int64Field32_codec.Read(ref input); + if (int64Field32_ == null || value != 0L) { + Int64Field32 = value; + } + break; + } + case 298: { + long? value = _single_int64Field37_codec.Read(ref input); + if (int64Field37_ == null || value != 0L) { + Int64Field37 = value; + } + break; + } + case 306: { + double? value = _single_doubleField38_codec.Read(ref input); + if (doubleField38_ == null || value != 0D) { + DoubleField38 = value; + } + break; + } + case 314: { + long? value = _single_interactions_codec.Read(ref input); + if (interactions_ == null || value != 0L) { + Interactions = value; + } + break; + } + case 322: { + double? value = _single_doubleField40_codec.Read(ref input); + if (doubleField40_ == null || value != 0D) { + DoubleField40 = value; + } + break; + } + case 330: { + long? value = _single_int64Field41_codec.Read(ref input); + if (int64Field41_ == null || value != 0L) { + Int64Field41 = value; + } + break; + } + case 338: { + double? value = _single_doubleField42_codec.Read(ref input); + if (doubleField42_ == null || value != 0D) { + DoubleField42 = value; + } + break; + } + case 346: { + long? value = _single_int64Field43_codec.Read(ref input); + if (int64Field43_ == null || value != 0L) { + Int64Field43 = value; + } + break; + } + case 354: { + long? value = _single_int64Field44_codec.Read(ref input); + if (int64Field44_ == null || value != 0L) { + Int64Field44 = value; + } + break; + } + case 362: { + double? value = _single_doubleField45_codec.Read(ref input); + if (doubleField45_ == null || value != 0D) { + DoubleField45 = value; + } + break; + } + case 370: { + double? value = _single_doubleField46_codec.Read(ref input); + if (doubleField46_ == null || value != 0D) { + DoubleField46 = value; + } + break; + } + case 378: { + double? value = _single_doubleField47_codec.Read(ref input); + if (doubleField47_ == null || value != 0D) { + DoubleField47 = value; + } + break; + } + case 386: { + double? value = _single_doubleField48_codec.Read(ref input); + if (doubleField48_ == null || value != 0D) { + DoubleField48 = value; + } + break; + } + case 394: { + double? value = _single_doubleField49_codec.Read(ref input); + if (doubleField49_ == null || value != 0D) { + DoubleField49 = value; + } + break; + } + case 402: { + double? value = _single_doubleField50_codec.Read(ref input); + if (doubleField50_ == null || value != 0D) { + DoubleField50 = value; + } + break; + } + case 410: { + double? value = _single_doubleField51_codec.Read(ref input); + if (doubleField51_ == null || value != 0D) { + DoubleField51 = value; + } + break; + } + case 418: { + double? value = _single_doubleField52_codec.Read(ref input); + if (doubleField52_ == null || value != 0D) { + DoubleField52 = value; + } + break; + } + case 426: { + double? value = _single_doubleField53_codec.Read(ref input); + if (doubleField53_ == null || value != 0D) { + DoubleField53 = value; + } + break; + } + case 434: { + double? value = _single_doubleField54_codec.Read(ref input); + if (doubleField54_ == null || value != 0D) { + DoubleField54 = value; + } + break; + } + case 442: { + double? value = _single_doubleField55_codec.Read(ref input); + if (doubleField55_ == null || value != 0D) { + DoubleField55 = value; + } + break; + } + case 450: { + double? value = _single_doubleField56_codec.Read(ref input); + if (doubleField56_ == null || value != 0D) { + DoubleField56 = value; + } + break; + } + case 458: { + double? value = _single_doubleField57_codec.Read(ref input); + if (doubleField57_ == null || value != 0D) { + DoubleField57 = value; + } + break; + } + case 466: { + double? value = _single_doubleField58_codec.Read(ref input); + if (doubleField58_ == null || value != 0D) { + DoubleField58 = value; + } + break; + } + case 474: { + long? value = _single_int64Field59_codec.Read(ref input); + if (int64Field59_ == null || value != 0L) { + Int64Field59 = value; + } + break; + } + case 482: { + long? value = _single_int64Field60_codec.Read(ref input); + if (int64Field60_ == null || value != 0L) { + Int64Field60 = value; + } + break; + } + case 498: { + double? value = _single_doubleField62_codec.Read(ref input); + if (doubleField62_ == null || value != 0D) { + DoubleField62 = value; + } + break; + } + case 522: { + double? value = _single_doubleField65_codec.Read(ref input); + if (doubleField65_ == null || value != 0D) { + DoubleField65 = value; + } + break; + } + case 530: { + double? value = _single_doubleField66_codec.Read(ref input); + if (doubleField66_ == null || value != 0D) { + DoubleField66 = value; + } + break; + } + case 538: { + double? value = _single_doubleField67_codec.Read(ref input); + if (doubleField67_ == null || value != 0D) { + DoubleField67 = value; + } + break; + } + case 546: { + double? value = _single_doubleField68_codec.Read(ref input); + if (doubleField68_ == null || value != 0D) { + DoubleField68 = value; + } + break; + } + case 554: { + double? value = _single_doubleField69_codec.Read(ref input); + if (doubleField69_ == null || value != 0D) { + DoubleField69 = value; + } + break; + } + case 562: { + double? value = _single_doubleField70_codec.Read(ref input); + if (doubleField70_ == null || value != 0D) { + DoubleField70 = value; + } + break; + } + case 570: { + double? value = _single_doubleField71_codec.Read(ref input); + if (doubleField71_ == null || value != 0D) { + DoubleField71 = value; + } + break; + } + case 578: { + double? value = _single_doubleField72_codec.Read(ref input); + if (doubleField72_ == null || value != 0D) { + DoubleField72 = value; + } + break; + } + case 586: { + string value = _single_stringField73_codec.Read(ref input); + if (stringField73_ == null || value != "") { + StringField73 = value; + } + break; + } + case 594: { + string value = _single_stringField74_codec.Read(ref input); + if (stringField74_ == null || value != "") { + StringField74 = value; + } + break; + } + case 602: { + double? value = _single_doubleField75_codec.Read(ref input); + if (doubleField75_ == null || value != 0D) { + DoubleField75 = value; + } + break; + } + case 618: { + double? value = _single_doubleField77_codec.Read(ref input); + if (doubleField77_ == null || value != 0D) { + DoubleField77 = value; + } + break; + } + case 626: { + double? value = _single_doubleField78_codec.Read(ref input); + if (doubleField78_ == null || value != 0D) { + DoubleField78 = value; + } + break; + } + case 634: { + double? value = _single_doubleField79_codec.Read(ref input); + if (doubleField79_ == null || value != 0D) { + DoubleField79 = value; + } + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 658: { + long? value = _single_int64Field82_codec.Read(ref input); + if (int64Field82_ == null || value != 0L) { + Int64Field82 = value; + } + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 674: { + double? value = _single_doubleField84_codec.Read(ref input); + if (doubleField84_ == null || value != 0D) { + DoubleField84 = value; + } + break; + } + case 682: { + long? value = _single_int64Field85_codec.Read(ref input); + if (int64Field85_ == null || value != 0L) { + Int64Field85 = value; + } + break; + } + case 690: { + long? value = _single_int64Field86_codec.Read(ref input); + if (int64Field86_ == null || value != 0L) { + Int64Field86 = value; + } + break; + } + case 698: { + long? value = _single_int64Field87_codec.Read(ref input); + if (int64Field87_ == null || value != 0L) { + Int64Field87 = value; + } + break; + } + case 706: { + double? value = _single_doubleField88_codec.Read(ref input); + if (doubleField88_ == null || value != 0D) { + DoubleField88 = value; + } + break; + } + case 714: { + double? value = _single_doubleField89_codec.Read(ref input); + if (doubleField89_ == null || value != 0D) { + DoubleField89 = value; + } + break; + } + case 722: { + double? value = _single_doubleField90_codec.Read(ref input); + if (doubleField90_ == null || value != 0D) { + DoubleField90 = value; + } + break; + } + case 730: { + double? value = _single_doubleField91_codec.Read(ref input); + if (doubleField91_ == null || value != 0D) { + DoubleField91 = value; + } + break; + } + case 738: { + double? value = _single_doubleField92_codec.Read(ref input); + if (doubleField92_ == null || value != 0D) { + DoubleField92 = value; + } + break; + } + case 746: { + double? value = _single_doubleField93_codec.Read(ref input); + if (doubleField93_ == null || value != 0D) { + DoubleField93 = value; + } + break; + } + case 754: { + double? value = _single_doubleField94_codec.Read(ref input); + if (doubleField94_ == null || value != 0D) { + DoubleField94 = value; + } + break; + } + case 762: { + double? value = _single_doubleField95_codec.Read(ref input); + if (doubleField95_ == null || value != 0D) { + DoubleField95 = value; + } + break; + } + case 770: { + double? value = _single_doubleField96_codec.Read(ref input); + if (doubleField96_ == null || value != 0D) { + DoubleField96 = value; + } + break; + } + case 778: { + double? value = _single_doubleField97_codec.Read(ref input); + if (doubleField97_ == null || value != 0D) { + DoubleField97 = value; + } + break; + } + case 786: { + double? value = _single_doubleField98_codec.Read(ref input); + if (doubleField98_ == null || value != 0D) { + DoubleField98 = value; + } + break; + } + case 794: { + double? value = _single_doubleField99_codec.Read(ref input); + if (doubleField99_ == null || value != 0D) { + DoubleField99 = value; + } + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec); + break; + } + case 810: { + double? value = _single_doubleField101_codec.Read(ref input); + if (doubleField101_ == null || value != 0D) { + DoubleField101 = value; + } + break; + } + case 818: { + double? value = _single_doubleField102_codec.Read(ref input); + if (doubleField102_ == null || value != 0D) { + DoubleField102 = value; + } + break; + } + case 826: { + double? value = _single_doubleField103_codec.Read(ref input); + if (doubleField103_ == null || value != 0D) { + DoubleField103 = value; + } + break; + } + case 834: { + double? value = _single_doubleField104_codec.Read(ref input); + if (doubleField104_ == null || value != 0D) { + DoubleField104 = value; + } + break; + } + case 842: { + double? value = _single_doubleField105_codec.Read(ref input); + if (doubleField105_ == null || value != 0D) { + DoubleField105 = value; + } + break; + } + case 850: { + double? value = _single_doubleField106_codec.Read(ref input); + if (doubleField106_ == null || value != 0D) { + DoubleField106 = value; + } + break; + } + case 858: { + long? value = _single_int64Field107_codec.Read(ref input); + if (int64Field107_ == null || value != 0L) { + Int64Field107 = value; + } + break; + } + case 866: { + double? value = _single_doubleField108_codec.Read(ref input); + if (doubleField108_ == null || value != 0D) { + DoubleField108 = value; + } + break; + } + case 874: { + double? value = _single_doubleField109_codec.Read(ref input); + if (doubleField109_ == null || value != 0D) { + DoubleField109 = value; + } + break; + } + case 882: { + long? value = _single_int64Field110_codec.Read(ref input); + if (int64Field110_ == null || value != 0L) { + Int64Field110 = value; + } + break; + } + case 890: { + double? value = _single_doubleField111_codec.Read(ref input); + if (doubleField111_ == null || value != 0D) { + DoubleField111 = value; + } + break; + } + case 898: { + long? value = _single_int64Field112_codec.Read(ref input); + if (int64Field112_ == null || value != 0L) { + Int64Field112 = value; + } + break; + } + case 906: { + double? value = _single_doubleField113_codec.Read(ref input); + if (doubleField113_ == null || value != 0D) { + DoubleField113 = value; + } + break; + } + case 914: { + long? value = _single_int64Field114_codec.Read(ref input); + if (int64Field114_ == null || value != 0L) { + Int64Field114 = value; + } + break; + } + case 922: { + long? value = _single_int64Field115_codec.Read(ref input); + if (int64Field115_ == null || value != 0L) { + Int64Field115 = value; + } + break; + } + case 930: { + double? value = _single_doubleField116_codec.Read(ref input); + if (doubleField116_ == null || value != 0D) { + DoubleField116 = value; + } + break; + } + case 938: { + long? value = _single_int64Field117_codec.Read(ref input); + if (int64Field117_ == null || value != 0L) { + Int64Field117 = value; + } + break; + } + case 946: { + double? value = _single_doubleField118_codec.Read(ref input); + if (doubleField118_ == null || value != 0D) { + DoubleField118 = value; + } + break; + } + case 954: { + double? value = _single_doubleField119_codec.Read(ref input); + if (doubleField119_ == null || value != 0D) { + DoubleField119 = value; + } + break; + } + case 962: { + double? value = _single_doubleField120_codec.Read(ref input); + if (doubleField120_ == null || value != 0D) { + DoubleField120 = value; + } + break; + } + case 970: { + double? value = _single_doubleField121_codec.Read(ref input); + if (doubleField121_ == null || value != 0D) { + DoubleField121 = value; + } + break; + } + case 978: { + double? value = _single_doubleField122_codec.Read(ref input); + if (doubleField122_ == null || value != 0D) { + DoubleField122 = value; + } + break; + } + case 986: { + double? value = _single_doubleField123_codec.Read(ref input); + if (doubleField123_ == null || value != 0D) { + DoubleField123 = value; + } + break; + } + case 994: { + double? value = _single_doubleField124_codec.Read(ref input); + if (doubleField124_ == null || value != 0D) { + DoubleField124 = value; + } + break; + } + case 1002: { + long? value = _single_int64Field125_codec.Read(ref input); + if (int64Field125_ == null || value != 0L) { + Int64Field125 = value; + } + break; + } + case 1010: { + long? value = _single_int64Field126_codec.Read(ref input); + if (int64Field126_ == null || value != 0L) { + Int64Field126 = value; + } + break; + } + case 1018: { + long? value = _single_int64Field127_codec.Read(ref input); + if (int64Field127_ == null || value != 0L) { + Int64Field127 = value; + } + break; + } + case 1026: { + double? value = _single_doubleField128_codec.Read(ref input); + if (doubleField128_ == null || value != 0D) { + DoubleField128 = value; + } + break; + } + case 1034: { + double? value = _single_doubleField129_codec.Read(ref input); + if (doubleField129_ == null || value != 0D) { + DoubleField129 = value; + } + break; + } + } + } + } + #endif + + } + + /// + /// same as ManyWrapperFieldsMessages, but with primitive fields + /// for comparison. + /// + public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyPrimitiveFieldsMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyPrimitiveFieldsMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ManyPrimitiveFieldsMessage(ManyPrimitiveFieldsMessage other) : this() { + doubleField95_ = other.doubleField95_; + doubleField1_ = other.doubleField1_; + doubleField79_ = other.doubleField79_; + int64Field2_ = other.int64Field2_; + doubleField96_ = other.doubleField96_; + int64Field3_ = other.int64Field3_; + int64Field4_ = other.int64Field4_; + doubleField97_ = other.doubleField97_; + doubleField65_ = other.doubleField65_; + doubleField66_ = other.doubleField66_; + doubleField7_ = other.doubleField7_; + doubleField62_ = other.doubleField62_; + doubleField118_ = other.doubleField118_; + doubleField119_ = other.doubleField119_; + doubleField67_ = other.doubleField67_; + doubleField120_ = other.doubleField120_; + doubleField121_ = other.doubleField121_; + doubleField122_ = other.doubleField122_; + doubleField123_ = other.doubleField123_; + doubleField124_ = other.doubleField124_; + doubleField8_ = other.doubleField8_; + doubleField9_ = other.doubleField9_; + doubleField98_ = other.doubleField98_; + doubleField10_ = other.doubleField10_; + doubleField11_ = other.doubleField11_; + doubleField99_ = other.doubleField99_; + doubleField84_ = other.doubleField84_; + doubleField14_ = other.doubleField14_; + doubleField77_ = other.doubleField77_; + doubleField15_ = other.doubleField15_; + int64Field19_ = other.int64Field19_; + int64Field115_ = other.int64Field115_; + doubleField116_ = other.doubleField116_; + int64Field117_ = other.int64Field117_; + doubleField20_ = other.doubleField20_; + doubleField21_ = other.doubleField21_; + stringField73_ = other.stringField73_; + stringField74_ = other.stringField74_; + doubleField22_ = other.doubleField22_; + doubleField69_ = other.doubleField69_; + doubleField70_ = other.doubleField70_; + doubleField71_ = other.doubleField71_; + doubleField72_ = other.doubleField72_; + doubleField25_ = other.doubleField25_; + int64Field26_ = other.int64Field26_; + doubleField68_ = other.doubleField68_; + doubleField28_ = other.doubleField28_; + doubleField106_ = other.doubleField106_; + doubleField29_ = other.doubleField29_; + doubleField30_ = other.doubleField30_; + doubleField101_ = other.doubleField101_; + doubleField102_ = other.doubleField102_; + doubleField103_ = other.doubleField103_; + doubleField104_ = other.doubleField104_; + doubleField105_ = other.doubleField105_; + doubleField31_ = other.doubleField31_; + int64Field32_ = other.int64Field32_; + doubleField75_ = other.doubleField75_; + doubleField129_ = other.doubleField129_; + enumField80_ = other.enumField80_; + enumField81_ = other.enumField81_; + int64Field82_ = other.int64Field82_; + enumField83_ = other.enumField83_; + int64Field85_ = other.int64Field85_; + int64Field86_ = other.int64Field86_; + int64Field87_ = other.int64Field87_; + int64Field125_ = other.int64Field125_; + int64Field37_ = other.int64Field37_; + doubleField38_ = other.doubleField38_; + interactions_ = other.interactions_; + repeatedIntField100_ = other.repeatedIntField100_.Clone(); + doubleField40_ = other.doubleField40_; + int64Field41_ = other.int64Field41_; + int64Field126_ = other.int64Field126_; + int64Field127_ = other.int64Field127_; + doubleField128_ = other.doubleField128_; + doubleField109_ = other.doubleField109_; + int64Field110_ = other.int64Field110_; + doubleField111_ = other.doubleField111_; + int64Field112_ = other.int64Field112_; + doubleField113_ = other.doubleField113_; + int64Field114_ = other.int64Field114_; + doubleField42_ = other.doubleField42_; + int64Field43_ = other.int64Field43_; + int64Field44_ = other.int64Field44_; + doubleField45_ = other.doubleField45_; + doubleField46_ = other.doubleField46_; + doubleField78_ = other.doubleField78_; + doubleField88_ = other.doubleField88_; + doubleField47_ = other.doubleField47_; + doubleField89_ = other.doubleField89_; + doubleField48_ = other.doubleField48_; + doubleField49_ = other.doubleField49_; + doubleField50_ = other.doubleField50_; + doubleField90_ = other.doubleField90_; + doubleField51_ = other.doubleField51_; + doubleField91_ = other.doubleField91_; + doubleField92_ = other.doubleField92_; + int64Field107_ = other.int64Field107_; + doubleField93_ = other.doubleField93_; + doubleField108_ = other.doubleField108_; + doubleField52_ = other.doubleField52_; + doubleField53_ = other.doubleField53_; + doubleField94_ = other.doubleField94_; + doubleField54_ = other.doubleField54_; + doubleField55_ = other.doubleField55_; + doubleField56_ = other.doubleField56_; + doubleField57_ = other.doubleField57_; + doubleField58_ = other.doubleField58_; + int64Field59_ = other.int64Field59_; + int64Field60_ = other.int64Field60_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ManyPrimitiveFieldsMessage Clone() { return new ManyPrimitiveFieldsMessage(this); @@ -6830,14 +7617,471 @@ namespace Google.Protobuf.Benchmarks { if (other.Int64Field60 != 0L) { Int64Field60 = other.Int64Field60; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + DoubleField1 = input.ReadDouble(); + break; + } + case 16: { + Int64Field2 = input.ReadInt64(); + break; + } + case 24: { + Int64Field3 = input.ReadInt64(); + break; + } + case 32: { + Int64Field4 = input.ReadInt64(); + break; + } + case 57: { + DoubleField7 = input.ReadDouble(); + break; + } + case 65: { + DoubleField8 = input.ReadDouble(); + break; + } + case 73: { + DoubleField9 = input.ReadDouble(); + break; + } + case 81: { + DoubleField10 = input.ReadDouble(); + break; + } + case 89: { + DoubleField11 = input.ReadDouble(); + break; + } + case 113: { + DoubleField14 = input.ReadDouble(); + break; + } + case 121: { + DoubleField15 = input.ReadDouble(); + break; + } + case 152: { + Int64Field19 = input.ReadInt64(); + break; + } + case 161: { + DoubleField20 = input.ReadDouble(); + break; + } + case 169: { + DoubleField21 = input.ReadDouble(); + break; + } + case 177: { + DoubleField22 = input.ReadDouble(); + break; + } + case 201: { + DoubleField25 = input.ReadDouble(); + break; + } + case 208: { + Int64Field26 = input.ReadInt64(); + break; + } + case 225: { + DoubleField28 = input.ReadDouble(); + break; + } + case 233: { + DoubleField29 = input.ReadDouble(); + break; + } + case 241: { + DoubleField30 = input.ReadDouble(); + break; + } + case 249: { + DoubleField31 = input.ReadDouble(); + break; + } + case 256: { + Int64Field32 = input.ReadInt64(); + break; + } + case 296: { + Int64Field37 = input.ReadInt64(); + break; + } + case 305: { + DoubleField38 = input.ReadDouble(); + break; + } + case 312: { + Interactions = input.ReadInt64(); + break; + } + case 321: { + DoubleField40 = input.ReadDouble(); + break; + } + case 328: { + Int64Field41 = input.ReadInt64(); + break; + } + case 337: { + DoubleField42 = input.ReadDouble(); + break; + } + case 344: { + Int64Field43 = input.ReadInt64(); + break; + } + case 352: { + Int64Field44 = input.ReadInt64(); + break; + } + case 361: { + DoubleField45 = input.ReadDouble(); + break; + } + case 369: { + DoubleField46 = input.ReadDouble(); + break; + } + case 377: { + DoubleField47 = input.ReadDouble(); + break; + } + case 385: { + DoubleField48 = input.ReadDouble(); + break; + } + case 393: { + DoubleField49 = input.ReadDouble(); + break; + } + case 401: { + DoubleField50 = input.ReadDouble(); + break; + } + case 409: { + DoubleField51 = input.ReadDouble(); + break; + } + case 417: { + DoubleField52 = input.ReadDouble(); + break; + } + case 425: { + DoubleField53 = input.ReadDouble(); + break; + } + case 433: { + DoubleField54 = input.ReadDouble(); + break; + } + case 441: { + DoubleField55 = input.ReadDouble(); + break; + } + case 449: { + DoubleField56 = input.ReadDouble(); + break; + } + case 457: { + DoubleField57 = input.ReadDouble(); + break; + } + case 465: { + DoubleField58 = input.ReadDouble(); + break; + } + case 472: { + Int64Field59 = input.ReadInt64(); + break; + } + case 480: { + Int64Field60 = input.ReadInt64(); + break; + } + case 497: { + DoubleField62 = input.ReadDouble(); + break; + } + case 521: { + DoubleField65 = input.ReadDouble(); + break; + } + case 529: { + DoubleField66 = input.ReadDouble(); + break; + } + case 537: { + DoubleField67 = input.ReadDouble(); + break; + } + case 545: { + DoubleField68 = input.ReadDouble(); + break; + } + case 553: { + DoubleField69 = input.ReadDouble(); + break; + } + case 561: { + DoubleField70 = input.ReadDouble(); + break; + } + case 569: { + DoubleField71 = input.ReadDouble(); + break; + } + case 577: { + DoubleField72 = input.ReadDouble(); + break; + } + case 586: { + StringField73 = input.ReadString(); + break; + } + case 594: { + StringField74 = input.ReadString(); + break; + } + case 601: { + DoubleField75 = input.ReadDouble(); + break; + } + case 617: { + DoubleField77 = input.ReadDouble(); + break; + } + case 625: { + DoubleField78 = input.ReadDouble(); + break; + } + case 633: { + DoubleField79 = input.ReadDouble(); + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 656: { + Int64Field82 = input.ReadInt64(); + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 673: { + DoubleField84 = input.ReadDouble(); + break; + } + case 680: { + Int64Field85 = input.ReadInt64(); + break; + } + case 688: { + Int64Field86 = input.ReadInt64(); + break; + } + case 696: { + Int64Field87 = input.ReadInt64(); + break; + } + case 705: { + DoubleField88 = input.ReadDouble(); + break; + } + case 713: { + DoubleField89 = input.ReadDouble(); + break; + } + case 721: { + DoubleField90 = input.ReadDouble(); + break; + } + case 729: { + DoubleField91 = input.ReadDouble(); + break; + } + case 737: { + DoubleField92 = input.ReadDouble(); + break; + } + case 745: { + DoubleField93 = input.ReadDouble(); + break; + } + case 753: { + DoubleField94 = input.ReadDouble(); + break; + } + case 761: { + DoubleField95 = input.ReadDouble(); + break; + } + case 769: { + DoubleField96 = input.ReadDouble(); + break; + } + case 777: { + DoubleField97 = input.ReadDouble(); + break; + } + case 785: { + DoubleField98 = input.ReadDouble(); + break; + } + case 793: { + DoubleField99 = input.ReadDouble(); + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec); + break; + } + case 809: { + DoubleField101 = input.ReadDouble(); + break; + } + case 817: { + DoubleField102 = input.ReadDouble(); + break; + } + case 825: { + DoubleField103 = input.ReadDouble(); + break; + } + case 833: { + DoubleField104 = input.ReadDouble(); + break; + } + case 841: { + DoubleField105 = input.ReadDouble(); + break; + } + case 849: { + DoubleField106 = input.ReadDouble(); + break; + } + case 856: { + Int64Field107 = input.ReadInt64(); + break; + } + case 865: { + DoubleField108 = input.ReadDouble(); + break; + } + case 873: { + DoubleField109 = input.ReadDouble(); + break; + } + case 880: { + Int64Field110 = input.ReadInt64(); + break; + } + case 889: { + DoubleField111 = input.ReadDouble(); + break; + } + case 896: { + Int64Field112 = input.ReadInt64(); + break; + } + case 905: { + DoubleField113 = input.ReadDouble(); + break; + } + case 912: { + Int64Field114 = input.ReadInt64(); + break; + } + case 920: { + Int64Field115 = input.ReadInt64(); + break; + } + case 929: { + DoubleField116 = input.ReadDouble(); + break; + } + case 936: { + Int64Field117 = input.ReadInt64(); + break; + } + case 945: { + DoubleField118 = input.ReadDouble(); + break; + } + case 953: { + DoubleField119 = input.ReadDouble(); + break; + } + case 961: { + DoubleField120 = input.ReadDouble(); + break; + } + case 969: { + DoubleField121 = input.ReadDouble(); + break; + } + case 977: { + DoubleField122 = input.ReadDouble(); + break; + } + case 985: { + DoubleField123 = input.ReadDouble(); + break; + } + case 993: { + DoubleField124 = input.ReadDouble(); + break; + } + case 1000: { + Int64Field125 = input.ReadInt64(); + break; + } + case 1008: { + Int64Field126 = input.ReadInt64(); + break; + } + case 1016: { + Int64Field127 = input.ReadInt64(); + break; + } + case 1025: { + DoubleField128 = input.ReadDouble(); + break; + } + case 1033: { + DoubleField129 = input.ReadDouble(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7294,6 +8538,7 @@ namespace Google.Protobuf.Benchmarks { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs index f9bda13c60..2c0846643e 100644 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs +++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs @@ -107,7 +107,11 @@ namespace Conformance { /// This will be known by message_type == "conformance.FailureSet", a conformance /// test should return a serialized FailureSet in protobuf_payload. /// - public sealed partial class FailureSet : pb::IMessage, pb::IBufferMessage { + public sealed partial class FailureSet : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FailureSet()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -212,9 +216,25 @@ namespace Conformance { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + failure_.AddEntriesFrom(input, _repeated_failure_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -230,6 +250,7 @@ namespace Conformance { } } } + #endif } @@ -240,7 +261,11 @@ namespace Conformance { /// 2. parse the protobuf or JSON payload in "payload" (which may fail) /// 3. if the parse succeeded, serialize the message in the requested format. /// - public sealed partial class ConformanceRequest : pb::IMessage, pb::IBufferMessage { + public sealed partial class ConformanceRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -608,9 +633,60 @@ namespace Conformance { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ProtobufPayload = input.ReadBytes(); + break; + } + case 18: { + JsonPayload = input.ReadString(); + break; + } + case 24: { + RequestedOutputFormat = (global::Conformance.WireFormat) input.ReadEnum(); + break; + } + case 34: { + MessageType = input.ReadString(); + break; + } + case 40: { + TestCategory = (global::Conformance.TestCategory) input.ReadEnum(); + break; + } + case 50: { + if (jspbEncodingOptions_ == null) { + JspbEncodingOptions = new global::Conformance.JspbEncodingConfig(); + } + input.ReadMessage(JspbEncodingOptions); + break; + } + case 58: { + JspbPayload = input.ReadString(); + break; + } + case 66: { + TextPayload = input.ReadString(); + break; + } + case 72: { + PrintUnknownFields = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -661,13 +737,18 @@ namespace Conformance { } } } + #endif } /// /// Represents a single test case's output. /// - public sealed partial class ConformanceResponse : pb::IMessage, pb::IBufferMessage { + public sealed partial class ConformanceResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1035,9 +1116,53 @@ namespace Conformance { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + ParseError = input.ReadString(); + break; + } + case 18: { + RuntimeError = input.ReadString(); + break; + } + case 26: { + ProtobufPayload = input.ReadBytes(); + break; + } + case 34: { + JsonPayload = input.ReadString(); + break; + } + case 42: { + Skipped = input.ReadString(); + break; + } + case 50: { + SerializeError = input.ReadString(); + break; + } + case 58: { + JspbPayload = input.ReadString(); + break; + } + case 66: { + TextPayload = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1081,13 +1206,18 @@ namespace Conformance { } } } + #endif } /// /// Encoding options for jspb format. /// - public sealed partial class JspbEncodingConfig : pb::IMessage, pb::IBufferMessage { + public sealed partial class JspbEncodingConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JspbEncodingConfig()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1203,9 +1333,25 @@ namespace Conformance { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + UseJspbArrayAnyFormat = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1221,6 +1367,7 @@ namespace Conformance { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index d1093abee1..d721ecfcb7 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -83,44 +83,52 @@ namespace Google.Protobuf.Conformance private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry) { + ExtensionRegistry proto2ExtensionRegistry = new ExtensionRegistry + { + ProtobufTestMessages.Proto2.TestMessagesProto2Extensions.ExtensionInt32, + ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension, + ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension + }; IMessage message; try { switch (request.PayloadCase) { case ConformanceRequest.PayloadOneofCase.JsonPayload: - if (request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest) { + if (request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest) + { return new ConformanceResponse { Skipped = "CSharp doesn't support skipping unknown fields in json parsing." }; } var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); - message = parser.Parse(request.JsonPayload); - break; - case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - { - if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3")) + switch (request.MessageType) { - message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); + case "protobuf_test_messages.proto3.TestAllTypesProto3": + message = parser.Parse(request.JsonPayload); + break; + case "protobuf_test_messages.proto2.TestAllTypesProto2": + message = parser.Parse(request.JsonPayload); + break; + default: + throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"); } - else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) - { - ExtensionRegistry registry = new ExtensionRegistry() - { - ProtobufTestMessages.Proto2.TestMessagesProto2Extensions.ExtensionInt32, - ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension, - ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension - }; - message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser.WithExtensionRegistry(registry).ParseFrom(request.ProtobufPayload); - } - else + break; + case ConformanceRequest.PayloadOneofCase.ProtobufPayload: + switch (request.MessageType) { - throw new Exception(" Protobuf request doesn't have specific payload type"); + case "protobuf_test_messages.proto3.TestAllTypesProto3": + message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); + break; + case "protobuf_test_messages.proto2.TestAllTypesProto2": + message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser + .WithExtensionRegistry(proto2ExtensionRegistry) + .ParseFrom(request.ProtobufPayload); + break; + default: + throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"); } break; - } case ConformanceRequest.PayloadOneofCase.TextPayload: - { return new ConformanceResponse { Skipped = "CSharp doesn't support text format" }; - } default: throw new Exception("Unsupported request payload: " + request.PayloadCase); } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs index 8d2060593d..308ccbd649 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs @@ -176,7 +176,11 @@ namespace Google.Protobuf.TestProtos { /// /// Tests maps. /// - public sealed partial class TestMap : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -537,9 +541,89 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + break; + } + case 18: { + mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + break; + } + case 26: { + mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + break; + } + case 34: { + mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + break; + } + case 42: { + mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + break; + } + case 50: { + mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + break; + } + case 58: { + mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + break; + } + case 66: { + mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + break; + } + case 74: { + mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 82: { + mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 90: { + mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + break; + } + case 98: { + mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + break; + } + case 106: { + mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + break; + } + case 114: { + mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec); + break; + } + case 122: { + mapInt32Bytes_.AddEntriesFrom(input, _map_mapInt32Bytes_codec); + break; + } + case 130: { + mapInt32Enum_.AddEntriesFrom(input, _map_mapInt32Enum_codec); + break; + } + case 138: { + mapInt32ForeignMessage_.AddEntriesFrom(input, _map_mapInt32ForeignMessage_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -619,10 +703,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestMapSubmessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMapSubmessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMapSubmessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -738,9 +827,28 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (testMap_ == null) { + TestMap = new global::Google.Protobuf.TestProtos.TestMap(); + } + input.ReadMessage(TestMap); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -759,10 +867,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestMessageMap : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMessageMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -867,9 +980,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -885,13 +1014,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Two map fields share the same entry default instance. /// - public sealed partial class TestSameTypeMap : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestSameTypeMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1012,9 +1146,29 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + map1_.AddEntriesFrom(input, _map_map1_codec); + break; + } + case 18: { + map2_.AddEntriesFrom(input, _map_map2_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1034,10 +1188,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestArenaMap : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestArenaMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestArenaMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1366,9 +1525,81 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + break; + } + case 18: { + mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + break; + } + case 26: { + mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + break; + } + case 34: { + mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + break; + } + case 42: { + mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + break; + } + case 50: { + mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + break; + } + case 58: { + mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + break; + } + case 66: { + mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + break; + } + case 74: { + mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 82: { + mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 90: { + mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + break; + } + case 98: { + mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + break; + } + case 106: { + mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + break; + } + case 114: { + mapInt32Enum_.AddEntriesFrom(input, _map_mapInt32Enum_codec); + break; + } + case 122: { + mapInt32ForeignMessage_.AddEntriesFrom(input, _map_mapInt32ForeignMessage_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1440,6 +1671,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -1447,7 +1679,11 @@ namespace Google.Protobuf.TestProtos { /// Previously, message containing enum called Type cannot be used as value of /// map field. /// - public sealed partial class MessageContainingEnumCalledType : pb::IMessage, pb::IBufferMessage { + public sealed partial class MessageContainingEnumCalledType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingEnumCalledType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1552,9 +1788,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + type_.AddEntriesFrom(input, _map_type_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1570,6 +1822,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the MessageContainingEnumCalledType message type. @@ -1587,7 +1840,11 @@ namespace Google.Protobuf.TestProtos { /// /// Previously, message cannot contain map field called "entry". /// - public sealed partial class MessageContainingMapCalledEntry : pb::IMessage, pb::IBufferMessage { + public sealed partial class MessageContainingMapCalledEntry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingMapCalledEntry()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1692,9 +1949,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + entry_.AddEntriesFrom(input, _map_entry_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1710,6 +1983,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs index bef3645874..eb22955dc3 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs @@ -244,7 +244,11 @@ namespace ProtobufTestMessages.Proto2 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto2()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -3311,9 +3315,556 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); + } + input.ReadMessage(OptionalForeignMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + OptionalForeignEnum = (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) input.ReadEnum(); + break; + } + case 194: { + OptionalStringPiece = input.ReadString(); + break; + } + case 202: { + OptionalCord = input.ReadString(); + break; + } + case 218: { + if (recursiveMessage_ == null) { + RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); + } + input.ReadMessage(RecursiveMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec); + break; + } + case 434: { + repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec); + break; + } + case 442: { + repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec); + break; + } + case 450: { + mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + break; + } + case 458: { + mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + break; + } + case 466: { + mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + break; + } + case 474: { + mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + break; + } + case 482: { + mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + break; + } + case 490: { + mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + break; + } + case 498: { + mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + break; + } + case 506: { + mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + break; + } + case 514: { + mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 522: { + mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 530: { + mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + break; + } + case 538: { + mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + break; + } + case 546: { + mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + break; + } + case 554: { + mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec); + break; + } + case 562: { + mapStringBytes_.AddEntriesFrom(input, _map_mapStringBytes_codec); + break; + } + case 570: { + mapStringNestedMessage_.AddEntriesFrom(input, _map_mapStringNestedMessage_codec); + break; + } + case 578: { + mapStringForeignMessage_.AddEntriesFrom(input, _map_mapStringForeignMessage_codec); + break; + } + case 586: { + mapStringNestedEnum_.AddEntriesFrom(input, _map_mapStringNestedEnum_codec); + break; + } + case 594: { + mapStringForeignEnum_.AddEntriesFrom(input, _map_mapStringForeignEnum_codec); + break; + } + case 602: + case 600: { + packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + break; + } + case 610: + case 608: { + packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec); + break; + } + case 618: + case 616: { + packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec); + break; + } + case 626: + case 624: { + packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec); + break; + } + case 634: + case 632: { + packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec); + break; + } + case 642: + case 640: { + packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec); + break; + } + case 650: + case 653: { + packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec); + break; + } + case 658: + case 657: { + packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec); + break; + } + case 666: + case 669: { + packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec); + break; + } + case 674: + case 673: { + packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec); + break; + } + case 682: + case 685: { + packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec); + break; + } + case 690: + case 689: { + packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec); + break; + } + case 698: + case 696: { + packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec); + break; + } + case 706: + case 704: { + packedNestedEnum_.AddEntriesFrom(input, _repeated_packedNestedEnum_codec); + break; + } + case 714: + case 712: { + unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + break; + } + case 722: + case 720: { + unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + break; + } + case 730: + case 728: { + unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + break; + } + case 738: + case 736: { + unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + break; + } + case 746: + case 744: { + unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + break; + } + case 754: + case 752: { + unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + break; + } + case 762: + case 765: { + unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + break; + } + case 770: + case 769: { + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 778: + case 781: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 786: + case 785: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 794: + case 797: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 802: + case 801: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 810: + case 808: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 818: + case 816: { + unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + case 920: { + OneofBool = input.ReadBool(); + break; + } + case 928: { + OneofUint64 = input.ReadUInt64(); + break; + } + case 941: { + OneofFloat = input.ReadFloat(); + break; + } + case 945: { + OneofDouble = input.ReadDouble(); + break; + } + case 952: { + oneofField_ = input.ReadEnum(); + oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; + break; + } + case 1611: { + if (!HasData) { + Data = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data(); + } + input.ReadGroup(Data); + break; + } + case 3208: { + Fieldname1 = input.ReadInt32(); + break; + } + case 3216: { + FieldName2 = input.ReadInt32(); + break; + } + case 3224: { + FieldName3 = input.ReadInt32(); + break; + } + case 3232: { + FieldName4 = input.ReadInt32(); + break; + } + case 3240: { + Field0Name5 = input.ReadInt32(); + break; + } + case 3248: { + Field0Name6 = input.ReadInt32(); + break; + } + case 3256: { + FieldName7 = input.ReadInt32(); + break; + } + case 3264: { + FieldName8 = input.ReadInt32(); + break; + } + case 3272: { + FieldName9 = input.ReadInt32(); + break; + } + case 3280: { + FieldName10 = input.ReadInt32(); + break; + } + case 3288: { + FIELDNAME11 = input.ReadInt32(); + break; + } + case 3296: { + FIELDName12 = input.ReadInt32(); + break; + } + case 3304: { + FieldName13 = input.ReadInt32(); + break; + } + case 3312: { + FieldName14 = input.ReadInt32(); + break; + } + case 3320: { + FieldName15 = input.ReadInt32(); + break; + } + case 3328: { + FieldName16 = input.ReadInt32(); + break; + } + case 3336: { + FieldName17 = input.ReadInt32(); + break; + } + case 3344: { + FieldName18 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3860,6 +4411,7 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -3897,7 +4449,11 @@ namespace ProtobufTestMessages.Proto2 { [pbr::OriginalName("NEG")] Neg = -1, } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4052,9 +4608,32 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 18: { + if (corecursive_ == null) { + Corecursive = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); + } + input.ReadMessage(Corecursive); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4077,13 +4656,18 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif } /// /// groups /// - public sealed partial class Data : pb::IMessage, pb::IBufferMessage { + public sealed partial class Data : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Data()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4248,9 +4832,31 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 1612: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 1616: { + GroupInt32 = input.ReadInt32(); + break; + } + case 1624: { + GroupUint32 = input.ReadUInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4272,13 +4878,18 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif } /// /// message_set test case. /// - public sealed partial class MessageSetCorrect : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class MessageSetCorrect : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrect()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -4383,9 +4994,23 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4399,6 +5024,7 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -4424,7 +5050,11 @@ namespace ProtobufTestMessages.Proto2 { } - public sealed partial class MessageSetCorrectExtension1 : pb::IMessage, pb::IBufferMessage { + public sealed partial class MessageSetCorrectExtension1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4549,9 +5179,25 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 202: { + Str = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4567,6 +5213,7 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the MessageSetCorrectExtension1 message type. @@ -4579,7 +5226,11 @@ namespace ProtobufTestMessages.Proto2 { } - public sealed partial class MessageSetCorrectExtension2 : pb::IMessage, pb::IBufferMessage { + public sealed partial class MessageSetCorrectExtension2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension2()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4707,9 +5358,25 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 72: { + I = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4725,6 +5392,7 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the MessageSetCorrectExtension2 message type. @@ -4742,7 +5410,11 @@ namespace ProtobufTestMessages.Proto2 { } - public sealed partial class ForeignMessageProto2 : pb::IMessage, pb::IBufferMessage { + public sealed partial class ForeignMessageProto2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessageProto2()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4870,9 +5542,25 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4888,10 +5576,15 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif } - public sealed partial class UnknownToTestAllTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class UnknownToTestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnknownToTestAllTypes()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -5173,9 +5866,52 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8008: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 8018: { + OptionalString = input.ReadString(); + break; + } + case 8026: { + if (nestedMessage_ == null) { + NestedMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); + } + input.ReadMessage(NestedMessage); + break; + } + case 8035: { + if (!HasOptionalGroup) { + OptionalGroup = new global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 8048: { + OptionalBool = input.ReadBool(); + break; + } + case 8090: + case 8088: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5218,12 +5954,17 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the UnknownToTestAllTypes message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -5351,9 +6092,27 @@ namespace ProtobufTestMessages.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 8036: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5371,6 +6130,7 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs index 465d5e804c..41bc006cb1 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs @@ -259,7 +259,11 @@ namespace ProtobufTestMessages.Proto3 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - public sealed partial class TestAllTypesProto3 : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestAllTypesProto3 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3383,9 +3387,720 @@ namespace ProtobufTestMessages.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::ProtobufTestMessages.Proto3.ForeignMessage(); + } + input.ReadMessage(OptionalForeignMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + OptionalForeignEnum = (global::ProtobufTestMessages.Proto3.ForeignEnum) input.ReadEnum(); + break; + } + case 184: { + OptionalAliasedEnum = (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum) input.ReadEnum(); + break; + } + case 194: { + OptionalStringPiece = input.ReadString(); + break; + } + case 202: { + OptionalCord = input.ReadString(); + break; + } + case 218: { + if (recursiveMessage_ == null) { + RecursiveMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); + } + input.ReadMessage(RecursiveMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec); + break; + } + case 434: { + repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec); + break; + } + case 442: { + repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec); + break; + } + case 450: { + mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + break; + } + case 458: { + mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + break; + } + case 466: { + mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + break; + } + case 474: { + mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + break; + } + case 482: { + mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + break; + } + case 490: { + mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + break; + } + case 498: { + mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + break; + } + case 506: { + mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + break; + } + case 514: { + mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 522: { + mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 530: { + mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + break; + } + case 538: { + mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + break; + } + case 546: { + mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + break; + } + case 554: { + mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec); + break; + } + case 562: { + mapStringBytes_.AddEntriesFrom(input, _map_mapStringBytes_codec); + break; + } + case 570: { + mapStringNestedMessage_.AddEntriesFrom(input, _map_mapStringNestedMessage_codec); + break; + } + case 578: { + mapStringForeignMessage_.AddEntriesFrom(input, _map_mapStringForeignMessage_codec); + break; + } + case 586: { + mapStringNestedEnum_.AddEntriesFrom(input, _map_mapStringNestedEnum_codec); + break; + } + case 594: { + mapStringForeignEnum_.AddEntriesFrom(input, _map_mapStringForeignEnum_codec); + break; + } + case 602: + case 600: { + packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + break; + } + case 610: + case 608: { + packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec); + break; + } + case 618: + case 616: { + packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec); + break; + } + case 626: + case 624: { + packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec); + break; + } + case 634: + case 632: { + packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec); + break; + } + case 642: + case 640: { + packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec); + break; + } + case 650: + case 653: { + packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec); + break; + } + case 658: + case 657: { + packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec); + break; + } + case 666: + case 669: { + packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec); + break; + } + case 674: + case 673: { + packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec); + break; + } + case 682: + case 685: { + packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec); + break; + } + case 690: + case 689: { + packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec); + break; + } + case 698: + case 696: { + packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec); + break; + } + case 706: + case 704: { + packedNestedEnum_.AddEntriesFrom(input, _repeated_packedNestedEnum_codec); + break; + } + case 714: + case 712: { + unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + break; + } + case 722: + case 720: { + unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + break; + } + case 730: + case 728: { + unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + break; + } + case 738: + case 736: { + unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + break; + } + case 746: + case 744: { + unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + break; + } + case 754: + case 752: { + unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + break; + } + case 762: + case 765: { + unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + break; + } + case 770: + case 769: { + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 778: + case 781: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 786: + case 785: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 794: + case 797: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 802: + case 801: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 810: + case 808: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 818: + case 816: { + unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + case 920: { + OneofBool = input.ReadBool(); + break; + } + case 928: { + OneofUint64 = input.ReadUInt64(); + break; + } + case 941: { + OneofFloat = input.ReadFloat(); + break; + } + case 945: { + OneofDouble = input.ReadDouble(); + break; + } + case 952: { + oneofField_ = input.ReadEnum(); + oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; + break; + } + case 1610: { + bool? value = _single_optionalBoolWrapper_codec.Read(input); + if (optionalBoolWrapper_ == null || value != false) { + OptionalBoolWrapper = value; + } + break; + } + case 1618: { + int? value = _single_optionalInt32Wrapper_codec.Read(input); + if (optionalInt32Wrapper_ == null || value != 0) { + OptionalInt32Wrapper = value; + } + break; + } + case 1626: { + long? value = _single_optionalInt64Wrapper_codec.Read(input); + if (optionalInt64Wrapper_ == null || value != 0L) { + OptionalInt64Wrapper = value; + } + break; + } + case 1634: { + uint? value = _single_optionalUint32Wrapper_codec.Read(input); + if (optionalUint32Wrapper_ == null || value != 0) { + OptionalUint32Wrapper = value; + } + break; + } + case 1642: { + ulong? value = _single_optionalUint64Wrapper_codec.Read(input); + if (optionalUint64Wrapper_ == null || value != 0UL) { + OptionalUint64Wrapper = value; + } + break; + } + case 1650: { + float? value = _single_optionalFloatWrapper_codec.Read(input); + if (optionalFloatWrapper_ == null || value != 0F) { + OptionalFloatWrapper = value; + } + break; + } + case 1658: { + double? value = _single_optionalDoubleWrapper_codec.Read(input); + if (optionalDoubleWrapper_ == null || value != 0D) { + OptionalDoubleWrapper = value; + } + break; + } + case 1666: { + string value = _single_optionalStringWrapper_codec.Read(input); + if (optionalStringWrapper_ == null || value != "") { + OptionalStringWrapper = value; + } + break; + } + case 1674: { + pb::ByteString value = _single_optionalBytesWrapper_codec.Read(input); + if (optionalBytesWrapper_ == null || value != pb::ByteString.Empty) { + OptionalBytesWrapper = value; + } + break; + } + case 1690: { + repeatedBoolWrapper_.AddEntriesFrom(input, _repeated_repeatedBoolWrapper_codec); + break; + } + case 1698: { + repeatedInt32Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt32Wrapper_codec); + break; + } + case 1706: { + repeatedInt64Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt64Wrapper_codec); + break; + } + case 1714: { + repeatedUint32Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint32Wrapper_codec); + break; + } + case 1722: { + repeatedUint64Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint64Wrapper_codec); + break; + } + case 1730: { + repeatedFloatWrapper_.AddEntriesFrom(input, _repeated_repeatedFloatWrapper_codec); + break; + } + case 1738: { + repeatedDoubleWrapper_.AddEntriesFrom(input, _repeated_repeatedDoubleWrapper_codec); + break; + } + case 1746: { + repeatedStringWrapper_.AddEntriesFrom(input, _repeated_repeatedStringWrapper_codec); + break; + } + case 1754: { + repeatedBytesWrapper_.AddEntriesFrom(input, _repeated_repeatedBytesWrapper_codec); + break; + } + case 2410: { + if (optionalDuration_ == null) { + OptionalDuration = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(OptionalDuration); + break; + } + case 2418: { + if (optionalTimestamp_ == null) { + OptionalTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(OptionalTimestamp); + break; + } + case 2426: { + if (optionalFieldMask_ == null) { + OptionalFieldMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + } + input.ReadMessage(OptionalFieldMask); + break; + } + case 2434: { + if (optionalStruct_ == null) { + OptionalStruct = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(OptionalStruct); + break; + } + case 2442: { + if (optionalAny_ == null) { + OptionalAny = new global::Google.Protobuf.WellKnownTypes.Any(); + } + input.ReadMessage(OptionalAny); + break; + } + case 2450: { + if (optionalValue_ == null) { + OptionalValue = new global::Google.Protobuf.WellKnownTypes.Value(); + } + input.ReadMessage(OptionalValue); + break; + } + case 2490: { + repeatedDuration_.AddEntriesFrom(input, _repeated_repeatedDuration_codec); + break; + } + case 2498: { + repeatedTimestamp_.AddEntriesFrom(input, _repeated_repeatedTimestamp_codec); + break; + } + case 2506: { + repeatedFieldmask_.AddEntriesFrom(input, _repeated_repeatedFieldmask_codec); + break; + } + case 2522: { + repeatedAny_.AddEntriesFrom(input, _repeated_repeatedAny_codec); + break; + } + case 2530: { + repeatedValue_.AddEntriesFrom(input, _repeated_repeatedValue_codec); + break; + } + case 2538: { + repeatedListValue_.AddEntriesFrom(input, _repeated_repeatedListValue_codec); + break; + } + case 2594: { + repeatedStruct_.AddEntriesFrom(input, _repeated_repeatedStruct_codec); + break; + } + case 3208: { + Fieldname1 = input.ReadInt32(); + break; + } + case 3216: { + FieldName2 = input.ReadInt32(); + break; + } + case 3224: { + FieldName3 = input.ReadInt32(); + break; + } + case 3232: { + FieldName4 = input.ReadInt32(); + break; + } + case 3240: { + Field0Name5 = input.ReadInt32(); + break; + } + case 3248: { + Field0Name6 = input.ReadInt32(); + break; + } + case 3256: { + FieldName7 = input.ReadInt32(); + break; + } + case 3264: { + FieldName8 = input.ReadInt32(); + break; + } + case 3272: { + FieldName9 = input.ReadInt32(); + break; + } + case 3280: { + FieldName10 = input.ReadInt32(); + break; + } + case 3288: { + FIELDNAME11 = input.ReadInt32(); + break; + } + case 3296: { + FIELDName12 = input.ReadInt32(); + break; + } + case 3304: { + FieldName13 = input.ReadInt32(); + break; + } + case 3312: { + FieldName14 = input.ReadInt32(); + break; + } + case 3320: { + FieldName15 = input.ReadInt32(); + break; + } + case 3328: { + FieldName16 = input.ReadInt32(); + break; + } + case 3336: { + FieldName17 = input.ReadInt32(); + break; + } + case 3344: { + FieldName18 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4096,6 +4811,7 @@ namespace ProtobufTestMessages.Proto3 { } } } + #endif #region Nested types /// Container for nested types declared in the TestAllTypesProto3 message type. @@ -4120,7 +4836,11 @@ namespace ProtobufTestMessages.Proto3 { [pbr::OriginalName("bAz", PreferredAlias = false)] BAz = 2, } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4260,9 +4980,32 @@ namespace ProtobufTestMessages.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 18: { + if (corecursive_ == null) { + Corecursive = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); + } + input.ReadMessage(Corecursive); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4285,6 +5028,7 @@ namespace ProtobufTestMessages.Proto3 { } } } + #endif } @@ -4293,7 +5037,11 @@ namespace ProtobufTestMessages.Proto3 { } - public sealed partial class ForeignMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class ForeignMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4406,9 +5154,25 @@ namespace ProtobufTestMessages.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4424,6 +5188,7 @@ namespace ProtobufTestMessages.Proto3 { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs index 9b5825a927..373f569df3 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs @@ -1120,7 +1120,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This proto includes every type of field in both singular and repeated /// forms. /// - public sealed partial class TestAllTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -3442,9 +3446,360 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 131: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(OptionalForeignMessage); + break; + } + case 162: { + if (optionalImportMessage_ == null) { + OptionalImportMessage = new global::Google.Protobuf.TestProtos.Proto2.ImportMessage(); + } + input.ReadMessage(OptionalImportMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + OptionalForeignEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 184: { + OptionalImportEnum = (global::Google.Protobuf.TestProtos.Proto2.ImportEnum) input.ReadEnum(); + break; + } + case 194: { + OptionalStringPiece = input.ReadString(); + break; + } + case 202: { + OptionalCord = input.ReadString(); + break; + } + case 210: { + if (optionalPublicImportMessage_ == null) { + OptionalPublicImportMessage = new global::Google.Protobuf.TestProtos.Proto2.PublicImportMessage(); + } + input.ReadMessage(OptionalPublicImportMessage); + break; + } + case 218: { + if (optionalLazyMessage_ == null) { + OptionalLazyMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(OptionalLazyMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec); + break; + } + case 371: { + repeatedGroup_.AddEntriesFrom(input, _repeated_repeatedGroup_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec); + break; + } + case 402: { + repeatedImportMessage_.AddEntriesFrom(input, _repeated_repeatedImportMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec); + break; + } + case 426: + case 424: { + repeatedImportEnum_.AddEntriesFrom(input, _repeated_repeatedImportEnum_codec); + break; + } + case 434: { + repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec); + break; + } + case 442: { + repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec); + break; + } + case 458: { + repeatedLazyMessage_.AddEntriesFrom(input, _repeated_repeatedLazyMessage_codec); + break; + } + case 488: { + DefaultInt32 = input.ReadInt32(); + break; + } + case 496: { + DefaultInt64 = input.ReadInt64(); + break; + } + case 504: { + DefaultUint32 = input.ReadUInt32(); + break; + } + case 512: { + DefaultUint64 = input.ReadUInt64(); + break; + } + case 520: { + DefaultSint32 = input.ReadSInt32(); + break; + } + case 528: { + DefaultSint64 = input.ReadSInt64(); + break; + } + case 541: { + DefaultFixed32 = input.ReadFixed32(); + break; + } + case 545: { + DefaultFixed64 = input.ReadFixed64(); + break; + } + case 557: { + DefaultSfixed32 = input.ReadSFixed32(); + break; + } + case 561: { + DefaultSfixed64 = input.ReadSFixed64(); + break; + } + case 573: { + DefaultFloat = input.ReadFloat(); + break; + } + case 577: { + DefaultDouble = input.ReadDouble(); + break; + } + case 584: { + DefaultBool = input.ReadBool(); + break; + } + case 594: { + DefaultString = input.ReadString(); + break; + } + case 602: { + DefaultBytes = input.ReadBytes(); + break; + } + case 648: { + DefaultNestedEnum = (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + break; + } + case 656: { + DefaultForeignEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 664: { + DefaultImportEnum = (global::Google.Protobuf.TestProtos.Proto2.ImportEnum) input.ReadEnum(); + break; + } + case 674: { + DefaultStringPiece = input.ReadString(); + break; + } + case 682: { + DefaultCord = input.ReadString(); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3795,6 +4150,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestAllTypes message type. @@ -3810,7 +4166,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("NEG")] Neg = -1, } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -3943,9 +4303,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3961,10 +4337,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4092,9 +4473,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4112,10 +4511,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class RepeatedGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class RepeatedGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4243,9 +4647,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 372: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 376: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4263,6 +4685,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -4274,7 +4697,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// This proto includes a recursively nested message. /// - public sealed partial class NestedTestAllTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedTestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4433,9 +4860,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (child_ == null) { + Child = new global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes(); + } + input.ReadMessage(Child); + break; + } + case 18: { + if (payload_ == null) { + Payload = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(Payload); + break; + } + case 26: { + repeatedChild_.AddEntriesFrom(input, _repeated_repeatedChild_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4465,10 +4922,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestDeprecatedFields : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestDeprecatedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4666,9 +5128,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + DeprecatedInt32 = input.ReadInt32(); + break; + } + case 16: { + DeprecatedInt32InOneof = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4688,11 +5170,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } [global::System.ObsoleteAttribute] - public sealed partial class TestDeprecatedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestDeprecatedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4781,9 +5268,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4795,6 +5294,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -4802,7 +5302,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Define these after TestAllTypes to make sure the compiler can handle /// that. /// - public sealed partial class ForeignMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class ForeignMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -4967,9 +5471,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + case 16: { + D = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4989,10 +5513,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestReservedFields : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestReservedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5081,9 +5610,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5095,10 +5636,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestAllExtensions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestAllExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -5203,9 +5749,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5219,6 +5779,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -5244,7 +5805,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class OptionalGroup_extension : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup_extension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup_extension()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -5372,9 +5937,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5392,10 +5975,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class RepeatedGroup_extension : pb::IMessage, pb::IBufferMessage { + public sealed partial class RepeatedGroup_extension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup_extension()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -5523,9 +6111,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 372: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 376: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5543,10 +6149,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -5712,9 +6323,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 131: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestGroup.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 176: { + OptionalForeignEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5737,12 +6371,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestGroup message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -5870,9 +6509,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5890,6 +6547,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -5898,7 +6556,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestGroupExtension : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestGroupExtension : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestGroupExtension()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -6003,9 +6665,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6019,6 +6695,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6044,7 +6721,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestNestedExtension : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestNestedExtension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedExtension()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6133,9 +6814,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6147,12 +6840,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestNestedExtension message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class OptionalGroup_extension : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup_extension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup_extension()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -6280,9 +6978,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6300,6 +7016,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -6338,7 +7055,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// required filed because the code output is basically identical to /// optional fields for all types. /// - public sealed partial class TestRequired : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRequired : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequired()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -7651,14 +8372,158 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasC) { C = other.C; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 16: { + Dummy2 = input.ReadInt32(); + break; + } + case 24: { + B = input.ReadInt32(); + break; + } + case 32: { + Dummy4 = input.ReadInt32(); + break; + } + case 40: { + Dummy5 = input.ReadInt32(); + break; + } + case 48: { + Dummy6 = input.ReadInt32(); + break; + } + case 56: { + Dummy7 = input.ReadInt32(); + break; + } + case 64: { + Dummy8 = input.ReadInt32(); + break; + } + case 72: { + Dummy9 = input.ReadInt32(); + break; + } + case 80: { + Dummy10 = input.ReadInt32(); + break; + } + case 88: { + Dummy11 = input.ReadInt32(); + break; + } + case 96: { + Dummy12 = input.ReadInt32(); + break; + } + case 104: { + Dummy13 = input.ReadInt32(); + break; + } + case 112: { + Dummy14 = input.ReadInt32(); + break; + } + case 120: { + Dummy15 = input.ReadInt32(); + break; + } + case 128: { + Dummy16 = input.ReadInt32(); + break; + } + case 136: { + Dummy17 = input.ReadInt32(); + break; + } + case 144: { + Dummy18 = input.ReadInt32(); + break; + } + case 152: { + Dummy19 = input.ReadInt32(); + break; + } + case 160: { + Dummy20 = input.ReadInt32(); + break; + } + case 168: { + Dummy21 = input.ReadInt32(); + break; + } + case 176: { + Dummy22 = input.ReadInt32(); + break; + } + case 184: { + Dummy23 = input.ReadInt32(); + break; + } + case 192: { + Dummy24 = input.ReadInt32(); + break; + } + case 200: { + Dummy25 = input.ReadInt32(); + break; + } + case 208: { + Dummy26 = input.ReadInt32(); + break; + } + case 216: { + Dummy27 = input.ReadInt32(); + break; + } + case 224: { + Dummy28 = input.ReadInt32(); + break; + } + case 232: { + Dummy29 = input.ReadInt32(); + break; + } + case 240: { + Dummy30 = input.ReadInt32(); + break; + } + case 248: { + Dummy31 = input.ReadInt32(); + break; + } + case 256: { + Dummy32 = input.ReadInt32(); + break; + } + case 264: { + C = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7802,6 +8667,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the TestRequired message type. @@ -7816,7 +8682,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRequiredForeign : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRequiredForeign : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredForeign()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -7987,9 +8857,36 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (optionalMessage_ == null) { + OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); + } + input.ReadMessage(OptionalMessage); + break; + } + case 18: { + repeatedMessage_.AddEntriesFrom(input, _repeated_repeatedMessage_codec); + break; + } + case 24: { + Dummy = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8016,10 +8913,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestRequiredMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRequiredMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8178,9 +9080,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (optionalMessage_ == null) { + OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); + } + input.ReadMessage(OptionalMessage); + break; + } + case 18: { + repeatedMessage_.AddEntriesFrom(input, _repeated_repeatedMessage_codec); + break; + } + case 26: { + if (requiredMessage_ == null) { + RequiredMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); + } + input.ReadMessage(RequiredMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8210,13 +9142,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test that we can use NestedMessage from outside TestAllTypes. /// - public sealed partial class TestForeignNested : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestForeignNested : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8332,9 +9269,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (foreignNested_ == null) { + ForeignNested = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(ForeignNested); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8353,13 +9309,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// TestEmptyMessage is used to test unknown field support. /// - public sealed partial class TestEmptyMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestEmptyMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8448,9 +9409,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8462,6 +9435,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -8469,7 +9443,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Like above, but declare all field numbers as potential extensions. No /// actual extensions should ever be defined for this type. /// - public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessageWithExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -8574,9 +9552,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8590,6 +9582,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -8615,7 +9608,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMultipleExtensionRanges()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -8720,9 +9717,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8736,6 +9747,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -8764,7 +9776,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that really large tag numbers don't break anything. /// - public sealed partial class TestReallyLargeTagNumber : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestReallyLargeTagNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -8933,9 +9949,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 2147483640: { + Bb = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8955,10 +9991,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestRecursiveMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRecursiveMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -9113,9 +10154,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage(); + } + input.ReadMessage(A); + break; + } + case 16: { + I = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -9138,13 +10202,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test that mutual recursion works. /// - public sealed partial class TestMutualRecursionA : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMutualRecursionA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9298,9 +10367,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (bb_ == null) { + Bb = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); + } + input.ReadMessage(Bb); + break; + } + case 19: { + if (!HasSubGroup) { + SubGroup = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubGroup(); + } + input.ReadGroup(SubGroup); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -9326,12 +10421,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestMutualRecursionA message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class SubMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9447,9 +10547,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (b_ == null) { + B = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); + } + input.ReadMessage(B); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -9468,10 +10587,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class SubGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class SubGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9617,9 +10741,37 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 20: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 26: { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubMessage(); + } + input.ReadMessage(SubMessage); + break; + } + case 34: { + if (notInThisScc_ == null) { + NotInThisScc = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(NotInThisScc); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -9647,6 +10799,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -9655,7 +10808,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestMutualRecursionB : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMutualRecursionB : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionB()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -9810,9 +10967,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA(); + } + input.ReadMessage(A); + break; + } + case 16: { + OptionalInt32 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -9835,10 +11015,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestIsInitialized : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestIsInitialized : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestIsInitialized()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -9954,9 +11139,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage(); + } + input.ReadMessage(SubMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -9975,12 +11179,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestIsInitialized message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class SubMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -10107,9 +11316,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 11: { + if (!HasSubGroup) { + SubGroup = new global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Types.SubGroup(); + } + input.ReadGroup(SubGroup); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -10128,12 +11356,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the SubMessage message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class SubGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class SubGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -10261,9 +11494,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 12: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16: { + I = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -10281,6 +11532,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -10300,7 +11552,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// to compile with proto1, this will emit an error; so we only include it /// in protobuf_unittest_proto. /// - public sealed partial class TestDupFieldNumber : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestDupFieldNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDupFieldNumber()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -10507,9 +11763,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 19: { + if (!HasFoo) { + Foo = new global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Foo(); + } + input.ReadGroup(Foo); + break; + } + case 27: { + if (!HasBar) { + Bar = new global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Bar(); + } + input.ReadGroup(Bar); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -10539,12 +11825,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestDupFieldNumber message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class Foo : pb::IMessage, pb::IBufferMessage { + public sealed partial class Foo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Foo()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -10672,9 +11963,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 20: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -10692,10 +12001,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class Bar : pb::IMessage, pb::IBufferMessage { + public sealed partial class Bar : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bar()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -10823,9 +12137,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 28: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -10843,6 +12175,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -10854,7 +12187,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Additional messages for testing lazy fields. /// - public sealed partial class TestEagerMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestEagerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEagerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -10970,9 +12307,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(SubMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -10991,10 +12347,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestLazyMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestLazyMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestLazyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -11110,9 +12471,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(SubMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -11131,13 +12511,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Needed for a Python test. /// - public sealed partial class TestNestedMessageHasBits : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestNestedMessageHasBits : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedMessageHasBits()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -11253,9 +12638,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -11274,12 +12678,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestNestedMessageHasBits message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -11400,9 +12809,30 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + nestedmessageRepeatedInt32_.AddEntriesFrom(input, _repeated_nestedmessageRepeatedInt32_codec); + break; + } + case 18: { + nestedmessageRepeatedForeignmessage_.AddEntriesFrom(input, _repeated_nestedmessageRepeatedForeignmessage_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -11423,6 +12853,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -11435,7 +12866,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Test message with CamelCase field names. This violates Protocol Buffer /// standard style. /// - public sealed partial class TestCamelCaseFieldNames : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestCamelCaseFieldNames : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -11831,9 +13266,74 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + PrimitiveField = input.ReadInt32(); + break; + } + case 18: { + StringField = input.ReadString(); + break; + } + case 24: { + EnumField = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 34: { + if (messageField_ == null) { + MessageField = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(MessageField); + break; + } + case 42: { + StringPieceField = input.ReadString(); + break; + } + case 50: { + CordField = input.ReadString(); + break; + } + case 58: + case 56: { + repeatedPrimitiveField_.AddEntriesFrom(input, _repeated_repeatedPrimitiveField_codec); + break; + } + case 66: { + repeatedStringField_.AddEntriesFrom(input, _repeated_repeatedStringField_codec); + break; + } + case 74: + case 72: { + repeatedEnumField_.AddEntriesFrom(input, _repeated_repeatedEnumField_codec); + break; + } + case 82: { + repeatedMessageField_.AddEntriesFrom(input, _repeated_repeatedMessageField_codec); + break; + } + case 90: { + repeatedStringPieceField_.AddEntriesFrom(input, _repeated_repeatedStringPieceField_codec); + break; + } + case 98: { + repeatedCordField_.AddEntriesFrom(input, _repeated_repeatedCordField_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -11898,6 +13398,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -11905,7 +13406,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// We list fields out of order, to ensure that we're using field number and not /// field index to determine serialization order. /// - public sealed partial class TestFieldOrderings : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestFieldOrderings : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -12149,9 +13654,42 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + MyInt = input.ReadInt64(); + break; + } + case 90: { + MyString = input.ReadString(); + break; + } + case 813: { + MyFloat = input.ReadFloat(); + break; + } + case 1602: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -12184,6 +13722,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -12211,7 +13750,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Container for nested types declared in the TestFieldOrderings message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -12381,9 +13924,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + case 16: { + Oo = input.ReadInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -12403,6 +13966,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -12411,7 +13975,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtensionOrderings1 : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestExtensionOrderings1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -12536,9 +14104,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MyString = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -12554,6 +14138,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings1 message type. @@ -12566,7 +14151,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtensionOrderings2 : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestExtensionOrderings2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -12691,9 +14280,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MyString = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -12709,12 +14314,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestExtensionOrderings2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class TestExtensionOrderings3 : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestExtensionOrderings3 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -12839,9 +14449,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MyString = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -12857,6 +14483,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings3 message type. @@ -12883,7 +14510,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtremeDefaultValues : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestExtremeDefaultValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtremeDefaultValues()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -13989,9 +15620,129 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + EscapedBytes = input.ReadBytes(); + break; + } + case 16: { + LargeUint32 = input.ReadUInt32(); + break; + } + case 24: { + LargeUint64 = input.ReadUInt64(); + break; + } + case 32: { + SmallInt32 = input.ReadInt32(); + break; + } + case 40: { + SmallInt64 = input.ReadInt64(); + break; + } + case 50: { + Utf8String = input.ReadString(); + break; + } + case 61: { + ZeroFloat = input.ReadFloat(); + break; + } + case 69: { + OneFloat = input.ReadFloat(); + break; + } + case 77: { + SmallFloat = input.ReadFloat(); + break; + } + case 85: { + NegativeOneFloat = input.ReadFloat(); + break; + } + case 93: { + NegativeFloat = input.ReadFloat(); + break; + } + case 101: { + LargeFloat = input.ReadFloat(); + break; + } + case 109: { + SmallNegativeFloat = input.ReadFloat(); + break; + } + case 113: { + InfDouble = input.ReadDouble(); + break; + } + case 121: { + NegInfDouble = input.ReadDouble(); + break; + } + case 129: { + NanDouble = input.ReadDouble(); + break; + } + case 141: { + InfFloat = input.ReadFloat(); + break; + } + case 149: { + NegInfFloat = input.ReadFloat(); + break; + } + case 157: { + NanFloat = input.ReadFloat(); + break; + } + case 162: { + CppTrigraph = input.ReadString(); + break; + } + case 168: { + ReallySmallInt32 = input.ReadInt32(); + break; + } + case 176: { + ReallySmallInt64 = input.ReadInt64(); + break; + } + case 186: { + StringWithZero = input.ReadString(); + break; + } + case 194: { + BytesWithZero = input.ReadBytes(); + break; + } + case 202: { + StringPieceWithZero = input.ReadString(); + break; + } + case 210: { + CordWithZero = input.ReadString(); + break; + } + case 218: { + ReplacementString = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14111,10 +15862,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class SparseEnumMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class SparseEnumMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseEnumMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -14242,9 +15998,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SparseEnum = (global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14260,13 +16032,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test String and Bytes: string is for valid UTF-8 strings /// - public sealed partial class OneString : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14391,9 +16168,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14409,10 +16202,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class MoreString : pb::IMessage, pb::IBufferMessage { + public sealed partial class MoreString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14517,9 +16315,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + data_.AddEntriesFrom(input, _repeated_data_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14535,10 +16349,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class OneBytes : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14663,9 +16482,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14681,10 +16516,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class MoreBytes : pb::IMessage, pb::IBufferMessage { + public sealed partial class MoreBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -14789,9 +16629,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + data_.AddEntriesFrom(input, _repeated_data_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14807,13 +16663,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test int32, uint32, int64, uint64, and bool are all compatible /// - public sealed partial class Int32Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Int32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -14941,9 +16802,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -14959,10 +16836,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class Uint32Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Uint32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint32Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -15090,9 +16972,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadUInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -15108,10 +17006,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class Int64Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Int64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -15239,9 +17142,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -15257,10 +17176,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class Uint64Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Uint64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint64Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -15388,9 +17312,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadUInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -15406,10 +17346,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class BoolMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class BoolMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -15537,9 +17482,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -15555,13 +17516,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test oneofs. /// - public sealed partial class TestOneof : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -15826,9 +17792,47 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + case 35: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup(); + if (HasFooGroup) { + subBuilder.MergeFrom(FooGroup); + } + input.ReadGroup(subBuilder); + FooGroup = subBuilder; + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -15866,12 +17870,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestOneof message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class FooGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -16035,9 +18044,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 36: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 40: { + A = input.ReadInt32(); + break; + } + case 50: { + B = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -16059,6 +18090,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -16067,7 +18099,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestOneofBackwardsCompatible : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestOneofBackwardsCompatible : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneofBackwardsCompatible()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -16296,9 +18332,43 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + if (fooMessage_ == null) { + FooMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(FooMessage); + break; + } + case 35: { + if (!HasFooGroup) { + FooGroup = new global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Types.FooGroup(); + } + input.ReadGroup(FooGroup); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -16332,12 +18402,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestOneofBackwardsCompatible message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class FooGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -16501,9 +18576,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 36: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 40: { + A = input.ReadInt32(); + break; + } + case 50: { + B = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -16525,6 +18622,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -16533,7 +18631,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestOneof2 : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestOneof2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof2()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -17276,51 +19378,148 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (FooMessage == null) { FooMessage = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); } - FooMessage.MergeFrom(other.FooMessage); - break; - case FooOneofCase.FooGroup: - if (FooGroup == null) { - FooGroup = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup(); + FooMessage.MergeFrom(other.FooMessage); + break; + case FooOneofCase.FooGroup: + if (FooGroup == null) { + FooGroup = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup(); + } + FooGroup.MergeFrom(other.FooGroup); + break; + case FooOneofCase.FooLazyMessage: + if (FooLazyMessage == null) { + FooLazyMessage = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); + } + FooLazyMessage.MergeFrom(other.FooLazyMessage); + break; + } + + switch (other.BarCase) { + case BarOneofCase.BarInt: + BarInt = other.BarInt; + break; + case BarOneofCase.BarString: + BarString = other.BarString; + break; + case BarOneofCase.BarCord: + BarCord = other.BarCord; + break; + case BarOneofCase.BarStringPiece: + BarStringPiece = other.BarStringPiece; + break; + case BarOneofCase.BarBytes: + BarBytes = other.BarBytes; + break; + case BarOneofCase.BarEnum: + BarEnum = other.BarEnum; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + FooCord = input.ReadString(); + break; + } + case 34: { + FooStringPiece = input.ReadString(); + break; + } + case 42: { + FooBytes = input.ReadBytes(); + break; + } + case 48: { + foo_ = input.ReadEnum(); + fooCase_ = FooOneofCase.FooEnum; + break; + } + case 58: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + case 67: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup(); + if (HasFooGroup) { + subBuilder.MergeFrom(FooGroup); + } + input.ReadGroup(subBuilder); + FooGroup = subBuilder; + break; + } + case 90: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); + if (fooCase_ == FooOneofCase.FooLazyMessage) { + subBuilder.MergeFrom(FooLazyMessage); + } + input.ReadMessage(subBuilder); + FooLazyMessage = subBuilder; + break; + } + case 96: { + BarInt = input.ReadInt32(); + break; + } + case 106: { + BarString = input.ReadString(); + break; + } + case 114: { + BarCord = input.ReadString(); + break; + } + case 122: { + BarStringPiece = input.ReadString(); + break; } - FooGroup.MergeFrom(other.FooGroup); - break; - case FooOneofCase.FooLazyMessage: - if (FooLazyMessage == null) { - FooLazyMessage = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); + case 130: { + BarBytes = input.ReadBytes(); + break; } - FooLazyMessage.MergeFrom(other.FooLazyMessage); - break; - } - - switch (other.BarCase) { - case BarOneofCase.BarInt: - BarInt = other.BarInt; - break; - case BarOneofCase.BarString: - BarString = other.BarString; - break; - case BarOneofCase.BarCord: - BarCord = other.BarCord; - break; - case BarOneofCase.BarStringPiece: - BarStringPiece = other.BarStringPiece; - break; - case BarOneofCase.BarBytes: - BarBytes = other.BarBytes; - break; - case BarOneofCase.BarEnum: - BarEnum = other.BarEnum; - break; + case 136: { + bar_ = input.ReadEnum(); + barCase_ = BarOneofCase.BarEnum; + break; + } + case 144: { + BazInt = input.ReadInt32(); + break; + } + case 154: { + BazString = input.ReadString(); + break; + } + } } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -17417,6 +19616,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestOneof2 message type. @@ -17428,7 +19628,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("BAZ")] Baz = 3, } - public sealed partial class FooGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -17592,9 +19796,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 68: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 72: { + A = input.ReadInt32(); + break; + } + case 82: { + B = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -17616,10 +19842,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -17763,9 +19994,30 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + QuxInt = input.ReadInt64(); + break; + } + case 18: + case 16: { + corgeInt_.AddEntriesFrom(input, _repeated_corgeInt_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -17786,6 +20038,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -17794,7 +20047,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRequiredOneof : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRequiredOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18016,9 +20273,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage(); + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -18047,12 +20333,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestRequiredOneof message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -18180,9 +20471,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + RequiredDouble = input.ReadDouble(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -18198,6 +20505,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -18206,7 +20514,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRequiredMap : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRequiredMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18311,9 +20623,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + foo_.AddEntriesFrom(input, _map_foo_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -18329,12 +20657,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestRequiredMap message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -18462,9 +20795,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RequiredInt32 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -18480,6 +20829,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -18488,7 +20838,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestPackedTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestPackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -18801,9 +21155,91 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 722: + case 720: { + packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + break; + } + case 730: + case 728: { + packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec); + break; + } + case 738: + case 736: { + packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec); + break; + } + case 746: + case 744: { + packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec); + break; + } + case 754: + case 752: { + packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec); + break; + } + case 762: + case 760: { + packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec); + break; + } + case 770: + case 773: { + packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec); + break; + } + case 778: + case 777: { + packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec); + break; + } + case 786: + case 789: { + packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec); + break; + } + case 794: + case 793: { + packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec); + break; + } + case 802: + case 805: { + packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec); + break; + } + case 810: + case 809: { + packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec); + break; + } + case 818: + case 816: { + packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec); + break; + } + case 826: + case 824: { + packedEnum_.AddEntriesFrom(input, _repeated_packedEnum_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -18885,6 +21321,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -18892,7 +21329,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// A message with the same fields as TestPackedTypes, but without packing. Used /// to test packed <-> unpacked wire compatibility. /// - public sealed partial class TestUnpackedTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestUnpackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -19186,28 +21627,110 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other == null) { return; } - unpackedInt32_.Add(other.unpackedInt32_); - unpackedInt64_.Add(other.unpackedInt64_); - unpackedUint32_.Add(other.unpackedUint32_); - unpackedUint64_.Add(other.unpackedUint64_); - unpackedSint32_.Add(other.unpackedSint32_); - unpackedSint64_.Add(other.unpackedSint64_); - unpackedFixed32_.Add(other.unpackedFixed32_); - unpackedFixed64_.Add(other.unpackedFixed64_); - unpackedSfixed32_.Add(other.unpackedSfixed32_); - unpackedSfixed64_.Add(other.unpackedSfixed64_); - unpackedFloat_.Add(other.unpackedFloat_); - unpackedDouble_.Add(other.unpackedDouble_); - unpackedBool_.Add(other.unpackedBool_); - unpackedEnum_.Add(other.unpackedEnum_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + unpackedInt32_.Add(other.unpackedInt32_); + unpackedInt64_.Add(other.unpackedInt64_); + unpackedUint32_.Add(other.unpackedUint32_); + unpackedUint64_.Add(other.unpackedUint64_); + unpackedSint32_.Add(other.unpackedSint32_); + unpackedSint64_.Add(other.unpackedSint64_); + unpackedFixed32_.Add(other.unpackedFixed32_); + unpackedFixed64_.Add(other.unpackedFixed64_); + unpackedSfixed32_.Add(other.unpackedSfixed32_); + unpackedSfixed64_.Add(other.unpackedSfixed64_); + unpackedFloat_.Add(other.unpackedFloat_); + unpackedDouble_.Add(other.unpackedDouble_); + unpackedBool_.Add(other.unpackedBool_); + unpackedEnum_.Add(other.unpackedEnum_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 722: + case 720: { + unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + break; + } + case 730: + case 728: { + unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + break; + } + case 738: + case 736: { + unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + break; + } + case 746: + case 744: { + unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + break; + } + case 754: + case 752: { + unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + break; + } + case 762: + case 760: { + unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + break; + } + case 770: + case 773: { + unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + break; + } + case 778: + case 777: { + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 786: + case 789: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 794: + case 793: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 802: + case 805: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 810: + case 809: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 818: + case 816: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 826: + case 824: { + unpackedEnum_.AddEntriesFrom(input, _repeated_unpackedEnum_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -19289,10 +21812,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestPackedExtensions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestPackedExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -19397,9 +21925,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -19413,6 +21955,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -19438,7 +21981,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestUnpackedExtensions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestUnpackedExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -19543,9 +22090,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -19559,6 +22120,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -19589,7 +22151,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// a set of extensions to TestAllExtensions dynamically, based on the fields /// of this message type. /// - public sealed partial class TestDynamicExtensions : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestDynamicExtensions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDynamicExtensions()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -19877,9 +22443,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16005: { + ScalarExtension = input.ReadFixed32(); + break; + } + case 16008: { + EnumExtension = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 16016: { + DynamicEnumExtension = (global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicEnumType) input.ReadEnum(); + break; + } + case 16026: { + if (messageExtension_ == null) { + MessageExtension = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(MessageExtension); + break; + } + case 16034: { + if (dynamicMessageExtension_ == null) { + DynamicMessageExtension = new global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType(); + } + input.ReadMessage(DynamicMessageExtension); + break; + } + case 16042: { + repeatedExtension_.AddEntriesFrom(input, _repeated_repeatedExtension_codec); + break; + } + case 16050: + case 16048: { + packedExtension_.AddEntriesFrom(input, _repeated_packedExtension_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -19926,6 +22539,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestDynamicExtensions message type. @@ -19937,7 +22551,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("DYNAMIC_BAZ")] DynamicBaz = 2202, } - public sealed partial class DynamicMessageType : pb::IMessage, pb::IBufferMessage { + public sealed partial class DynamicMessageType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DynamicMessageType()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -20065,9 +22683,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16800: { + DynamicField = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -20083,6 +22717,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -20091,7 +22726,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -20290,9 +22929,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 98: + case 101: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 106: + case 104: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 16370: + case 16369: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 16378: + case 16376: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 2097138: + case 2097141: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 2097146: + case 2097144: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -20334,6 +23015,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -20341,7 +23023,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Test that if an optional or required message/group field appears multiple /// times in the input, they need to be merged. /// - public sealed partial class TestParsingMerge : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestParsingMerge : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestParsingMerge()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -20570,9 +23256,52 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + if (requiredAllTypes_ == null) { + RequiredAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(RequiredAllTypes); + break; + } + case 18: { + if (optionalAllTypes_ == null) { + OptionalAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(OptionalAllTypes); + break; + } + case 26: { + repeatedAllTypes_.AddEntriesFrom(input, _repeated_repeatedAllTypes_codec); + break; + } + case 83: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 163: { + repeatedGroup_.AddEntriesFrom(input, _repeated_repeatedGroup_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -20615,6 +23344,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -20649,7 +23379,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Repeated fields in RepeatedFieldsGenerator are expected to be merged into /// the corresponding required/optional fields in TestParsingMerge. /// - public sealed partial class RepeatedFieldsGenerator : pb::IMessage, pb::IBufferMessage { + public sealed partial class RepeatedFieldsGenerator : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedFieldsGenerator()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -20850,9 +23584,49 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + field1_.AddEntriesFrom(input, _repeated_field1_codec); + break; + } + case 18: { + field2_.AddEntriesFrom(input, _repeated_field2_codec); + break; + } + case 26: { + field3_.AddEntriesFrom(input, _repeated_field3_codec); + break; + } + case 83: { + group1_.AddEntriesFrom(input, _repeated_group1_codec); + break; + } + case 163: { + group2_.AddEntriesFrom(input, _repeated_group2_codec); + break; + } + case 8002: { + ext1_.AddEntriesFrom(input, _repeated_ext1_codec); + break; + } + case 8010: { + ext2_.AddEntriesFrom(input, _repeated_ext2_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -20892,12 +23666,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the RepeatedFieldsGenerator message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class Group1 : pb::IMessage, pb::IBufferMessage { + public sealed partial class Group1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Group1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21013,9 +23792,30 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 84: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 90: { + if (field1_ == null) { + Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(Field1); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21036,10 +23836,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class Group2 : pb::IMessage, pb::IBufferMessage { + public sealed partial class Group2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Group2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21148,16 +23953,37 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (field1_ == null) { Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } - Field1.MergeFrom(other.Field1); + Field1.MergeFrom(other.Field1); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 164: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 170: { + if (field1_ == null) { + Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(Field1); + break; + } + } } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21178,6 +24004,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -21186,7 +24013,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21302,9 +24133,30 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 84: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 90: { + if (optionalGroupAllTypes_ == null) { + OptionalGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(OptionalGroupAllTypes); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21325,10 +24177,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class RepeatedGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class RepeatedGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21444,9 +24301,30 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 164: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 170: { + if (repeatedGroupAllTypes_ == null) { + RepeatedGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(RepeatedGroupAllTypes); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21467,6 +24345,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -21486,7 +24365,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestCommentInjectionMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestCommentInjectionMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21614,9 +24497,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + A = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21632,13 +24531,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test that RPC services work. /// - public sealed partial class FooRequest : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21727,9 +24631,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21741,10 +24657,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class FooResponse : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21833,9 +24754,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21847,10 +24780,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class FooClientMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -21939,9 +24877,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -21953,10 +24903,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class FooServerMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -22045,9 +25000,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -22059,10 +25026,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class BarRequest : pb::IMessage, pb::IBufferMessage { + public sealed partial class BarRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -22151,9 +25123,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -22165,10 +25149,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class BarResponse : pb::IMessage, pb::IBufferMessage { + public sealed partial class BarResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -22257,9 +25246,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -22271,10 +25272,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestJsonName : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestJsonName : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonName()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -22587,9 +25593,45 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FieldName1 = input.ReadInt32(); + break; + } + case 16: { + FieldName2 = input.ReadInt32(); + break; + } + case 24: { + FieldName3 = input.ReadInt32(); + break; + } + case 32: { + FieldName4 = input.ReadInt32(); + break; + } + case 40: { + FIELDNAME5 = input.ReadInt32(); + break; + } + case 48: { + FieldName6 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -22625,10 +25667,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestHugeFieldNumbers : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestHugeFieldNumbers : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestHugeFieldNumbers()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -23203,9 +26250,92 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 4294960000: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 4294960008: { + Fixed32 = input.ReadInt32(); + break; + } + case 4294960018: + case 4294960016: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 4294960026: + case 4294960024: { + packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + break; + } + case 4294960032: { + OptionalEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 4294960042: { + OptionalString = input.ReadString(); + break; + } + case 4294960050: { + OptionalBytes = input.ReadBytes(); + break; + } + case 4294960058: { + if (optionalMessage_ == null) { + OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(OptionalMessage); + break; + } + case 4294960067: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 4294960082: { + stringStringMap_.AddEntriesFrom(input, _map_stringStringMap_codec); + break; + } + case 4294960088: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 4294960098: { + global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) { + subBuilder.MergeFrom(OneofTestAllTypes); + } + input.ReadMessage(subBuilder); + OneofTestAllTypes = subBuilder; + break; + } + case 4294960106: { + OneofString = input.ReadString(); + break; + } + case 4294960114: { + OneofBytes = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -23288,6 +26418,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -23315,7 +26446,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Container for nested types declared in the TestHugeFieldNumbers message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -23443,9 +26578,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 4294960068: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 4294960072: { + GroupA = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -23463,6 +26616,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -23471,7 +26625,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtensionInsideTable : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class TestExtensionInsideTable : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionInsideTable()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -23911,9 +27069,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + Field1 = input.ReadInt32(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 32: { + Field4 = input.ReadInt32(); + break; + } + case 48: { + Field6 = input.ReadInt32(); + break; + } + case 56: { + Field7 = input.ReadInt32(); + break; + } + case 64: { + Field8 = input.ReadInt32(); + break; + } + case 72: { + Field9 = input.ReadInt32(); + break; + } + case 80: { + Field10 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -23963,6 +27171,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs index 818748b298..26455da906 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs @@ -257,7 +257,11 @@ namespace UnitTest.Issues.TestProtos { /// A test message with custom options at all possible locations (and also some /// regular options, to make sure they interact nicely). /// - public sealed partial class TestMessageWithCustomOptions : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMessageWithCustomOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageWithCustomOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -422,9 +426,29 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Field1 = input.ReadString(); + break; + } + case 16: { + OneofField = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -444,6 +468,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the TestMessageWithCustomOptions message type. @@ -464,7 +489,11 @@ namespace UnitTest.Issues.TestProtos { /// A test RPC service with custom options at all possible locations (and also /// some regular options, to make sure they interact nicely). /// - public sealed partial class CustomOptionFooRequest : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionFooRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -553,9 +582,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -567,10 +608,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class CustomOptionFooResponse : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionFooResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -659,9 +705,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -673,10 +731,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class CustomOptionFooClientMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionFooClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -765,9 +828,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -779,10 +854,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class CustomOptionFooServerMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionFooServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -871,9 +951,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -885,10 +977,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class DummyMessageContainingEnum : pb::IMessage, pb::IBufferMessage { + public sealed partial class DummyMessageContainingEnum : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessageContainingEnum()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -977,9 +1074,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -991,6 +1100,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the DummyMessageContainingEnum message type. @@ -1007,7 +1117,11 @@ namespace UnitTest.Issues.TestProtos { } - public sealed partial class DummyMessageInvalidAsOptionType : pb::IMessage, pb::IBufferMessage { + public sealed partial class DummyMessageInvalidAsOptionType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessageInvalidAsOptionType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1096,9 +1210,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1110,10 +1236,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class CustomOptionMinIntegerValues : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionMinIntegerValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionMinIntegerValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1202,9 +1333,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1216,10 +1359,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class CustomOptionMaxIntegerValues : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionMaxIntegerValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionMaxIntegerValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1308,9 +1456,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1322,10 +1482,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class CustomOptionOtherValues : pb::IMessage, pb::IBufferMessage { + public sealed partial class CustomOptionOtherValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionOtherValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1414,9 +1579,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1428,10 +1605,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class SettingRealsFromPositiveInts : pb::IMessage, pb::IBufferMessage { + public sealed partial class SettingRealsFromPositiveInts : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SettingRealsFromPositiveInts()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1520,9 +1702,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1534,10 +1728,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class SettingRealsFromNegativeInts : pb::IMessage, pb::IBufferMessage { + public sealed partial class SettingRealsFromNegativeInts : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SettingRealsFromNegativeInts()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1626,9 +1825,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1640,10 +1851,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class ComplexOptionType1 : pb::IMessage, pb::IBufferMessage { + public sealed partial class ComplexOptionType1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1820,9 +2036,38 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Foo = input.ReadInt32(); + break; + } + case 16: { + Foo2 = input.ReadInt32(); + break; + } + case 24: { + Foo3 = input.ReadInt32(); + break; + } + case 34: + case 32: { + foo4_.AddEntriesFrom(input, _repeated_foo4_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1851,10 +2096,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class ComplexOptionType2 : pb::IMessage, pb::IBufferMessage { + public sealed partial class ComplexOptionType2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2037,9 +2287,43 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (bar_ == null) { + Bar = new global::UnitTest.Issues.TestProtos.ComplexOptionType1(); + } + input.ReadMessage(Bar); + break; + } + case 16: { + Baz = input.ReadInt32(); + break; + } + case 26: { + if (fred_ == null) { + Fred = new global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4(); + } + input.ReadMessage(Fred); + break; + } + case 34: { + barney_.AddEntriesFrom(input, _repeated_barney_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2073,12 +2357,17 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the ComplexOptionType2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class ComplexOptionType4 : pb::IMessage, pb::IBufferMessage { + public sealed partial class ComplexOptionType4 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType4()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2191,9 +2480,25 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Waldo = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2209,6 +2514,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the ComplexOptionType4 message type. @@ -2226,7 +2532,11 @@ namespace UnitTest.Issues.TestProtos { } - public sealed partial class ComplexOptionType3 : pb::IMessage, pb::IBufferMessage { + public sealed partial class ComplexOptionType3 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2339,9 +2649,25 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Qux = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2357,13 +2683,18 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } /// /// Note that we try various different ways of naming the same extension. /// - public sealed partial class VariousComplexOptions : pb::IMessage, pb::IBufferMessage { + public sealed partial class VariousComplexOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VariousComplexOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2452,9 +2783,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2466,13 +2809,18 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } /// /// A helper type used to test aggregate option parsing /// - public sealed partial class Aggregate : pb::IMessage, pb::IBufferMessage { + public sealed partial class Aggregate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Aggregate()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2639,9 +2987,36 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + I = input.ReadInt32(); + break; + } + case 18: { + S = input.ReadString(); + break; + } + case 26: { + if (sub_ == null) { + Sub = new global::UnitTest.Issues.TestProtos.Aggregate(); + } + input.ReadMessage(Sub); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2668,10 +3043,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class AggregateMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class AggregateMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AggregateMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2784,9 +3164,25 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Fieldname = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2802,13 +3198,18 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } /// /// Test custom options for nested type. /// - public sealed partial class NestedOptionType : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedOptionType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOptionType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2897,9 +3298,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2911,6 +3324,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the NestedOptionType message type. @@ -2921,7 +3335,11 @@ namespace UnitTest.Issues.TestProtos { [pbr::OriginalName("NESTED_ENUM_VALUE")] Value = 1, } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3034,9 +3452,25 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NestedField = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3052,6 +3486,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs index 1cddcd82ce..6ac9f11069 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs @@ -59,7 +59,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endregion #region Messages - public sealed partial class ImportMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class ImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImportMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -187,9 +191,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + D = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -205,6 +225,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs index bcd27bf2e1..99575b1a3d 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs @@ -50,7 +50,11 @@ namespace Google.Protobuf.TestProtos { #endregion #region Messages - public sealed partial class ImportMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class ImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImportMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -163,9 +167,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + D = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -181,6 +201,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs index 6b35c107d6..9bdcf1d686 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs @@ -37,7 +37,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } #region Messages - public sealed partial class PublicImportMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class PublicImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PublicImportMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -165,9 +169,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + E = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -183,6 +203,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs index 664c666793..dba9165f44 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs @@ -38,7 +38,11 @@ namespace Google.Protobuf.TestProtos { } #region Messages - public sealed partial class PublicImportMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class PublicImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PublicImportMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -151,9 +155,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + E = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -169,6 +189,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs index bede87ab57..660dbbdda3 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs @@ -37,7 +37,11 @@ namespace UnitTest.Issues.TestProtos { } #region Messages - public sealed partial class Foo : pb::IMessage, pb::IBufferMessage { + public sealed partial class Foo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Foo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -126,9 +130,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -140,6 +156,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs index e86780f70e..b7498d6f23 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs @@ -39,7 +39,11 @@ namespace UnitTest.Issues.TestProtos { } #region Messages - public sealed partial class Bar : pb::IMessage, pb::IBufferMessage { + public sealed partial class Bar : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bar()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -155,9 +159,28 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (foo_ == null) { + Foo = new global::UnitTest.Issues.TestProtos.Foo(); + } + input.ReadMessage(Foo); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -176,6 +199,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs index 68884e1961..f5c46a9503 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs @@ -88,7 +88,11 @@ namespace UnitTest.Issues.TestProtos { /// Issue 307: when generating doubly-nested types, any references /// should be of the form A.Types.B.Types.C. /// - public sealed partial class Issue307 : pb::IMessage, pb::IBufferMessage { + public sealed partial class Issue307 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issue307()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -177,9 +181,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -191,12 +207,17 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the Issue307 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedOnce : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedOnce : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOnce()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -285,9 +306,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -299,12 +332,17 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the NestedOnce message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedTwice : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedTwice : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTwice()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -393,9 +431,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -407,6 +457,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } @@ -420,7 +471,11 @@ namespace UnitTest.Issues.TestProtos { } - public sealed partial class NegativeEnumMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NegativeEnumMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NegativeEnumMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -565,9 +620,35 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum(); + break; + } + case 18: + case 16: { + values_.AddEntriesFrom(input, _repeated_values_codec); + break; + } + case 26: + case 24: { + packedValues_.AddEntriesFrom(input, _repeated_packedValues_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -593,10 +674,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class DeprecatedChild : pb::IMessage, pb::IBufferMessage { + public sealed partial class DeprecatedChild : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedChild()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -685,9 +771,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -699,10 +797,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class DeprecatedFieldsMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class DeprecatedFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedFieldsMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -920,9 +1023,50 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + PrimitiveValue = input.ReadInt32(); + break; + } + case 18: + case 16: { + primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec); + break; + } + case 26: { + if (messageValue_ == null) { + MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild(); + } + input.ReadMessage(MessageValue); + break; + } + case 34: { + messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec); + break; + } + case 40: { + EnumValue = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum(); + break; + } + case 50: + case 48: { + enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -963,13 +1107,18 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } /// /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 /// - public sealed partial class ItemField : pb::IMessage, pb::IBufferMessage { + public sealed partial class ItemField : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ItemField()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1082,9 +1231,25 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Item = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1100,10 +1265,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class ReservedNames : pb::IMessage, pb::IBufferMessage { + public sealed partial class ReservedNames : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedNames()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1240,9 +1410,29 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Types_ = input.ReadInt32(); + break; + } + case 16: { + Descriptor_ = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1262,6 +1452,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the ReservedNames message type. @@ -1270,7 +1461,11 @@ namespace UnitTest.Issues.TestProtos { /// /// Force a nested type called Types /// - public sealed partial class SomeNestedType : pb::IMessage, pb::IBufferMessage { + public sealed partial class SomeNestedType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SomeNestedType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1359,9 +1554,21 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1373,6 +1580,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } @@ -1393,7 +1601,11 @@ namespace UnitTest.Issues.TestProtos { /// Alternatively, consider just adding this to /// unittest_proto3.proto if multiple platforms want it. /// - public sealed partial class TestJsonFieldOrdering : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestJsonFieldOrdering : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonFieldOrdering()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1688,9 +1900,45 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + PlainString = input.ReadString(); + break; + } + case 18: { + O1String = input.ReadString(); + break; + } + case 26: { + O2String = input.ReadString(); + break; + } + case 32: { + PlainInt32 = input.ReadInt32(); + break; + } + case 40: { + O1Int32 = input.ReadInt32(); + break; + } + case 48: { + O2Int32 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1726,10 +1974,15 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - public sealed partial class TestJsonName : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestJsonName : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonName()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1893,9 +2146,33 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Description = input.ReadString(); + break; + } + case 26: { + Guid = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1919,6 +2196,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } @@ -1927,7 +2205,11 @@ namespace UnitTest.Issues.TestProtos { /// oneof case, which is itself a message type, the submessages should /// be merged. /// - public sealed partial class OneofMerging : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneofMerging : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofMerging()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2098,9 +2380,34 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Text = input.ReadString(); + break; + } + case 18: { + global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested subBuilder = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested(); + if (valueCase_ == ValueOneofCase.Nested) { + subBuilder.MergeFrom(Nested); + } + input.ReadMessage(subBuilder); + Nested = subBuilder; + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2125,12 +2432,17 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the OneofMerging message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class Nested : pb::IMessage, pb::IBufferMessage { + public sealed partial class Nested : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Nested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2267,9 +2579,29 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + X = input.ReadInt32(); + break; + } + case 16: { + Y = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2289,6 +2621,7 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs index 5d0ea8672d..468e48bd05 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs @@ -254,7 +254,11 @@ namespace Google.Protobuf.TestProtos { /// This proto includes every type of field in both singular and repeated /// forms. /// - public sealed partial class TestAllTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1383,9 +1387,246 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SingleInt32 = input.ReadInt32(); + break; + } + case 16: { + SingleInt64 = input.ReadInt64(); + break; + } + case 24: { + SingleUint32 = input.ReadUInt32(); + break; + } + case 32: { + SingleUint64 = input.ReadUInt64(); + break; + } + case 40: { + SingleSint32 = input.ReadSInt32(); + break; + } + case 48: { + SingleSint64 = input.ReadSInt64(); + break; + } + case 61: { + SingleFixed32 = input.ReadFixed32(); + break; + } + case 65: { + SingleFixed64 = input.ReadFixed64(); + break; + } + case 77: { + SingleSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + SingleSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + SingleFloat = input.ReadFloat(); + break; + } + case 97: { + SingleDouble = input.ReadDouble(); + break; + } + case 104: { + SingleBool = input.ReadBool(); + break; + } + case 114: { + SingleString = input.ReadString(); + break; + } + case 122: { + SingleBytes = input.ReadBytes(); + break; + } + case 146: { + if (singleNestedMessage_ == null) { + SingleNestedMessage = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(SingleNestedMessage); + break; + } + case 154: { + if (singleForeignMessage_ == null) { + SingleForeignMessage = new global::Google.Protobuf.TestProtos.ForeignMessage(); + } + input.ReadMessage(SingleForeignMessage); + break; + } + case 162: { + if (singleImportMessage_ == null) { + SingleImportMessage = new global::Google.Protobuf.TestProtos.ImportMessage(); + } + input.ReadMessage(SingleImportMessage); + break; + } + case 168: { + SingleNestedEnum = (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + SingleForeignEnum = (global::Google.Protobuf.TestProtos.ForeignEnum) input.ReadEnum(); + break; + } + case 184: { + SingleImportEnum = (global::Google.Protobuf.TestProtos.ImportEnum) input.ReadEnum(); + break; + } + case 210: { + if (singlePublicImportMessage_ == null) { + SinglePublicImportMessage = new global::Google.Protobuf.TestProtos.PublicImportMessage(); + } + input.ReadMessage(SinglePublicImportMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec); + break; + } + case 402: { + repeatedImportMessage_.AddEntriesFrom(input, _repeated_repeatedImportMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec); + break; + } + case 426: + case 424: { + repeatedImportEnum_.AddEntriesFrom(input, _repeated_repeatedImportEnum_codec); + break; + } + case 434: { + repeatedPublicImportMessage_.AddEntriesFrom(input, _repeated_repeatedPublicImportMessage_codec); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1622,6 +1863,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the TestAllTypes message type. @@ -1638,7 +1880,11 @@ namespace Google.Protobuf.TestProtos { [pbr::OriginalName("NEG")] Neg = -1, } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1756,9 +2002,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1774,6 +2036,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -1785,7 +2048,11 @@ namespace Google.Protobuf.TestProtos { /// /// This proto includes a recursively nested message. /// - public sealed partial class NestedTestAllTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedTestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1944,9 +2211,39 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (child_ == null) { + Child = new global::Google.Protobuf.TestProtos.NestedTestAllTypes(); + } + input.ReadMessage(Child); + break; + } + case 18: { + if (payload_ == null) { + Payload = new global::Google.Protobuf.TestProtos.TestAllTypes(); + } + input.ReadMessage(Payload); + break; + } + case 26: { + repeatedChild_.AddEntriesFrom(input, _repeated_repeatedChild_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1976,10 +2273,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestDeprecatedFields : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestDeprecatedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2093,9 +2395,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + DeprecatedInt32 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2111,6 +2429,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -2118,7 +2437,11 @@ namespace Google.Protobuf.TestProtos { /// Define these after TestAllTypes to make sure the compiler can handle /// that. /// - public sealed partial class ForeignMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class ForeignMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2231,9 +2554,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2249,10 +2588,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestReservedFields : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestReservedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2341,9 +2685,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2355,13 +2711,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test that we can use NestedMessage from outside TestAllTypes. /// - public sealed partial class TestForeignNested : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestForeignNested : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2477,9 +2838,28 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (foreignNested_ == null) { + ForeignNested = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(ForeignNested); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2498,13 +2878,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test that really large tag numbers don't break anything. /// - public sealed partial class TestReallyLargeTagNumber : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestReallyLargeTagNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2645,9 +3030,29 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 2147483640: { + Bb = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2667,10 +3072,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestRecursiveMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRecursiveMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2810,9 +3220,32 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.TestRecursiveMessage(); + } + input.ReadMessage(A); + break; + } + case 16: { + I = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2835,13 +3268,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test that mutual recursion works. /// - public sealed partial class TestMutualRecursionA : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMutualRecursionA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2950,16 +3388,35 @@ namespace Google.Protobuf.TestProtos { if (bb_ == null) { Bb = new global::Google.Protobuf.TestProtos.TestMutualRecursionB(); } - Bb.MergeFrom(other.Bb); + Bb.MergeFrom(other.Bb); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (bb_ == null) { + Bb = new global::Google.Protobuf.TestProtos.TestMutualRecursionB(); + } + input.ReadMessage(Bb); + break; + } + } } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2978,10 +3435,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestMutualRecursionB : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestMutualRecursionB : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionB()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3121,9 +3583,32 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.TestMutualRecursionA(); + } + input.ReadMessage(A); + break; + } + case 16: { + OptionalInt32 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3146,10 +3631,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestEnumAllowAlias : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestEnumAllowAlias : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEnumAllowAlias()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3262,9 +3752,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Value = (global::Google.Protobuf.TestProtos.TestEnumWithDupValue) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3280,6 +3786,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -3287,7 +3794,11 @@ namespace Google.Protobuf.TestProtos { /// Test message with CamelCase field names. This violates Protocol Buffer /// standard style. /// - public sealed partial class TestCamelCaseFieldNames : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestCamelCaseFieldNames : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3539,9 +4050,58 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + PrimitiveField = input.ReadInt32(); + break; + } + case 18: { + StringField = input.ReadString(); + break; + } + case 24: { + EnumField = (global::Google.Protobuf.TestProtos.ForeignEnum) input.ReadEnum(); + break; + } + case 34: { + if (messageField_ == null) { + MessageField = new global::Google.Protobuf.TestProtos.ForeignMessage(); + } + input.ReadMessage(MessageField); + break; + } + case 58: + case 56: { + repeatedPrimitiveField_.AddEntriesFrom(input, _repeated_repeatedPrimitiveField_codec); + break; + } + case 66: { + repeatedStringField_.AddEntriesFrom(input, _repeated_repeatedStringField_codec); + break; + } + case 74: + case 72: { + repeatedEnumField_.AddEntriesFrom(input, _repeated_repeatedEnumField_codec); + break; + } + case 82: { + repeatedMessageField_.AddEntriesFrom(input, _repeated_repeatedMessageField_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3590,6 +4150,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -3597,7 +4158,11 @@ namespace Google.Protobuf.TestProtos { /// We list fields out of order, to ensure that we're using field number and not /// field index to determine serialization order. /// - public sealed partial class TestFieldOrderings : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestFieldOrderings : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3785,9 +4350,40 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + MyInt = input.ReadInt64(); + break; + } + case 90: { + MyString = input.ReadString(); + break; + } + case 813: { + MyFloat = input.ReadFloat(); + break; + } + case 1602: { + if (singleNestedMessage_ == null) { + SingleNestedMessage = new global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage(); + } + input.ReadMessage(SingleNestedMessage); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3818,12 +4414,17 @@ namespace Google.Protobuf.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the TestFieldOrderings message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3965,9 +4566,29 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + case 16: { + Oo = input.ReadInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3987,6 +4608,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -3995,7 +4617,11 @@ namespace Google.Protobuf.TestProtos { } - public sealed partial class SparseEnumMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class SparseEnumMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseEnumMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4108,9 +4734,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + SparseEnum = (global::Google.Protobuf.TestProtos.TestSparseEnum) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4126,13 +4768,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test String and Bytes: string is for valid UTF-8 strings /// - public sealed partial class OneString : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4245,9 +4892,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4263,10 +4926,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class MoreString : pb::IMessage, pb::IBufferMessage { + public sealed partial class MoreString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4371,9 +5039,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + data_.AddEntriesFrom(input, _repeated_data_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4389,10 +5073,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class OneBytes : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4505,9 +5194,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4523,10 +5228,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class MoreBytes : pb::IMessage, pb::IBufferMessage { + public sealed partial class MoreBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4639,9 +5349,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4657,13 +5383,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test int32, uint32, int64, uint64, and bool are all compatible /// - public sealed partial class Int32Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Int32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4776,9 +5507,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4794,10 +5541,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class Uint32Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Uint32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint32Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -4910,9 +5662,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadUInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4928,10 +5696,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class Int64Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Int64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5044,9 +5817,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5062,10 +5851,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class Uint64Message : pb::IMessage, pb::IBufferMessage { + public sealed partial class Uint64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint64Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5178,9 +5972,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadUInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5196,10 +6006,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class BoolMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class BoolMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5312,9 +6127,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5330,13 +6161,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test oneofs. /// - public sealed partial class TestOneof : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5525,18 +6361,47 @@ namespace Google.Protobuf.TestProtos { if (FooMessage == null) { FooMessage = new global::Google.Protobuf.TestProtos.TestAllTypes(); } - FooMessage.MergeFrom(other.FooMessage); - break; + FooMessage.MergeFrom(other.FooMessage); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + global::Google.Protobuf.TestProtos.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes(); + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + } } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5565,10 +6430,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestPackedTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestPackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -5881,9 +6751,91 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 722: + case 720: { + packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + break; + } + case 730: + case 728: { + packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec); + break; + } + case 738: + case 736: { + packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec); + break; + } + case 746: + case 744: { + packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec); + break; + } + case 754: + case 752: { + packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec); + break; + } + case 762: + case 760: { + packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec); + break; + } + case 770: + case 773: { + packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec); + break; + } + case 778: + case 777: { + packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec); + break; + } + case 786: + case 789: { + packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec); + break; + } + case 794: + case 793: { + packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec); + break; + } + case 802: + case 805: { + packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec); + break; + } + case 810: + case 809: { + packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec); + break; + } + case 818: + case 816: { + packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec); + break; + } + case 826: + case 824: { + packedEnum_.AddEntriesFrom(input, _repeated_packedEnum_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5965,6 +6917,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -5972,7 +6925,11 @@ namespace Google.Protobuf.TestProtos { /// A message with the same fields as TestPackedTypes, but without packing. Used /// to test packed <-> unpacked wire compatibility. /// - public sealed partial class TestUnpackedTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestUnpackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6285,9 +7242,91 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 722: + case 720: { + unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + break; + } + case 730: + case 728: { + unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + break; + } + case 738: + case 736: { + unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + break; + } + case 746: + case 744: { + unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + break; + } + case 754: + case 752: { + unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + break; + } + case 762: + case 760: { + unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + break; + } + case 770: + case 773: { + unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + break; + } + case 778: + case 777: { + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 786: + case 789: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 794: + case 793: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 802: + case 805: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 810: + case 809: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 818: + case 816: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 826: + case 824: { + unpackedEnum_.AddEntriesFrom(input, _repeated_unpackedEnum_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6369,10 +7408,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6571,9 +7615,51 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 98: + case 101: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 106: + case 104: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 16370: + case 16369: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 16378: + case 16376: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 2097138: + case 2097141: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 2097146: + case 2097144: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6615,10 +7701,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestCommentInjectionMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestCommentInjectionMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6734,9 +7825,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + A = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6752,13 +7859,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// Test that RPC services work. /// - public sealed partial class FooRequest : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6847,9 +7959,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6861,10 +7985,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class FooResponse : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -6953,9 +8082,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6967,10 +8108,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class FooClientMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7059,9 +8205,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7073,10 +8231,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class FooServerMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class FooServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7165,9 +8328,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7179,10 +8354,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class BarRequest : pb::IMessage, pb::IBufferMessage { + public sealed partial class BarRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7271,9 +8451,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7285,10 +8477,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class BarResponse : pb::IMessage, pb::IBufferMessage { + public sealed partial class BarResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7377,9 +8574,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7391,10 +8600,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestEmptyMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestEmptyMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7483,9 +8697,21 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7497,13 +8723,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// This is a leading comment /// - public sealed partial class CommentMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class CommentMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommentMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7619,9 +8850,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Text = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7637,6 +8884,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif #region Nested types /// Container for nested types declared in the CommentMessage message type. @@ -7655,7 +8903,11 @@ namespace Google.Protobuf.TestProtos { /// /// Leading nested message comment /// - public sealed partial class NestedCommentMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedCommentMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedCommentMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7771,9 +9023,25 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + NestedText = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7789,6 +9057,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs index 21e55f72d4..c8cd7f7aa3 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs @@ -67,7 +67,11 @@ namespace ProtobufUnittest { } #region Messages - public sealed partial class TestProto3Optional : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestProto3Optional : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestProto3Optional()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -858,9 +862,111 @@ namespace ProtobufUnittest { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 130: { + OptionalCord = input.ReadString(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (lazyNestedMessage_ == null) { + LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + input.ReadMessage(LazyNestedMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + SingularInt32 = input.ReadInt32(); + break; + } + case 184: { + SingularInt64 = input.ReadInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -962,6 +1068,7 @@ namespace ProtobufUnittest { } } } + #endif #region Nested types /// Container for nested types declared in the TestProto3Optional message type. @@ -978,7 +1085,11 @@ namespace ProtobufUnittest { [pbr::OriginalName("NEG")] Neg = -1, } - public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -1109,9 +1220,25 @@ namespace ProtobufUnittest { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1127,6 +1254,7 @@ namespace ProtobufUnittest { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs index e466d54043..4365368acc 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs @@ -63,7 +63,11 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } #region Messages - public sealed partial class FooOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class FooOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooOptions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -250,9 +254,31 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + IntOpt = input.ReadInt32(); + break; + } + case 16: { + Foo = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -274,6 +300,7 @@ namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs index c67187e7fb..30c906cd40 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs @@ -179,7 +179,11 @@ namespace Google.Protobuf.TestProtos { /// Each wrapper type is included separately, as languages /// map handle different wrappers in different ways. /// - public sealed partial class TestWellKnownTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class TestWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -784,9 +788,154 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (anyField_ == null) { + AnyField = new global::Google.Protobuf.WellKnownTypes.Any(); + } + input.ReadMessage(AnyField); + break; + } + case 18: { + if (apiField_ == null) { + ApiField = new global::Google.Protobuf.WellKnownTypes.Api(); + } + input.ReadMessage(ApiField); + break; + } + case 26: { + if (durationField_ == null) { + DurationField = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(DurationField); + break; + } + case 34: { + if (emptyField_ == null) { + EmptyField = new global::Google.Protobuf.WellKnownTypes.Empty(); + } + input.ReadMessage(EmptyField); + break; + } + case 42: { + if (fieldMaskField_ == null) { + FieldMaskField = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + } + input.ReadMessage(FieldMaskField); + break; + } + case 50: { + if (sourceContextField_ == null) { + SourceContextField = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContextField); + break; + } + case 58: { + if (structField_ == null) { + StructField = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(StructField); + break; + } + case 66: { + if (timestampField_ == null) { + TimestampField = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(TimestampField); + break; + } + case 74: { + if (typeField_ == null) { + TypeField = new global::Google.Protobuf.WellKnownTypes.Type(); + } + input.ReadMessage(TypeField); + break; + } + case 82: { + double? value = _single_doubleField_codec.Read(input); + if (doubleField_ == null || value != 0D) { + DoubleField = value; + } + break; + } + case 90: { + float? value = _single_floatField_codec.Read(input); + if (floatField_ == null || value != 0F) { + FloatField = value; + } + break; + } + case 98: { + long? value = _single_int64Field_codec.Read(input); + if (int64Field_ == null || value != 0L) { + Int64Field = value; + } + break; + } + case 106: { + ulong? value = _single_uint64Field_codec.Read(input); + if (uint64Field_ == null || value != 0UL) { + Uint64Field = value; + } + break; + } + case 114: { + int? value = _single_int32Field_codec.Read(input); + if (int32Field_ == null || value != 0) { + Int32Field = value; + } + break; + } + case 122: { + uint? value = _single_uint32Field_codec.Read(input); + if (uint32Field_ == null || value != 0) { + Uint32Field = value; + } + break; + } + case 130: { + bool? value = _single_boolField_codec.Read(input); + if (boolField_ == null || value != false) { + BoolField = value; + } + break; + } + case 138: { + string value = _single_stringField_codec.Read(input); + if (stringField_ == null || value != "") { + StringField = value; + } + break; + } + case 146: { + pb::ByteString value = _single_bytesField_codec.Read(input); + if (bytesField_ == null || value != pb::ByteString.Empty) { + BytesField = value; + } + break; + } + case 154: { + if (valueField_ == null) { + ValueField = new global::Google.Protobuf.WellKnownTypes.Value(); + } + input.ReadMessage(ValueField); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -931,13 +1080,18 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } /// /// A repeated field for each well-known type. /// - public sealed partial class RepeatedWellKnownTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class RepeatedWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1317,9 +1471,93 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + anyField_.AddEntriesFrom(input, _repeated_anyField_codec); + break; + } + case 18: { + apiField_.AddEntriesFrom(input, _repeated_apiField_codec); + break; + } + case 26: { + durationField_.AddEntriesFrom(input, _repeated_durationField_codec); + break; + } + case 34: { + emptyField_.AddEntriesFrom(input, _repeated_emptyField_codec); + break; + } + case 42: { + fieldMaskField_.AddEntriesFrom(input, _repeated_fieldMaskField_codec); + break; + } + case 50: { + sourceContextField_.AddEntriesFrom(input, _repeated_sourceContextField_codec); + break; + } + case 58: { + structField_.AddEntriesFrom(input, _repeated_structField_codec); + break; + } + case 66: { + timestampField_.AddEntriesFrom(input, _repeated_timestampField_codec); + break; + } + case 74: { + typeField_.AddEntriesFrom(input, _repeated_typeField_codec); + break; + } + case 82: { + doubleField_.AddEntriesFrom(input, _repeated_doubleField_codec); + break; + } + case 90: { + floatField_.AddEntriesFrom(input, _repeated_floatField_codec); + break; + } + case 98: { + int64Field_.AddEntriesFrom(input, _repeated_int64Field_codec); + break; + } + case 106: { + uint64Field_.AddEntriesFrom(input, _repeated_uint64Field_codec); + break; + } + case 114: { + int32Field_.AddEntriesFrom(input, _repeated_int32Field_codec); + break; + } + case 122: { + uint32Field_.AddEntriesFrom(input, _repeated_uint32Field_codec); + break; + } + case 130: { + boolField_.AddEntriesFrom(input, _repeated_boolField_codec); + break; + } + case 138: { + stringField_.AddEntriesFrom(input, _repeated_stringField_codec); + break; + } + case 146: { + bytesField_.AddEntriesFrom(input, _repeated_bytesField_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1403,10 +1641,15 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class OneofWellKnownTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneofWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2033,9 +2276,138 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any(); + if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { + subBuilder.MergeFrom(AnyField); + } + input.ReadMessage(subBuilder); + AnyField = subBuilder; + break; + } + case 18: { + global::Google.Protobuf.WellKnownTypes.Api subBuilder = new global::Google.Protobuf.WellKnownTypes.Api(); + if (oneofFieldCase_ == OneofFieldOneofCase.ApiField) { + subBuilder.MergeFrom(ApiField); + } + input.ReadMessage(subBuilder); + ApiField = subBuilder; + break; + } + case 26: { + global::Google.Protobuf.WellKnownTypes.Duration subBuilder = new global::Google.Protobuf.WellKnownTypes.Duration(); + if (oneofFieldCase_ == OneofFieldOneofCase.DurationField) { + subBuilder.MergeFrom(DurationField); + } + input.ReadMessage(subBuilder); + DurationField = subBuilder; + break; + } + case 34: { + global::Google.Protobuf.WellKnownTypes.Empty subBuilder = new global::Google.Protobuf.WellKnownTypes.Empty(); + if (oneofFieldCase_ == OneofFieldOneofCase.EmptyField) { + subBuilder.MergeFrom(EmptyField); + } + input.ReadMessage(subBuilder); + EmptyField = subBuilder; + break; + } + case 42: { + global::Google.Protobuf.WellKnownTypes.FieldMask subBuilder = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + if (oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField) { + subBuilder.MergeFrom(FieldMaskField); + } + input.ReadMessage(subBuilder); + FieldMaskField = subBuilder; + break; + } + case 50: { + global::Google.Protobuf.WellKnownTypes.SourceContext subBuilder = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + if (oneofFieldCase_ == OneofFieldOneofCase.SourceContextField) { + subBuilder.MergeFrom(SourceContextField); + } + input.ReadMessage(subBuilder); + SourceContextField = subBuilder; + break; + } + case 58: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (oneofFieldCase_ == OneofFieldOneofCase.StructField) { + subBuilder.MergeFrom(StructField); + } + input.ReadMessage(subBuilder); + StructField = subBuilder; + break; + } + case 66: { + global::Google.Protobuf.WellKnownTypes.Timestamp subBuilder = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + if (oneofFieldCase_ == OneofFieldOneofCase.TimestampField) { + subBuilder.MergeFrom(TimestampField); + } + input.ReadMessage(subBuilder); + TimestampField = subBuilder; + break; + } + case 74: { + global::Google.Protobuf.WellKnownTypes.Type subBuilder = new global::Google.Protobuf.WellKnownTypes.Type(); + if (oneofFieldCase_ == OneofFieldOneofCase.TypeField) { + subBuilder.MergeFrom(TypeField); + } + input.ReadMessage(subBuilder); + TypeField = subBuilder; + break; + } + case 82: { + DoubleField = _oneof_doubleField_codec.Read(input); + break; + } + case 90: { + FloatField = _oneof_floatField_codec.Read(input); + break; + } + case 98: { + Int64Field = _oneof_int64Field_codec.Read(input); + break; + } + case 106: { + Uint64Field = _oneof_uint64Field_codec.Read(input); + break; + } + case 114: { + Int32Field = _oneof_int32Field_codec.Read(input); + break; + } + case 122: { + Uint32Field = _oneof_uint32Field_codec.Read(input); + break; + } + case 130: { + BoolField = _oneof_boolField_codec.Read(input); + break; + } + case 138: { + StringField = _oneof_stringField_codec.Read(input); + break; + } + case 146: { + BytesField = _oneof_bytesField_codec.Read(input); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2164,6 +2536,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } @@ -2172,7 +2545,11 @@ namespace Google.Protobuf.TestProtos { /// need to worry about the value part of the map being the /// well-known types, as messages can't be map keys. /// - public sealed partial class MapWellKnownTypes : pb::IMessage, pb::IBufferMessage { + public sealed partial class MapWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2549,9 +2926,93 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + anyField_.AddEntriesFrom(input, _map_anyField_codec); + break; + } + case 18: { + apiField_.AddEntriesFrom(input, _map_apiField_codec); + break; + } + case 26: { + durationField_.AddEntriesFrom(input, _map_durationField_codec); + break; + } + case 34: { + emptyField_.AddEntriesFrom(input, _map_emptyField_codec); + break; + } + case 42: { + fieldMaskField_.AddEntriesFrom(input, _map_fieldMaskField_codec); + break; + } + case 50: { + sourceContextField_.AddEntriesFrom(input, _map_sourceContextField_codec); + break; + } + case 58: { + structField_.AddEntriesFrom(input, _map_structField_codec); + break; + } + case 66: { + timestampField_.AddEntriesFrom(input, _map_timestampField_codec); + break; + } + case 74: { + typeField_.AddEntriesFrom(input, _map_typeField_codec); + break; + } + case 82: { + doubleField_.AddEntriesFrom(input, _map_doubleField_codec); + break; + } + case 90: { + floatField_.AddEntriesFrom(input, _map_floatField_codec); + break; + } + case 98: { + int64Field_.AddEntriesFrom(input, _map_int64Field_codec); + break; + } + case 106: { + uint64Field_.AddEntriesFrom(input, _map_uint64Field_codec); + break; + } + case 114: { + int32Field_.AddEntriesFrom(input, _map_int32Field_codec); + break; + } + case 122: { + uint32Field_.AddEntriesFrom(input, _map_uint32Field_codec); + break; + } + case 130: { + boolField_.AddEntriesFrom(input, _map_boolField_codec); + break; + } + case 138: { + stringField_.AddEntriesFrom(input, _map_stringField_codec); + break; + } + case 146: { + bytesField_.AddEntriesFrom(input, _map_bytesField_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2635,6 +3096,7 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs index 84e6341e95..0ef8d8f4e7 100644 --- a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs +++ b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs @@ -233,5 +233,21 @@ namespace Google.Protobuf ByteString b2 = ByteString.CopyFrom(200, 1, 2, 3, 4); Assert.AreNotEqual(b1.GetHashCode(), b2.GetHashCode()); } + + [Test] + public void GetContentsAsReadOnlySpan() + { + var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); + var copied = byteString.Span.ToArray(); + CollectionAssert.AreEqual(byteString, copied); + } + + [Test] + public void GetContentsAsReadOnlyMemory() + { + var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); + var copied = byteString.Memory.ToArray(); + CollectionAssert.AreEqual(byteString, copied); + } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs index 527c7d404c..61453e5ab2 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs @@ -595,6 +595,95 @@ namespace Google.Protobuf.Collections Assert.AreEqual(((SampleEnum)(-5)), values[5]); } + [Test] + public void TestPackedRepeatedFieldCollectionNonDivisibleLength() + { + uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); + var codec = FieldCodec.ForFixed32(tag); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(tag); + output.WriteString("A long string"); + output.WriteTag(codec.Tag); + output.WriteRawVarint32((uint)codec.FixedSize - 1); // Length not divisible by FixedSize + output.WriteFixed32(uint.MaxValue); + output.Flush(); + stream.Position = 0; + + var input = new CodedInputStream(stream); + input.ReadTag(); + input.ReadString(); + input.ReadTag(); + var field = new RepeatedField(); + Assert.Throws(() => field.AddEntriesFrom(input, codec)); + + // Collection was not pre-initialized + Assert.AreEqual(0, field.Count); + } + + [Test] + public void TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsBuffer() + { + uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); + var codec = FieldCodec.ForFixed32(tag); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(tag); + output.WriteString("A long string"); + output.WriteTag(codec.Tag); + output.WriteRawVarint32((uint)codec.FixedSize); + // Note that there is no content for the packed field. + // The field length exceeds the remaining length of content. + output.Flush(); + stream.Position = 0; + + var input = new CodedInputStream(stream); + input.ReadTag(); + input.ReadString(); + input.ReadTag(); + var field = new RepeatedField(); + Assert.Throws(() => field.AddEntriesFrom(input, codec)); + + // Collection was not pre-initialized + Assert.AreEqual(0, field.Count); + } + + [Test] + public void TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsRemainingData() + { + uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); + var codec = FieldCodec.ForFixed32(tag); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(tag); + output.WriteString("A long string"); + output.WriteTag(codec.Tag); + output.WriteRawVarint32((uint)codec.FixedSize); + // Note that there is no content for the packed field. + // The field length exceeds the remaining length of the buffer. + output.Flush(); + stream.Position = 0; + + var sequence = ReadOnlySequenceFactory.CreateWithContent(stream.ToArray()); + ParseContext.Initialize(sequence, out ParseContext ctx); + + ctx.ReadTag(); + ctx.ReadString(); + ctx.ReadTag(); + var field = new RepeatedField(); + try + { + field.AddEntriesFrom(ref ctx, codec); + Assert.Fail(); + } + catch (InvalidProtocolBufferException) + { + } + + // Collection was not pre-initialized + Assert.AreEqual(0, field.Count); + } + // Fairly perfunctory tests for the non-generic IList implementation [Test] public void IList_Indexer() diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index b07a84161a..5e9730b2af 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -40,6 +40,7 @@ using Google.Protobuf.Reflection; using static Google.Protobuf.JsonParserTest; // For WrapInQuotes using System.IO; using Google.Protobuf.Collections; +using ProtobufUnittest; namespace Google.Protobuf { @@ -153,6 +154,48 @@ namespace Google.Protobuf AssertJson(expectedText, actualText); } + [Test] + public void WithFormatDefaultValues_DoesNotAffectMessageFields() + { + var message = new TestAllTypes(); + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + Assert.IsFalse(json.Contains("\"singleNestedMessage\"")); + Assert.IsFalse(json.Contains("\"singleForeignMessage\"")); + Assert.IsFalse(json.Contains("\"singleImportMessage\"")); + } + + [Test] + public void WithFormatDefaultValues_DoesNotAffectProto3OptionalFields() + { + var message = new TestProto3Optional(); + message.OptionalInt32 = 0; + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + // The non-optional proto3 fields are formatted, as is the optional-but-specified field. + AssertJson("{ 'optionalInt32': 0, 'singularInt32': 0, 'singularInt64': '0' }", json); + } + + [Test] + public void WithFormatDefaultValues_DoesNotAffectProto2Fields() + { + var message = new TestProtos.Proto2.ForeignMessage(); + message.C = 0; + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + // The specified field is formatted, but the non-specified field (d) is not. + AssertJson("{ 'c': 0 }", json); + } + + [Test] + public void WithFormatDefaultValues_DoesNotAffectOneofFields() + { + var message = new TestOneof(); + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + AssertJson("{ }", json); + } + [Test] public void RepeatedField() { @@ -313,14 +356,16 @@ namespace Google.Protobuf } [Test] - public void WrapperFormatting_IncludeNull() + public void WrapperFormatting_FormatDefaultValuesDoesNotFormatNull() { // The actual JSON here is very large because there are lots of fields. Just test a couple of them. var message = new TestWellKnownTypes { Int32Field = 10 }; var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); var actualJson = formatter.Format(message); - Assert.IsTrue(actualJson.Contains("\"int64Field\": null")); - Assert.IsFalse(actualJson.Contains("\"int32Field\": null")); + // This *used* to include "int64Field": null, but that was a bug. + // WithDefaultValues should not affect message fields, including wrapper types. + Assert.IsFalse(actualJson.Contains("\"int64Field\": null")); + Assert.IsTrue(actualJson.Contains("\"int32Field\": 10")); } [Test] @@ -602,6 +647,13 @@ namespace Google.Protobuf AssertWriteValue(value, "[ 1, 2, 3 ]"); } + [Test] + public void Proto2_DefaultValuesWritten() + { + var value = new ProtobufTestMessages.Proto2.TestAllTypesProto2() { FieldName13 = 0 }; + AssertWriteValue(value, "{ 'FieldName13': 0 }"); + } + private static void AssertWriteValue(object value, string expectedJson) { var writer = new StringWriter(); diff --git a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs index a6cf04ab7a..f9f8cde050 100644 --- a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs @@ -34,6 +34,7 @@ using Google.Protobuf.Reflection; using Google.Protobuf.TestProtos; using Google.Protobuf.WellKnownTypes; using NUnit.Framework; +using ProtobufTestMessages.Proto2; using System; namespace Google.Protobuf @@ -949,6 +950,16 @@ namespace Google.Protobuf Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); } + [Test] + public void Proto2_DefaultValuesPreserved() + { + string json = "{ \"FieldName13\": 0 }"; + var parsed = TestAllTypesProto2.Parser.ParseJson(json); + Assert.False(parsed.HasFieldName10); + Assert.True(parsed.HasFieldName13); + Assert.AreEqual(0, parsed.FieldName13); + } + [Test] [TestCase("5")] [TestCase("\"text\"")] diff --git a/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs b/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs index d2050d37ca..588b559e9f 100644 --- a/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs +++ b/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs @@ -50,9 +50,9 @@ namespace Google.Protobuf while (currentIndex < data.Length) { var segment = new List(); - for (; currentIndex < Math.Min(currentIndex + segmentSize, data.Length); currentIndex++) + while (segment.Count < segmentSize && currentIndex < data.Length) { - segment.Add(data[currentIndex]); + segment.Add(data[currentIndex++]); } segments.Add(segment.ToArray()); segments.Add(new byte[0]); diff --git a/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs b/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs new file mode 100644 index 0000000000..f2d9a2d4e2 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs @@ -0,0 +1,119 @@ +#region Copyright notice and license +// 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. +#endregion + +using NUnit.Framework; +using System.Diagnostics; +using System; +using System.Reflection; +using System.IO; + +namespace Google.Protobuf +{ + public class RefStructCompatibilityTest + { + /// + /// Checks that the generated code can be compiler with an old C# compiler. + /// The reason why this test is needed is that even though dotnet SDK projects allow to set LangVersion, + /// this setting doesn't accurately simulate compilation with an actual old pre-roslyn C# compiler. + /// For instance, the "ref struct" types are only supported by C# 7.2 and higher, but even if + /// LangVersion is set low, the roslyn compiler still understands the concept of ref struct + /// and silently accepts them. Therefore we try to build the generated code with an actual old C# compiler + /// to be able to catch these sort of compatibility problems. + /// + [Test] + public void GeneratedCodeCompilesWithOldCsharpCompiler() + { + if (Environment.OSVersion.Platform != PlatformID.Win32NT) + { + // This tests needs old C# compiler which is only available on Windows. Skipping it on all other platforms. + return; + } + + var currentAssemblyDir = Path.GetDirectoryName(typeof(RefStructCompatibilityTest).GetTypeInfo().Assembly.Location); + var testProtosProjectDir = Path.GetFullPath(Path.Combine(currentAssemblyDir, "..", "..", "..", "..", "Google.Protobuf.Test.TestProtos")); + var testProtosOutputDir = (currentAssemblyDir.Contains("bin/Debug/") || currentAssemblyDir.Contains("bin\\Debug\\")) ? "bin\\Debug\\net45" : "bin\\Release\\net45"; + + // If "ref struct" types are used in the generated code, compilation with an old compiler will fail with the following error: + // "XYZ is obsolete: 'Types with embedded references are not supported in this version of your compiler.'" + // We build the code with GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE to avoid the use of ref struct in the generated code. + var compatibilityFlag = "-define:GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE"; + var sources = "*.cs"; // the generated sources from the TestProtos project + var args = $"-langversion:3 -target:library {compatibilityFlag} -reference:{testProtosOutputDir}\\Google.Protobuf.dll -out:{testProtosOutputDir}\\TestProtos.RefStructCompatibilityTest.OldCompiler.dll {sources}"; + RunOldCsharpCompilerAndCheckSuccess(args, testProtosProjectDir); + } + + /// + /// Invoke an old C# compiler in a subprocess and check it finished successful. + /// + /// + /// + private void RunOldCsharpCompilerAndCheckSuccess(string args, string workingDirectory) + { + using (var process = new Process()) + { + // Get the path to the old C# 5 compiler from .NET framework. This approach is not 100% reliable, but works on most machines. + // Alternative way of getting the framework path is System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + // but it only works with the net45 target. + var oldCsharpCompilerPath = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v4.0.30319", "csc.exe"); + process.StartInfo.FileName = oldCsharpCompilerPath; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardError = true; + process.StartInfo.UseShellExecute = false; + process.StartInfo.Arguments = args; + process.StartInfo.WorkingDirectory = workingDirectory; + + process.OutputDataReceived += (sender, e) => + { + if (e.Data != null) + { + Console.WriteLine(e.Data); + } + }; + process.ErrorDataReceived += (sender, e) => + { + if (e.Data != null) + { + Console.WriteLine(e.Data); + } + }; + + process.Start(); + + process.BeginErrorReadLine(); + process.BeginOutputReadLine(); + + process.WaitForExit(); + Assert.AreEqual(0, process.ExitCode); + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ByteString.cs b/csharp/src/Google.Protobuf/ByteString.cs index 027c8d81c8..74dc865e9d 100644 --- a/csharp/src/Google.Protobuf/ByteString.cs +++ b/csharp/src/Google.Protobuf/ByteString.cs @@ -34,6 +34,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.IO; +using System.Security; using System.Text; #if !NET35 using System.Threading; @@ -115,13 +116,27 @@ namespace Google.Protobuf /// Provides read-only access to the data of this . /// No data is copied so this is the most efficient way of accessing. /// - public ReadOnlySpan Span => new ReadOnlySpan(bytes); + public ReadOnlySpan Span + { + [SecuritySafeCritical] + get + { + return new ReadOnlySpan(bytes); + } + } /// /// Provides read-only access to the data of this . /// No data is copied so this is the most efficient way of accessing. /// - public ReadOnlyMemory Memory => new ReadOnlyMemory(bytes); + public ReadOnlyMemory Memory + { + [SecuritySafeCritical] + get + { + return new ReadOnlyMemory(bytes); + } + } #endif /// diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs index 5c39aabafb..b1bd9b13d1 100644 --- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs +++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs @@ -35,6 +35,7 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Security; +using System.Threading; namespace Google.Protobuf.Collections { @@ -126,9 +127,31 @@ namespace Google.Protobuf.Collections if (length > 0) { int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); - while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + + // If the content is fixed size then we can calculate the length + // of the repeated field and pre-initialize the underlying collection. + // + // Check that the supplied length doesn't exceed the underlying buffer. + // That prevents a malicious length from initializing a very large collection. + if (codec.FixedSize > 0 && length % codec.FixedSize == 0 && IsDataAvailable(ref ctx, length)) + { + EnsureSize(count + (length / codec.FixedSize)); + + while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + // Only FieldCodecs with a fixed size can reach here, and they are all known + // types that don't allow the user to specify a custom reader action. + // reader action will never return null. + array[count++] = reader(ref ctx); + } + } + else { - Add(reader(ref ctx)); + // Content is variable size so add until we reach the limit. + while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + Add(reader(ref ctx)); + } } SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); } @@ -144,6 +167,24 @@ namespace Google.Protobuf.Collections } } + private bool IsDataAvailable(ref ParseContext ctx, int size) + { + // Data fits in remaining buffer + if (size <= ctx.state.bufferSize - ctx.state.bufferPos) + { + return true; + } + + // Data fits in remaining source data. + // Note that this will never be true when reading from a stream as the total length is unknown. + if (size < ctx.state.segmentedBufferHelper.TotalLength - ctx.state.totalBytesRetired - ctx.state.bufferPos) + { + return true; + } + + return false; + } + /// /// Calculates the size of this collection based on the given codec. /// diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 11615c856e..db86da520e 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -5,6 +5,7 @@ Copyright 2015, Google Inc. Google Protocol Buffers 3.12.2 + 3.12.3 7.2 Google Inc. diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index 5aaefe7a89..699a81de51 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -221,19 +221,12 @@ namespace Google.Protobuf foreach (var field in fields.InFieldNumberOrder()) { var accessor = field.Accessor; - if (field.ContainingOneof != null && field.ContainingOneof.Accessor.GetCaseFieldDescriptor(message) != field) - { - continue; - } - // Omit default values unless we're asked to format them, or they're oneofs (where the default - // value is still formatted regardless, because that's how we preserve the oneof case). - object value = accessor.GetValue(message); - if (field.ContainingOneof == null && !settings.FormatDefaultValues && IsDefaultValue(accessor, value)) + var value = accessor.GetValue(message); + if (!ShouldFormatFieldValue(message, field, value)) { continue; } - // Okay, all tests complete: let's write the field value... if (!first) { writer.Write(PropertySeparator); @@ -248,6 +241,18 @@ namespace Google.Protobuf return !first; } + /// + /// Determines whether or not a field value should be serialized according to the field, + /// its value in the message, and the settings of this formatter. + /// + private bool ShouldFormatFieldValue(IMessage message, FieldDescriptor field, object value) => + field.HasPresence + // Fields that support presence *just* use that + ? field.Accessor.HasValue(message) + // Otherwise, format if either we've been asked to format default values, or if it's + // not a default value anyway. + : settings.FormatDefaultValues || !IsDefaultValue(field, value); + // Converted from java/core/src/main/java/com/google/protobuf/Descriptors.java internal static string ToJsonName(string name) { @@ -295,19 +300,19 @@ namespace Google.Protobuf writer.Write("null"); } - private static bool IsDefaultValue(IFieldAccessor accessor, object value) + private static bool IsDefaultValue(FieldDescriptor descriptor, object value) { - if (accessor.Descriptor.IsMap) + if (descriptor.IsMap) { IDictionary dictionary = (IDictionary) value; return dictionary.Count == 0; } - if (accessor.Descriptor.IsRepeated) + if (descriptor.IsRepeated) { IList list = (IList) value; return list.Count == 0; } - switch (accessor.Descriptor.FieldType) + switch (descriptor.FieldType) { case FieldType.Bool: return (bool) value == false; @@ -793,8 +798,10 @@ namespace Google.Protobuf } /// - /// Whether fields whose values are the default for the field type (e.g. 0 for integers) - /// should be formatted (true) or omitted (false). + /// Whether fields which would otherwise not be included in the formatted data + /// should be formatted even when the value is not present, or has the default value. + /// This option only affects fields which don't support "presence" (e.g. + /// singular non-optional proto3 primitive fields). /// public bool FormatDefaultValues { get; } diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs index 3c6e82b9cc..fda56764e0 100644 --- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs @@ -194,7 +194,11 @@ namespace Google.Protobuf.Reflection { /// The protocol compiler can output a FileDescriptorSet containing the .proto /// files it parses. /// - public sealed partial class FileDescriptorSet : pb::IMessage, pb::IBufferMessage { + public sealed partial class FileDescriptorSet : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorSet()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -299,9 +303,25 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + file_.AddEntriesFrom(input, _repeated_file_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -317,13 +337,18 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes a complete .proto file. /// - public sealed partial class FileDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class FileDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -715,9 +740,77 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Package = input.ReadString(); + break; + } + case 26: { + dependency_.AddEntriesFrom(input, _repeated_dependency_codec); + break; + } + case 34: { + messageType_.AddEntriesFrom(input, _repeated_messageType_codec); + break; + } + case 42: { + enumType_.AddEntriesFrom(input, _repeated_enumType_codec); + break; + } + case 50: { + service_.AddEntriesFrom(input, _repeated_service_codec); + break; + } + case 58: { + extension_.AddEntriesFrom(input, _repeated_extension_codec); + break; + } + case 66: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.FileOptions(); + } + input.ReadMessage(Options); + break; + } + case 74: { + if (sourceCodeInfo_ == null) { + SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); + } + input.ReadMessage(SourceCodeInfo); + break; + } + case 82: + case 80: { + publicDependency_.AddEntriesFrom(input, _repeated_publicDependency_codec); + break; + } + case 90: + case 88: { + weakDependency_.AddEntriesFrom(input, _repeated_weakDependency_codec); + break; + } + case 98: { + Syntax = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -785,13 +878,18 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes a message type. /// - public sealed partial class DescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class DescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1075,9 +1173,64 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + field_.AddEntriesFrom(input, _repeated_field_codec); + break; + } + case 26: { + nestedType_.AddEntriesFrom(input, _repeated_nestedType_codec); + break; + } + case 34: { + enumType_.AddEntriesFrom(input, _repeated_enumType_codec); + break; + } + case 42: { + extensionRange_.AddEntriesFrom(input, _repeated_extensionRange_codec); + break; + } + case 50: { + extension_.AddEntriesFrom(input, _repeated_extension_codec); + break; + } + case 58: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.MessageOptions(); + } + input.ReadMessage(Options); + break; + } + case 66: { + oneofDecl_.AddEntriesFrom(input, _repeated_oneofDecl_codec); + break; + } + case 74: { + reservedRange_.AddEntriesFrom(input, _repeated_reservedRange_codec); + break; + } + case 82: { + reservedName_.AddEntriesFrom(input, _repeated_reservedName_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1132,12 +1285,17 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the DescriptorProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class ExtensionRange : pb::IMessage, pb::IBufferMessage { + public sealed partial class ExtensionRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRange()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -1335,9 +1493,36 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Start = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1364,6 +1549,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } @@ -1372,7 +1558,11 @@ namespace Google.Protobuf.Reflection { /// fields or extension ranges in the same message. Reserved ranges may /// not overlap. /// - public sealed partial class ReservedRange : pb::IMessage, pb::IBufferMessage { + public sealed partial class ReservedRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedRange()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -1543,9 +1733,29 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Start = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1565,6 +1775,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } @@ -1573,7 +1784,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class ExtensionRangeOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class ExtensionRangeOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRangeOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -1697,9 +1912,27 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1717,6 +1950,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -1745,7 +1979,11 @@ namespace Google.Protobuf.Reflection { /// /// Describes a field within a message. /// - public sealed partial class FieldDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class FieldDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldDescriptorProto()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -2283,9 +2521,68 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Extendee = input.ReadString(); + break; + } + case 24: { + Number = input.ReadInt32(); + break; + } + case 32: { + Label = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) input.ReadEnum(); + break; + } + case 40: { + Type = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type) input.ReadEnum(); + break; + } + case 50: { + TypeName = input.ReadString(); + break; + } + case 58: { + DefaultValue = input.ReadString(); + break; + } + case 66: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.FieldOptions(); + } + input.ReadMessage(Options); + break; + } + case 72: { + OneofIndex = input.ReadInt32(); + break; + } + case 82: { + JsonName = input.ReadString(); + break; + } + case 136: { + Proto3Optional = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2344,6 +2641,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the FieldDescriptorProto message type. @@ -2417,7 +2715,11 @@ namespace Google.Protobuf.Reflection { /// /// Describes a oneof. /// - public sealed partial class OneofDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class OneofDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2569,9 +2871,32 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.OneofOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2594,13 +2919,18 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes an enum type. /// - public sealed partial class EnumDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class EnumDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2809,9 +3139,44 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + value_.AddEntriesFrom(input, _repeated_value_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.EnumOptions(); + } + input.ReadMessage(Options); + break; + } + case 34: { + reservedRange_.AddEntriesFrom(input, _repeated_reservedRange_codec); + break; + } + case 42: { + reservedName_.AddEntriesFrom(input, _repeated_reservedName_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -2846,6 +3211,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the EnumDescriptorProto message type. @@ -2859,7 +3225,11 @@ namespace Google.Protobuf.Reflection { /// is inclusive such that it can appropriately represent the entire int32 /// domain. /// - public sealed partial class EnumReservedRange : pb::IMessage, pb::IBufferMessage { + public sealed partial class EnumReservedRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumReservedRange()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -3030,9 +3400,29 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Start = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3052,6 +3442,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } @@ -3063,7 +3454,11 @@ namespace Google.Protobuf.Reflection { /// /// Describes a value within an enum. /// - public sealed partial class EnumValueDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class EnumValueDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueDescriptorProto()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -3254,9 +3649,36 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + Number = input.ReadInt32(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3283,13 +3705,18 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes a service. /// - public sealed partial class ServiceDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class ServiceDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3457,9 +3884,36 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + method_.AddEntriesFrom(input, _repeated_method_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.ServiceOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3486,13 +3940,18 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes a method of a service. /// - public sealed partial class MethodDescriptorProto : pb::IMessage, pb::IBufferMessage { + public sealed partial class MethodDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodDescriptorProto()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -3802,9 +4261,48 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + InputType = input.ReadString(); + break; + } + case 26: { + OutputType = input.ReadString(); + break; + } + case 34: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.MethodOptions(); + } + input.ReadMessage(Options); + break; + } + case 40: { + ClientStreaming = input.ReadBool(); + break; + } + case 48: { + ServerStreaming = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -3843,10 +4341,15 @@ namespace Google.Protobuf.Reflection { } } } + #endif } - public sealed partial class FileOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class FileOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -4799,9 +5302,107 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + JavaPackage = input.ReadString(); + break; + } + case 66: { + JavaOuterClassname = input.ReadString(); + break; + } + case 72: { + OptimizeFor = (global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) input.ReadEnum(); + break; + } + case 80: { + JavaMultipleFiles = input.ReadBool(); + break; + } + case 90: { + GoPackage = input.ReadString(); + break; + } + case 128: { + CcGenericServices = input.ReadBool(); + break; + } + case 136: { + JavaGenericServices = input.ReadBool(); + break; + } + case 144: { + PyGenericServices = input.ReadBool(); + break; + } + case 160: { + JavaGenerateEqualsAndHash = input.ReadBool(); + break; + } + case 184: { + Deprecated = input.ReadBool(); + break; + } + case 216: { + JavaStringCheckUtf8 = input.ReadBool(); + break; + } + case 248: { + CcEnableArenas = input.ReadBool(); + break; + } + case 290: { + ObjcClassPrefix = input.ReadString(); + break; + } + case 298: { + CsharpNamespace = input.ReadString(); + break; + } + case 314: { + SwiftPrefix = input.ReadString(); + break; + } + case 322: { + PhpClassPrefix = input.ReadString(); + break; + } + case 330: { + PhpNamespace = input.ReadString(); + break; + } + case 336: { + PhpGenericServices = input.ReadBool(); + break; + } + case 354: { + PhpMetadataNamespace = input.ReadString(); + break; + } + case 362: { + RubyPackage = input.ReadString(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -4899,6 +5500,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -4949,7 +5551,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class MessageOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class MessageOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -5270,16 +5876,50 @@ namespace Google.Protobuf.Reflection { if (other.HasMapEntry) { MapEntry = other.MapEntry; } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - input.ReadRawMessage(this); + uninterpretedOption_.Add(other.uninterpretedOption_); + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + MessageSetWireFormat = input.ReadBool(); + break; + } + case 16: { + NoStandardDescriptorAccessor = input.ReadBool(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 56: { + MapEntry = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5313,6 +5953,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -5338,7 +5979,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class FieldOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class FieldOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -5750,9 +6395,51 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + Ctype = (global::Google.Protobuf.Reflection.FieldOptions.Types.CType) input.ReadEnum(); + break; + } + case 16: { + Packed = input.ReadBool(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 40: { + Lazy = input.ReadBool(); + break; + } + case 48: { + Jstype = (global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) input.ReadEnum(); + break; + } + case 80: { + Weak = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5794,6 +6481,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -5850,7 +6538,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class OneofOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class OneofOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -5974,9 +6666,27 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -5994,6 +6704,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6019,7 +6730,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class EnumOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class EnumOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -6229,9 +6944,35 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 16: { + AllowAlias = input.ReadBool(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6257,6 +6998,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6282,7 +7024,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class EnumValueOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class EnumValueOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -6451,9 +7197,31 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + Deprecated = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6475,6 +7243,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6500,7 +7269,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class ServiceOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class ServiceOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -6669,9 +7442,31 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 264: { + Deprecated = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6693,6 +7488,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6718,7 +7514,11 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class MethodOptions : pb::IExtendableMessage, pb::IBufferMessage { + public sealed partial class MethodOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; @@ -6924,9 +7724,35 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 264: { + Deprecated = input.ReadBool(); + break; + } + case 272: { + IdempotencyLevel = (global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel) input.ReadEnum(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -6952,6 +7778,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -7009,7 +7836,11 @@ namespace Google.Protobuf.Reflection { /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions /// in them. /// - public sealed partial class UninterpretedOption : pb::IMessage, pb::IBufferMessage { + public sealed partial class UninterpretedOption : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UninterpretedOption()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -7339,9 +8170,49 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 18: { + name_.AddEntriesFrom(input, _repeated_name_codec); + break; + } + case 26: { + IdentifierValue = input.ReadString(); + break; + } + case 32: { + PositiveIntValue = input.ReadUInt64(); + break; + } + case 40: { + NegativeIntValue = input.ReadInt64(); + break; + } + case 49: { + DoubleValue = input.ReadDouble(); + break; + } + case 58: { + StringValue = input.ReadBytes(); + break; + } + case 66: { + AggregateValue = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7381,6 +8252,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the UninterpretedOption message type. @@ -7393,7 +8265,11 @@ namespace Google.Protobuf.Reflection { /// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents /// "foo.(bar.baz).qux". /// - public sealed partial class NamePart : pb::IMessage, pb::IBufferMessage { + public sealed partial class NamePart : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NamePart()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -7557,9 +8433,29 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + NamePart_ = input.ReadString(); + break; + } + case 16: { + IsExtension = input.ReadBool(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7579,6 +8475,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } @@ -7591,7 +8488,11 @@ namespace Google.Protobuf.Reflection { /// Encapsulates information about the original source file from which a /// FileDescriptorProto was generated. /// - public sealed partial class SourceCodeInfo : pb::IMessage, pb::IBufferMessage { + public sealed partial class SourceCodeInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceCodeInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -7741,9 +8642,25 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + location_.AddEntriesFrom(input, _repeated_location_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -7759,12 +8676,17 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the SourceCodeInfo message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class Location : pb::IMessage, pb::IBufferMessage { + public sealed partial class Location : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Location()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8054,9 +8976,43 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + path_.AddEntriesFrom(input, _repeated_path_codec); + break; + } + case 18: + case 16: { + span_.AddEntriesFrom(input, _repeated_span_codec); + break; + } + case 26: { + LeadingComments = input.ReadString(); + break; + } + case 34: { + TrailingComments = input.ReadString(); + break; + } + case 50: { + leadingDetachedComments_.AddEntriesFrom(input, _repeated_leadingDetachedComments_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8090,6 +9046,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } @@ -8103,7 +9060,11 @@ namespace Google.Protobuf.Reflection { /// file. A GeneratedCodeInfo message is associated with only one generated /// source file, but may contain references to different source .proto files. /// - public sealed partial class GeneratedCodeInfo : pb::IMessage, pb::IBufferMessage { + public sealed partial class GeneratedCodeInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GeneratedCodeInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8212,9 +9173,25 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + annotation_.AddEntriesFrom(input, _repeated_annotation_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8230,12 +9207,17 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the GeneratedCodeInfo message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { - public sealed partial class Annotation : pb::IMessage, pb::IBufferMessage { + public sealed partial class Annotation : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Annotation()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; @@ -8468,9 +9450,38 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 8: { + path_.AddEntriesFrom(input, _repeated_path_codec); + break; + } + case 18: { + SourceFile = input.ReadString(); + break; + } + case 24: { + Begin = input.ReadInt32(); + break; + } + case 32: { + End = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -8499,6 +9510,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index c4e744706c..fc23560f8a 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -119,7 +119,11 @@ namespace Google.Protobuf.WellKnownTypes { /// "value": "1.212s" /// } /// - public sealed partial class Any : pb::IMessage, pb::IBufferMessage { + public sealed partial class Any : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Any()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -288,9 +292,29 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + TypeUrl = input.ReadString(); + break; + } + case 18: { + Value = input.ReadBytes(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -310,6 +334,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index 1f29224916..e8f1a50e29 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -64,7 +64,11 @@ namespace Google.Protobuf.WellKnownTypes { /// this message itself. See https://cloud.google.com/apis/design/glossary for /// detailed terminology. /// - public sealed partial class Api : pb::IMessage, pb::IBufferMessage { + public sealed partial class Api : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -341,9 +345,52 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + methods_.AddEntriesFrom(input, _repeated_methods_codec); + break; + } + case 26: { + options_.AddEntriesFrom(input, _repeated_options_codec); + break; + } + case 34: { + Version = input.ReadString(); + break; + } + case 42: { + if (sourceContext_ == null) { + SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContext); + break; + } + case 50: { + mixins_.AddEntriesFrom(input, _repeated_mixins_codec); + break; + } + case 56: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -386,13 +433,18 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } /// /// Method represents a method of an API interface. /// - public sealed partial class Method : pb::IMessage, pb::IBufferMessage { + public sealed partial class Method : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Method()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -662,9 +714,49 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + RequestTypeUrl = input.ReadString(); + break; + } + case 24: { + RequestStreaming = input.ReadBool(); + break; + } + case 34: { + ResponseTypeUrl = input.ReadString(); + break; + } + case 40: { + ResponseStreaming = input.ReadBool(); + break; + } + case 50: { + options_.AddEntriesFrom(input, _repeated_options_codec); + break; + } + case 56: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -704,6 +796,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } @@ -787,7 +880,11 @@ namespace Google.Protobuf.WellKnownTypes { /// ... /// } /// - public sealed partial class Mixin : pb::IMessage, pb::IBufferMessage { + public sealed partial class Mixin : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mixin()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -931,9 +1028,29 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Root = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -953,6 +1070,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index 804b82f0fa..8ef1b3778b 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -100,7 +100,11 @@ namespace Google.Protobuf.WellKnownTypes { /// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 /// microsecond should be expressed in JSON format as "3.000001s". /// - public sealed partial class Duration : pb::IMessage, pb::IBufferMessage { + public sealed partial class Duration : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Duration()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -250,9 +254,29 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Seconds = input.ReadInt64(); + break; + } + case 16: { + Nanos = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -272,6 +296,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index f73c345dfb..ff04940390 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -50,7 +50,11 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `Empty` is empty JSON object `{}`. /// - public sealed partial class Empty : pb::IMessage, pb::IBufferMessage { + public sealed partial class Empty : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -139,9 +143,21 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -153,6 +169,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index 25a2f050a1..72c049f709 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -240,7 +240,11 @@ namespace Google.Protobuf.WellKnownTypes { /// request should verify the included field paths, and return an /// `INVALID_ARGUMENT` error if any path is unmappable. /// - public sealed partial class FieldMask : pb::IMessage, pb::IBufferMessage { + public sealed partial class FieldMask : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldMask()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -348,9 +352,25 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + paths_.AddEntriesFrom(input, _repeated_paths_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -366,6 +386,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index 99d40a5be0..dbfc8a99c8 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -44,7 +44,11 @@ namespace Google.Protobuf.WellKnownTypes { /// `SourceContext` represents information about the source of a /// protobuf element, like the file in which it is defined. /// - public sealed partial class SourceContext : pb::IMessage, pb::IBufferMessage { + public sealed partial class SourceContext : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceContext()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -161,9 +165,25 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + FileName = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -179,6 +199,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 84057422c2..2ba1b1cc5c 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -77,7 +77,11 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `Struct` is JSON object. /// - public sealed partial class Struct : pb::IMessage, pb::IBufferMessage { + public sealed partial class Struct : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Struct()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -185,9 +189,25 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + fields_.AddEntriesFrom(input, _map_fields_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -203,6 +223,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } @@ -214,7 +235,11 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `Value` is JSON value. /// - public sealed partial class Value : pb::IMessage, pb::IBufferMessage { + public sealed partial class Value : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -514,9 +539,56 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + kind_ = input.ReadEnum(); + kindCase_ = KindOneofCase.NullValue; + break; + } + case 17: { + NumberValue = input.ReadDouble(); + break; + } + case 26: { + StringValue = input.ReadString(); + break; + } + case 32: { + BoolValue = input.ReadBool(); + break; + } + case 42: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (kindCase_ == KindOneofCase.StructValue) { + subBuilder.MergeFrom(StructValue); + } + input.ReadMessage(subBuilder); + StructValue = subBuilder; + break; + } + case 50: { + global::Google.Protobuf.WellKnownTypes.ListValue subBuilder = new global::Google.Protobuf.WellKnownTypes.ListValue(); + if (kindCase_ == KindOneofCase.ListValue) { + subBuilder.MergeFrom(ListValue); + } + input.ReadMessage(subBuilder); + ListValue = subBuilder; + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -563,6 +635,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } @@ -571,7 +644,11 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `ListValue` is JSON array. /// - public sealed partial class ListValue : pb::IMessage, pb::IBufferMessage { + public sealed partial class ListValue : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -679,9 +756,25 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + values_.AddEntriesFrom(input, _repeated_values_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -697,6 +790,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index 31cbe95b89..208cd26fe7 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -123,7 +123,11 @@ namespace Google.Protobuf.WellKnownTypes { /// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D /// ) to obtain a formatter capable of generating timestamps in this format. /// - public sealed partial class Timestamp : pb::IMessage, pb::IBufferMessage { + public sealed partial class Timestamp : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Timestamp()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -271,9 +275,29 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Seconds = input.ReadInt64(); + break; + } + case 16: { + Nanos = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -293,6 +317,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index 3c074f85ec..453ff8dd6d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -94,7 +94,11 @@ namespace Google.Protobuf.WellKnownTypes { /// /// A protocol buffer message type. /// - public sealed partial class Type : pb::IMessage, pb::IBufferMessage { + public sealed partial class Type : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Type()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -324,9 +328,48 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + fields_.AddEntriesFrom(input, _repeated_fields_codec); + break; + } + case 26: { + oneofs_.AddEntriesFrom(input, _repeated_oneofs_codec); + break; + } + case 34: { + options_.AddEntriesFrom(input, _repeated_options_codec); + break; + } + case 42: { + if (sourceContext_ == null) { + SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContext); + break; + } + case 48: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -365,13 +408,18 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } /// /// A single field of a message type. /// - public sealed partial class Field : pb::IMessage, pb::IBufferMessage { + public sealed partial class Field : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Field()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -724,9 +772,61 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum(); + break; + } + case 16: { + Cardinality = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum(); + break; + } + case 24: { + Number = input.ReadInt32(); + break; + } + case 34: { + Name = input.ReadString(); + break; + } + case 50: { + TypeUrl = input.ReadString(); + break; + } + case 56: { + OneofIndex = input.ReadInt32(); + break; + } + case 64: { + Packed = input.ReadBool(); + break; + } + case 74: { + options_.AddEntriesFrom(input, _repeated_options_codec); + break; + } + case 82: { + JsonName = input.ReadString(); + break; + } + case 90: { + DefaultValue = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -778,6 +878,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif #region Nested types /// Container for nested types declared in the Field message type. @@ -895,7 +996,11 @@ namespace Google.Protobuf.WellKnownTypes { /// /// Enum type definition. /// - public sealed partial class Enum : pb::IMessage, pb::IBufferMessage { + public sealed partial class Enum : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Enum()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1106,9 +1211,44 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + enumvalue_.AddEntriesFrom(input, _repeated_enumvalue_codec); + break; + } + case 26: { + options_.AddEntriesFrom(input, _repeated_options_codec); + break; + } + case 34: { + if (sourceContext_ == null) { + SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContext); + break; + } + case 40: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1143,13 +1283,18 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } /// /// Enum value definition. /// - public sealed partial class EnumValue : pb::IMessage, pb::IBufferMessage { + public sealed partial class EnumValue : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1311,9 +1456,33 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + Number = input.ReadInt32(); + break; + } + case 26: { + options_.AddEntriesFrom(input, _repeated_options_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; @@ -1337,6 +1506,7 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } @@ -1344,7 +1514,11 @@ namespace Google.Protobuf.WellKnownTypes { /// A protocol buffer option, which can be attached to a message, field, /// enumeration, etc. /// - public sealed partial class Option : pb::IMessage