aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Test
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-09-16 12:21:00 -0500
committerrogerk <devnull@localhost>2011-09-16 12:21:00 -0500
commit4ecebd8b4a34c1f902176395024185f1724cb2eb (patch)
treeb66dbd1ef1b8fc8f4b4813f4ac7522fc25d637dc /src/ProtocolBuffers.Test
parent8f0dcf3df1548a1eff0bed54a9b992f55b8f72d5 (diff)
downloadprotobuf-4ecebd8b4a34c1f902176395024185f1724cb2eb.tar.gz
protobuf-4ecebd8b4a34c1f902176395024185f1724cb2eb.tar.bz2
protobuf-4ecebd8b4a34c1f902176395024185f1724cb2eb.zip
Tests and fixes for double-enumeration on AddRange and adding of null to PopsicleList
Diffstat (limited to 'src/ProtocolBuffers.Test')
-rw-r--r--src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs59
-rw-r--r--src/ProtocolBuffers.Test/GeneratedBuilderTest.cs123
-rw-r--r--src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj1
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs4
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs16
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs32
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs4
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs276
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs12
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs20
10 files changed, 365 insertions, 182 deletions
diff --git a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
index c339cef6..35b13a1d 100644
--- a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
+++ b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs
@@ -35,6 +35,7 @@
#endregion
using System;
+using System.Collections.Generic;
using NUnit.Framework;
internal delegate void Action();
@@ -94,6 +95,64 @@ namespace Google.ProtocolBuffers.Collections
Assert.IsFalse(list.IsReadOnly);
}
+ [Test]
+ public void DoesNotAddNullEnumerable()
+ {
+ PopsicleList<string> list = new PopsicleList<string>();
+ try
+ {
+ list.Add((IEnumerable<string>)null);
+ }
+ catch (ArgumentNullException)
+ { return; }
+
+ Assert.Fail("List should not allow nulls.");
+ }
+
+ [Test]
+ public void DoesNotAddRangeWithNull()
+ {
+ PopsicleList<string> list = new PopsicleList<string>();
+ try
+ {
+ list.Add(new[] { "a", "b", null });
+ }
+ catch (ArgumentNullException)
+ { return; }
+
+ Assert.Fail("List should not allow nulls.");
+ }
+
+ [Test]
+ public void DoesNotAddNull()
+ {
+ PopsicleList<string> list = new PopsicleList<string>();
+ try
+ {
+ list.Add((string)null);
+ }
+ catch (ArgumentNullException)
+ { return; }
+
+ Assert.Fail("List should not allow nulls.");
+ }
+
+ [Test]
+ public void DoesNotSetNull()
+ {
+ PopsicleList<string> list = new PopsicleList<string>();
+ list.Add("a");
+ try
+ {
+ list[0] = null;
+ }
+ catch (ArgumentNullException)
+ { return; }
+
+ Assert.Fail("List should not allow nulls.");
+ }
+
+
private static void AssertNotSupported(Action action)
{
try
diff --git a/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs b/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
new file mode 100644
index 00000000..b1290031
--- /dev/null
+++ b/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Google.ProtocolBuffers.TestProtos;
+using NUnit.Framework;
+
+namespace Google.ProtocolBuffers
+{
+ [TestFixture]
+ public class GeneratedBuilderTest
+ {
+ class OneTimeEnumerator<T> : IEnumerable<T>
+ {
+ readonly T _item;
+ bool _enumerated;
+ public OneTimeEnumerator(T item)
+ {
+ _item = item;
+ }
+ public IEnumerator<T> GetEnumerator()
+ {
+ Assert.IsFalse(_enumerated, "The collection {0} has already been enumerated", GetType());
+ _enumerated = true;
+ yield return _item;
+ }
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ { return GetEnumerator(); }
+ }
+
+ [Test]
+ public void DoesNotEnumerateTwiceForMessageList()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ b.AddRangeRepeatedForeignMessage(
+ new OneTimeEnumerator<ForeignMessage>(
+ ForeignMessage.DefaultInstance));
+ }
+ [Test]
+ public void DoesNotEnumerateTwiceForPrimitiveList()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ b.AddRangeRepeatedInt32(new OneTimeEnumerator<int>(1));
+ }
+ [Test]
+ public void DoesNotEnumerateTwiceForStringList()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ b.AddRangeRepeatedString(new OneTimeEnumerator<string>("test"));
+ }
+ [Test]
+ public void DoesNotEnumerateTwiceForEnumList()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator<ForeignEnum>(ForeignEnum.FOREIGN_BAR));
+ }
+
+ private static void AssertThrows<T>(System.Threading.ThreadStart method) where T : Exception
+ {
+ try
+ {
+ method();
+ }
+ catch (Exception error)
+ {
+ if (error is T)
+ return;
+ throw;
+ }
+ Assert.Fail("Expected exception of type " + typeof(T));
+ }
+
+ [Test]
+ public void DoesNotAddNullToMessageListByAddRange()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ AssertThrows<ArgumentNullException>(
+ () => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null })
+ );
+ }
+ [Test]
+ public void DoesNotAddNullToMessageListByAdd()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ AssertThrows<ArgumentNullException>(
+ () => b.AddRepeatedForeignMessage((ForeignMessage)null)
+ );
+ }
+ [Test]
+ public void DoesNotAddNullToMessageListBySet()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ b.AddRepeatedForeignMessage(ForeignMessage.DefaultInstance);
+ AssertThrows<ArgumentNullException>(
+ () => b.SetRepeatedForeignMessage(0, (ForeignMessage)null)
+ );
+ }
+ [Test]
+ public void DoesNotAddNullToStringListByAddRange()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ AssertThrows<ArgumentNullException>(
+ () => b.AddRangeRepeatedString(new String[] { null })
+ );
+ }
+ [Test]
+ public void DoesNotAddNullToStringListByAdd()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ AssertThrows<ArgumentNullException>(
+ () => b.AddRepeatedString(null)
+ );
+ }
+ [Test]
+ public void DoesNotAddNullToStringListBySet()
+ {
+ TestAllTypes.Builder b = new TestAllTypes.Builder();
+ b.AddRepeatedString("one");
+ AssertThrows<ArgumentNullException>(
+ () => b.SetRepeatedString(0, null)
+ );
+ }
+ }
+}
diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
index 95ab0b9c..f87546f8 100644
--- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+++ b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
@@ -97,6 +97,7 @@
<Compile Include="Descriptors\MessageDescriptorTest.cs" />
<Compile Include="DynamicMessageTest.cs" />
<Compile Include="ExtendableMessageTest.cs" />
+ <Compile Include="GeneratedBuilderTest.cs" />
<Compile Include="GeneratedMessageTest.cs" />
<Compile Include="MessageStreamIteratorTest.cs" />
<Compile Include="MessageStreamWriterTest.cs" />
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
index 09ecdd63..a15488c3 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
@@ -246,7 +246,7 @@ namespace Google.ProtocolBuffers.TestProtos {
MergeOptionalMessage(other.OptionalMessage);
}
if (other.repeatedMessage_.Count != 0) {
- base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
+ result.repeatedMessage_.Add(other.repeatedMessage_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -379,7 +379,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> values) {
- base.AddRange(values, result.repeatedMessage_);
+ result.repeatedMessage_.Add(values);
return this;
}
public Builder ClearRepeatedMessage() {
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs
index 77635f21..df2a9a53 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs
@@ -877,7 +877,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeField5(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.field5_);
+ result.field5_.Add(values);
return this;
}
public Builder ClearField5() {
@@ -2515,7 +2515,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField14(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field14_);
+ result.field14_.Add(values);
return this;
}
public Builder ClearField14() {
@@ -2656,7 +2656,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField22(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field22_);
+ result.field22_.Add(values);
return this;
}
public Builder ClearField22() {
@@ -2682,7 +2682,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField73(scg::IEnumerable<int> values) {
- base.AddRange(values, result.field73_);
+ result.field73_.Add(values);
return this;
}
public Builder ClearField73() {
@@ -3591,7 +3591,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeGroup1(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1> values) {
- base.AddRange(values, result.group1_);
+ result.group1_.Add(values);
return this;
}
public Builder ClearGroup1() {
@@ -3619,7 +3619,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField128(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field128_);
+ result.field128_.Add(values);
return this;
}
public Builder ClearField128() {
@@ -3665,7 +3665,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField127(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field127_);
+ result.field127_.Add(values);
return this;
}
public Builder ClearField127() {
@@ -3709,7 +3709,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField130(scg::IEnumerable<long> values) {
- base.AddRange(values, result.field130_);
+ result.field130_.Add(values);
return this;
}
public Builder ClearField130() {
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
index 918be643..3305da40 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
@@ -975,7 +975,7 @@ namespace Google.ProtocolBuffers.TestProtos {
Field4 = other.Field4;
}
if (other.field5_.Count != 0) {
- base.AddRange(other.field5_, result.field5_);
+ result.field5_.Add(other.field5_);
}
if (other.HasField59) {
Field59 = other.Field59;
@@ -1511,7 +1511,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeField5(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.field5_);
+ result.field5_.Add(values);
return this;
}
public Builder ClearField5() {
@@ -3569,7 +3569,7 @@ namespace Google.ProtocolBuffers.TestProtos {
Field13 = other.Field13;
}
if (other.field14_.Count != 0) {
- base.AddRange(other.field14_, result.field14_);
+ result.field14_.Add(other.field14_);
}
if (other.HasField15) {
Field15 = other.Field15;
@@ -3590,10 +3590,10 @@ namespace Google.ProtocolBuffers.TestProtos {
Field16 = other.Field16;
}
if (other.field22_.Count != 0) {
- base.AddRange(other.field22_, result.field22_);
+ result.field22_.Add(other.field22_);
}
if (other.field73_.Count != 0) {
- base.AddRange(other.field73_, result.field73_);
+ result.field73_.Add(other.field73_);
}
if (other.HasField20) {
Field20 = other.Field20;
@@ -3820,7 +3820,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField14(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field14_);
+ result.field14_.Add(values);
return this;
}
public Builder ClearField14() {
@@ -3961,7 +3961,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField22(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field22_);
+ result.field22_.Add(values);
return this;
}
public Builder ClearField22() {
@@ -3987,7 +3987,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField73(scg::IEnumerable<int> values) {
- base.AddRange(values, result.field73_);
+ result.field73_.Add(values);
return this;
}
public Builder ClearField73() {
@@ -4764,22 +4764,22 @@ namespace Google.ProtocolBuffers.TestProtos {
Field63 = other.Field63;
}
if (other.group1_.Count != 0) {
- base.AddRange(other.group1_, result.group1_);
+ result.group1_.Add(other.group1_);
}
if (other.field128_.Count != 0) {
- base.AddRange(other.field128_, result.field128_);
+ result.field128_.Add(other.field128_);
}
if (other.HasField131) {
Field131 = other.Field131;
}
if (other.field127_.Count != 0) {
- base.AddRange(other.field127_, result.field127_);
+ result.field127_.Add(other.field127_);
}
if (other.HasField129) {
Field129 = other.Field129;
}
if (other.field130_.Count != 0) {
- base.AddRange(other.field130_, result.field130_);
+ result.field130_.Add(other.field130_);
}
if (other.HasField205) {
Field205 = other.Field205;
@@ -5389,7 +5389,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeGroup1(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1> values) {
- base.AddRange(values, result.group1_);
+ result.group1_.Add(values);
return this;
}
public Builder ClearGroup1() {
@@ -5417,7 +5417,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField128(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field128_);
+ result.field128_.Add(values);
return this;
}
public Builder ClearField128() {
@@ -5463,7 +5463,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField127(scg::IEnumerable<string> values) {
- base.AddRange(values, result.field127_);
+ result.field127_.Add(values);
return this;
}
public Builder ClearField127() {
@@ -5507,7 +5507,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeField130(scg::IEnumerable<long> values) {
- base.AddRange(values, result.field130_);
+ result.field130_.Add(values);
return this;
}
public Builder ClearField130() {
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
index 8a6bb589..34de1a98 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
@@ -1499,7 +1499,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(RawMessageSet other) {
if (other == global::Google.ProtocolBuffers.TestProtos.RawMessageSet.DefaultInstance) return this;
if (other.item_.Count != 0) {
- base.AddRange(other.item_, result.item_);
+ result.item_.Add(other.item_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -1587,7 +1587,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeItem(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item> values) {
- base.AddRange(values, result.item_);
+ result.item_.Add(values);
return this;
}
public Builder ClearItem() {
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
index d8824d49..49efaecd 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
@@ -3333,76 +3333,76 @@ namespace Google.ProtocolBuffers.TestProtos {
OptionalCord = other.OptionalCord;
}
if (other.repeatedInt32_.Count != 0) {
- base.AddRange(other.repeatedInt32_, result.repeatedInt32_);
+ result.repeatedInt32_.Add(other.repeatedInt32_);
}
if (other.repeatedInt64_.Count != 0) {
- base.AddRange(other.repeatedInt64_, result.repeatedInt64_);
+ result.repeatedInt64_.Add(other.repeatedInt64_);
}
if (other.repeatedUint32_.Count != 0) {
- base.AddRange(other.repeatedUint32_, result.repeatedUint32_);
+ result.repeatedUint32_.Add(other.repeatedUint32_);
}
if (other.repeatedUint64_.Count != 0) {
- base.AddRange(other.repeatedUint64_, result.repeatedUint64_);
+ result.repeatedUint64_.Add(other.repeatedUint64_);
}
if (other.repeatedSint32_.Count != 0) {
- base.AddRange(other.repeatedSint32_, result.repeatedSint32_);
+ result.repeatedSint32_.Add(other.repeatedSint32_);
}
if (other.repeatedSint64_.Count != 0) {
- base.AddRange(other.repeatedSint64_, result.repeatedSint64_);
+ result.repeatedSint64_.Add(other.repeatedSint64_);
}
if (other.repeatedFixed32_.Count != 0) {
- base.AddRange(other.repeatedFixed32_, result.repeatedFixed32_);
+ result.repeatedFixed32_.Add(other.repeatedFixed32_);
}
if (other.repeatedFixed64_.Count != 0) {
- base.AddRange(other.repeatedFixed64_, result.repeatedFixed64_);
+ result.repeatedFixed64_.Add(other.repeatedFixed64_);
}
if (other.repeatedSfixed32_.Count != 0) {
- base.AddRange(other.repeatedSfixed32_, result.repeatedSfixed32_);
+ result.repeatedSfixed32_.Add(other.repeatedSfixed32_);
}
if (other.repeatedSfixed64_.Count != 0) {
- base.AddRange(other.repeatedSfixed64_, result.repeatedSfixed64_);
+ result.repeatedSfixed64_.Add(other.repeatedSfixed64_);
}
if (other.repeatedFloat_.Count != 0) {
- base.AddRange(other.repeatedFloat_, result.repeatedFloat_);
+ result.repeatedFloat_.Add(other.repeatedFloat_);
}
if (other.repeatedDouble_.Count != 0) {
- base.AddRange(other.repeatedDouble_, result.repeatedDouble_);
+ result.repeatedDouble_.Add(other.repeatedDouble_);
}
if (other.repeatedBool_.Count != 0) {
- base.AddRange(other.repeatedBool_, result.repeatedBool_);
+ result.repeatedBool_.Add(other.repeatedBool_);
}
if (other.repeatedString_.Count != 0) {
- base.AddRange(other.repeatedString_, result.repeatedString_);
+ result.repeatedString_.Add(other.repeatedString_);
}
if (other.repeatedBytes_.Count != 0) {
- base.AddRange(other.repeatedBytes_, result.repeatedBytes_);
+ result.repeatedBytes_.Add(other.repeatedBytes_);
}
if (other.repeatedGroup_.Count != 0) {
- base.AddRange(other.repeatedGroup_, result.repeatedGroup_);
+ result.repeatedGroup_.Add(other.repeatedGroup_);
}
if (other.repeatedNestedMessage_.Count != 0) {
- base.AddRange(other.repeatedNestedMessage_, result.repeatedNestedMessage_);
+ result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_);
}
if (other.repeatedForeignMessage_.Count != 0) {
- base.AddRange(other.repeatedForeignMessage_, result.repeatedForeignMessage_);
+ result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_);
}
if (other.repeatedImportMessage_.Count != 0) {
- base.AddRange(other.repeatedImportMessage_, result.repeatedImportMessage_);
+ result.repeatedImportMessage_.Add(other.repeatedImportMessage_);
}
if (other.repeatedNestedEnum_.Count != 0) {
- base.AddRange(other.repeatedNestedEnum_, result.repeatedNestedEnum_);
+ result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_);
}
if (other.repeatedForeignEnum_.Count != 0) {
- base.AddRange(other.repeatedForeignEnum_, result.repeatedForeignEnum_);
+ result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_);
}
if (other.repeatedImportEnum_.Count != 0) {
- base.AddRange(other.repeatedImportEnum_, result.repeatedImportEnum_);
+ result.repeatedImportEnum_.Add(other.repeatedImportEnum_);
}
if (other.repeatedStringPiece_.Count != 0) {
- base.AddRange(other.repeatedStringPiece_, result.repeatedStringPiece_);
+ result.repeatedStringPiece_.Add(other.repeatedStringPiece_);
}
if (other.repeatedCord_.Count != 0) {
- base.AddRange(other.repeatedCord_, result.repeatedCord_);
+ result.repeatedCord_.Add(other.repeatedCord_);
}
if (other.HasDefaultInt32) {
DefaultInt32 = other.DefaultInt32;
@@ -4433,7 +4433,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedInt32_);
+ result.repeatedInt32_.Add(values);
return this;
}
public Builder ClearRepeatedInt32() {
@@ -4459,7 +4459,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedInt64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedInt64_);
+ result.repeatedInt64_.Add(values);
return this;
}
public Builder ClearRepeatedInt64() {
@@ -4490,7 +4490,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedUint32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.repeatedUint32_);
+ result.repeatedUint32_.Add(values);
return this;
}
public Builder ClearRepeatedUint32() {
@@ -4521,7 +4521,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.repeatedUint64_);
+ result.repeatedUint64_.Add(values);
return this;
}
public Builder ClearRepeatedUint64() {
@@ -4547,7 +4547,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedSint32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedSint32_);
+ result.repeatedSint32_.Add(values);
return this;
}
public Builder ClearRepeatedSint32() {
@@ -4573,7 +4573,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedSint64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedSint64_);
+ result.repeatedSint64_.Add(values);
return this;
}
public Builder ClearRepeatedSint64() {
@@ -4604,7 +4604,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.repeatedFixed32_);
+ result.repeatedFixed32_.Add(values);
return this;
}
public Builder ClearRepeatedFixed32() {
@@ -4635,7 +4635,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.repeatedFixed64_);
+ result.repeatedFixed64_.Add(values);
return this;
}
public Builder ClearRepeatedFixed64() {
@@ -4661,7 +4661,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedSfixed32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedSfixed32_);
+ result.repeatedSfixed32_.Add(values);
return this;
}
public Builder ClearRepeatedSfixed32() {
@@ -4687,7 +4687,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedSfixed64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedSfixed64_);
+ result.repeatedSfixed64_.Add(values);
return this;
}
public Builder ClearRepeatedSfixed64() {
@@ -4713,7 +4713,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedFloat(scg::IEnumerable<float> values) {
- base.AddRange(values, result.repeatedFloat_);
+ result.repeatedFloat_.Add(values);
return this;
}
public Builder ClearRepeatedFloat() {
@@ -4739,7 +4739,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedDouble(scg::IEnumerable<double> values) {
- base.AddRange(values, result.repeatedDouble_);
+ result.repeatedDouble_.Add(values);
return this;
}
public Builder ClearRepeatedDouble() {
@@ -4765,7 +4765,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedBool(scg::IEnumerable<bool> values) {
- base.AddRange(values, result.repeatedBool_);
+ result.repeatedBool_.Add(values);
return this;
}
public Builder ClearRepeatedBool() {
@@ -4793,7 +4793,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedString(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedString_);
+ result.repeatedString_.Add(values);
return this;
}
public Builder ClearRepeatedString() {
@@ -4821,7 +4821,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedBytes(scg::IEnumerable<pb::ByteString> values) {
- base.AddRange(values, result.repeatedBytes_);
+ result.repeatedBytes_.Add(values);
return this;
}
public Builder ClearRepeatedBytes() {
@@ -4859,7 +4859,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedGroup(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup> values) {
- base.AddRange(values, result.repeatedGroup_);
+ result.repeatedGroup_.Add(values);
return this;
}
public Builder ClearRepeatedGroup() {
@@ -4897,7 +4897,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage> values) {
- base.AddRange(values, result.repeatedNestedMessage_);
+ result.repeatedNestedMessage_.Add(values);
return this;
}
public Builder ClearRepeatedNestedMessage() {
@@ -4935,7 +4935,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> values) {
- base.AddRange(values, result.repeatedForeignMessage_);
+ result.repeatedForeignMessage_.Add(values);
return this;
}
public Builder ClearRepeatedForeignMessage() {
@@ -4973,7 +4973,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedImportMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ImportMessage> values) {
- base.AddRange(values, result.repeatedImportMessage_);
+ result.repeatedImportMessage_.Add(values);
return this;
}
public Builder ClearRepeatedImportMessage() {
@@ -4999,7 +4999,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum> values) {
- base.AddRange(values, result.repeatedNestedEnum_);
+ result.repeatedNestedEnum_.Add(values);
return this;
}
public Builder ClearRepeatedNestedEnum() {
@@ -5025,7 +5025,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> values) {
- base.AddRange(values, result.repeatedForeignEnum_);
+ result.repeatedForeignEnum_.Add(values);
return this;
}
public Builder ClearRepeatedForeignEnum() {
@@ -5051,7 +5051,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedImportEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ImportEnum> values) {
- base.AddRange(values, result.repeatedImportEnum_);
+ result.repeatedImportEnum_.Add(values);
return this;
}
public Builder ClearRepeatedImportEnum() {
@@ -5079,7 +5079,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedStringPiece(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedStringPiece_);
+ result.repeatedStringPiece_.Add(values);
return this;
}
public Builder ClearRepeatedStringPiece() {
@@ -5107,7 +5107,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedCord(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedCord_);
+ result.repeatedCord_.Add(values);
return this;
}
public Builder ClearRepeatedCord() {
@@ -8611,7 +8611,7 @@ namespace Google.ProtocolBuffers.TestProtos {
MergeOptionalMessage(other.OptionalMessage);
}
if (other.repeatedMessage_.Count != 0) {
- base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
+ result.repeatedMessage_.Add(other.repeatedMessage_);
}
if (other.HasDummy) {
Dummy = other.Dummy;
@@ -8751,7 +8751,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestRequired> values) {
- base.AddRange(values, result.repeatedMessage_);
+ result.repeatedMessage_.Add(values);
return this;
}
public Builder ClearRepeatedMessage() {
@@ -11868,10 +11868,10 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(NestedMessage other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) return this;
if (other.nestedmessageRepeatedInt32_.Count != 0) {
- base.AddRange(other.nestedmessageRepeatedInt32_, result.nestedmessageRepeatedInt32_);
+ result.nestedmessageRepeatedInt32_.Add(other.nestedmessageRepeatedInt32_);
}
if (other.nestedmessageRepeatedForeignmessage_.Count != 0) {
- base.AddRange(other.nestedmessageRepeatedForeignmessage_, result.nestedmessageRepeatedForeignmessage_);
+ result.nestedmessageRepeatedForeignmessage_.Add(other.nestedmessageRepeatedForeignmessage_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -11952,7 +11952,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeNestedmessageRepeatedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.nestedmessageRepeatedInt32_);
+ result.nestedmessageRepeatedInt32_.Add(values);
return this;
}
public Builder ClearNestedmessageRepeatedInt32() {
@@ -11990,7 +11990,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeNestedmessageRepeatedForeignmessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> values) {
- base.AddRange(values, result.nestedmessageRepeatedForeignmessage_);
+ result.nestedmessageRepeatedForeignmessage_.Add(values);
return this;
}
public Builder ClearNestedmessageRepeatedForeignmessage() {
@@ -12638,22 +12638,22 @@ namespace Google.ProtocolBuffers.TestProtos {
CordField = other.CordField;
}
if (other.repeatedPrimitiveField_.Count != 0) {
- base.AddRange(other.repeatedPrimitiveField_, result.repeatedPrimitiveField_);
+ result.repeatedPrimitiveField_.Add(other.repeatedPrimitiveField_);
}
if (other.repeatedStringField_.Count != 0) {
- base.AddRange(other.repeatedStringField_, result.repeatedStringField_);
+ result.repeatedStringField_.Add(other.repeatedStringField_);
}
if (other.repeatedEnumField_.Count != 0) {
- base.AddRange(other.repeatedEnumField_, result.repeatedEnumField_);
+ result.repeatedEnumField_.Add(other.repeatedEnumField_);
}
if (other.repeatedMessageField_.Count != 0) {
- base.AddRange(other.repeatedMessageField_, result.repeatedMessageField_);
+ result.repeatedMessageField_.Add(other.repeatedMessageField_);
}
if (other.repeatedStringPieceField_.Count != 0) {
- base.AddRange(other.repeatedStringPieceField_, result.repeatedStringPieceField_);
+ result.repeatedStringPieceField_.Add(other.repeatedStringPieceField_);
}
if (other.repeatedCordField_.Count != 0) {
- base.AddRange(other.repeatedCordField_, result.repeatedCordField_);
+ result.repeatedCordField_.Add(other.repeatedCordField_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -12926,7 +12926,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedPrimitiveField(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedPrimitiveField_);
+ result.repeatedPrimitiveField_.Add(values);
return this;
}
public Builder ClearRepeatedPrimitiveField() {
@@ -12954,7 +12954,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedStringField(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedStringField_);
+ result.repeatedStringField_.Add(values);
return this;
}
public Builder ClearRepeatedStringField() {
@@ -12980,7 +12980,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedEnumField(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> values) {
- base.AddRange(values, result.repeatedEnumField_);
+ result.repeatedEnumField_.Add(values);
return this;
}
public Builder ClearRepeatedEnumField() {
@@ -13018,7 +13018,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedMessageField(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignMessage> values) {
- base.AddRange(values, result.repeatedMessageField_);
+ result.repeatedMessageField_.Add(values);
return this;
}
public Builder ClearRepeatedMessageField() {
@@ -13046,7 +13046,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedStringPieceField(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedStringPieceField_);
+ result.repeatedStringPieceField_.Add(values);
return this;
}
public Builder ClearRepeatedStringPieceField() {
@@ -13074,7 +13074,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedCordField(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedCordField_);
+ result.repeatedCordField_.Add(values);
return this;
}
public Builder ClearRepeatedCordField() {
@@ -15409,46 +15409,46 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(TestPackedTypes other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance) return this;
if (other.packedInt32_.Count != 0) {
- base.AddRange(other.packedInt32_, result.packedInt32_);
+ result.packedInt32_.Add(other.packedInt32_);
}
if (other.packedInt64_.Count != 0) {
- base.AddRange(other.packedInt64_, result.packedInt64_);
+ result.packedInt64_.Add(other.packedInt64_);
}
if (other.packedUint32_.Count != 0) {
- base.AddRange(other.packedUint32_, result.packedUint32_);
+ result.packedUint32_.Add(other.packedUint32_);
}
if (other.packedUint64_.Count != 0) {
- base.AddRange(other.packedUint64_, result.packedUint64_);
+ result.packedUint64_.Add(other.packedUint64_);
}
if (other.packedSint32_.Count != 0) {
- base.AddRange(other.packedSint32_, result.packedSint32_);
+ result.packedSint32_.Add(other.packedSint32_);
}
if (other.packedSint64_.Count != 0) {
- base.AddRange(other.packedSint64_, result.packedSint64_);
+ result.packedSint64_.Add(other.packedSint64_);
}
if (other.packedFixed32_.Count != 0) {
- base.AddRange(other.packedFixed32_, result.packedFixed32_);
+ result.packedFixed32_.Add(other.packedFixed32_);
}
if (other.packedFixed64_.Count != 0) {
- base.AddRange(other.packedFixed64_, result.packedFixed64_);
+ result.packedFixed64_.Add(other.packedFixed64_);
}
if (other.packedSfixed32_.Count != 0) {
- base.AddRange(other.packedSfixed32_, result.packedSfixed32_);
+ result.packedSfixed32_.Add(other.packedSfixed32_);
}
if (other.packedSfixed64_.Count != 0) {
- base.AddRange(other.packedSfixed64_, result.packedSfixed64_);
+ result.packedSfixed64_.Add(other.packedSfixed64_);
}
if (other.packedFloat_.Count != 0) {
- base.AddRange(other.packedFloat_, result.packedFloat_);
+ result.packedFloat_.Add(other.packedFloat_);
}
if (other.packedDouble_.Count != 0) {
- base.AddRange(other.packedDouble_, result.packedDouble_);
+ result.packedDouble_.Add(other.packedDouble_);
}
if (other.packedBool_.Count != 0) {
- base.AddRange(other.packedBool_, result.packedBool_);
+ result.packedBool_.Add(other.packedBool_);
}
if (other.packedEnum_.Count != 0) {
- base.AddRange(other.packedEnum_, result.packedEnum_);
+ result.packedEnum_.Add(other.packedEnum_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -15599,7 +15599,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.packedInt32_);
+ result.packedInt32_.Add(values);
return this;
}
public Builder ClearPackedInt32() {
@@ -15625,7 +15625,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedInt64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.packedInt64_);
+ result.packedInt64_.Add(values);
return this;
}
public Builder ClearPackedInt64() {
@@ -15656,7 +15656,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangePackedUint32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.packedUint32_);
+ result.packedUint32_.Add(values);
return this;
}
public Builder ClearPackedUint32() {
@@ -15687,7 +15687,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangePackedUint64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.packedUint64_);
+ result.packedUint64_.Add(values);
return this;
}
public Builder ClearPackedUint64() {
@@ -15713,7 +15713,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedSint32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.packedSint32_);
+ result.packedSint32_.Add(values);
return this;
}
public Builder ClearPackedSint32() {
@@ -15739,7 +15739,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedSint64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.packedSint64_);
+ result.packedSint64_.Add(values);
return this;
}
public Builder ClearPackedSint64() {
@@ -15770,7 +15770,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangePackedFixed32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.packedFixed32_);
+ result.packedFixed32_.Add(values);
return this;
}
public Builder ClearPackedFixed32() {
@@ -15801,7 +15801,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangePackedFixed64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.packedFixed64_);
+ result.packedFixed64_.Add(values);
return this;
}
public Builder ClearPackedFixed64() {
@@ -15827,7 +15827,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedSfixed32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.packedSfixed32_);
+ result.packedSfixed32_.Add(values);
return this;
}
public Builder ClearPackedSfixed32() {
@@ -15853,7 +15853,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedSfixed64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.packedSfixed64_);
+ result.packedSfixed64_.Add(values);
return this;
}
public Builder ClearPackedSfixed64() {
@@ -15879,7 +15879,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedFloat(scg::IEnumerable<float> values) {
- base.AddRange(values, result.packedFloat_);
+ result.packedFloat_.Add(values);
return this;
}
public Builder ClearPackedFloat() {
@@ -15905,7 +15905,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedDouble(scg::IEnumerable<double> values) {
- base.AddRange(values, result.packedDouble_);
+ result.packedDouble_.Add(values);
return this;
}
public Builder ClearPackedDouble() {
@@ -15931,7 +15931,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedBool(scg::IEnumerable<bool> values) {
- base.AddRange(values, result.packedBool_);
+ result.packedBool_.Add(values);
return this;
}
public Builder ClearPackedBool() {
@@ -15957,7 +15957,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> values) {
- base.AddRange(values, result.packedEnum_);
+ result.packedEnum_.Add(values);
return this;
}
public Builder ClearPackedEnum() {
@@ -16444,46 +16444,46 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(TestUnpackedTypes other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance) return this;
if (other.unpackedInt32_.Count != 0) {
- base.AddRange(other.unpackedInt32_, result.unpackedInt32_);
+ result.unpackedInt32_.Add(other.unpackedInt32_);
}
if (other.unpackedInt64_.Count != 0) {
- base.AddRange(other.unpackedInt64_, result.unpackedInt64_);
+ result.unpackedInt64_.Add(other.unpackedInt64_);
}
if (other.unpackedUint32_.Count != 0) {
- base.AddRange(other.unpackedUint32_, result.unpackedUint32_);
+ result.unpackedUint32_.Add(other.unpackedUint32_);
}
if (other.unpackedUint64_.Count != 0) {
- base.AddRange(other.unpackedUint64_, result.unpackedUint64_);
+ result.unpackedUint64_.Add(other.unpackedUint64_);
}
if (other.unpackedSint32_.Count != 0) {
- base.AddRange(other.unpackedSint32_, result.unpackedSint32_);
+ result.unpackedSint32_.Add(other.unpackedSint32_);
}
if (other.unpackedSint64_.Count != 0) {
- base.AddRange(other.unpackedSint64_, result.unpackedSint64_);
+ result.unpackedSint64_.Add(other.unpackedSint64_);
}
if (other.unpackedFixed32_.Count != 0) {
- base.AddRange(other.unpackedFixed32_, result.unpackedFixed32_);
+ result.unpackedFixed32_.Add(other.unpackedFixed32_);
}
if (other.unpackedFixed64_.Count != 0) {
- base.AddRange(other.unpackedFixed64_, result.unpackedFixed64_);
+ result.unpackedFixed64_.Add(other.unpackedFixed64_);
}
if (other.unpackedSfixed32_.Count != 0) {
- base.AddRange(other.unpackedSfixed32_, result.unpackedSfixed32_);
+ result.unpackedSfixed32_.Add(other.unpackedSfixed32_);
}
if (other.unpackedSfixed64_.Count != 0) {
- base.AddRange(other.unpackedSfixed64_, result.unpackedSfixed64_);
+ result.unpackedSfixed64_.Add(other.unpackedSfixed64_);
}
if (other.unpackedFloat_.Count != 0) {
- base.AddRange(other.unpackedFloat_, result.unpackedFloat_);
+ result.unpackedFloat_.Add(other.unpackedFloat_);
}
if (other.unpackedDouble_.Count != 0) {
- base.AddRange(other.unpackedDouble_, result.unpackedDouble_);
+ result.unpackedDouble_.Add(other.unpackedDouble_);
}
if (other.unpackedBool_.Count != 0) {
- base.AddRange(other.unpackedBool_, result.unpackedBool_);
+ result.unpackedBool_.Add(other.unpackedBool_);
}
if (other.unpackedEnum_.Count != 0) {
- base.AddRange(other.unpackedEnum_, result.unpackedEnum_);
+ result.unpackedEnum_.Add(other.unpackedEnum_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -16634,7 +16634,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.unpackedInt32_);
+ result.unpackedInt32_.Add(values);
return this;
}
public Builder ClearUnpackedInt32() {
@@ -16660,7 +16660,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedInt64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.unpackedInt64_);
+ result.unpackedInt64_.Add(values);
return this;
}
public Builder ClearUnpackedInt64() {
@@ -16691,7 +16691,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeUnpackedUint32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.unpackedUint32_);
+ result.unpackedUint32_.Add(values);
return this;
}
public Builder ClearUnpackedUint32() {
@@ -16722,7 +16722,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeUnpackedUint64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.unpackedUint64_);
+ result.unpackedUint64_.Add(values);
return this;
}
public Builder ClearUnpackedUint64() {
@@ -16748,7 +16748,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedSint32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.unpackedSint32_);
+ result.unpackedSint32_.Add(values);
return this;
}
public Builder ClearUnpackedSint32() {
@@ -16774,7 +16774,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedSint64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.unpackedSint64_);
+ result.unpackedSint64_.Add(values);
return this;
}
public Builder ClearUnpackedSint64() {
@@ -16805,7 +16805,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeUnpackedFixed32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.unpackedFixed32_);
+ result.unpackedFixed32_.Add(values);
return this;
}
public Builder ClearUnpackedFixed32() {
@@ -16836,7 +16836,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeUnpackedFixed64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.unpackedFixed64_);
+ result.unpackedFixed64_.Add(values);
return this;
}
public Builder ClearUnpackedFixed64() {
@@ -16862,7 +16862,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedSfixed32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.unpackedSfixed32_);
+ result.unpackedSfixed32_.Add(values);
return this;
}
public Builder ClearUnpackedSfixed32() {
@@ -16888,7 +16888,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedSfixed64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.unpackedSfixed64_);
+ result.unpackedSfixed64_.Add(values);
return this;
}
public Builder ClearUnpackedSfixed64() {
@@ -16914,7 +16914,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedFloat(scg::IEnumerable<float> values) {
- base.AddRange(values, result.unpackedFloat_);
+ result.unpackedFloat_.Add(values);
return this;
}
public Builder ClearUnpackedFloat() {
@@ -16940,7 +16940,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedDouble(scg::IEnumerable<double> values) {
- base.AddRange(values, result.unpackedDouble_);
+ result.unpackedDouble_.Add(values);
return this;
}
public Builder ClearUnpackedDouble() {
@@ -16966,7 +16966,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedBool(scg::IEnumerable<bool> values) {
- base.AddRange(values, result.unpackedBool_);
+ result.unpackedBool_.Add(values);
return this;
}
public Builder ClearUnpackedBool() {
@@ -16992,7 +16992,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeUnpackedEnum(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.ForeignEnum> values) {
- base.AddRange(values, result.unpackedEnum_);
+ result.unpackedEnum_.Add(values);
return this;
}
public Builder ClearUnpackedEnum() {
@@ -17956,10 +17956,10 @@ namespace Google.ProtocolBuffers.TestProtos {
MergeDynamicMessageExtension(other.DynamicMessageExtension);
}
if (other.repeatedExtension_.Count != 0) {
- base.AddRange(other.repeatedExtension_, result.repeatedExtension_);
+ result.repeatedExtension_.Add(other.repeatedExtension_);
}
if (other.packedExtension_.Count != 0) {
- base.AddRange(other.packedExtension_, result.packedExtension_);
+ result.packedExtension_.Add(other.packedExtension_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -18216,7 +18216,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedExtension(scg::IEnumerable<string> values) {
- base.AddRange(values, result.repeatedExtension_);
+ result.repeatedExtension_.Add(values);
return this;
}
public Builder ClearRepeatedExtension() {
@@ -18242,7 +18242,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangePackedExtension(scg::IEnumerable<int> values) {
- base.AddRange(values, result.packedExtension_);
+ result.packedExtension_.Add(values);
return this;
}
public Builder ClearPackedExtension() {
@@ -18541,22 +18541,22 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(TestRepeatedScalarDifferentTagSizes other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance) return this;
if (other.repeatedFixed32_.Count != 0) {
- base.AddRange(other.repeatedFixed32_, result.repeatedFixed32_);
+ result.repeatedFixed32_.Add(other.repeatedFixed32_);
}
if (other.repeatedInt32_.Count != 0) {
- base.AddRange(other.repeatedInt32_, result.repeatedInt32_);
+ result.repeatedInt32_.Add(other.repeatedInt32_);
}
if (other.repeatedFixed64_.Count != 0) {
- base.AddRange(other.repeatedFixed64_, result.repeatedFixed64_);
+ result.repeatedFixed64_.Add(other.repeatedFixed64_);
}
if (other.repeatedInt64_.Count != 0) {
- base.AddRange(other.repeatedInt64_, result.repeatedInt64_);
+ result.repeatedInt64_.Add(other.repeatedInt64_);
}
if (other.repeatedFloat_.Count != 0) {
- base.AddRange(other.repeatedFloat_, result.repeatedFloat_);
+ result.repeatedFloat_.Add(other.repeatedFloat_);
}
if (other.repeatedUint64_.Count != 0) {
- base.AddRange(other.repeatedUint64_, result.repeatedUint64_);
+ result.repeatedUint64_.Add(other.repeatedUint64_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -18663,7 +18663,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedFixed32(scg::IEnumerable<uint> values) {
- base.AddRange(values, result.repeatedFixed32_);
+ result.repeatedFixed32_.Add(values);
return this;
}
public Builder ClearRepeatedFixed32() {
@@ -18689,7 +18689,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedInt32(scg::IEnumerable<int> values) {
- base.AddRange(values, result.repeatedInt32_);
+ result.repeatedInt32_.Add(values);
return this;
}
public Builder ClearRepeatedInt32() {
@@ -18720,7 +18720,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedFixed64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.repeatedFixed64_);
+ result.repeatedFixed64_.Add(values);
return this;
}
public Builder ClearRepeatedFixed64() {
@@ -18746,7 +18746,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedInt64(scg::IEnumerable<long> values) {
- base.AddRange(values, result.repeatedInt64_);
+ result.repeatedInt64_.Add(values);
return this;
}
public Builder ClearRepeatedInt64() {
@@ -18772,7 +18772,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeRepeatedFloat(scg::IEnumerable<float> values) {
- base.AddRange(values, result.repeatedFloat_);
+ result.repeatedFloat_.Add(values);
return this;
}
public Builder ClearRepeatedFloat() {
@@ -18803,7 +18803,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
[global::System.CLSCompliant(false)]
public Builder AddRangeRepeatedUint64(scg::IEnumerable<ulong> values) {
- base.AddRange(values, result.repeatedUint64_);
+ result.repeatedUint64_.Add(values);
return this;
}
public Builder ClearRepeatedUint64() {
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
index ae309fa7..9863025f 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
@@ -245,7 +245,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(SearchRequest other) {
if (other == global::Google.ProtocolBuffers.TestProtos.SearchRequest.DefaultInstance) return this;
if (other.criteria_.Count != 0) {
- base.AddRange(other.criteria_, result.criteria_);
+ result.criteria_.Add(other.criteria_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -323,7 +323,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeCriteria(scg::IEnumerable<string> values) {
- base.AddRange(values, result.criteria_);
+ result.criteria_.Add(values);
return this;
}
public Builder ClearCriteria() {
@@ -791,7 +791,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(SearchResponse other) {
if (other == global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance) return this;
if (other.results_.Count != 0) {
- base.AddRange(other.results_, result.results_);
+ result.results_.Add(other.results_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
@@ -879,7 +879,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeResults(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem> values) {
- base.AddRange(values, result.results_);
+ result.results_.Add(values);
return this;
}
public Builder ClearResults() {
@@ -1076,7 +1076,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(RefineSearchRequest other) {
if (other == global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.DefaultInstance) return this;
if (other.criteria_.Count != 0) {
- base.AddRange(other.criteria_, result.criteria_);
+ result.criteria_.Add(other.criteria_);
}
if (other.HasPreviousResults) {
MergePreviousResults(other.PreviousResults);
@@ -1166,7 +1166,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeCriteria(scg::IEnumerable<string> values) {
- base.AddRange(values, result.criteria_);
+ result.criteria_.Add(values);
return this;
}
public Builder ClearCriteria() {
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
index 3d818a60..3221ba1c 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
@@ -318,7 +318,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(TestXmlChild other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) return this;
if (other.options_.Count != 0) {
- base.AddRange(other.options_, result.options_);
+ result.options_.Add(other.options_);
}
if (other.HasBinary) {
Binary = other.Binary;
@@ -411,7 +411,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeOptions(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.EnumOptions> values) {
- base.AddRange(values, result.options_);
+ result.options_.Add(values);
return this;
}
public Builder ClearOptions() {
@@ -1119,7 +1119,7 @@ namespace Google.ProtocolBuffers.TestProtos {
public override Builder MergeFrom(Children other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance) return this;
if (other.options_.Count != 0) {
- base.AddRange(other.options_, result.options_);
+ result.options_.Add(other.options_);
}
if (other.HasBinary) {
Binary = other.Binary;
@@ -1212,7 +1212,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeOptions(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.EnumOptions> values) {
- base.AddRange(values, result.options_);
+ result.options_.Add(values);
return this;
}
public Builder ClearOptions() {
@@ -1500,13 +1500,13 @@ namespace Google.ProtocolBuffers.TestProtos {
Number = other.Number;
}
if (other.numbers_.Count != 0) {
- base.AddRange(other.numbers_, result.numbers_);
+ result.numbers_.Add(other.numbers_);
}
if (other.HasText) {
Text = other.Text;
}
if (other.textlines_.Count != 0) {
- base.AddRange(other.textlines_, result.textlines_);
+ result.textlines_.Add(other.textlines_);
}
if (other.HasValid) {
Valid = other.Valid;
@@ -1515,7 +1515,7 @@ namespace Google.ProtocolBuffers.TestProtos {
MergeChild(other.Child);
}
if (other.children_.Count != 0) {
- base.AddRange(other.children_, result.children_);
+ result.children_.Add(other.children_);
}
this.MergeExtensionFields(other);
this.MergeUnknownFields(other.UnknownFields);
@@ -1640,7 +1640,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeNumbers(scg::IEnumerable<int> values) {
- base.AddRange(values, result.numbers_);
+ result.numbers_.Add(values);
return this;
}
public Builder ClearNumbers() {
@@ -1687,7 +1687,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeTextlines(scg::IEnumerable<string> values) {
- base.AddRange(values, result.textlines_);
+ result.textlines_.Add(values);
return this;
}
public Builder ClearTextlines() {
@@ -1779,7 +1779,7 @@ namespace Google.ProtocolBuffers.TestProtos {
return this;
}
public Builder AddRangeChildren(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children> values) {
- base.AddRange(values, result.children_);
+ result.children_.Add(values);
return this;
}
public Builder ClearChildren() {