From 3e7d70cb699e93a485ef11fce034f4767aac4b8f Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 25 Jun 2015 12:08:55 +0100 Subject: Generated code changes due to map changes. (Primarily this is starting the hash code of messages at a non-zero value...) --- .../TestProtos/UnittestProto3.cs | 114 ++++++++++++++------- 1 file changed, 76 insertions(+), 38 deletions(-) (limited to 'csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs') diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs index e0d0d3d0..8d879617 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs @@ -1058,7 +1058,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (SingleInt32 != 0) hash ^= SingleInt32.GetHashCode(); if (SingleInt64 != 0L) hash ^= SingleInt64.GetHashCode(); if (SingleUint32 != 0) hash ^= SingleUint32.GetHashCode(); @@ -1544,6 +1544,7 @@ namespace Google.Protobuf.TestProtos { size += mapBoolToEnum_.CalculateSize(_map_mapBoolToEnum_codec); return size; } + public void MergeFrom(TestAllTypes other) { if (other == null) { return; @@ -1992,7 +1993,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Bb != 0) hash ^= Bb.GetHashCode(); return hash; } @@ -2011,6 +2012,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -2115,7 +2117,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Key.Length != 0) hash ^= Key.GetHashCode(); if (value_ != null) hash ^= Value.GetHashCode(); return hash; @@ -2142,6 +2144,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(MapStringToNestedMessageEntry other) { if (other == null) { return; @@ -2258,7 +2261,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Key != 0) hash ^= Key.GetHashCode(); if (Value.Length != 0) hash ^= Value.GetHashCode(); return hash; @@ -2285,6 +2288,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(MapInt32ToBytesEntry other) { if (other == null) { return; @@ -2395,7 +2399,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Key != false) hash ^= Key.GetHashCode(); if (Value != global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.NESTED_ENUM_UNSPECIFIED) hash ^= Value.GetHashCode(); return hash; @@ -2422,6 +2426,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(MapBoolToEnumEntry other) { if (other == null) { return; @@ -2548,7 +2553,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (child_ != null) hash ^= Child.GetHashCode(); if (payload_ != null) hash ^= Payload.GetHashCode(); hash ^= repeatedChild_.GetHashCode(); @@ -2585,6 +2590,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(NestedTestAllTypes other) { if (other == null) { return; @@ -2701,7 +2707,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (DeprecatedInt32 != 0) hash ^= DeprecatedInt32.GetHashCode(); return hash; } @@ -2720,6 +2726,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestDeprecatedFields other) { if (other == null) { return; @@ -2811,7 +2818,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (C != 0) hash ^= C.GetHashCode(); return hash; } @@ -2830,6 +2837,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -2909,7 +2917,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -2920,6 +2928,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(TestReservedFields other) { if (other == null) { return; @@ -3005,7 +3014,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (foreignNested_ != null) hash ^= ForeignNested.GetHashCode(); return hash; } @@ -3024,6 +3033,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestForeignNested other) { if (other == null) { return; @@ -3133,7 +3143,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (A != 0) hash ^= A.GetHashCode(); if (Bb != 0) hash ^= Bb.GetHashCode(); return hash; @@ -3160,6 +3170,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestReallyLargeTagNumber other) { if (other == null) { return; @@ -3271,7 +3282,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (a_ != null) hash ^= A.GetHashCode(); if (I != 0) hash ^= I.GetHashCode(); return hash; @@ -3298,6 +3309,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestRecursiveMessage other) { if (other == null) { return; @@ -3403,7 +3415,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (bb_ != null) hash ^= Bb.GetHashCode(); return hash; } @@ -3422,6 +3434,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestMutualRecursionA other) { if (other == null) { return; @@ -3532,7 +3545,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (a_ != null) hash ^= A.GetHashCode(); if (OptionalInt32 != 0) hash ^= OptionalInt32.GetHashCode(); return hash; @@ -3559,6 +3572,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestMutualRecursionB other) { if (other == null) { return; @@ -3736,7 +3750,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (PrimitiveField != 0) hash ^= PrimitiveField.GetHashCode(); if (StringField.Length != 0) hash ^= StringField.GetHashCode(); if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) hash ^= EnumField.GetHashCode(); @@ -3827,6 +3841,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestCamelCaseFieldNames other) { if (other == null) { return; @@ -4004,7 +4019,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (MyString.Length != 0) hash ^= MyString.GetHashCode(); if (MyInt != 0L) hash ^= MyInt.GetHashCode(); if (MyFloat != 0F) hash ^= MyFloat.GetHashCode(); @@ -4047,6 +4062,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestFieldOrderings other) { if (other == null) { return; @@ -4178,7 +4194,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Oo != 0L) hash ^= Oo.GetHashCode(); if (Bb != 0) hash ^= Bb.GetHashCode(); return hash; @@ -4205,6 +4221,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -4308,7 +4325,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED) hash ^= SparseEnum.GetHashCode(); return hash; } @@ -4327,6 +4344,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(SparseEnumMessage other) { if (other == null) { return; @@ -4418,7 +4436,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data.Length != 0) hash ^= Data.GetHashCode(); return hash; } @@ -4437,6 +4455,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(OneString other) { if (other == null) { return; @@ -4525,7 +4544,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; hash ^= data_.GetHashCode(); return hash; } @@ -4548,6 +4567,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(MoreString other) { if (other == null) { return; @@ -4637,7 +4657,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data.Length != 0) hash ^= Data.GetHashCode(); return hash; } @@ -4656,6 +4676,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(OneBytes other) { if (other == null) { return; @@ -4747,7 +4768,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data.Length != 0) hash ^= Data.GetHashCode(); return hash; } @@ -4766,6 +4787,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(MoreBytes other) { if (other == null) { return; @@ -4857,7 +4879,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data != 0) hash ^= Data.GetHashCode(); return hash; } @@ -4876,6 +4898,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(Int32Message other) { if (other == null) { return; @@ -4967,7 +4990,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data != 0) hash ^= Data.GetHashCode(); return hash; } @@ -4986,6 +5009,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(Uint32Message other) { if (other == null) { return; @@ -5077,7 +5101,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data != 0L) hash ^= Data.GetHashCode(); return hash; } @@ -5096,6 +5120,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(Int64Message other) { if (other == null) { return; @@ -5187,7 +5212,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data != 0UL) hash ^= Data.GetHashCode(); return hash; } @@ -5206,6 +5231,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(Uint64Message other) { if (other == null) { return; @@ -5297,7 +5323,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (Data != false) hash ^= Data.GetHashCode(); return hash; } @@ -5316,6 +5342,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(BoolMessage other) { if (other == null) { return; @@ -5459,7 +5486,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (fooCase_ == FooOneofCase.FooInt) hash ^= FooInt.GetHashCode(); if (fooCase_ == FooOneofCase.FooString) hash ^= FooString.GetHashCode(); if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode(); @@ -5494,6 +5521,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestOneof other) { if (other == null) { return; @@ -5721,7 +5749,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; hash ^= packedInt32_.GetHashCode(); hash ^= packedInt64_.GetHashCode(); hash ^= packedUint32_.GetHashCode(); @@ -5900,6 +5928,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestPackedTypes other) { if (other == null) { return; @@ -6182,7 +6211,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; hash ^= unpackedInt32_.GetHashCode(); hash ^= unpackedInt64_.GetHashCode(); hash ^= unpackedUint32_.GetHashCode(); @@ -6347,6 +6376,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestUnpackedTypes other) { if (other == null) { return; @@ -6557,7 +6587,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; hash ^= repeatedFixed32_.GetHashCode(); hash ^= repeatedInt32_.GetHashCode(); hash ^= repeatedFixed64_.GetHashCode(); @@ -6640,6 +6670,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestRepeatedScalarDifferentTagSizes other) { if (other == null) { return; @@ -6760,7 +6791,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; if (A.Length != 0) hash ^= A.GetHashCode(); return hash; } @@ -6779,6 +6810,7 @@ namespace Google.Protobuf.TestProtos { } return size; } + public void MergeFrom(TestCommentInjectionMessage other) { if (other == null) { return; @@ -6858,7 +6890,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -6869,6 +6901,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(FooRequest other) { if (other == null) { return; @@ -6941,7 +6974,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -6952,6 +6985,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(FooResponse other) { if (other == null) { return; @@ -7024,7 +7058,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -7035,6 +7069,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(FooClientMessage other) { if (other == null) { return; @@ -7107,7 +7142,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -7118,6 +7153,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(FooServerMessage other) { if (other == null) { return; @@ -7190,7 +7226,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -7201,6 +7237,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(BarRequest other) { if (other == null) { return; @@ -7273,7 +7310,7 @@ namespace Google.Protobuf.TestProtos { } public override int GetHashCode() { - int hash = 0; + int hash = 17; return hash; } @@ -7284,6 +7321,7 @@ namespace Google.Protobuf.TestProtos { int size = 0; return size; } + public void MergeFrom(BarResponse other) { if (other == null) { return; -- cgit v1.2.3