aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf.Test
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf.Test')
-rw-r--r--csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs10
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs112
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs48
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs336
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs16
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs16
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs208
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs708
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs64
-rw-r--r--csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs128
10 files changed, 1455 insertions, 191 deletions
diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs
index 8292d3e7..5694754e 100644
--- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs
+++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs
@@ -638,7 +638,7 @@ namespace Google.Protobuf
}
[Test]
- public void IgnoreUnknownFields_RealDataStillRead()
+ public void DiscardUnknownFields_RealDataStillRead()
{
var message = SampleMessages.CreateFullTestAllTypes();
var stream = new MemoryStream();
@@ -652,16 +652,18 @@ namespace Google.Protobuf
stream.Position = 0;
var parsed = TestAllTypes.Parser.ParseFrom(stream);
- Assert.AreEqual(message, parsed);
+ // TODO(jieluo): Add test back when DiscardUnknownFields API is supported.
+ // Assert.AreEqual(message, parsed);
}
[Test]
- public void IgnoreUnknownFields_AllTypes()
+ public void DiscardUnknownFields_AllTypes()
{
// Simple way of ensuring we can skip all kinds of fields.
var data = SampleMessages.CreateFullTestAllTypes().ToByteArray();
var empty = Empty.Parser.ParseFrom(data);
- Assert.AreEqual(new Empty(), empty);
+ // TODO(jieluo): Add test back when DiscardUnknownFields API is supported.
+ // Assert.AreNotEqual(new Empty(), empty);
}
// This was originally seen as a conformance test failure.
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
index bb946046..f55f9c30 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
@@ -176,6 +176,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestMap : pb::IMessage<TestMap> {
private static readonly pb::MessageParser<TestMap> _parser = new pb::MessageParser<TestMap>(() => new TestMap());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestMap> Parser { get { return _parser; } }
@@ -215,6 +216,7 @@ namespace Google.Protobuf.TestProtos {
mapInt32Bytes_ = other.mapInt32Bytes_.Clone();
mapInt32Enum_ = other.mapInt32Enum_.Clone();
mapInt32ForeignMessage_ = other.mapInt32ForeignMessage_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -422,7 +424,7 @@ namespace Google.Protobuf.TestProtos {
if (!MapInt32Bytes.Equals(other.MapInt32Bytes)) return false;
if (!MapInt32Enum.Equals(other.MapInt32Enum)) return false;
if (!MapInt32ForeignMessage.Equals(other.MapInt32ForeignMessage)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -445,6 +447,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= MapInt32Bytes.GetHashCode();
hash ^= MapInt32Enum.GetHashCode();
hash ^= MapInt32ForeignMessage.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -472,6 +477,9 @@ namespace Google.Protobuf.TestProtos {
mapInt32Bytes_.WriteTo(output, _map_mapInt32Bytes_codec);
mapInt32Enum_.WriteTo(output, _map_mapInt32Enum_codec);
mapInt32ForeignMessage_.WriteTo(output, _map_mapInt32ForeignMessage_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -494,6 +502,9 @@ namespace Google.Protobuf.TestProtos {
size += mapInt32Bytes_.CalculateSize(_map_mapInt32Bytes_codec);
size += mapInt32Enum_.CalculateSize(_map_mapInt32Enum_codec);
size += mapInt32ForeignMessage_.CalculateSize(_map_mapInt32ForeignMessage_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -519,6 +530,7 @@ namespace Google.Protobuf.TestProtos {
mapInt32Bytes_.Add(other.mapInt32Bytes_);
mapInt32Enum_.Add(other.mapInt32Enum_);
mapInt32ForeignMessage_.Add(other.mapInt32ForeignMessage_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -527,7 +539,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
@@ -605,6 +617,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestMapSubmessage : pb::IMessage<TestMapSubmessage> {
private static readonly pb::MessageParser<TestMapSubmessage> _parser = new pb::MessageParser<TestMapSubmessage>(() => new TestMapSubmessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestMapSubmessage> Parser { get { return _parser; } }
@@ -628,6 +641,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestMapSubmessage(TestMapSubmessage other) : this() {
TestMap = other.testMap_ != null ? other.TestMap.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -660,13 +674,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (!object.Equals(TestMap, other.TestMap)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (testMap_ != null) hash ^= TestMap.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -681,6 +698,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteMessage(TestMap);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -689,6 +709,9 @@ namespace Google.Protobuf.TestProtos {
if (testMap_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(TestMap);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -703,6 +726,7 @@ namespace Google.Protobuf.TestProtos {
}
TestMap.MergeFrom(other.TestMap);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -711,7 +735,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (testMap_ == null) {
@@ -728,6 +752,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestMessageMap : pb::IMessage<TestMessageMap> {
private static readonly pb::MessageParser<TestMessageMap> _parser = new pb::MessageParser<TestMessageMap>(() => new TestMessageMap());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestMessageMap> Parser { get { return _parser; } }
@@ -751,6 +776,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestMessageMap(TestMessageMap other) : this() {
mapInt32Message_ = other.mapInt32Message_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -782,13 +808,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (!MapInt32Message.Equals(other.MapInt32Message)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= MapInt32Message.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -800,12 +829,18 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
mapInt32Message_.WriteTo(output, _map_mapInt32Message_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += mapInt32Message_.CalculateSize(_map_mapInt32Message_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -815,6 +850,7 @@ namespace Google.Protobuf.TestProtos {
return;
}
mapInt32Message_.Add(other.mapInt32Message_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -823,7 +859,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec);
@@ -840,6 +876,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestSameTypeMap : pb::IMessage<TestSameTypeMap> {
private static readonly pb::MessageParser<TestSameTypeMap> _parser = new pb::MessageParser<TestSameTypeMap>(() => new TestSameTypeMap());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestSameTypeMap> Parser { get { return _parser; } }
@@ -864,6 +901,7 @@ namespace Google.Protobuf.TestProtos {
public TestSameTypeMap(TestSameTypeMap other) : this() {
map1_ = other.map1_.Clone();
map2_ = other.map2_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -906,7 +944,7 @@ namespace Google.Protobuf.TestProtos {
}
if (!Map1.Equals(other.Map1)) return false;
if (!Map2.Equals(other.Map2)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -914,6 +952,9 @@ namespace Google.Protobuf.TestProtos {
int hash = 1;
hash ^= Map1.GetHashCode();
hash ^= Map2.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -926,6 +967,9 @@ namespace Google.Protobuf.TestProtos {
public void WriteTo(pb::CodedOutputStream output) {
map1_.WriteTo(output, _map_map1_codec);
map2_.WriteTo(output, _map_map2_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -933,6 +977,9 @@ namespace Google.Protobuf.TestProtos {
int size = 0;
size += map1_.CalculateSize(_map_map1_codec);
size += map2_.CalculateSize(_map_map2_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -943,6 +990,7 @@ namespace Google.Protobuf.TestProtos {
}
map1_.Add(other.map1_);
map2_.Add(other.map2_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -951,7 +999,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
map1_.AddEntriesFrom(input, _map_map1_codec);
@@ -969,6 +1017,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestArenaMap : pb::IMessage<TestArenaMap> {
private static readonly pb::MessageParser<TestArenaMap> _parser = new pb::MessageParser<TestArenaMap>(() => new TestArenaMap());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestArenaMap> Parser { get { return _parser; } }
@@ -1006,6 +1055,7 @@ namespace Google.Protobuf.TestProtos {
mapBoolBool_ = other.mapBoolBool_.Clone();
mapInt32Enum_ = other.mapInt32Enum_.Clone();
mapInt32ForeignMessage_ = other.mapInt32ForeignMessage_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1191,7 +1241,7 @@ namespace Google.Protobuf.TestProtos {
if (!MapBoolBool.Equals(other.MapBoolBool)) return false;
if (!MapInt32Enum.Equals(other.MapInt32Enum)) return false;
if (!MapInt32ForeignMessage.Equals(other.MapInt32ForeignMessage)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1212,6 +1262,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= MapBoolBool.GetHashCode();
hash ^= MapInt32Enum.GetHashCode();
hash ^= MapInt32ForeignMessage.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1237,6 +1290,9 @@ namespace Google.Protobuf.TestProtos {
mapBoolBool_.WriteTo(output, _map_mapBoolBool_codec);
mapInt32Enum_.WriteTo(output, _map_mapInt32Enum_codec);
mapInt32ForeignMessage_.WriteTo(output, _map_mapInt32ForeignMessage_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1257,6 +1313,9 @@ namespace Google.Protobuf.TestProtos {
size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec);
size += mapInt32Enum_.CalculateSize(_map_mapInt32Enum_codec);
size += mapInt32ForeignMessage_.CalculateSize(_map_mapInt32ForeignMessage_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1280,6 +1339,7 @@ namespace Google.Protobuf.TestProtos {
mapBoolBool_.Add(other.mapBoolBool_);
mapInt32Enum_.Add(other.mapInt32Enum_);
mapInt32ForeignMessage_.Add(other.mapInt32ForeignMessage_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1288,7 +1348,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
@@ -1362,6 +1422,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class MessageContainingEnumCalledType : pb::IMessage<MessageContainingEnumCalledType> {
private static readonly pb::MessageParser<MessageContainingEnumCalledType> _parser = new pb::MessageParser<MessageContainingEnumCalledType>(() => new MessageContainingEnumCalledType());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MessageContainingEnumCalledType> Parser { get { return _parser; } }
@@ -1385,6 +1446,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MessageContainingEnumCalledType(MessageContainingEnumCalledType other) : this() {
type_ = other.type_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1416,13 +1478,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (!Type.Equals(other.Type)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= Type.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1434,12 +1499,18 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
type_.WriteTo(output, _map_type_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += type_.CalculateSize(_map_type_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1449,6 +1520,7 @@ namespace Google.Protobuf.TestProtos {
return;
}
type_.Add(other.type_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1457,7 +1529,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
type_.AddEntriesFrom(input, _map_type_codec);
@@ -1485,6 +1557,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class MessageContainingMapCalledEntry : pb::IMessage<MessageContainingMapCalledEntry> {
private static readonly pb::MessageParser<MessageContainingMapCalledEntry> _parser = new pb::MessageParser<MessageContainingMapCalledEntry>(() => new MessageContainingMapCalledEntry());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MessageContainingMapCalledEntry> Parser { get { return _parser; } }
@@ -1508,6 +1581,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MessageContainingMapCalledEntry(MessageContainingMapCalledEntry other) : this() {
entry_ = other.entry_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1539,13 +1613,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (!Entry.Equals(other.Entry)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= Entry.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1557,12 +1634,18 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
entry_.WriteTo(output, _map_entry_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += entry_.CalculateSize(_map_entry_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1572,6 +1655,7 @@ namespace Google.Protobuf.TestProtos {
return;
}
entry_.Add(other.entry_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1580,7 +1664,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
entry_.AddEntriesFrom(input, _map_entry_codec);
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
index d3aaa01b..9b82db27 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
@@ -233,6 +233,7 @@ namespace ProtobufTestMessages.Proto3 {
/// </summary>
public sealed partial class TestAllTypesProto3 : pb::IMessage<TestAllTypesProto3> {
private static readonly pb::MessageParser<TestAllTypesProto3> _parser = new pb::MessageParser<TestAllTypesProto3>(() => new TestAllTypesProto3());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestAllTypesProto3> Parser { get { return _parser; } }
@@ -395,6 +396,7 @@ namespace ProtobufTestMessages.Proto3 {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1840,7 +1842,7 @@ namespace ProtobufTestMessages.Proto3 {
if (FieldName17 != other.FieldName17) return false;
if (FieldName18 != other.FieldName18) return false;
if (OneofFieldCase != other.OneofFieldCase) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1966,6 +1968,9 @@ namespace ProtobufTestMessages.Proto3 {
if (FieldName17 != 0) hash ^= FieldName17.GetHashCode();
if (FieldName18 != 0) hash ^= FieldName18.GetHashCode();
hash ^= (int) oneofFieldCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2278,6 +2283,9 @@ namespace ProtobufTestMessages.Proto3 {
output.WriteRawTag(144, 26);
output.WriteInt32(FieldName18);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2530,6 +2538,9 @@ namespace ProtobufTestMessages.Proto3 {
if (FieldName18 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName18);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2836,6 +2847,7 @@ namespace ProtobufTestMessages.Proto3 {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2844,7 +2856,7 @@ namespace ProtobufTestMessages.Proto3 {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
OptionalInt32 = input.ReadInt32();
@@ -3417,6 +3429,7 @@ namespace ProtobufTestMessages.Proto3 {
public sealed partial class NestedMessage : pb::IMessage<NestedMessage> {
private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } }
@@ -3441,6 +3454,7 @@ namespace ProtobufTestMessages.Proto3 {
public NestedMessage(NestedMessage other) : this() {
a_ = other.a_;
Corecursive = other.corecursive_ != null ? other.Corecursive.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3485,7 +3499,7 @@ namespace ProtobufTestMessages.Proto3 {
}
if (A != other.A) return false;
if (!object.Equals(Corecursive, other.Corecursive)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3493,6 +3507,9 @@ namespace ProtobufTestMessages.Proto3 {
int hash = 1;
if (A != 0) hash ^= A.GetHashCode();
if (corecursive_ != null) hash ^= Corecursive.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3511,6 +3528,9 @@ namespace ProtobufTestMessages.Proto3 {
output.WriteRawTag(18);
output.WriteMessage(Corecursive);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3522,6 +3542,9 @@ namespace ProtobufTestMessages.Proto3 {
if (corecursive_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Corecursive);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3539,6 +3562,7 @@ namespace ProtobufTestMessages.Proto3 {
}
Corecursive.MergeFrom(other.Corecursive);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3547,7 +3571,7 @@ namespace ProtobufTestMessages.Proto3 {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
A = input.ReadInt32();
@@ -3573,6 +3597,7 @@ namespace ProtobufTestMessages.Proto3 {
public sealed partial class ForeignMessage : pb::IMessage<ForeignMessage> {
private static readonly pb::MessageParser<ForeignMessage> _parser = new pb::MessageParser<ForeignMessage>(() => new ForeignMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ForeignMessage> Parser { get { return _parser; } }
@@ -3596,6 +3621,7 @@ namespace ProtobufTestMessages.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ForeignMessage(ForeignMessage other) : this() {
c_ = other.c_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3628,13 +3654,16 @@ namespace ProtobufTestMessages.Proto3 {
return true;
}
if (C != other.C) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (C != 0) hash ^= C.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3649,6 +3678,9 @@ namespace ProtobufTestMessages.Proto3 {
output.WriteRawTag(8);
output.WriteInt32(C);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3657,6 +3689,9 @@ namespace ProtobufTestMessages.Proto3 {
if (C != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(C);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3668,6 +3703,7 @@ namespace ProtobufTestMessages.Proto3 {
if (other.C != 0) {
C = other.C;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3676,7 +3712,7 @@ namespace ProtobufTestMessages.Proto3 {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
C = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs
index e21ede9c..30196d7f 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs
@@ -183,6 +183,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class TestMessageWithCustomOptions : pb::IMessage<TestMessageWithCustomOptions> {
private static readonly pb::MessageParser<TestMessageWithCustomOptions> _parser = new pb::MessageParser<TestMessageWithCustomOptions>(() => new TestMessageWithCustomOptions());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestMessageWithCustomOptions> Parser { get { return _parser; } }
@@ -212,6 +213,7 @@ namespace UnitTest.Issues.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -275,7 +277,7 @@ namespace UnitTest.Issues.TestProtos {
if (Field1 != other.Field1) return false;
if (OneofField != other.OneofField) return false;
if (AnOneofCase != other.AnOneofCase) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -284,6 +286,9 @@ namespace UnitTest.Issues.TestProtos {
if (Field1.Length != 0) hash ^= Field1.GetHashCode();
if (anOneofCase_ == AnOneofOneofCase.OneofField) hash ^= OneofField.GetHashCode();
hash ^= (int) anOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -302,6 +307,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(16);
output.WriteInt32(OneofField);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -313,6 +321,9 @@ namespace UnitTest.Issues.TestProtos {
if (anOneofCase_ == AnOneofOneofCase.OneofField) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(OneofField);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -330,6 +341,7 @@ namespace UnitTest.Issues.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -338,7 +350,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Field1 = input.ReadString();
@@ -373,6 +385,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class CustomOptionFooRequest : pb::IMessage<CustomOptionFooRequest> {
private static readonly pb::MessageParser<CustomOptionFooRequest> _parser = new pb::MessageParser<CustomOptionFooRequest>(() => new CustomOptionFooRequest());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionFooRequest> Parser { get { return _parser; } }
@@ -395,6 +408,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionFooRequest(CustomOptionFooRequest other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -415,12 +429,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -431,11 +448,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -444,6 +467,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -452,7 +476,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -462,6 +486,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class CustomOptionFooResponse : pb::IMessage<CustomOptionFooResponse> {
private static readonly pb::MessageParser<CustomOptionFooResponse> _parser = new pb::MessageParser<CustomOptionFooResponse>(() => new CustomOptionFooResponse());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionFooResponse> Parser { get { return _parser; } }
@@ -484,6 +509,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionFooResponse(CustomOptionFooResponse other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -504,12 +530,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -520,11 +549,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -533,6 +568,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -541,7 +577,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -551,6 +587,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class CustomOptionFooClientMessage : pb::IMessage<CustomOptionFooClientMessage> {
private static readonly pb::MessageParser<CustomOptionFooClientMessage> _parser = new pb::MessageParser<CustomOptionFooClientMessage>(() => new CustomOptionFooClientMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionFooClientMessage> Parser { get { return _parser; } }
@@ -573,6 +610,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionFooClientMessage(CustomOptionFooClientMessage other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -593,12 +631,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -609,11 +650,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -622,6 +669,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -630,7 +678,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -640,6 +688,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class CustomOptionFooServerMessage : pb::IMessage<CustomOptionFooServerMessage> {
private static readonly pb::MessageParser<CustomOptionFooServerMessage> _parser = new pb::MessageParser<CustomOptionFooServerMessage>(() => new CustomOptionFooServerMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionFooServerMessage> Parser { get { return _parser; } }
@@ -662,6 +711,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionFooServerMessage(CustomOptionFooServerMessage other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -682,12 +732,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -698,11 +751,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -711,6 +770,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -719,7 +779,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -729,6 +789,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class DummyMessageContainingEnum : pb::IMessage<DummyMessageContainingEnum> {
private static readonly pb::MessageParser<DummyMessageContainingEnum> _parser = new pb::MessageParser<DummyMessageContainingEnum>(() => new DummyMessageContainingEnum());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DummyMessageContainingEnum> Parser { get { return _parser; } }
@@ -751,6 +812,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DummyMessageContainingEnum(DummyMessageContainingEnum other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -771,12 +833,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -787,11 +852,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -800,6 +871,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -808,7 +880,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -831,6 +903,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class DummyMessageInvalidAsOptionType : pb::IMessage<DummyMessageInvalidAsOptionType> {
private static readonly pb::MessageParser<DummyMessageInvalidAsOptionType> _parser = new pb::MessageParser<DummyMessageInvalidAsOptionType>(() => new DummyMessageInvalidAsOptionType());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DummyMessageInvalidAsOptionType> Parser { get { return _parser; } }
@@ -853,6 +926,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DummyMessageInvalidAsOptionType(DummyMessageInvalidAsOptionType other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -873,12 +947,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -889,11 +966,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -902,6 +985,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -910,7 +994,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -920,6 +1004,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class CustomOptionMinIntegerValues : pb::IMessage<CustomOptionMinIntegerValues> {
private static readonly pb::MessageParser<CustomOptionMinIntegerValues> _parser = new pb::MessageParser<CustomOptionMinIntegerValues>(() => new CustomOptionMinIntegerValues());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionMinIntegerValues> Parser { get { return _parser; } }
@@ -942,6 +1027,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionMinIntegerValues(CustomOptionMinIntegerValues other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -962,12 +1048,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -978,11 +1067,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -991,6 +1086,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -999,7 +1095,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -1009,6 +1105,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class CustomOptionMaxIntegerValues : pb::IMessage<CustomOptionMaxIntegerValues> {
private static readonly pb::MessageParser<CustomOptionMaxIntegerValues> _parser = new pb::MessageParser<CustomOptionMaxIntegerValues>(() => new CustomOptionMaxIntegerValues());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionMaxIntegerValues> Parser { get { return _parser; } }
@@ -1031,6 +1128,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionMaxIntegerValues(CustomOptionMaxIntegerValues other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1051,12 +1149,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1067,11 +1168,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1080,6 +1187,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1088,7 +1196,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -1098,6 +1206,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class CustomOptionOtherValues : pb::IMessage<CustomOptionOtherValues> {
private static readonly pb::MessageParser<CustomOptionOtherValues> _parser = new pb::MessageParser<CustomOptionOtherValues>(() => new CustomOptionOtherValues());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CustomOptionOtherValues> Parser { get { return _parser; } }
@@ -1120,6 +1229,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CustomOptionOtherValues(CustomOptionOtherValues other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1140,12 +1250,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1156,11 +1269,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1169,6 +1288,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1177,7 +1297,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -1187,6 +1307,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class SettingRealsFromPositiveInts : pb::IMessage<SettingRealsFromPositiveInts> {
private static readonly pb::MessageParser<SettingRealsFromPositiveInts> _parser = new pb::MessageParser<SettingRealsFromPositiveInts>(() => new SettingRealsFromPositiveInts());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SettingRealsFromPositiveInts> Parser { get { return _parser; } }
@@ -1209,6 +1330,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SettingRealsFromPositiveInts(SettingRealsFromPositiveInts other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1229,12 +1351,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1245,11 +1370,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1258,6 +1389,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1266,7 +1398,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -1276,6 +1408,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class SettingRealsFromNegativeInts : pb::IMessage<SettingRealsFromNegativeInts> {
private static readonly pb::MessageParser<SettingRealsFromNegativeInts> _parser = new pb::MessageParser<SettingRealsFromNegativeInts>(() => new SettingRealsFromNegativeInts());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SettingRealsFromNegativeInts> Parser { get { return _parser; } }
@@ -1298,6 +1431,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SettingRealsFromNegativeInts(SettingRealsFromNegativeInts other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1318,12 +1452,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1334,11 +1471,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1347,6 +1490,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1355,7 +1499,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -1365,6 +1509,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class ComplexOptionType1 : pb::IMessage<ComplexOptionType1> {
private static readonly pb::MessageParser<ComplexOptionType1> _parser = new pb::MessageParser<ComplexOptionType1>(() => new ComplexOptionType1());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ComplexOptionType1> Parser { get { return _parser; } }
@@ -1391,6 +1536,7 @@ namespace UnitTest.Issues.TestProtos {
foo2_ = other.foo2_;
foo3_ = other.foo3_;
foo4_ = other.foo4_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1458,7 +1604,7 @@ namespace UnitTest.Issues.TestProtos {
if (Foo2 != other.Foo2) return false;
if (Foo3 != other.Foo3) return false;
if(!foo4_.Equals(other.foo4_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1468,6 +1614,9 @@ namespace UnitTest.Issues.TestProtos {
if (Foo2 != 0) hash ^= Foo2.GetHashCode();
if (Foo3 != 0) hash ^= Foo3.GetHashCode();
hash ^= foo4_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1491,6 +1640,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteInt32(Foo3);
}
foo4_.WriteTo(output, _repeated_foo4_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1506,6 +1658,9 @@ namespace UnitTest.Issues.TestProtos {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Foo3);
}
size += foo4_.CalculateSize(_repeated_foo4_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1524,6 +1679,7 @@ namespace UnitTest.Issues.TestProtos {
Foo3 = other.Foo3;
}
foo4_.Add(other.foo4_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1532,7 +1688,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Foo = input.ReadInt32();
@@ -1559,6 +1715,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class ComplexOptionType2 : pb::IMessage<ComplexOptionType2> {
private static readonly pb::MessageParser<ComplexOptionType2> _parser = new pb::MessageParser<ComplexOptionType2>(() => new ComplexOptionType2());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ComplexOptionType2> Parser { get { return _parser; } }
@@ -1585,6 +1742,7 @@ namespace UnitTest.Issues.TestProtos {
baz_ = other.baz_;
Fred = other.fred_ != null ? other.Fred.Clone() : null;
barney_ = other.barney_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1652,7 +1810,7 @@ namespace UnitTest.Issues.TestProtos {
if (Baz != other.Baz) return false;
if (!object.Equals(Fred, other.Fred)) return false;
if(!barney_.Equals(other.barney_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1662,6 +1820,9 @@ namespace UnitTest.Issues.TestProtos {
if (Baz != 0) hash ^= Baz.GetHashCode();
if (fred_ != null) hash ^= Fred.GetHashCode();
hash ^= barney_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1685,6 +1846,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteMessage(Fred);
}
barney_.WriteTo(output, _repeated_barney_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1700,6 +1864,9 @@ namespace UnitTest.Issues.TestProtos {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Fred);
}
size += barney_.CalculateSize(_repeated_barney_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1724,6 +1891,7 @@ namespace UnitTest.Issues.TestProtos {
Fred.MergeFrom(other.Fred);
}
barney_.Add(other.barney_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1732,7 +1900,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (bar_ == null) {
@@ -1766,6 +1934,7 @@ namespace UnitTest.Issues.TestProtos {
public static partial class Types {
public sealed partial class ComplexOptionType4 : pb::IMessage<ComplexOptionType4> {
private static readonly pb::MessageParser<ComplexOptionType4> _parser = new pb::MessageParser<ComplexOptionType4>(() => new ComplexOptionType4());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ComplexOptionType4> Parser { get { return _parser; } }
@@ -1789,6 +1958,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ComplexOptionType4(ComplexOptionType4 other) : this() {
waldo_ = other.waldo_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1821,13 +1991,16 @@ namespace UnitTest.Issues.TestProtos {
return true;
}
if (Waldo != other.Waldo) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Waldo != 0) hash ^= Waldo.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1842,6 +2015,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(Waldo);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1850,6 +2026,9 @@ namespace UnitTest.Issues.TestProtos {
if (Waldo != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Waldo);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1861,6 +2040,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Waldo != 0) {
Waldo = other.Waldo;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1869,7 +2049,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Waldo = input.ReadInt32();
@@ -1888,6 +2068,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class ComplexOptionType3 : pb::IMessage<ComplexOptionType3> {
private static readonly pb::MessageParser<ComplexOptionType3> _parser = new pb::MessageParser<ComplexOptionType3>(() => new ComplexOptionType3());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ComplexOptionType3> Parser { get { return _parser; } }
@@ -1911,6 +2092,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ComplexOptionType3(ComplexOptionType3 other) : this() {
qux_ = other.qux_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1943,13 +2125,16 @@ namespace UnitTest.Issues.TestProtos {
return true;
}
if (Qux != other.Qux) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Qux != 0) hash ^= Qux.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1964,6 +2149,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(Qux);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1972,6 +2160,9 @@ namespace UnitTest.Issues.TestProtos {
if (Qux != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Qux);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1983,6 +2174,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Qux != 0) {
Qux = other.Qux;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1991,7 +2183,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Qux = input.ReadInt32();
@@ -2008,6 +2200,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class VariousComplexOptions : pb::IMessage<VariousComplexOptions> {
private static readonly pb::MessageParser<VariousComplexOptions> _parser = new pb::MessageParser<VariousComplexOptions>(() => new VariousComplexOptions());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<VariousComplexOptions> Parser { get { return _parser; } }
@@ -2030,6 +2223,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public VariousComplexOptions(VariousComplexOptions other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2050,12 +2244,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2066,11 +2263,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2079,6 +2282,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2087,7 +2291,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -2100,6 +2304,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class Aggregate : pb::IMessage<Aggregate> {
private static readonly pb::MessageParser<Aggregate> _parser = new pb::MessageParser<Aggregate>(() => new Aggregate());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Aggregate> Parser { get { return _parser; } }
@@ -2125,6 +2330,7 @@ namespace UnitTest.Issues.TestProtos {
i_ = other.i_;
s_ = other.s_;
Sub = other.sub_ != null ? other.Sub.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2184,7 +2390,7 @@ namespace UnitTest.Issues.TestProtos {
if (I != other.I) return false;
if (S != other.S) return false;
if (!object.Equals(Sub, other.Sub)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2193,6 +2399,9 @@ namespace UnitTest.Issues.TestProtos {
if (I != 0) hash ^= I.GetHashCode();
if (S.Length != 0) hash ^= S.GetHashCode();
if (sub_ != null) hash ^= Sub.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2215,6 +2424,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(26);
output.WriteMessage(Sub);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2229,6 +2441,9 @@ namespace UnitTest.Issues.TestProtos {
if (sub_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sub);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2249,6 +2464,7 @@ namespace UnitTest.Issues.TestProtos {
}
Sub.MergeFrom(other.Sub);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2257,7 +2473,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
I = input.ReadInt32();
@@ -2282,6 +2498,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class AggregateMessage : pb::IMessage<AggregateMessage> {
private static readonly pb::MessageParser<AggregateMessage> _parser = new pb::MessageParser<AggregateMessage>(() => new AggregateMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AggregateMessage> Parser { get { return _parser; } }
@@ -2305,6 +2522,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AggregateMessage(AggregateMessage other) : this() {
fieldname_ = other.fieldname_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2337,13 +2555,16 @@ namespace UnitTest.Issues.TestProtos {
return true;
}
if (Fieldname != other.Fieldname) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Fieldname != 0) hash ^= Fieldname.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2358,6 +2579,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(Fieldname);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2366,6 +2590,9 @@ namespace UnitTest.Issues.TestProtos {
if (Fieldname != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Fieldname);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2377,6 +2604,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Fieldname != 0) {
Fieldname = other.Fieldname;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2385,7 +2613,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Fieldname = input.ReadInt32();
@@ -2402,6 +2630,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class NestedOptionType : pb::IMessage<NestedOptionType> {
private static readonly pb::MessageParser<NestedOptionType> _parser = new pb::MessageParser<NestedOptionType>(() => new NestedOptionType());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedOptionType> Parser { get { return _parser; } }
@@ -2424,6 +2653,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedOptionType(NestedOptionType other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2444,12 +2674,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2460,11 +2693,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2473,6 +2712,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2481,7 +2721,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -2498,6 +2738,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class NestedMessage : pb::IMessage<NestedMessage> {
private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } }
@@ -2521,6 +2762,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedMessage(NestedMessage other) : this() {
nestedField_ = other.nestedField_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2553,13 +2795,16 @@ namespace UnitTest.Issues.TestProtos {
return true;
}
if (NestedField != other.NestedField) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (NestedField != 0) hash ^= NestedField.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2574,6 +2819,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(NestedField);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2582,6 +2830,9 @@ namespace UnitTest.Issues.TestProtos {
if (NestedField != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(NestedField);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2593,6 +2844,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.NestedField != 0) {
NestedField = other.NestedField;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2601,7 +2853,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
NestedField = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
index 1ebf007f..dfd09683 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
@@ -50,6 +50,7 @@ namespace Google.Protobuf.TestProtos {
#region Messages
public sealed partial class ImportMessage : pb::IMessage<ImportMessage> {
private static readonly pb::MessageParser<ImportMessage> _parser = new pb::MessageParser<ImportMessage>(() => new ImportMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ImportMessage> Parser { get { return _parser; } }
@@ -73,6 +74,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ImportMessage(ImportMessage other) : this() {
d_ = other.d_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -105,13 +107,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (D != other.D) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (D != 0) hash ^= D.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -126,6 +131,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(D);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -134,6 +142,9 @@ namespace Google.Protobuf.TestProtos {
if (D != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(D);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -145,6 +156,7 @@ namespace Google.Protobuf.TestProtos {
if (other.D != 0) {
D = other.D;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -153,7 +165,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
D = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
index 422f0b50..5dce082c 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
@@ -38,6 +38,7 @@ namespace Google.Protobuf.TestProtos {
#region Messages
public sealed partial class PublicImportMessage : pb::IMessage<PublicImportMessage> {
private static readonly pb::MessageParser<PublicImportMessage> _parser = new pb::MessageParser<PublicImportMessage>(() => new PublicImportMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PublicImportMessage> Parser { get { return _parser; } }
@@ -61,6 +62,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PublicImportMessage(PublicImportMessage other) : this() {
e_ = other.e_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -93,13 +95,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (E != other.E) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (E != 0) hash ^= E.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -114,6 +119,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(E);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -122,6 +130,9 @@ namespace Google.Protobuf.TestProtos {
if (E != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(E);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -133,6 +144,7 @@ namespace Google.Protobuf.TestProtos {
if (other.E != 0) {
E = other.E;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -141,7 +153,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
E = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
index ccf99dc5..7393cc47 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
@@ -88,6 +88,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class Issue307 : pb::IMessage<Issue307> {
private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Issue307> Parser { get { return _parser; } }
@@ -110,6 +111,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Issue307(Issue307 other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -130,12 +132,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -146,11 +151,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -159,6 +170,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -167,7 +179,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -179,6 +191,7 @@ namespace UnitTest.Issues.TestProtos {
public static partial class Types {
public sealed partial class NestedOnce : pb::IMessage<NestedOnce> {
private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } }
@@ -201,6 +214,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedOnce(NestedOnce other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -221,12 +235,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -237,11 +254,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -250,6 +273,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -258,7 +282,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -270,6 +294,7 @@ namespace UnitTest.Issues.TestProtos {
public static partial class Types {
public sealed partial class NestedTwice : pb::IMessage<NestedTwice> {
private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } }
@@ -292,6 +317,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedTwice(NestedTwice other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -312,12 +338,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -328,11 +357,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -341,6 +376,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -349,7 +385,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -369,6 +405,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage> {
private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
@@ -394,6 +431,7 @@ namespace UnitTest.Issues.TestProtos {
value_ = other.value_;
values_ = other.values_.Clone();
packedValues_ = other.packedValues_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -448,7 +486,7 @@ namespace UnitTest.Issues.TestProtos {
if (Value != other.Value) return false;
if(!values_.Equals(other.values_)) return false;
if(!packedValues_.Equals(other.packedValues_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -457,6 +495,9 @@ namespace UnitTest.Issues.TestProtos {
if (Value != 0) hash ^= Value.GetHashCode();
hash ^= values_.GetHashCode();
hash ^= packedValues_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -473,6 +514,9 @@ namespace UnitTest.Issues.TestProtos {
}
values_.WriteTo(output, _repeated_values_codec);
packedValues_.WriteTo(output, _repeated_packedValues_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -483,6 +527,9 @@ namespace UnitTest.Issues.TestProtos {
}
size += values_.CalculateSize(_repeated_values_codec);
size += packedValues_.CalculateSize(_repeated_packedValues_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -496,6 +543,7 @@ namespace UnitTest.Issues.TestProtos {
}
values_.Add(other.values_);
packedValues_.Add(other.packedValues_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -504,7 +552,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
@@ -528,6 +576,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild> {
private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
@@ -550,6 +599,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DeprecatedChild(DeprecatedChild other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -570,12 +620,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -586,11 +639,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -599,6 +658,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -607,7 +667,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -617,6 +677,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage> {
private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
@@ -645,6 +706,7 @@ namespace UnitTest.Issues.TestProtos {
messageArray_ = other.messageArray_.Clone();
enumValue_ = other.enumValue_;
enumArray_ = other.enumArray_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -740,7 +802,7 @@ namespace UnitTest.Issues.TestProtos {
if(!messageArray_.Equals(other.messageArray_)) return false;
if (EnumValue != other.EnumValue) return false;
if(!enumArray_.Equals(other.enumArray_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -752,6 +814,9 @@ namespace UnitTest.Issues.TestProtos {
hash ^= messageArray_.GetHashCode();
if (EnumValue != 0) hash ^= EnumValue.GetHashCode();
hash ^= enumArray_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -777,6 +842,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteEnum((int) EnumValue);
}
enumArray_.WriteTo(output, _repeated_enumArray_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -794,6 +862,9 @@ namespace UnitTest.Issues.TestProtos {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
}
size += enumArray_.CalculateSize(_repeated_enumArray_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -817,6 +888,7 @@ namespace UnitTest.Issues.TestProtos {
EnumValue = other.EnumValue;
}
enumArray_.Add(other.enumArray_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -825,7 +897,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
PrimitiveValue = input.ReadInt32();
@@ -867,6 +939,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class ItemField : pb::IMessage<ItemField> {
private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
@@ -890,6 +963,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ItemField(ItemField other) : this() {
item_ = other.item_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -922,13 +996,16 @@ namespace UnitTest.Issues.TestProtos {
return true;
}
if (Item != other.Item) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Item != 0) hash ^= Item.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -943,6 +1020,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(Item);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -951,6 +1031,9 @@ namespace UnitTest.Issues.TestProtos {
if (Item != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -962,6 +1045,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Item != 0) {
Item = other.Item;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -970,7 +1054,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Item = input.ReadInt32();
@@ -984,6 +1068,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class ReservedNames : pb::IMessage<ReservedNames> {
private static readonly pb::MessageParser<ReservedNames> _parser = new pb::MessageParser<ReservedNames>(() => new ReservedNames());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ReservedNames> Parser { get { return _parser; } }
@@ -1008,6 +1093,7 @@ namespace UnitTest.Issues.TestProtos {
public ReservedNames(ReservedNames other) : this() {
types_ = other.types_;
descriptor_ = other.descriptor_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1052,7 +1138,7 @@ namespace UnitTest.Issues.TestProtos {
}
if (Types_ != other.Types_) return false;
if (Descriptor_ != other.Descriptor_) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1060,6 +1146,9 @@ namespace UnitTest.Issues.TestProtos {
int hash = 1;
if (Types_ != 0) hash ^= Types_.GetHashCode();
if (Descriptor_ != 0) hash ^= Descriptor_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1078,6 +1167,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(16);
output.WriteInt32(Descriptor_);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1089,6 +1181,9 @@ namespace UnitTest.Issues.TestProtos {
if (Descriptor_ != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Descriptor_);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1103,6 +1198,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Descriptor_ != 0) {
Descriptor_ = other.Descriptor_;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1111,7 +1207,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Types_ = input.ReadInt32();
@@ -1134,6 +1230,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> {
private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SomeNestedType> Parser { get { return _parser; } }
@@ -1156,6 +1253,7 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SomeNestedType(SomeNestedType other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1176,12 +1274,15 @@ namespace UnitTest.Issues.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1192,11 +1293,17 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1205,6 +1312,7 @@ namespace UnitTest.Issues.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1213,7 +1321,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -1240,6 +1348,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> {
private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestJsonFieldOrdering> Parser { get { return _parser; } }
@@ -1282,6 +1391,7 @@ namespace UnitTest.Issues.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1414,7 +1524,7 @@ namespace UnitTest.Issues.TestProtos {
if (O2String != other.O2String) return false;
if (O1Case != other.O1Case) return false;
if (O2Case != other.O2Case) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1428,6 +1538,9 @@ namespace UnitTest.Issues.TestProtos {
if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode();
hash ^= (int) o1Case_;
hash ^= (int) o2Case_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1462,6 +1575,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(48);
output.WriteInt32(O2Int32);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1485,6 +1601,9 @@ namespace UnitTest.Issues.TestProtos {
if (o2Case_ == O2OneofCase.O2String) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(O2String);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1517,6 +1636,7 @@ namespace UnitTest.Issues.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1525,7 +1645,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
PlainString = input.ReadString();
@@ -1559,6 +1679,7 @@ namespace UnitTest.Issues.TestProtos {
public sealed partial class TestJsonName : pb::IMessage<TestJsonName> {
private static readonly pb::MessageParser<TestJsonName> _parser = new pb::MessageParser<TestJsonName>(() => new TestJsonName());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestJsonName> Parser { get { return _parser; } }
@@ -1584,6 +1705,7 @@ namespace UnitTest.Issues.TestProtos {
name_ = other.name_;
description_ = other.description_;
guid_ = other.guid_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1643,7 +1765,7 @@ namespace UnitTest.Issues.TestProtos {
if (Name != other.Name) return false;
if (Description != other.Description) return false;
if (Guid != other.Guid) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1652,6 +1774,9 @@ namespace UnitTest.Issues.TestProtos {
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Description.Length != 0) hash ^= Description.GetHashCode();
if (Guid.Length != 0) hash ^= Guid.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1674,6 +1799,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(26);
output.WriteString(Guid);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1688,6 +1816,9 @@ namespace UnitTest.Issues.TestProtos {
if (Guid.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Guid);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1705,6 +1836,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Guid.Length != 0) {
Guid = other.Guid;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1713,7 +1845,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
@@ -1740,6 +1872,7 @@ namespace UnitTest.Issues.TestProtos {
/// </summary>
public sealed partial class OneofMerging : pb::IMessage<OneofMerging> {
private static readonly pb::MessageParser<OneofMerging> _parser = new pb::MessageParser<OneofMerging>(() => new OneofMerging());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OneofMerging> Parser { get { return _parser; } }
@@ -1771,6 +1904,7 @@ namespace UnitTest.Issues.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1835,7 +1969,7 @@ namespace UnitTest.Issues.TestProtos {
if (Text != other.Text) return false;
if (!object.Equals(Nested, other.Nested)) return false;
if (ValueCase != other.ValueCase) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1844,6 +1978,9 @@ namespace UnitTest.Issues.TestProtos {
if (valueCase_ == ValueOneofCase.Text) hash ^= Text.GetHashCode();
if (valueCase_ == ValueOneofCase.Nested) hash ^= Nested.GetHashCode();
hash ^= (int) valueCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1862,6 +1999,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(18);
output.WriteMessage(Nested);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1873,6 +2013,9 @@ namespace UnitTest.Issues.TestProtos {
if (valueCase_ == ValueOneofCase.Nested) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Nested);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1893,6 +2036,7 @@ namespace UnitTest.Issues.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1901,7 +2045,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Text = input.ReadString();
@@ -1926,6 +2070,7 @@ namespace UnitTest.Issues.TestProtos {
public static partial class Types {
public sealed partial class Nested : pb::IMessage<Nested> {
private static readonly pb::MessageParser<Nested> _parser = new pb::MessageParser<Nested>(() => new Nested());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Nested> Parser { get { return _parser; } }
@@ -1950,6 +2095,7 @@ namespace UnitTest.Issues.TestProtos {
public Nested(Nested other) : this() {
x_ = other.x_;
y_ = other.y_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1994,7 +2140,7 @@ namespace UnitTest.Issues.TestProtos {
}
if (X != other.X) return false;
if (Y != other.Y) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2002,6 +2148,9 @@ namespace UnitTest.Issues.TestProtos {
int hash = 1;
if (X != 0) hash ^= X.GetHashCode();
if (Y != 0) hash ^= Y.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2020,6 +2169,9 @@ namespace UnitTest.Issues.TestProtos {
output.WriteRawTag(16);
output.WriteInt32(Y);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2031,6 +2183,9 @@ namespace UnitTest.Issues.TestProtos {
if (Y != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2045,6 +2200,7 @@ namespace UnitTest.Issues.TestProtos {
if (other.Y != 0) {
Y = other.Y;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2053,7 +2209,7 @@ namespace UnitTest.Issues.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
X = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
index f95f0af8..590ec840 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
@@ -137,20 +137,20 @@ namespace Google.Protobuf.TestProtos {
"NBj//w8gAygEIigKG1Rlc3RDb21tZW50SW5qZWN0aW9uTWVzc2FnZRIJCgFh",
"GAEgASgJIgwKCkZvb1JlcXVlc3QiDQoLRm9vUmVzcG9uc2UiEgoQRm9vQ2xp",
"ZW50TWVzc2FnZSISChBGb29TZXJ2ZXJNZXNzYWdlIgwKCkJhclJlcXVlc3Qi",
- "DQoLQmFyUmVzcG9uc2UqWQoLRm9yZWlnbkVudW0SFwoTRk9SRUlHTl9VTlNQ",
- "RUNJRklFRBAAEg8KC0ZPUkVJR05fRk9PEAQSDwoLRk9SRUlHTl9CQVIQBRIP",
- "CgtGT1JFSUdOX0JBWhAGKnUKFFRlc3RFbnVtV2l0aER1cFZhbHVlEigKJFRF",
- "U1RfRU5VTV9XSVRIX0RVUF9WQUxVRV9VTlNQRUNJRklFRBAAEggKBEZPTzEQ",
- "ARIICgRCQVIxEAISBwoDQkFaEAMSCAoERk9PMhABEggKBEJBUjIQAhoCEAEq",
- "nQEKDlRlc3RTcGFyc2VFbnVtEiAKHFRFU1RfU1BBUlNFX0VOVU1fVU5TUEVD",
- "SUZJRUQQABIMCghTUEFSU0VfQRB7Eg4KCFNQQVJTRV9CEKbnAxIPCghTUEFS",
- "U0VfQxCysYAGEhUKCFNQQVJTRV9EEPH//////////wESFQoIU1BBUlNFX0UQ",
- "tN78////////ARIMCghTUEFSU0VfRxACMp0BCgtUZXN0U2VydmljZRJGCgNG",
- "b28SHi5wcm90b2J1Zl91bml0dGVzdDMuRm9vUmVxdWVzdBofLnByb3RvYnVm",
- "X3VuaXR0ZXN0My5Gb29SZXNwb25zZRJGCgNCYXISHi5wcm90b2J1Zl91bml0",
- "dGVzdDMuQmFyUmVxdWVzdBofLnByb3RvYnVmX3VuaXR0ZXN0My5CYXJSZXNw",
- "b25zZUIsQg1Vbml0dGVzdFByb3RvqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQ",
- "cm90b3NiBnByb3RvMw=="));
+ "DQoLQmFyUmVzcG9uc2UiEgoQVGVzdEVtcHR5TWVzc2FnZSpZCgtGb3JlaWdu",
+ "RW51bRIXChNGT1JFSUdOX1VOU1BFQ0lGSUVEEAASDwoLRk9SRUlHTl9GT08Q",
+ "BBIPCgtGT1JFSUdOX0JBUhAFEg8KC0ZPUkVJR05fQkFaEAYqdQoUVGVzdEVu",
+ "dW1XaXRoRHVwVmFsdWUSKAokVEVTVF9FTlVNX1dJVEhfRFVQX1ZBTFVFX1VO",
+ "U1BFQ0lGSUVEEAASCAoERk9PMRABEggKBEJBUjEQAhIHCgNCQVoQAxIICgRG",
+ "T08yEAESCAoEQkFSMhACGgIQASqdAQoOVGVzdFNwYXJzZUVudW0SIAocVEVT",
+ "VF9TUEFSU0VfRU5VTV9VTlNQRUNJRklFRBAAEgwKCFNQQVJTRV9BEHsSDgoI",
+ "U1BBUlNFX0IQpucDEg8KCFNQQVJTRV9DELKxgAYSFQoIU1BBUlNFX0QQ8f//",
+ "////////ARIVCghTUEFSU0VfRRC03vz///////8BEgwKCFNQQVJTRV9HEAIy",
+ "nQEKC1Rlc3RTZXJ2aWNlEkYKA0ZvbxIeLnByb3RvYnVmX3VuaXR0ZXN0My5G",
+ "b29SZXF1ZXN0Gh8ucHJvdG9idWZfdW5pdHRlc3QzLkZvb1Jlc3BvbnNlEkYK",
+ "A0JhchIeLnByb3RvYnVmX3VuaXR0ZXN0My5CYXJSZXF1ZXN0Gh8ucHJvdG9i",
+ "dWZfdW5pdHRlc3QzLkJhclJlc3BvbnNlQixCDVVuaXR0ZXN0UHJvdG+qAhpH",
+ "b29nbGUuUHJvdG9idWYuVGVzdFByb3Rvc2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3Reflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.TestSparseEnum), }, new pbr::GeneratedClrTypeInfo[] {
@@ -187,7 +187,8 @@ namespace Google.Protobuf.TestProtos {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.FooClientMessage), global::Google.Protobuf.TestProtos.FooClientMessage.Parser, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.FooServerMessage), global::Google.Protobuf.TestProtos.FooServerMessage.Parser, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.BarRequest), global::Google.Protobuf.TestProtos.BarRequest.Parser, null, null, null, null),
- new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.BarResponse), global::Google.Protobuf.TestProtos.BarResponse.Parser, null, null, null, null)
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.BarResponse), global::Google.Protobuf.TestProtos.BarResponse.Parser, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.TestProtos.TestEmptyMessage), global::Google.Protobuf.TestProtos.TestEmptyMessage.Parser, null, null, null, null)
}));
}
#endregion
@@ -239,6 +240,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestAllTypes : pb::IMessage<TestAllTypes> {
private static readonly pb::MessageParser<TestAllTypes> _parser = new pb::MessageParser<TestAllTypes>(() => new TestAllTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestAllTypes> Parser { get { return _parser; } }
@@ -320,6 +322,7 @@ namespace Google.Protobuf.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -928,7 +931,7 @@ namespace Google.Protobuf.TestProtos {
if (OneofString != other.OneofString) return false;
if (OneofBytes != other.OneofBytes) return false;
if (OneofFieldCase != other.OneofFieldCase) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -983,6 +986,9 @@ namespace Google.Protobuf.TestProtos {
if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) hash ^= OneofString.GetHashCode();
if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) hash ^= OneofBytes.GetHashCode();
hash ^= (int) oneofFieldCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1119,6 +1125,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(146, 7);
output.WriteBytes(OneofBytes);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1224,6 +1233,9 @@ namespace Google.Protobuf.TestProtos {
if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) {
size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1350,6 +1362,7 @@ namespace Google.Protobuf.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1358,7 +1371,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
SingleInt32 = input.ReadInt32();
@@ -1606,6 +1619,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class NestedMessage : pb::IMessage<NestedMessage> {
private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } }
@@ -1629,6 +1643,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedMessage(NestedMessage other) : this() {
bb_ = other.bb_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1666,13 +1681,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Bb != other.Bb) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Bb != 0) hash ^= Bb.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1687,6 +1705,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(Bb);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1695,6 +1716,9 @@ namespace Google.Protobuf.TestProtos {
if (Bb != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bb);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1706,6 +1730,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Bb != 0) {
Bb = other.Bb;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1714,7 +1739,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Bb = input.ReadInt32();
@@ -1736,6 +1761,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class NestedTestAllTypes : pb::IMessage<NestedTestAllTypes> {
private static readonly pb::MessageParser<NestedTestAllTypes> _parser = new pb::MessageParser<NestedTestAllTypes>(() => new NestedTestAllTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedTestAllTypes> Parser { get { return _parser; } }
@@ -1761,6 +1787,7 @@ namespace Google.Protobuf.TestProtos {
Child = other.child_ != null ? other.Child.Clone() : null;
Payload = other.payload_ != null ? other.Payload.Clone() : null;
repeatedChild_ = other.repeatedChild_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1816,7 +1843,7 @@ namespace Google.Protobuf.TestProtos {
if (!object.Equals(Child, other.Child)) return false;
if (!object.Equals(Payload, other.Payload)) return false;
if(!repeatedChild_.Equals(other.repeatedChild_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1825,6 +1852,9 @@ namespace Google.Protobuf.TestProtos {
if (child_ != null) hash ^= Child.GetHashCode();
if (payload_ != null) hash ^= Payload.GetHashCode();
hash ^= repeatedChild_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1844,6 +1874,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteMessage(Payload);
}
repeatedChild_.WriteTo(output, _repeated_repeatedChild_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1856,6 +1889,9 @@ namespace Google.Protobuf.TestProtos {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload);
}
size += repeatedChild_.CalculateSize(_repeated_repeatedChild_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1877,6 +1913,7 @@ namespace Google.Protobuf.TestProtos {
Payload.MergeFrom(other.Payload);
}
repeatedChild_.Add(other.repeatedChild_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1885,7 +1922,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (child_ == null) {
@@ -1913,6 +1950,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestDeprecatedFields : pb::IMessage<TestDeprecatedFields> {
private static readonly pb::MessageParser<TestDeprecatedFields> _parser = new pb::MessageParser<TestDeprecatedFields>(() => new TestDeprecatedFields());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestDeprecatedFields> Parser { get { return _parser; } }
@@ -1936,6 +1974,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestDeprecatedFields(TestDeprecatedFields other) : this() {
deprecatedInt32_ = other.deprecatedInt32_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1969,13 +2008,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (DeprecatedInt32 != other.DeprecatedInt32) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (DeprecatedInt32 != 0) hash ^= DeprecatedInt32.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1990,6 +2032,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(DeprecatedInt32);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1998,6 +2043,9 @@ namespace Google.Protobuf.TestProtos {
if (DeprecatedInt32 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(DeprecatedInt32);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2009,6 +2057,7 @@ namespace Google.Protobuf.TestProtos {
if (other.DeprecatedInt32 != 0) {
DeprecatedInt32 = other.DeprecatedInt32;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2017,7 +2066,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
DeprecatedInt32 = input.ReadInt32();
@@ -2035,6 +2084,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class ForeignMessage : pb::IMessage<ForeignMessage> {
private static readonly pb::MessageParser<ForeignMessage> _parser = new pb::MessageParser<ForeignMessage>(() => new ForeignMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ForeignMessage> Parser { get { return _parser; } }
@@ -2058,6 +2108,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ForeignMessage(ForeignMessage other) : this() {
c_ = other.c_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2090,13 +2141,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (C != other.C) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (C != 0) hash ^= C.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2111,6 +2165,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(C);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2119,6 +2176,9 @@ namespace Google.Protobuf.TestProtos {
if (C != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(C);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2130,6 +2190,7 @@ namespace Google.Protobuf.TestProtos {
if (other.C != 0) {
C = other.C;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2138,7 +2199,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
C = input.ReadInt32();
@@ -2152,6 +2213,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestReservedFields : pb::IMessage<TestReservedFields> {
private static readonly pb::MessageParser<TestReservedFields> _parser = new pb::MessageParser<TestReservedFields>(() => new TestReservedFields());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestReservedFields> Parser { get { return _parser; } }
@@ -2174,6 +2236,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestReservedFields(TestReservedFields other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2194,12 +2257,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2210,11 +2276,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2223,6 +2295,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2231,7 +2304,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -2244,6 +2317,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestForeignNested : pb::IMessage<TestForeignNested> {
private static readonly pb::MessageParser<TestForeignNested> _parser = new pb::MessageParser<TestForeignNested>(() => new TestForeignNested());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestForeignNested> Parser { get { return _parser; } }
@@ -2267,6 +2341,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestForeignNested(TestForeignNested other) : this() {
ForeignNested = other.foreignNested_ != null ? other.ForeignNested.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2299,13 +2374,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (!object.Equals(ForeignNested, other.ForeignNested)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (foreignNested_ != null) hash ^= ForeignNested.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2320,6 +2398,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteMessage(ForeignNested);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2328,6 +2409,9 @@ namespace Google.Protobuf.TestProtos {
if (foreignNested_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ForeignNested);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2342,6 +2426,7 @@ namespace Google.Protobuf.TestProtos {
}
ForeignNested.MergeFrom(other.ForeignNested);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2350,7 +2435,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (foreignNested_ == null) {
@@ -2370,6 +2455,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestReallyLargeTagNumber : pb::IMessage<TestReallyLargeTagNumber> {
private static readonly pb::MessageParser<TestReallyLargeTagNumber> _parser = new pb::MessageParser<TestReallyLargeTagNumber>(() => new TestReallyLargeTagNumber());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestReallyLargeTagNumber> Parser { get { return _parser; } }
@@ -2394,6 +2480,7 @@ namespace Google.Protobuf.TestProtos {
public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) : this() {
a_ = other.a_;
bb_ = other.bb_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2442,7 +2529,7 @@ namespace Google.Protobuf.TestProtos {
}
if (A != other.A) return false;
if (Bb != other.Bb) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2450,6 +2537,9 @@ namespace Google.Protobuf.TestProtos {
int hash = 1;
if (A != 0) hash ^= A.GetHashCode();
if (Bb != 0) hash ^= Bb.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2468,6 +2558,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(248, 255, 255, 255, 7);
output.WriteInt32(Bb);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2479,6 +2572,9 @@ namespace Google.Protobuf.TestProtos {
if (Bb != 0) {
size += 5 + pb::CodedOutputStream.ComputeInt32Size(Bb);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2493,6 +2589,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Bb != 0) {
Bb = other.Bb;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2501,7 +2598,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
A = input.ReadInt32();
@@ -2519,6 +2616,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestRecursiveMessage : pb::IMessage<TestRecursiveMessage> {
private static readonly pb::MessageParser<TestRecursiveMessage> _parser = new pb::MessageParser<TestRecursiveMessage>(() => new TestRecursiveMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestRecursiveMessage> Parser { get { return _parser; } }
@@ -2543,6 +2641,7 @@ namespace Google.Protobuf.TestProtos {
public TestRecursiveMessage(TestRecursiveMessage other) : this() {
A = other.a_ != null ? other.A.Clone() : null;
i_ = other.i_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2587,7 +2686,7 @@ namespace Google.Protobuf.TestProtos {
}
if (!object.Equals(A, other.A)) return false;
if (I != other.I) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2595,6 +2694,9 @@ namespace Google.Protobuf.TestProtos {
int hash = 1;
if (a_ != null) hash ^= A.GetHashCode();
if (I != 0) hash ^= I.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2613,6 +2715,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(16);
output.WriteInt32(I);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2624,6 +2729,9 @@ namespace Google.Protobuf.TestProtos {
if (I != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(I);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2641,6 +2749,7 @@ namespace Google.Protobuf.TestProtos {
if (other.I != 0) {
I = other.I;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2649,7 +2758,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (a_ == null) {
@@ -2673,6 +2782,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestMutualRecursionA : pb::IMessage<TestMutualRecursionA> {
private static readonly pb::MessageParser<TestMutualRecursionA> _parser = new pb::MessageParser<TestMutualRecursionA>(() => new TestMutualRecursionA());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestMutualRecursionA> Parser { get { return _parser; } }
@@ -2696,6 +2806,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestMutualRecursionA(TestMutualRecursionA other) : this() {
Bb = other.bb_ != null ? other.Bb.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2728,13 +2839,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (!object.Equals(Bb, other.Bb)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (bb_ != null) hash ^= Bb.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2749,6 +2863,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteMessage(Bb);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2757,6 +2874,9 @@ namespace Google.Protobuf.TestProtos {
if (bb_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bb);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2771,6 +2891,7 @@ namespace Google.Protobuf.TestProtos {
}
Bb.MergeFrom(other.Bb);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2779,7 +2900,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (bb_ == null) {
@@ -2796,6 +2917,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestMutualRecursionB : pb::IMessage<TestMutualRecursionB> {
private static readonly pb::MessageParser<TestMutualRecursionB> _parser = new pb::MessageParser<TestMutualRecursionB>(() => new TestMutualRecursionB());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestMutualRecursionB> Parser { get { return _parser; } }
@@ -2820,6 +2942,7 @@ namespace Google.Protobuf.TestProtos {
public TestMutualRecursionB(TestMutualRecursionB other) : this() {
A = other.a_ != null ? other.A.Clone() : null;
optionalInt32_ = other.optionalInt32_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2864,7 +2987,7 @@ namespace Google.Protobuf.TestProtos {
}
if (!object.Equals(A, other.A)) return false;
if (OptionalInt32 != other.OptionalInt32) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2872,6 +2995,9 @@ namespace Google.Protobuf.TestProtos {
int hash = 1;
if (a_ != null) hash ^= A.GetHashCode();
if (OptionalInt32 != 0) hash ^= OptionalInt32.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2890,6 +3016,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(16);
output.WriteInt32(OptionalInt32);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2901,6 +3030,9 @@ namespace Google.Protobuf.TestProtos {
if (OptionalInt32 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2918,6 +3050,7 @@ namespace Google.Protobuf.TestProtos {
if (other.OptionalInt32 != 0) {
OptionalInt32 = other.OptionalInt32;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2926,7 +3059,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (a_ == null) {
@@ -2947,6 +3080,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestEnumAllowAlias : pb::IMessage<TestEnumAllowAlias> {
private static readonly pb::MessageParser<TestEnumAllowAlias> _parser = new pb::MessageParser<TestEnumAllowAlias>(() => new TestEnumAllowAlias());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestEnumAllowAlias> Parser { get { return _parser; } }
@@ -2970,6 +3104,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestEnumAllowAlias(TestEnumAllowAlias other) : this() {
value_ = other.value_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3002,13 +3137,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Value != other.Value) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Value != 0) hash ^= Value.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3023,6 +3161,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteEnum((int) Value);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3031,6 +3172,9 @@ namespace Google.Protobuf.TestProtos {
if (Value != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3042,6 +3186,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Value != 0) {
Value = other.Value;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3050,7 +3195,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
value_ = (global::Google.Protobuf.TestProtos.TestEnumWithDupValue) input.ReadEnum();
@@ -3068,6 +3213,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestCamelCaseFieldNames : pb::IMessage<TestCamelCaseFieldNames> {
private static readonly pb::MessageParser<TestCamelCaseFieldNames> _parser = new pb::MessageParser<TestCamelCaseFieldNames>(() => new TestCamelCaseFieldNames());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestCamelCaseFieldNames> Parser { get { return _parser; } }
@@ -3098,6 +3244,7 @@ namespace Google.Protobuf.TestProtos {
repeatedStringField_ = other.repeatedStringField_.Clone();
repeatedEnumField_ = other.repeatedEnumField_.Clone();
repeatedMessageField_ = other.repeatedMessageField_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3210,7 +3357,7 @@ namespace Google.Protobuf.TestProtos {
if(!repeatedStringField_.Equals(other.repeatedStringField_)) return false;
if(!repeatedEnumField_.Equals(other.repeatedEnumField_)) return false;
if(!repeatedMessageField_.Equals(other.repeatedMessageField_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3224,6 +3371,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= repeatedStringField_.GetHashCode();
hash ^= repeatedEnumField_.GetHashCode();
hash ^= repeatedMessageField_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3254,6 +3404,9 @@ namespace Google.Protobuf.TestProtos {
repeatedStringField_.WriteTo(output, _repeated_repeatedStringField_codec);
repeatedEnumField_.WriteTo(output, _repeated_repeatedEnumField_codec);
repeatedMessageField_.WriteTo(output, _repeated_repeatedMessageField_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3275,6 +3428,9 @@ namespace Google.Protobuf.TestProtos {
size += repeatedStringField_.CalculateSize(_repeated_repeatedStringField_codec);
size += repeatedEnumField_.CalculateSize(_repeated_repeatedEnumField_codec);
size += repeatedMessageField_.CalculateSize(_repeated_repeatedMessageField_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3302,6 +3458,7 @@ namespace Google.Protobuf.TestProtos {
repeatedStringField_.Add(other.repeatedStringField_);
repeatedEnumField_.Add(other.repeatedEnumField_);
repeatedMessageField_.Add(other.repeatedMessageField_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3310,7 +3467,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
PrimitiveField = input.ReadInt32();
@@ -3361,6 +3518,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestFieldOrderings : pb::IMessage<TestFieldOrderings> {
private static readonly pb::MessageParser<TestFieldOrderings> _parser = new pb::MessageParser<TestFieldOrderings>(() => new TestFieldOrderings());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestFieldOrderings> Parser { get { return _parser; } }
@@ -3387,6 +3545,7 @@ namespace Google.Protobuf.TestProtos {
myInt_ = other.myInt_;
myFloat_ = other.myFloat_;
SingleNestedMessage = other.singleNestedMessage_ != null ? other.SingleNestedMessage.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3455,7 +3614,7 @@ namespace Google.Protobuf.TestProtos {
if (MyInt != other.MyInt) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MyFloat, other.MyFloat)) return false;
if (!object.Equals(SingleNestedMessage, other.SingleNestedMessage)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3465,6 +3624,9 @@ namespace Google.Protobuf.TestProtos {
if (MyInt != 0L) hash ^= MyInt.GetHashCode();
if (MyFloat != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MyFloat);
if (singleNestedMessage_ != null) hash ^= SingleNestedMessage.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3491,6 +3653,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(194, 12);
output.WriteMessage(SingleNestedMessage);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3508,6 +3673,9 @@ namespace Google.Protobuf.TestProtos {
if (singleNestedMessage_ != null) {
size += 2 + pb::CodedOutputStream.ComputeMessageSize(SingleNestedMessage);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3531,6 +3699,7 @@ namespace Google.Protobuf.TestProtos {
}
SingleNestedMessage.MergeFrom(other.SingleNestedMessage);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3539,7 +3708,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
MyInt = input.ReadInt64();
@@ -3570,6 +3739,7 @@ namespace Google.Protobuf.TestProtos {
public static partial class Types {
public sealed partial class NestedMessage : pb::IMessage<NestedMessage> {
private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } }
@@ -3594,6 +3764,7 @@ namespace Google.Protobuf.TestProtos {
public NestedMessage(NestedMessage other) : this() {
oo_ = other.oo_;
bb_ = other.bb_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3643,7 +3814,7 @@ namespace Google.Protobuf.TestProtos {
}
if (Oo != other.Oo) return false;
if (Bb != other.Bb) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3651,6 +3822,9 @@ namespace Google.Protobuf.TestProtos {
int hash = 1;
if (Oo != 0L) hash ^= Oo.GetHashCode();
if (Bb != 0) hash ^= Bb.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3669,6 +3843,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(16);
output.WriteInt64(Oo);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3680,6 +3857,9 @@ namespace Google.Protobuf.TestProtos {
if (Bb != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bb);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3694,6 +3874,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Bb != 0) {
Bb = other.Bb;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3702,7 +3883,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Bb = input.ReadInt32();
@@ -3725,6 +3906,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class SparseEnumMessage : pb::IMessage<SparseEnumMessage> {
private static readonly pb::MessageParser<SparseEnumMessage> _parser = new pb::MessageParser<SparseEnumMessage>(() => new SparseEnumMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SparseEnumMessage> Parser { get { return _parser; } }
@@ -3748,6 +3930,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseEnumMessage(SparseEnumMessage other) : this() {
sparseEnum_ = other.sparseEnum_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3780,13 +3963,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (SparseEnum != other.SparseEnum) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (SparseEnum != 0) hash ^= SparseEnum.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3801,6 +3987,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteEnum((int) SparseEnum);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3809,6 +3998,9 @@ namespace Google.Protobuf.TestProtos {
if (SparseEnum != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SparseEnum);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3820,6 +4012,7 @@ namespace Google.Protobuf.TestProtos {
if (other.SparseEnum != 0) {
SparseEnum = other.SparseEnum;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3828,7 +4021,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
sparseEnum_ = (global::Google.Protobuf.TestProtos.TestSparseEnum) input.ReadEnum();
@@ -3845,6 +4038,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class OneString : pb::IMessage<OneString> {
private static readonly pb::MessageParser<OneString> _parser = new pb::MessageParser<OneString>(() => new OneString());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OneString> Parser { get { return _parser; } }
@@ -3868,6 +4062,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OneString(OneString other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3900,13 +4095,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data.Length != 0) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -3921,6 +4119,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteString(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3929,6 +4130,9 @@ namespace Google.Protobuf.TestProtos {
if (Data.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -3940,6 +4144,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data.Length != 0) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3948,7 +4153,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Data = input.ReadString();
@@ -3962,6 +4167,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class MoreString : pb::IMessage<MoreString> {
private static readonly pb::MessageParser<MoreString> _parser = new pb::MessageParser<MoreString>(() => new MoreString());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MoreString> Parser { get { return _parser; } }
@@ -3985,6 +4191,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MoreString(MoreString other) : this() {
data_ = other.data_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4016,13 +4223,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if(!data_.Equals(other.data_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= data_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4034,12 +4244,18 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
data_.WriteTo(output, _repeated_data_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += data_.CalculateSize(_repeated_data_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4049,6 +4265,7 @@ namespace Google.Protobuf.TestProtos {
return;
}
data_.Add(other.data_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4057,7 +4274,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
data_.AddEntriesFrom(input, _repeated_data_codec);
@@ -4071,6 +4288,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class OneBytes : pb::IMessage<OneBytes> {
private static readonly pb::MessageParser<OneBytes> _parser = new pb::MessageParser<OneBytes>(() => new OneBytes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OneBytes> Parser { get { return _parser; } }
@@ -4094,6 +4312,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OneBytes(OneBytes other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4126,13 +4345,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data.Length != 0) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4147,6 +4369,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteBytes(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4155,6 +4380,9 @@ namespace Google.Protobuf.TestProtos {
if (Data.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4166,6 +4394,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data.Length != 0) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4174,7 +4403,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Data = input.ReadBytes();
@@ -4188,6 +4417,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class MoreBytes : pb::IMessage<MoreBytes> {
private static readonly pb::MessageParser<MoreBytes> _parser = new pb::MessageParser<MoreBytes>(() => new MoreBytes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MoreBytes> Parser { get { return _parser; } }
@@ -4211,6 +4441,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public MoreBytes(MoreBytes other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4243,13 +4474,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data.Length != 0) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4264,6 +4498,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteBytes(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4272,6 +4509,9 @@ namespace Google.Protobuf.TestProtos {
if (Data.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4283,6 +4523,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data.Length != 0) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4291,7 +4532,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Data = input.ReadBytes();
@@ -4308,6 +4549,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class Int32Message : pb::IMessage<Int32Message> {
private static readonly pb::MessageParser<Int32Message> _parser = new pb::MessageParser<Int32Message>(() => new Int32Message());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Int32Message> Parser { get { return _parser; } }
@@ -4331,6 +4573,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Int32Message(Int32Message other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4363,13 +4606,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data != 0) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4384,6 +4630,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4392,6 +4641,9 @@ namespace Google.Protobuf.TestProtos {
if (Data != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4403,6 +4655,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data != 0) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4411,7 +4664,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Data = input.ReadInt32();
@@ -4425,6 +4678,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class Uint32Message : pb::IMessage<Uint32Message> {
private static readonly pb::MessageParser<Uint32Message> _parser = new pb::MessageParser<Uint32Message>(() => new Uint32Message());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Uint32Message> Parser { get { return _parser; } }
@@ -4448,6 +4702,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Uint32Message(Uint32Message other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4480,13 +4735,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data != 0) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4501,6 +4759,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteUInt32(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4509,6 +4770,9 @@ namespace Google.Protobuf.TestProtos {
if (Data != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4520,6 +4784,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data != 0) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4528,7 +4793,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Data = input.ReadUInt32();
@@ -4542,6 +4807,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class Int64Message : pb::IMessage<Int64Message> {
private static readonly pb::MessageParser<Int64Message> _parser = new pb::MessageParser<Int64Message>(() => new Int64Message());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Int64Message> Parser { get { return _parser; } }
@@ -4565,6 +4831,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Int64Message(Int64Message other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4597,13 +4864,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data != 0L) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4618,6 +4888,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt64(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4626,6 +4899,9 @@ namespace Google.Protobuf.TestProtos {
if (Data != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4637,6 +4913,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data != 0L) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4645,7 +4922,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Data = input.ReadInt64();
@@ -4659,6 +4936,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class Uint64Message : pb::IMessage<Uint64Message> {
private static readonly pb::MessageParser<Uint64Message> _parser = new pb::MessageParser<Uint64Message>(() => new Uint64Message());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Uint64Message> Parser { get { return _parser; } }
@@ -4682,6 +4960,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Uint64Message(Uint64Message other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4714,13 +4993,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data != 0UL) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4735,6 +5017,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteUInt64(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4743,6 +5028,9 @@ namespace Google.Protobuf.TestProtos {
if (Data != 0UL) {
size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Data);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4754,6 +5042,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data != 0UL) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4762,7 +5051,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Data = input.ReadUInt64();
@@ -4776,6 +5065,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class BoolMessage : pb::IMessage<BoolMessage> {
private static readonly pb::MessageParser<BoolMessage> _parser = new pb::MessageParser<BoolMessage>(() => new BoolMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BoolMessage> Parser { get { return _parser; } }
@@ -4799,6 +5089,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BoolMessage(BoolMessage other) : this() {
data_ = other.data_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4831,13 +5122,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (Data != other.Data) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Data != false) hash ^= Data.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -4852,6 +5146,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteBool(Data);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4860,6 +5157,9 @@ namespace Google.Protobuf.TestProtos {
if (Data != false) {
size += 1 + 1;
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -4871,6 +5171,7 @@ namespace Google.Protobuf.TestProtos {
if (other.Data != false) {
Data = other.Data;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4879,7 +5180,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Data = input.ReadBool();
@@ -4896,6 +5197,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestOneof : pb::IMessage<TestOneof> {
private static readonly pb::MessageParser<TestOneof> _parser = new pb::MessageParser<TestOneof>(() => new TestOneof());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestOneof> Parser { get { return _parser; } }
@@ -4930,6 +5232,7 @@ namespace Google.Protobuf.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5007,7 +5310,7 @@ namespace Google.Protobuf.TestProtos {
if (FooString != other.FooString) return false;
if (!object.Equals(FooMessage, other.FooMessage)) return false;
if (FooCase != other.FooCase) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5017,6 +5320,9 @@ namespace Google.Protobuf.TestProtos {
if (fooCase_ == FooOneofCase.FooString) hash ^= FooString.GetHashCode();
if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode();
hash ^= (int) fooCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -5039,6 +5345,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(26);
output.WriteMessage(FooMessage);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5053,6 +5362,9 @@ namespace Google.Protobuf.TestProtos {
if (fooCase_ == FooOneofCase.FooMessage) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(FooMessage);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -5076,6 +5388,7 @@ namespace Google.Protobuf.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5084,7 +5397,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
FooInt = input.ReadInt32();
@@ -5111,6 +5424,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestPackedTypes : pb::IMessage<TestPackedTypes> {
private static readonly pb::MessageParser<TestPackedTypes> _parser = new pb::MessageParser<TestPackedTypes>(() => new TestPackedTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestPackedTypes> Parser { get { return _parser; } }
@@ -5147,6 +5461,7 @@ namespace Google.Protobuf.TestProtos {
packedDouble_ = other.packedDouble_.Clone();
packedBool_ = other.packedBool_.Clone();
packedEnum_ = other.packedEnum_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5321,7 +5636,7 @@ namespace Google.Protobuf.TestProtos {
if(!packedDouble_.Equals(other.packedDouble_)) return false;
if(!packedBool_.Equals(other.packedBool_)) return false;
if(!packedEnum_.Equals(other.packedEnum_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5341,6 +5656,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= packedDouble_.GetHashCode();
hash ^= packedBool_.GetHashCode();
hash ^= packedEnum_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -5365,6 +5683,9 @@ namespace Google.Protobuf.TestProtos {
packedDouble_.WriteTo(output, _repeated_packedDouble_codec);
packedBool_.WriteTo(output, _repeated_packedBool_codec);
packedEnum_.WriteTo(output, _repeated_packedEnum_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5384,6 +5705,9 @@ namespace Google.Protobuf.TestProtos {
size += packedDouble_.CalculateSize(_repeated_packedDouble_codec);
size += packedBool_.CalculateSize(_repeated_packedBool_codec);
size += packedEnum_.CalculateSize(_repeated_packedEnum_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -5406,6 +5730,7 @@ namespace Google.Protobuf.TestProtos {
packedDouble_.Add(other.packedDouble_);
packedBool_.Add(other.packedBool_);
packedEnum_.Add(other.packedEnum_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5414,7 +5739,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 722:
case 720: {
@@ -5498,6 +5823,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestUnpackedTypes : pb::IMessage<TestUnpackedTypes> {
private static readonly pb::MessageParser<TestUnpackedTypes> _parser = new pb::MessageParser<TestUnpackedTypes>(() => new TestUnpackedTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestUnpackedTypes> Parser { get { return _parser; } }
@@ -5534,6 +5860,7 @@ namespace Google.Protobuf.TestProtos {
unpackedDouble_ = other.unpackedDouble_.Clone();
unpackedBool_ = other.unpackedBool_.Clone();
unpackedEnum_ = other.unpackedEnum_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5708,7 +6035,7 @@ namespace Google.Protobuf.TestProtos {
if(!unpackedDouble_.Equals(other.unpackedDouble_)) return false;
if(!unpackedBool_.Equals(other.unpackedBool_)) return false;
if(!unpackedEnum_.Equals(other.unpackedEnum_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5728,6 +6055,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= unpackedDouble_.GetHashCode();
hash ^= unpackedBool_.GetHashCode();
hash ^= unpackedEnum_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -5752,6 +6082,9 @@ namespace Google.Protobuf.TestProtos {
unpackedDouble_.WriteTo(output, _repeated_unpackedDouble_codec);
unpackedBool_.WriteTo(output, _repeated_unpackedBool_codec);
unpackedEnum_.WriteTo(output, _repeated_unpackedEnum_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5771,6 +6104,9 @@ namespace Google.Protobuf.TestProtos {
size += unpackedDouble_.CalculateSize(_repeated_unpackedDouble_codec);
size += unpackedBool_.CalculateSize(_repeated_unpackedBool_codec);
size += unpackedEnum_.CalculateSize(_repeated_unpackedEnum_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -5793,6 +6129,7 @@ namespace Google.Protobuf.TestProtos {
unpackedDouble_.Add(other.unpackedDouble_);
unpackedBool_.Add(other.unpackedBool_);
unpackedEnum_.Add(other.unpackedEnum_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5801,7 +6138,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 722:
case 720: {
@@ -5881,6 +6218,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage<TestRepeatedScalarDifferentTagSizes> {
private static readonly pb::MessageParser<TestRepeatedScalarDifferentTagSizes> _parser = new pb::MessageParser<TestRepeatedScalarDifferentTagSizes>(() => new TestRepeatedScalarDifferentTagSizes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestRepeatedScalarDifferentTagSizes> Parser { get { return _parser; } }
@@ -5909,6 +6247,7 @@ namespace Google.Protobuf.TestProtos {
repeatedInt64_ = other.repeatedInt64_.Clone();
repeatedFloat_ = other.repeatedFloat_.Clone();
repeatedUint64_ = other.repeatedUint64_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6009,7 +6348,7 @@ namespace Google.Protobuf.TestProtos {
if(!repeatedInt64_.Equals(other.repeatedInt64_)) return false;
if(!repeatedFloat_.Equals(other.repeatedFloat_)) return false;
if(!repeatedUint64_.Equals(other.repeatedUint64_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6021,6 +6360,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= repeatedInt64_.GetHashCode();
hash ^= repeatedFloat_.GetHashCode();
hash ^= repeatedUint64_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6037,6 +6379,9 @@ namespace Google.Protobuf.TestProtos {
repeatedInt64_.WriteTo(output, _repeated_repeatedInt64_codec);
repeatedFloat_.WriteTo(output, _repeated_repeatedFloat_codec);
repeatedUint64_.WriteTo(output, _repeated_repeatedUint64_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6048,6 +6393,9 @@ namespace Google.Protobuf.TestProtos {
size += repeatedInt64_.CalculateSize(_repeated_repeatedInt64_codec);
size += repeatedFloat_.CalculateSize(_repeated_repeatedFloat_codec);
size += repeatedUint64_.CalculateSize(_repeated_repeatedUint64_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6062,6 +6410,7 @@ namespace Google.Protobuf.TestProtos {
repeatedInt64_.Add(other.repeatedInt64_);
repeatedFloat_.Add(other.repeatedFloat_);
repeatedUint64_.Add(other.repeatedUint64_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6070,7 +6419,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 98:
case 101: {
@@ -6110,6 +6459,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class TestCommentInjectionMessage : pb::IMessage<TestCommentInjectionMessage> {
private static readonly pb::MessageParser<TestCommentInjectionMessage> _parser = new pb::MessageParser<TestCommentInjectionMessage>(() => new TestCommentInjectionMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestCommentInjectionMessage> Parser { get { return _parser; } }
@@ -6133,6 +6483,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestCommentInjectionMessage(TestCommentInjectionMessage other) : this() {
a_ = other.a_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6168,13 +6519,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (A != other.A) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (A.Length != 0) hash ^= A.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6189,6 +6543,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(10);
output.WriteString(A);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6197,6 +6554,9 @@ namespace Google.Protobuf.TestProtos {
if (A.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(A);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6208,6 +6568,7 @@ namespace Google.Protobuf.TestProtos {
if (other.A.Length != 0) {
A = other.A;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6216,7 +6577,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
A = input.ReadString();
@@ -6233,6 +6594,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class FooRequest : pb::IMessage<FooRequest> {
private static readonly pb::MessageParser<FooRequest> _parser = new pb::MessageParser<FooRequest>(() => new FooRequest());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FooRequest> Parser { get { return _parser; } }
@@ -6255,6 +6617,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FooRequest(FooRequest other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6275,12 +6638,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6291,11 +6657,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6304,6 +6676,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6312,7 +6685,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -6322,6 +6695,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class FooResponse : pb::IMessage<FooResponse> {
private static readonly pb::MessageParser<FooResponse> _parser = new pb::MessageParser<FooResponse>(() => new FooResponse());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FooResponse> Parser { get { return _parser; } }
@@ -6344,6 +6718,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FooResponse(FooResponse other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6364,12 +6739,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6380,11 +6758,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6393,6 +6777,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6401,7 +6786,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -6411,6 +6796,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class FooClientMessage : pb::IMessage<FooClientMessage> {
private static readonly pb::MessageParser<FooClientMessage> _parser = new pb::MessageParser<FooClientMessage>(() => new FooClientMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FooClientMessage> Parser { get { return _parser; } }
@@ -6433,6 +6819,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FooClientMessage(FooClientMessage other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6453,12 +6840,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6469,11 +6859,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6482,6 +6878,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6490,7 +6887,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -6500,6 +6897,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class FooServerMessage : pb::IMessage<FooServerMessage> {
private static readonly pb::MessageParser<FooServerMessage> _parser = new pb::MessageParser<FooServerMessage>(() => new FooServerMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FooServerMessage> Parser { get { return _parser; } }
@@ -6522,6 +6920,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FooServerMessage(FooServerMessage other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6542,12 +6941,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6558,11 +6960,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6571,6 +6979,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6579,7 +6988,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -6589,6 +6998,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class BarRequest : pb::IMessage<BarRequest> {
private static readonly pb::MessageParser<BarRequest> _parser = new pb::MessageParser<BarRequest>(() => new BarRequest());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BarRequest> Parser { get { return _parser; } }
@@ -6611,6 +7021,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BarRequest(BarRequest other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6631,12 +7042,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6647,11 +7061,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6660,6 +7080,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6668,7 +7089,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
@@ -6678,6 +7099,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class BarResponse : pb::IMessage<BarResponse> {
private static readonly pb::MessageParser<BarResponse> _parser = new pb::MessageParser<BarResponse>(() => new BarResponse());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BarResponse> Parser { get { return _parser; } }
@@ -6700,6 +7122,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public BarResponse(BarResponse other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6720,12 +7143,15 @@ namespace Google.Protobuf.TestProtos {
if (ReferenceEquals(other, this)) {
return true;
}
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -6736,11 +7162,17 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -6749,6 +7181,108 @@ namespace Google.Protobuf.TestProtos {
if (other == null) {
return;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class TestEmptyMessage : pb::IMessage<TestEmptyMessage> {
+ private static readonly pb::MessageParser<TestEmptyMessage> _parser = new pb::MessageParser<TestEmptyMessage>(() => new TestEmptyMessage());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser<TestEmptyMessage> Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[34]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TestEmptyMessage() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TestEmptyMessage(TestEmptyMessage other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TestEmptyMessage Clone() {
+ return new TestEmptyMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as TestEmptyMessage);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(TestEmptyMessage other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(TestEmptyMessage other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6757,7 +7291,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
index ea2a83fc..a9a0d490 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
@@ -179,6 +179,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class TestWellKnownTypes : pb::IMessage<TestWellKnownTypes> {
private static readonly pb::MessageParser<TestWellKnownTypes> _parser = new pb::MessageParser<TestWellKnownTypes>(() => new TestWellKnownTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestWellKnownTypes> Parser { get { return _parser; } }
@@ -220,6 +221,7 @@ namespace Google.Protobuf.TestProtos {
StringField = other.StringField;
BytesField = other.BytesField;
ValueField = other.valueField_ != null ? other.ValueField.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -480,7 +482,7 @@ namespace Google.Protobuf.TestProtos {
if (StringField != other.StringField) return false;
if (BytesField != other.BytesField) return false;
if (!object.Equals(ValueField, other.ValueField)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -505,6 +507,9 @@ namespace Google.Protobuf.TestProtos {
if (stringField_ != null) hash ^= StringField.GetHashCode();
if (bytesField_ != null) hash ^= BytesField.GetHashCode();
if (valueField_ != null) hash ^= ValueField.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -582,6 +587,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(154, 1);
output.WriteMessage(ValueField);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -644,6 +652,9 @@ namespace Google.Protobuf.TestProtos {
if (valueField_ != null) {
size += 2 + pb::CodedOutputStream.ComputeMessageSize(ValueField);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -757,6 +768,7 @@ namespace Google.Protobuf.TestProtos {
}
ValueField.MergeFrom(other.ValueField);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -765,7 +777,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (anyField_ == null) {
@@ -911,6 +923,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class RepeatedWellKnownTypes : pb::IMessage<RepeatedWellKnownTypes> {
private static readonly pb::MessageParser<RepeatedWellKnownTypes> _parser = new pb::MessageParser<RepeatedWellKnownTypes>(() => new RepeatedWellKnownTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RepeatedWellKnownTypes> Parser { get { return _parser; } }
@@ -951,6 +964,7 @@ namespace Google.Protobuf.TestProtos {
boolField_ = other.boolField_.Clone();
stringField_ = other.stringField_.Clone();
bytesField_ = other.bytesField_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1172,7 +1186,7 @@ namespace Google.Protobuf.TestProtos {
if(!boolField_.Equals(other.boolField_)) return false;
if(!stringField_.Equals(other.stringField_)) return false;
if(!bytesField_.Equals(other.bytesField_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1196,6 +1210,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= boolField_.GetHashCode();
hash ^= stringField_.GetHashCode();
hash ^= bytesField_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1224,6 +1241,9 @@ namespace Google.Protobuf.TestProtos {
boolField_.WriteTo(output, _repeated_boolField_codec);
stringField_.WriteTo(output, _repeated_stringField_codec);
bytesField_.WriteTo(output, _repeated_bytesField_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1247,6 +1267,9 @@ namespace Google.Protobuf.TestProtos {
size += boolField_.CalculateSize(_repeated_boolField_codec);
size += stringField_.CalculateSize(_repeated_stringField_codec);
size += bytesField_.CalculateSize(_repeated_bytesField_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1273,6 +1296,7 @@ namespace Google.Protobuf.TestProtos {
boolField_.Add(other.boolField_);
stringField_.Add(other.stringField_);
bytesField_.Add(other.bytesField_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1281,7 +1305,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
anyField_.AddEntriesFrom(input, _repeated_anyField_codec);
@@ -1363,6 +1387,7 @@ namespace Google.Protobuf.TestProtos {
public sealed partial class OneofWellKnownTypes : pb::IMessage<OneofWellKnownTypes> {
private static readonly pb::MessageParser<OneofWellKnownTypes> _parser = new pb::MessageParser<OneofWellKnownTypes>(() => new OneofWellKnownTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OneofWellKnownTypes> Parser { get { return _parser; } }
@@ -1442,6 +1467,7 @@ namespace Google.Protobuf.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1723,7 +1749,7 @@ namespace Google.Protobuf.TestProtos {
if (StringField != other.StringField) return false;
if (BytesField != other.BytesField) return false;
if (OneofFieldCase != other.OneofFieldCase) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1748,6 +1774,9 @@ namespace Google.Protobuf.TestProtos {
if (oneofFieldCase_ == OneofFieldOneofCase.StringField) hash ^= StringField.GetHashCode();
if (oneofFieldCase_ == OneofFieldOneofCase.BytesField) hash ^= BytesField.GetHashCode();
hash ^= (int) oneofFieldCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -1821,6 +1850,9 @@ namespace Google.Protobuf.TestProtos {
if (oneofFieldCase_ == OneofFieldOneofCase.BytesField) {
_oneof_bytesField_codec.WriteTagAndValue(output, (pb::ByteString) oneofField_);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1880,6 +1912,9 @@ namespace Google.Protobuf.TestProtos {
if (oneofFieldCase_ == OneofFieldOneofCase.BytesField) {
size += _oneof_bytesField_codec.CalculateSizeWithTag(BytesField);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -1972,6 +2007,7 @@ namespace Google.Protobuf.TestProtos {
break;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1980,7 +2016,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any();
@@ -2112,6 +2148,7 @@ namespace Google.Protobuf.TestProtos {
/// </summary>
public sealed partial class MapWellKnownTypes : pb::IMessage<MapWellKnownTypes> {
private static readonly pb::MessageParser<MapWellKnownTypes> _parser = new pb::MessageParser<MapWellKnownTypes>(() => new MapWellKnownTypes());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MapWellKnownTypes> Parser { get { return _parser; } }
@@ -2152,6 +2189,7 @@ namespace Google.Protobuf.TestProtos {
boolField_ = other.boolField_.Clone();
stringField_ = other.stringField_.Clone();
bytesField_ = other.bytesField_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2370,7 +2408,7 @@ namespace Google.Protobuf.TestProtos {
if (!BoolField.Equals(other.BoolField)) return false;
if (!StringField.Equals(other.StringField)) return false;
if (!BytesField.Equals(other.BytesField)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2394,6 +2432,9 @@ namespace Google.Protobuf.TestProtos {
hash ^= BoolField.GetHashCode();
hash ^= StringField.GetHashCode();
hash ^= BytesField.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -2422,6 +2463,9 @@ namespace Google.Protobuf.TestProtos {
boolField_.WriteTo(output, _map_boolField_codec);
stringField_.WriteTo(output, _map_stringField_codec);
bytesField_.WriteTo(output, _map_bytesField_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2445,6 +2489,9 @@ namespace Google.Protobuf.TestProtos {
size += boolField_.CalculateSize(_map_boolField_codec);
size += stringField_.CalculateSize(_map_stringField_codec);
size += bytesField_.CalculateSize(_map_bytesField_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -2471,6 +2518,7 @@ namespace Google.Protobuf.TestProtos {
boolField_.Add(other.boolField_);
stringField_.Add(other.stringField_);
bytesField_.Add(other.bytesField_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2479,7 +2527,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
anyField_.AddEntriesFrom(input, _map_anyField_codec);
diff --git a/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs b/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs
new file mode 100644
index 00000000..1edd6fba
--- /dev/null
+++ b/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs
@@ -0,0 +1,128 @@
+#region Copyright notice and license
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#endregion
+
+using System;
+using Google.Protobuf.TestProtos;
+using NUnit.Framework;
+
+namespace Google.Protobuf
+{
+ public class UnknownFieldSetTest
+ {
+ [Test]
+ public void EmptyUnknownFieldSet()
+ {
+ UnknownFieldSet unknownFields = new UnknownFieldSet();
+ Assert.AreEqual(0, unknownFields.CalculateSize());
+ }
+
+ [Test]
+ public void MergeUnknownFieldSet()
+ {
+ UnknownFieldSet unknownFields = new UnknownFieldSet();
+ UnknownField field = new UnknownField();
+ field.AddFixed32(123);
+ unknownFields.AddOrReplaceField(1, field);
+ UnknownFieldSet otherUnknownFields = new UnknownFieldSet();
+ Assert.IsFalse(otherUnknownFields.HasField(1));
+ UnknownFieldSet.MergeFrom(otherUnknownFields, unknownFields);
+ Assert.IsTrue(otherUnknownFields.HasField(1));
+ }
+
+ [Test]
+ public void TestMergeCodedInput()
+ {
+ var message = SampleMessages.CreateFullTestAllTypes();
+ var emptyMessage = new TestEmptyMessage();
+ emptyMessage.MergeFrom(message.ToByteArray());
+ Assert.AreEqual(message.CalculateSize(), emptyMessage.CalculateSize());
+ Assert.AreEqual(message.ToByteArray(), emptyMessage.ToByteArray());
+
+ var newMessage = new TestAllTypes();
+ newMessage.MergeFrom(emptyMessage.ToByteArray());
+ Assert.AreEqual(message, newMessage);
+ Assert.AreEqual(message.CalculateSize(), newMessage.CalculateSize());
+ }
+
+ [Test]
+ public void TestMergeMessage()
+ {
+ var message = SampleMessages.CreateFullTestAllTypes();
+ var emptyMessage = new TestEmptyMessage();
+ var otherEmptyMessage = new TestEmptyMessage();
+ emptyMessage.MergeFrom(message.ToByteArray());
+ otherEmptyMessage.MergeFrom(emptyMessage);
+
+ Assert.AreEqual(message.CalculateSize(), otherEmptyMessage.CalculateSize());
+ Assert.AreEqual(message.ToByteArray(), otherEmptyMessage.ToByteArray());
+ }
+
+ [Test]
+ public void TestEquals()
+ {
+ var message = SampleMessages.CreateFullTestAllTypes();
+ var emptyMessage = new TestEmptyMessage();
+ var otherEmptyMessage = new TestEmptyMessage();
+ Assert.AreEqual(emptyMessage, otherEmptyMessage);
+ emptyMessage.MergeFrom(message.ToByteArray());
+ Assert.AreNotEqual(emptyMessage.CalculateSize(),
+ otherEmptyMessage.CalculateSize());
+ Assert.AreNotEqual(emptyMessage, otherEmptyMessage);
+ }
+
+ [Test]
+ public void TestHashCode()
+ {
+ var message = SampleMessages.CreateFullTestAllTypes();
+ var emptyMessage = new TestEmptyMessage();
+ int hashCode = emptyMessage.GetHashCode();
+ emptyMessage.MergeFrom(message.ToByteArray());
+ Assert.AreNotEqual(hashCode, emptyMessage.GetHashCode());
+ }
+
+ [Test]
+ public void TestClone()
+ {
+ var emptyMessage = new TestEmptyMessage();
+ var otherEmptyMessage = new TestEmptyMessage();
+ otherEmptyMessage = emptyMessage.Clone();
+ Assert.AreEqual(emptyMessage.CalculateSize(), otherEmptyMessage.CalculateSize());
+ Assert.AreEqual(emptyMessage.ToByteArray(), otherEmptyMessage.ToByteArray());
+
+ var message = SampleMessages.CreateFullTestAllTypes();
+ emptyMessage.MergeFrom(message.ToByteArray());
+ otherEmptyMessage = emptyMessage.Clone();
+ Assert.AreEqual(message.CalculateSize(), otherEmptyMessage.CalculateSize());
+ Assert.AreEqual(message.ToByteArray(), otherEmptyMessage.ToByteArray());
+ }
+ }
+}