From 487da48ad2c88d7c07451c546c3541d7db7ceae6 Mon Sep 17 00:00:00 2001 From: csharptest Date: Sun, 7 Nov 2010 18:49:42 -0600 Subject: [PATCH] Fix for repeated extensions. --- src/ProtoGen/ExtensionGenerator.cs | 8 +- src/ProtocolBuffers/EnumLite.cs | 4 +- src/ProtocolBuffers/GeneratedExtensionLite.cs | 64 +++--- src/ProtocolBuffersLite.Test/LiteTest.cs | 18 +- .../TestProtos/UnitTestLiteProtoFile.cs | 190 +++++++----------- 5 files changed, 123 insertions(+), 161 deletions(-) diff --git a/src/ProtoGen/ExtensionGenerator.cs b/src/ProtoGen/ExtensionGenerator.cs index 214e56d5bd..108f1a734c 100644 --- a/src/ProtoGen/ExtensionGenerator.cs +++ b/src/ProtoGen/ExtensionGenerator.cs @@ -73,7 +73,8 @@ namespace Google.ProtocolBuffers.ProtoGen { if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) { writer.WriteLine("[global::System.CLSCompliant(false)]"); } - writer.WriteLine("{0} static pb::GeneratedExtensionLite<{1}, {2}> {3};", ClassAccessLevel, extends, type, name); + writer.WriteLine("{0} static pb::{4}<{1}, {2}> {3};", ClassAccessLevel, extends, type, name, + Descriptor.IsRepeated ? "GeneratedRepeatExtensionLite" : "GeneratedExtensionLite"); } else if (Descriptor.IsRepeated) { if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) { writer.WriteLine("[global::System.CLSCompliant(false)]"); @@ -91,10 +92,11 @@ namespace Google.ProtocolBuffers.ProtoGen { if (UseLiteRuntime) { writer.WriteLine("{0}.{1} = ", scope, name); writer.Indent(); - writer.WriteLine("new pb::GeneratedExtensionLite<{0}, {1}>(", extends, type); + writer.WriteLine("new pb::{0}<{1}, {2}>(", Descriptor.IsRepeated ? "GeneratedRepeatExtensionLite" : "GeneratedExtensionLite", extends, type); writer.Indent(); writer.WriteLine("{0}.DefaultInstance,", extends); - writer.WriteLine("{0},", Descriptor.HasDefaultValue ? DefaultValue : IsNullableType ? "null" : "default(" + type + ")"); + if(!Descriptor.IsRepeated) + writer.WriteLine("{0},", Descriptor.HasDefaultValue ? DefaultValue : IsNullableType ? "null" : "default(" + type + ")"); writer.WriteLine("{0},", (Descriptor.MappedType == MappedType.Message) ? type + ".DefaultInstance" : "null"); writer.WriteLine("{0},", (Descriptor.MappedType == MappedType.Enum) ? "new EnumLiteMap<" + type + ">()" : "null"); writer.WriteLine("{0},", Descriptor.Index); diff --git a/src/ProtocolBuffers/EnumLite.cs b/src/ProtocolBuffers/EnumLite.cs index a408fd43ef..0418d77ebc 100644 --- a/src/ProtocolBuffers/EnumLite.cs +++ b/src/ProtocolBuffers/EnumLite.cs @@ -66,7 +66,7 @@ namespace Google.ProtocolBuffers { } public class EnumLiteMap : IEnumLiteMap - where TEnum : struct, IComparable, IFormattable, IConvertible { + where TEnum : struct, IComparable, IFormattable { struct EnumValue : IEnumLite, IComparable { int _value; @@ -86,7 +86,7 @@ namespace Google.ProtocolBuffers { public EnumLiteMap() { items = new SortedList(); foreach (TEnum evalue in Enum.GetValues(typeof(TEnum))) - items.Add(evalue.ToInt32(CultureInfo.InvariantCulture), new EnumValue(evalue.ToInt32(CultureInfo.InvariantCulture))); + items.Add(Convert.ToInt32(evalue), new EnumValue(Convert.ToInt32(evalue))); } IEnumLite IEnumLiteMap.FindValueByNumber(int number) { diff --git a/src/ProtocolBuffers/GeneratedExtensionLite.cs b/src/ProtocolBuffers/GeneratedExtensionLite.cs index c2ba5627ce..87009cf8c4 100644 --- a/src/ProtocolBuffers/GeneratedExtensionLite.cs +++ b/src/ProtocolBuffers/GeneratedExtensionLite.cs @@ -126,7 +126,32 @@ namespace Google.ProtocolBuffers { return FieldNumber.CompareTo(other.FieldNumber); } } - + + public class GeneratedRepeatExtensionLite : GeneratedExtensionLite> + where TContainingType : IMessageLite { + public GeneratedRepeatExtensionLite(TContainingType containingTypeDefaultInstance, + IMessageLite messageDefaultInstance, IEnumLiteMap enumTypeMap, int number, FieldType type, bool isPacked) : + base(containingTypeDefaultInstance, new List(), messageDefaultInstance, enumTypeMap, number, type, isPacked) { + } + + public override object ToReflectionType(object value) { + IList result = new List(); + foreach (object element in (IEnumerable)value) { + result.Add((TExtensionType)SingularToReflectionType(element)); + } + return result; + } + + public override object FromReflectionType(object value) { + // Must convert the whole list. + List result = new List(); + foreach (object element in (IEnumerable)value) { + result.Add((TExtensionType)SingularFromReflectionType(element)); + } + return result; + } + } + public class GeneratedExtensionLite : IGeneratedExtensionLite where TContainingType : IMessageLite { @@ -166,8 +191,8 @@ namespace Google.ProtocolBuffers { false /* isRepeated */, false /* isPacked */)) { } - /** For use by generated code only. */ - public GeneratedExtensionLite( + /** Repeating fields: For use by generated code only. */ + protected GeneratedExtensionLite( TContainingType containingTypeDefaultInstance, TExtensionType defaultValue, IMessageLite messageDefaultInstance, @@ -231,48 +256,21 @@ namespace Google.ProtocolBuffers { /// for enums use EnumValueDescriptors but the native accessors use /// the generated enum type. /// - public object ToReflectionType(object value) { - if (descriptor.IsRepeated) { - if (descriptor.MappedType == MappedType.Enum) { - // Must convert the whole list. - IList result = new List(); - foreach (object element in (IEnumerable)value) { - result.Add(SingularToReflectionType(element)); - } - return result; - } else { - return value; - } - } else { + public virtual object ToReflectionType(object value) { return SingularToReflectionType(value); - } } /// /// Like ToReflectionType(object) but for a single element. /// - internal Object SingularToReflectionType(object value) { + public object SingularToReflectionType(object value) { return descriptor.MappedType == MappedType.Enum ? descriptor.EnumType.FindValueByNumber((int)value) : value; } - public object FromReflectionType(object value) { - if (descriptor.IsRepeated) { - if (Descriptor.MappedType == MappedType.Message || - Descriptor.MappedType == MappedType.Enum) { - // Must convert the whole list. - List result = new List(); - foreach (object element in (IEnumerable)value) { - result.Add((TExtensionType)SingularFromReflectionType(element)); - } - return result; - } else { - return value; - } - } else { + public virtual object FromReflectionType(object value) { return SingularFromReflectionType(value); - } } public object SingularFromReflectionType(object value) { diff --git a/src/ProtocolBuffersLite.Test/LiteTest.cs b/src/ProtocolBuffersLite.Test/LiteTest.cs index 632f6f46a6..df26053dbb 100644 --- a/src/ProtocolBuffersLite.Test/LiteTest.cs +++ b/src/ProtocolBuffersLite.Test/LiteTest.cs @@ -32,6 +32,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; +using System.Collections.Generic; using System.IO; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; @@ -81,8 +83,7 @@ namespace Google.ProtocolBuffers { TestAllExtensionsLite message = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 123) -#warning broken -// .AddExtension(UnitTestLiteProtoFile.RepeatedStringExtensionLite, "hello") + .AddExtension(UnitTestLiteProtoFile.RepeatedStringExtensionLite, "hello") .SetExtension(UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite, TestAllTypesLite.Types.NestedEnum.BAZ) .SetExtension(UnitTestLiteProtoFile.OptionalNestedMessageExtensionLite, @@ -96,13 +97,12 @@ namespace Google.ProtocolBuffers { Assert.AreEqual(123, (int)message2.GetExtension( UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); -#warning broken type infrence - //Assert.AreEqual(1, message2.GetExtensionCount( - // UnitTestLiteProtoFile.RepeatedStringExtensionLite)); - //Assert.AreEqual(1, message2.GetExtension( - // UnitTestLiteProtoFile.RepeatedStringExtensionLite, 0)); - //Assert.AreEqual("hello", message2.GetExtension( - // UnitTestLiteProtoFile.RepeatedStringExtensionLite, 0)); + Assert.AreEqual(1, message2.GetExtensionCount( + UnitTestLiteProtoFile.RepeatedStringExtensionLite)); + Assert.AreEqual(1, message2.GetExtension( + UnitTestLiteProtoFile.RepeatedStringExtensionLite).Count); + Assert.AreEqual("hello", message2.GetExtension( + UnitTestLiteProtoFile.RepeatedStringExtensionLite, 0)); Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension( UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite)); Assert.AreEqual(7, message2.GetExtension( diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs index 52f0ad5aac..3808e6b31d 100644 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs +++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs @@ -149,57 +149,57 @@ namespace Google.ProtocolBuffers.TestProtos { public const int OptionalCordExtensionLiteFieldNumber = 25; public static pb::GeneratedExtensionLite OptionalCordExtensionLite; public const int RepeatedInt32ExtensionLiteFieldNumber = 31; - public static pb::GeneratedExtensionLite RepeatedInt32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedInt32ExtensionLite; public const int RepeatedInt64ExtensionLiteFieldNumber = 32; - public static pb::GeneratedExtensionLite RepeatedInt64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedInt64ExtensionLite; public const int RepeatedUint32ExtensionLiteFieldNumber = 33; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite RepeatedUint32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedUint32ExtensionLite; public const int RepeatedUint64ExtensionLiteFieldNumber = 34; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite RepeatedUint64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedUint64ExtensionLite; public const int RepeatedSint32ExtensionLiteFieldNumber = 35; - public static pb::GeneratedExtensionLite RepeatedSint32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedSint32ExtensionLite; public const int RepeatedSint64ExtensionLiteFieldNumber = 36; - public static pb::GeneratedExtensionLite RepeatedSint64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedSint64ExtensionLite; public const int RepeatedFixed32ExtensionLiteFieldNumber = 37; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite RepeatedFixed32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedFixed32ExtensionLite; public const int RepeatedFixed64ExtensionLiteFieldNumber = 38; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite RepeatedFixed64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedFixed64ExtensionLite; public const int RepeatedSfixed32ExtensionLiteFieldNumber = 39; - public static pb::GeneratedExtensionLite RepeatedSfixed32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedSfixed32ExtensionLite; public const int RepeatedSfixed64ExtensionLiteFieldNumber = 40; - public static pb::GeneratedExtensionLite RepeatedSfixed64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedSfixed64ExtensionLite; public const int RepeatedFloatExtensionLiteFieldNumber = 41; - public static pb::GeneratedExtensionLite RepeatedFloatExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedFloatExtensionLite; public const int RepeatedDoubleExtensionLiteFieldNumber = 42; - public static pb::GeneratedExtensionLite RepeatedDoubleExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedDoubleExtensionLite; public const int RepeatedBoolExtensionLiteFieldNumber = 43; - public static pb::GeneratedExtensionLite RepeatedBoolExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedBoolExtensionLite; public const int RepeatedStringExtensionLiteFieldNumber = 44; - public static pb::GeneratedExtensionLite RepeatedStringExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedStringExtensionLite; public const int RepeatedBytesExtensionLiteFieldNumber = 45; - public static pb::GeneratedExtensionLite RepeatedBytesExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedBytesExtensionLite; public const int RepeatedGroupExtensionLiteFieldNumber = 46; - public static pb::GeneratedExtensionLite RepeatedGroupExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedGroupExtensionLite; public const int RepeatedNestedMessageExtensionLiteFieldNumber = 48; - public static pb::GeneratedExtensionLite RepeatedNestedMessageExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedNestedMessageExtensionLite; public const int RepeatedForeignMessageExtensionLiteFieldNumber = 49; - public static pb::GeneratedExtensionLite RepeatedForeignMessageExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedForeignMessageExtensionLite; public const int RepeatedImportMessageExtensionLiteFieldNumber = 50; - public static pb::GeneratedExtensionLite RepeatedImportMessageExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedImportMessageExtensionLite; public const int RepeatedNestedEnumExtensionLiteFieldNumber = 51; - public static pb::GeneratedExtensionLite RepeatedNestedEnumExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedNestedEnumExtensionLite; public const int RepeatedForeignEnumExtensionLiteFieldNumber = 52; - public static pb::GeneratedExtensionLite RepeatedForeignEnumExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedForeignEnumExtensionLite; public const int RepeatedImportEnumExtensionLiteFieldNumber = 53; - public static pb::GeneratedExtensionLite RepeatedImportEnumExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedImportEnumExtensionLite; public const int RepeatedStringPieceExtensionLiteFieldNumber = 54; - public static pb::GeneratedExtensionLite RepeatedStringPieceExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedStringPieceExtensionLite; public const int RepeatedCordExtensionLiteFieldNumber = 55; - public static pb::GeneratedExtensionLite RepeatedCordExtensionLite; + public static pb::GeneratedRepeatExtensionLite RepeatedCordExtensionLite; public const int DefaultInt32ExtensionLiteFieldNumber = 61; public static pb::GeneratedExtensionLite DefaultInt32ExtensionLite; public const int DefaultInt64ExtensionLiteFieldNumber = 62; @@ -245,37 +245,37 @@ namespace Google.ProtocolBuffers.TestProtos { public const int DefaultCordExtensionLiteFieldNumber = 85; public static pb::GeneratedExtensionLite DefaultCordExtensionLite; public const int PackedInt32ExtensionLiteFieldNumber = 90; - public static pb::GeneratedExtensionLite PackedInt32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedInt32ExtensionLite; public const int PackedInt64ExtensionLiteFieldNumber = 91; - public static pb::GeneratedExtensionLite PackedInt64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedInt64ExtensionLite; public const int PackedUint32ExtensionLiteFieldNumber = 92; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite PackedUint32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedUint32ExtensionLite; public const int PackedUint64ExtensionLiteFieldNumber = 93; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite PackedUint64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedUint64ExtensionLite; public const int PackedSint32ExtensionLiteFieldNumber = 94; - public static pb::GeneratedExtensionLite PackedSint32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedSint32ExtensionLite; public const int PackedSint64ExtensionLiteFieldNumber = 95; - public static pb::GeneratedExtensionLite PackedSint64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedSint64ExtensionLite; public const int PackedFixed32ExtensionLiteFieldNumber = 96; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite PackedFixed32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedFixed32ExtensionLite; public const int PackedFixed64ExtensionLiteFieldNumber = 97; [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite PackedFixed64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedFixed64ExtensionLite; public const int PackedSfixed32ExtensionLiteFieldNumber = 98; - public static pb::GeneratedExtensionLite PackedSfixed32ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedSfixed32ExtensionLite; public const int PackedSfixed64ExtensionLiteFieldNumber = 99; - public static pb::GeneratedExtensionLite PackedSfixed64ExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedSfixed64ExtensionLite; public const int PackedFloatExtensionLiteFieldNumber = 100; - public static pb::GeneratedExtensionLite PackedFloatExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedFloatExtensionLite; public const int PackedDoubleExtensionLiteFieldNumber = 101; - public static pb::GeneratedExtensionLite PackedDoubleExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedDoubleExtensionLite; public const int PackedBoolExtensionLiteFieldNumber = 102; - public static pb::GeneratedExtensionLite PackedBoolExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedBoolExtensionLite; public const int PackedEnumExtensionLiteFieldNumber = 103; - public static pb::GeneratedExtensionLite PackedEnumExtensionLite; + public static pb::GeneratedRepeatExtensionLite PackedEnumExtensionLite; #endregion #region Static variables @@ -485,218 +485,194 @@ namespace Google.ProtocolBuffers.TestProtos { 23, pbd::FieldType.String); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), null, null, 24, pbd::FieldType.Int32, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(long), null, null, 25, pbd::FieldType.Int64, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(uint), null, null, 26, pbd::FieldType.UInt32, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(ulong), null, null, 27, pbd::FieldType.UInt64, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), null, null, 28, pbd::FieldType.SInt32, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(long), null, null, 29, pbd::FieldType.SInt64, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(uint), null, null, 30, pbd::FieldType.Fixed32, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(ulong), null, null, 31, pbd::FieldType.Fixed64, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), null, null, 32, pbd::FieldType.SFixed32, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(long), null, null, 33, pbd::FieldType.SFixed64, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFloatExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(float), null, null, 34, pbd::FieldType.Float, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedDoubleExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(double), null, null, 35, pbd::FieldType.Double, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBoolExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(bool), null, null, 36, pbd::FieldType.Bool, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, null, null, - null, 37, pbd::FieldType.String, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBytesExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, null, null, - null, 38, pbd::FieldType.Bytes, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedGroupExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension_lite.DefaultInstance, null, 39, pbd::FieldType.Group, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedMessageExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance, null, 40, pbd::FieldType.Message, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignMessageExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance, null, 41, pbd::FieldType.Message, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportMessageExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance, null, 42, pbd::FieldType.Message, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedEnumExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum), null, new EnumLiteMap(), 43, pbd::FieldType.Enum, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite), null, new EnumLiteMap(), 44, pbd::FieldType.Enum, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportEnumExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.ImportEnumLite), null, new EnumLiteMap(), 45, pbd::FieldType.Enum, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringPieceExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, null, null, - null, 46, pbd::FieldType.String, false); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedCordExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, null, null, - null, 47, pbd::FieldType.String, false); @@ -861,126 +837,112 @@ namespace Google.ProtocolBuffers.TestProtos { 67, pbd::FieldType.String); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(int), null, null, 68, pbd::FieldType.Int32, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(long), null, null, 69, pbd::FieldType.Int64, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(uint), null, null, 70, pbd::FieldType.UInt32, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(ulong), null, null, 71, pbd::FieldType.UInt64, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(int), null, null, 72, pbd::FieldType.SInt32, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(long), null, null, 73, pbd::FieldType.SInt64, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(uint), null, null, 74, pbd::FieldType.Fixed32, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(ulong), null, null, 75, pbd::FieldType.Fixed64, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed32ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(int), null, null, 76, pbd::FieldType.SFixed32, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed64ExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(long), null, null, 77, pbd::FieldType.SFixed64, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFloatExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(float), null, null, 78, pbd::FieldType.Float, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedDoubleExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(double), null, null, 79, pbd::FieldType.Double, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedBoolExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(bool), null, null, 80, pbd::FieldType.Bool, true); global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedEnumExtensionLite = - new pb::GeneratedExtensionLite( + new pb::GeneratedRepeatExtensionLite( global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite), null, new EnumLiteMap(), 81,