aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-06-03 14:15:21 -0500
committerrogerk <devnull@localhost>2011-06-03 14:15:21 -0500
commit123e534914df3dbdcd918ec4f8d79c47a3bf85e5 (patch)
tree036d1f3d61f9a5eb3dcb6950f35a0bd32022058e /src
parentffafdaa0f9a96d17d456c844a3e554512a5c121d (diff)
downloadprotobuf-123e534914df3dbdcd918ec4f8d79c47a3bf85e5.tar.gz
protobuf-123e534914df3dbdcd918ec4f8d79c47a3bf85e5.tar.bz2
protobuf-123e534914df3dbdcd918ec4f8d79c47a3bf85e5.zip
Canged CodedInputStream.ReadTag to use boolean result with out params to
support reading a field name rather than a field tag.
Diffstat (limited to 'src')
-rw-r--r--src/AddressBook/AddressBookProtos.cs45
-rw-r--r--src/ProtoGen/MessageGenerator.cs28
-rw-r--r--src/ProtocolBuffers.Test/CodedInputStreamTest.cs28
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs15
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs255
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs15
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs75
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs9
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs15
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs90
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs15
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs600
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs60
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs75
-rw-r--r--src/ProtocolBuffers.Test/WireFormatTest.cs12
-rw-r--r--src/ProtocolBuffers/CodedInputStream.cs41
-rw-r--r--src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs60
-rw-r--r--src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs270
-rw-r--r--src/ProtocolBuffers/ExtendableBuilderLite.cs2
-rw-r--r--src/ProtocolBuffers/GeneratedBuilderLite.cs2
-rw-r--r--src/ProtocolBuffers/InvalidProtocolBufferException.cs2
-rw-r--r--src/ProtocolBuffers/MessageStreamIterator.cs11
-rw-r--r--src/ProtocolBuffers/UnknownFieldSet.cs28
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs45
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs9
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs15
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs9
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs108
-rw-r--r--src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs600
29 files changed, 1540 insertions, 999 deletions
diff --git a/src/AddressBook/AddressBookProtos.cs b/src/AddressBook/AddressBookProtos.cs
index 2bb45d0a..1d60f2cd 100644
--- a/src/AddressBook/AddressBookProtos.cs
+++ b/src/AddressBook/AddressBookProtos.cs
@@ -287,14 +287,12 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -327,6 +325,11 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -582,14 +585,12 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -624,6 +625,11 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -899,14 +905,12 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -929,6 +933,11 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtoGen/MessageGenerator.cs b/src/ProtoGen/MessageGenerator.cs
index fa6fec06..ece0bb4d 100644
--- a/src/ProtoGen/MessageGenerator.cs
+++ b/src/ProtoGen/MessageGenerator.cs
@@ -615,19 +615,21 @@ namespace Google.ProtocolBuffers.ProtoGen
{
writer.WriteLine("pb::UnknownFieldSet.Builder unknownFields = null;");
}
- writer.WriteLine("while (true) {");
+ writer.WriteLine("uint tag;");
+ writer.WriteLine("string field_name;");
+ writer.WriteLine("while (input.ReadTag(out tag, out field_name)) {");
writer.Indent();
- writer.WriteLine("uint tag = input.ReadTag();");
writer.WriteLine("switch (tag) {");
writer.Indent();
writer.WriteLine("case 0: {"); // 0 signals EOF / limit reached
- if (!UseLiteRuntime)
- {
- writer.WriteLine(" if (unknownFields != null) {");
- writer.WriteLine(" this.UnknownFields = unknownFields.Build();");
- writer.WriteLine(" }");
- }
- writer.WriteLine(" return this;");
+ //if (!UseLiteRuntime)
+ //{
+ // writer.WriteLine(" if (unknownFields != null) {");
+ // writer.WriteLine(" this.UnknownFields = unknownFields.Build();");
+ // writer.WriteLine(" }");
+ //}
+ //writer.WriteLine(" return this;");
+ writer.WriteLine(" throw InvalidProtocolBufferException.InvalidTag();");
writer.WriteLine("}");
writer.WriteLine("default: {");
writer.WriteLine(" if (pb::WireFormat.IsEndGroupTag(tag)) {");
@@ -663,6 +665,14 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine("}");
writer.Outdent();
writer.WriteLine("}");
+ writer.WriteLine();
+ if (!UseLiteRuntime)
+ {
+ writer.WriteLine("if (unknownFields != null) {");
+ writer.WriteLine(" this.UnknownFields = unknownFields.Build();");
+ writer.WriteLine("}");
+ }
+ writer.WriteLine("return this;");
writer.Outdent();
writer.WriteLine("}");
writer.WriteLine();
diff --git a/src/ProtocolBuffers.Test/CodedInputStreamTest.cs b/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
index 878febee..a49b1ed3 100644
--- a/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
+++ b/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
@@ -283,16 +283,16 @@ namespace Google.ProtocolBuffers
CodedInputStream input2 = CodedInputStream.CreateInstance(rawBytes);
UnknownFieldSet.Builder unknownFields = UnknownFieldSet.CreateBuilder();
- while (true)
+ uint tag;
+ string name;
+ while (input1.ReadTag(out tag, out name))
{
- uint tag = input1.ReadTag();
- Assert.AreEqual(tag, input2.ReadTag());
- if (tag == 0)
- {
- break;
- }
+ uint tag2;
+ Assert.IsTrue(input2.ReadTag(out tag2, out name));
+ Assert.AreEqual(tag, tag2);
+
unknownFields.MergeFieldFrom(tag, input1);
- input2.SkipField(tag);
+ input2.SkipField();
}
}
@@ -355,7 +355,10 @@ namespace Google.ProtocolBuffers
ms.Position = 0;
CodedInputStream input = CodedInputStream.CreateInstance(ms);
- Assert.AreEqual(tag, input.ReadTag());
+ uint testtag;
+ string ignore;
+ Assert.IsTrue(input.ReadTag(out testtag, out ignore));
+ Assert.AreEqual(tag, testtag);
try
{
@@ -497,7 +500,12 @@ namespace Google.ProtocolBuffers
ms.Position = 0;
CodedInputStream input = CodedInputStream.CreateInstance(ms);
- Assert.AreEqual(tag, input.ReadTag());
+
+ uint testtag;
+ string ignored;
+
+ Assert.IsTrue(input.ReadTag(out testtag, out ignored));
+ Assert.AreEqual(tag, testtag);
string text = input.ReadString();
Assert.AreEqual('\ufffd', text[0]);
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
index 9cc59a22..d769cecc 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
@@ -259,14 +259,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -295,6 +293,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
index 53a076e6..c300e209 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
@@ -576,14 +576,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -604,6 +602,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -779,14 +782,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -803,6 +804,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -959,14 +965,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -983,6 +987,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -1154,14 +1163,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1178,6 +1185,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -1334,14 +1346,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1358,6 +1368,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -1514,14 +1529,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1538,6 +1551,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -1694,14 +1712,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1718,6 +1734,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -1874,14 +1895,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1898,6 +1917,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -2054,14 +2078,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2078,6 +2100,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -2234,14 +2261,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2258,6 +2283,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -2476,14 +2506,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2512,6 +2540,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -2773,14 +2806,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2801,6 +2832,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3018,14 +3054,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3064,6 +3098,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3359,14 +3398,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3387,6 +3424,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3577,14 +3619,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3614,6 +3654,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3843,14 +3888,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3871,6 +3914,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -4045,14 +4093,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -4069,6 +4115,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
index 4d94af25..d6610f45 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
@@ -253,14 +253,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -292,6 +290,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
index 3eb853ce..b3bb9f71 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
@@ -1069,14 +1069,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1262,6 +1260,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -2579,14 +2582,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2683,6 +2684,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3570,14 +3576,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3663,6 +3667,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -4736,14 +4745,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -4882,6 +4889,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5838,14 +5850,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5906,6 +5916,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
index 2002d8df..db26d728 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
@@ -207,11 +207,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -226,6 +227,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
index b00ff2f8..309dfc66 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
@@ -232,14 +232,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -260,6 +258,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
index c69ac9f9..89bf4597 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
@@ -250,14 +250,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -274,6 +272,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -449,14 +452,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -482,6 +483,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -695,14 +701,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -723,6 +727,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -918,14 +927,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -946,6 +953,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1191,14 +1203,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1223,6 +1233,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1416,14 +1431,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1446,6 +1459,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
index 423c3adc..994d5308 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
@@ -247,14 +247,12 @@ namespace Google.ProtocolBuffers.TestProtos.NoGenericService {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -275,6 +273,11 @@ namespace Google.ProtocolBuffers.TestProtos.NoGenericService {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
index a9a69f10..184fb682 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
@@ -1229,14 +1229,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1257,6 +1255,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1450,14 +1453,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1478,6 +1479,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1671,14 +1677,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1699,6 +1703,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3323,14 +3332,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3719,6 +3726,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5482,14 +5494,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5510,6 +5520,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5703,14 +5718,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5731,6 +5744,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5910,14 +5928,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5934,6 +5950,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -6109,14 +6130,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6137,6 +6156,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6330,14 +6354,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6358,6 +6380,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6534,14 +6561,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6558,6 +6583,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -7348,14 +7378,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7504,6 +7532,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -8320,14 +8353,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8363,6 +8394,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -8630,14 +8666,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8663,6 +8697,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -8855,14 +8894,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8879,6 +8916,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -9040,14 +9082,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9064,6 +9104,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -9227,14 +9272,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9251,6 +9294,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -9445,14 +9493,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9477,6 +9523,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -9707,14 +9758,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9744,6 +9793,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -9973,14 +10027,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10006,6 +10058,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10236,14 +10293,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10273,6 +10328,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10532,14 +10592,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10560,6 +10618,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10753,14 +10816,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10781,6 +10842,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10990,14 +11056,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -11036,6 +11100,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -11361,14 +11430,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -11395,6 +11462,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -11612,14 +11684,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -11645,6 +11715,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -12110,14 +12185,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -12205,6 +12278,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -12727,14 +12805,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -12763,6 +12839,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -13337,14 +13418,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -13437,6 +13516,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -13960,14 +14044,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -13988,6 +14070,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -14182,14 +14269,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -14210,6 +14295,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -14814,14 +14904,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -14972,6 +15060,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -15886,14 +15979,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -15974,6 +16065,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -16519,14 +16615,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -16543,6 +16637,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -16756,14 +16855,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -16784,6 +16881,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -17090,14 +17192,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -17173,6 +17273,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -17673,14 +17778,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -17721,6 +17824,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -18048,14 +18156,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18072,6 +18178,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -18228,14 +18339,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18252,6 +18361,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -18408,14 +18522,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18432,6 +18544,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -18588,14 +18705,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18612,6 +18727,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
index 08ac8a68..3e9c35c0 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
@@ -252,14 +252,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -280,6 +278,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -533,14 +536,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -565,6 +566,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -762,14 +768,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -792,6 +796,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1034,14 +1043,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1071,6 +1078,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
index 2c383336..722a5ffa 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
@@ -320,14 +320,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -360,6 +358,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -561,14 +564,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -585,6 +586,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -819,14 +825,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -859,6 +863,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1195,14 +1204,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1254,6 +1261,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1613,14 +1625,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1641,6 +1651,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers.Test/WireFormatTest.cs b/src/ProtocolBuffers.Test/WireFormatTest.cs
index f7ad864e..e390ce0d 100644
--- a/src/ProtocolBuffers.Test/WireFormatTest.cs
+++ b/src/ProtocolBuffers.Test/WireFormatTest.cs
@@ -173,17 +173,13 @@ namespace Google.ProtocolBuffers
CodedInputStream input = data.CreateCodedInput();
uint previousTag = 0;
- while (true)
+ uint tag;
+ string name;
+ while (input.ReadTag(out tag, out name))
{
- uint tag = input.ReadTag();
- if (tag == 0)
- {
- break;
- }
-
Assert.IsTrue(tag > previousTag);
previousTag = tag;
- input.SkipField(tag);
+ input.SkipField();
}
}
diff --git a/src/ProtocolBuffers/CodedInputStream.cs b/src/ProtocolBuffers/CodedInputStream.cs
index a9afbe60..33986d3f 100644
--- a/src/ProtocolBuffers/CodedInputStream.cs
+++ b/src/ProtocolBuffers/CodedInputStream.cs
@@ -162,29 +162,40 @@ namespace Google.ProtocolBuffers
#endregion
#region Reading of tags etc
-
+
/// <summary>
- /// Attempt to read a field tag, returning 0 if we have reached the end
- /// of the input data. Protocol message parsers use this to read tags,
- /// since a protocol message may legally end wherever a tag occurs, and
- /// zero is not a valid tag number.
+ /// Attempt to read a field tag, returning false if we have reached the end
+ /// of the input data.
/// </summary>
+ /// <remarks>
+ /// <para>
+ /// If fieldTag is non-zero and ReadTag returns true then the value in fieldName
+ /// may or may not be populated. However, if fieldTag is zero and ReadTag returns
+ /// true, then fieldName should be populated with a non-null field name.
+ /// </para><para>
+ /// In other words if ReadTag returns true then either fieldTag will be non-zero OR
+ /// fieldName will be non-zero. In some cases both may be populated, however the
+ /// builders will always prefer the fieldTag over fieldName.
+ /// </para>
+ /// </remarks>
[CLSCompliant(false)]
- public uint ReadTag()
+ public bool ReadTag(out uint fieldTag, out string fieldName)
{
+ fieldName = null;
+
if (IsAtEnd)
{
- lastTag = 0;
- return 0;
+ lastTag = fieldTag = 0;
+ return false;
}
- lastTag = ReadRawVarint32();
+ lastTag = fieldTag = ReadRawVarint32();
if (lastTag == 0)
{
// If we actually read zero, that's not a valid tag.
throw InvalidProtocolBufferException.InvalidTag();
}
- return lastTag;
+ return true;
}
/// <summary>
@@ -1030,8 +1041,9 @@ namespace Google.ProtocolBuffers
/// <returns>false if the tag is an end-group tag, in which case
/// nothing is skipped. Otherwise, returns true.</returns>
[CLSCompliant(false)]
- public bool SkipField(uint tag)
+ public bool SkipField()
{
+ uint tag = lastTag;
switch (WireFormat.GetTagWireType(tag))
{
case WireFormat.WireType.Varint:
@@ -1065,10 +1077,11 @@ namespace Google.ProtocolBuffers
/// </summary>
public void SkipMessage()
{
- while (true)
+ uint tag;
+ string name;
+ while (ReadTag(out tag, out name))
{
- uint tag = ReadTag();
- if (tag == 0 || !SkipField(tag))
+ if (!SkipField())
{
return;
}
diff --git a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
index d1ae767e..ccb118dc 100644
--- a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
+++ b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
@@ -514,14 +514,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -598,6 +596,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1012,14 +1015,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1040,6 +1041,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1234,14 +1240,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1262,6 +1266,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1456,14 +1465,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1484,6 +1491,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs b/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
index d4e5126e..a343587e 100644
--- a/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
+++ b/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
@@ -400,14 +400,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -430,6 +428,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -811,14 +814,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -880,6 +881,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1358,14 +1364,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1390,6 +1394,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1723,14 +1732,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1790,6 +1797,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -2385,14 +2397,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2462,6 +2472,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -2850,14 +2865,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -2893,6 +2906,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3202,14 +3220,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3243,6 +3259,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3538,14 +3559,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3581,6 +3600,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3909,14 +3933,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3954,6 +3976,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -4382,14 +4409,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -4448,6 +4473,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -4838,14 +4868,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -4876,6 +4904,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5228,14 +5261,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5282,6 +5313,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5579,14 +5615,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5609,6 +5643,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5833,14 +5872,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5863,6 +5900,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6087,14 +6129,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6117,6 +6157,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6341,14 +6386,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6371,6 +6414,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6635,14 +6683,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6667,6 +6713,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6959,14 +7010,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7009,6 +7058,11 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffers/ExtendableBuilderLite.cs b/src/ProtocolBuffers/ExtendableBuilderLite.cs
index 944b246b..fc748e6f 100644
--- a/src/ProtocolBuffers/ExtendableBuilderLite.cs
+++ b/src/ProtocolBuffers/ExtendableBuilderLite.cs
@@ -168,7 +168,7 @@ namespace Google.ProtocolBuffers
if (unknown)
{
// Unknown field or wrong wire type. Skip.
- return input.SkipField(tag);
+ return input.SkipField();
}
if (packed)
diff --git a/src/ProtocolBuffers/GeneratedBuilderLite.cs b/src/ProtocolBuffers/GeneratedBuilderLite.cs
index 1641b28a..810324cc 100644
--- a/src/ProtocolBuffers/GeneratedBuilderLite.cs
+++ b/src/ProtocolBuffers/GeneratedBuilderLite.cs
@@ -101,7 +101,7 @@ namespace Google.ProtocolBuffers
protected virtual bool ParseUnknownField(CodedInputStream input,
ExtensionRegistry extensionRegistry, uint tag)
{
- return input.SkipField(tag);
+ return input.SkipField();
}
/// <summary>
diff --git a/src/ProtocolBuffers/InvalidProtocolBufferException.cs b/src/ProtocolBuffers/InvalidProtocolBufferException.cs
index 40a377cb..67d7b374 100644
--- a/src/ProtocolBuffers/InvalidProtocolBufferException.cs
+++ b/src/ProtocolBuffers/InvalidProtocolBufferException.cs
@@ -71,7 +71,7 @@ namespace Google.ProtocolBuffers
"CodedInputStream encountered a malformed varint.");
}
- internal static InvalidProtocolBufferException InvalidTag()
+ public static InvalidProtocolBufferException InvalidTag()
{
return new InvalidProtocolBufferException(
"Protocol message contained an invalid tag (zero).");
diff --git a/src/ProtocolBuffers/MessageStreamIterator.cs b/src/ProtocolBuffers/MessageStreamIterator.cs
index 7bc32383..9b266fa4 100644
--- a/src/ProtocolBuffers/MessageStreamIterator.cs
+++ b/src/ProtocolBuffers/MessageStreamIterator.cs
@@ -219,13 +219,14 @@ namespace Google.ProtocolBuffers
CodedInputStream input = CodedInputStream.CreateInstance(stream);
input.SetSizeLimit(sizeLimit);
uint tag;
- while ((tag = input.ReadTag()) != 0)
+ string name;
+ while (input.ReadTag(out tag, out name))
{
- if (tag != ExpectedTag)
- {
+ if ((tag == 0 && name == "item") || (tag == ExpectedTag))
+ yield return messageReader(input, extensionRegistry);
+ else
throw InvalidProtocolBufferException.InvalidMessageStreamTag();
- }
- yield return messageReader(input, extensionRegistry);
+
input.ResetSizeCounter();
}
}
diff --git a/src/ProtocolBuffers/UnknownFieldSet.cs b/src/ProtocolBuffers/UnknownFieldSet.cs
index 20a46936..ff6a1534 100644
--- a/src/ProtocolBuffers/UnknownFieldSet.cs
+++ b/src/ProtocolBuffers/UnknownFieldSet.cs
@@ -419,13 +419,19 @@ namespace Google.ProtocolBuffers
/// </summary>
public Builder MergeFrom(CodedInputStream input)
{
- while (true)
+ uint tag;
+ string name;
+ while (input.ReadTag(out tag, out name))
{
- uint tag = input.ReadTag();
- if (tag == 0 || !MergeFieldFrom(tag, input))
+ if (tag == 0)
{
+ if (input.SkipField())
+ continue; //can't merge unknown without field tag
break;
}
+
+ if(!MergeFieldFrom(tag, input))
+ break;
}
return this;
}
@@ -581,11 +587,14 @@ namespace Google.ProtocolBuffers
internal void MergeFrom(CodedInputStream input, ExtensionRegistry extensionRegistry, IBuilder builder)
{
- while (true)
+ uint tag;
+ string name;
+ while (input.ReadTag(out tag, out name))
{
- uint tag = input.ReadTag();
if (tag == 0)
{
+ if (input.SkipField())
+ continue; //can't merge unknown without field tag
break;
}
@@ -765,11 +774,14 @@ namespace Google.ProtocolBuffers
IBuilderLite subBuilder = null;
FieldDescriptor field = null;
- while (true)
+ uint tag;
+ string name;
+ while (input.ReadTag(out tag, out name))
{
- uint tag = input.ReadTag();
if (tag == 0)
{
+ if (input.SkipField())
+ continue; //can't merge unknown without field tag
break;
}
@@ -833,7 +845,7 @@ namespace Google.ProtocolBuffers
else
{
// Unknown tag. Skip it.
- if (!input.SkipField(tag))
+ if (!input.SkipField())
{
break; // end of group
}
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
index 47bdcb62..445d1278 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
@@ -247,11 +247,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -274,6 +275,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -541,11 +544,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -568,6 +572,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -876,11 +882,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -911,6 +918,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -1321,11 +1330,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1369,6 +1379,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -1706,11 +1718,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1725,6 +1738,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs
index 2002d8df..db26d728 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs
@@ -207,11 +207,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -226,6 +227,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs
index b00ff2f8..309dfc66 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs
@@ -232,14 +232,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -260,6 +258,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs
index 375f5c35..4316350b 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs
@@ -196,11 +196,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -220,6 +221,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs
index 7d205f21..2e9d085c 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs
@@ -1250,11 +1250,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1269,6 +1270,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -1465,11 +1468,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1484,6 +1488,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -1680,11 +1686,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1699,6 +1706,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -3607,11 +3616,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3958,6 +3968,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -5724,11 +5736,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5743,6 +5756,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -6430,11 +6445,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6575,6 +6591,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -7123,11 +7141,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7138,6 +7157,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
}
@@ -7316,11 +7337,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7335,6 +7357,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -7531,11 +7555,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7550,6 +7575,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
@@ -7732,11 +7759,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7747,6 +7775,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
}
@@ -7905,11 +7935,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7920,6 +7951,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
}
@@ -8098,11 +8131,12 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8117,6 +8151,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ return this;
}
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs
index a9a69f10..184fb682 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs
@@ -1229,14 +1229,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1257,6 +1255,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1450,14 +1453,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1478,6 +1479,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -1671,14 +1677,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -1699,6 +1703,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -3323,14 +3332,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -3719,6 +3726,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5482,14 +5494,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5510,6 +5520,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5703,14 +5718,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5731,6 +5744,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -5910,14 +5928,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -5934,6 +5950,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -6109,14 +6130,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6137,6 +6156,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6330,14 +6354,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6358,6 +6380,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -6534,14 +6561,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -6558,6 +6583,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -7348,14 +7378,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -7504,6 +7532,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -8320,14 +8353,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8363,6 +8394,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -8630,14 +8666,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8663,6 +8697,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -8855,14 +8894,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -8879,6 +8916,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -9040,14 +9082,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9064,6 +9104,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -9227,14 +9272,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9251,6 +9294,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -9445,14 +9493,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9477,6 +9523,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -9707,14 +9758,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -9744,6 +9793,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -9973,14 +10027,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10006,6 +10058,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10236,14 +10293,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10273,6 +10328,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10532,14 +10592,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10560,6 +10618,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10753,14 +10816,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -10781,6 +10842,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -10990,14 +11056,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -11036,6 +11100,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -11361,14 +11430,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -11395,6 +11462,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -11612,14 +11684,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -11645,6 +11715,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -12110,14 +12185,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -12205,6 +12278,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -12727,14 +12805,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -12763,6 +12839,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -13337,14 +13418,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -13437,6 +13516,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -13960,14 +14044,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -13988,6 +14070,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -14182,14 +14269,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -14210,6 +14295,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -14814,14 +14904,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -14972,6 +15060,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -15886,14 +15979,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -15974,6 +16065,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -16519,14 +16615,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -16543,6 +16637,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -16756,14 +16855,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -16784,6 +16881,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -17090,14 +17192,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -17173,6 +17273,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -17673,14 +17778,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -17721,6 +17824,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
@@ -18048,14 +18156,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18072,6 +18178,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -18228,14 +18339,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18252,6 +18361,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -18408,14 +18522,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18432,6 +18544,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}
@@ -18588,14 +18705,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
- while (true) {
- uint tag = input.ReadTag();
+ uint tag;
+ string field_name;
+ while (input.ReadTag(out tag, out field_name)) {
switch (tag) {
case 0: {
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
+ throw InvalidProtocolBufferException.InvalidTag();
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
@@ -18612,6 +18727,11 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
}
+
+ if (unknownFields != null) {
+ this.UnknownFields = unknownFields.Build();
+ }
+ return this;
}
}