Commit 4ca46ede authored by Sydney Acksman's avatar Sydney Acksman Committed by Jie Luo

Write messages to backing field in generated C# cloning code (#4440)

* Edited MessageFieldGenerator to clone to backing field instead of property

* Generated C# proto code
parent 0dc4d75d
...@@ -78,7 +78,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -78,7 +78,7 @@ namespace Google.Protobuf.Examples.AddressBook {
id_ = other.id_; id_ = other.id_;
email_ = other.email_; email_ = other.email_;
phones_ = other.phones_.Clone(); phones_ = other.phones_.Clone();
LastUpdated = other.lastUpdated_ != null ? other.LastUpdated.Clone() : null; lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -642,7 +642,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -642,7 +642,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestMapSubmessage(TestMapSubmessage other) : this() { public TestMapSubmessage(TestMapSubmessage other) : this() {
TestMap = other.testMap_ != null ? other.TestMap.Clone() : null; testMap_ = other.testMap_ != null ? other.testMap_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -273,13 +273,13 @@ namespace ProtobufTestMessages.Proto3 { ...@@ -273,13 +273,13 @@ namespace ProtobufTestMessages.Proto3 {
optionalBool_ = other.optionalBool_; optionalBool_ = other.optionalBool_;
optionalString_ = other.optionalString_; optionalString_ = other.optionalString_;
optionalBytes_ = other.optionalBytes_; optionalBytes_ = other.optionalBytes_;
OptionalNestedMessage = other.optionalNestedMessage_ != null ? other.OptionalNestedMessage.Clone() : null; optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null;
OptionalForeignMessage = other.optionalForeignMessage_ != null ? other.OptionalForeignMessage.Clone() : null; optionalForeignMessage_ = other.optionalForeignMessage_ != null ? other.optionalForeignMessage_.Clone() : null;
optionalNestedEnum_ = other.optionalNestedEnum_; optionalNestedEnum_ = other.optionalNestedEnum_;
optionalForeignEnum_ = other.optionalForeignEnum_; optionalForeignEnum_ = other.optionalForeignEnum_;
optionalStringPiece_ = other.optionalStringPiece_; optionalStringPiece_ = other.optionalStringPiece_;
optionalCord_ = other.optionalCord_; optionalCord_ = other.optionalCord_;
RecursiveMessage = other.recursiveMessage_ != null ? other.RecursiveMessage.Clone() : null; recursiveMessage_ = other.recursiveMessage_ != null ? other.recursiveMessage_.Clone() : null;
repeatedInt32_ = other.repeatedInt32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone();
repeatedInt64_ = other.repeatedInt64_.Clone(); repeatedInt64_ = other.repeatedInt64_.Clone();
repeatedUint32_ = other.repeatedUint32_.Clone(); repeatedUint32_ = other.repeatedUint32_.Clone();
...@@ -338,12 +338,12 @@ namespace ProtobufTestMessages.Proto3 { ...@@ -338,12 +338,12 @@ namespace ProtobufTestMessages.Proto3 {
repeatedDoubleWrapper_ = other.repeatedDoubleWrapper_.Clone(); repeatedDoubleWrapper_ = other.repeatedDoubleWrapper_.Clone();
repeatedStringWrapper_ = other.repeatedStringWrapper_.Clone(); repeatedStringWrapper_ = other.repeatedStringWrapper_.Clone();
repeatedBytesWrapper_ = other.repeatedBytesWrapper_.Clone(); repeatedBytesWrapper_ = other.repeatedBytesWrapper_.Clone();
OptionalDuration = other.optionalDuration_ != null ? other.OptionalDuration.Clone() : null; optionalDuration_ = other.optionalDuration_ != null ? other.optionalDuration_.Clone() : null;
OptionalTimestamp = other.optionalTimestamp_ != null ? other.OptionalTimestamp.Clone() : null; optionalTimestamp_ = other.optionalTimestamp_ != null ? other.optionalTimestamp_.Clone() : null;
OptionalFieldMask = other.optionalFieldMask_ != null ? other.OptionalFieldMask.Clone() : null; optionalFieldMask_ = other.optionalFieldMask_ != null ? other.optionalFieldMask_.Clone() : null;
OptionalStruct = other.optionalStruct_ != null ? other.OptionalStruct.Clone() : null; optionalStruct_ = other.optionalStruct_ != null ? other.optionalStruct_.Clone() : null;
OptionalAny = other.optionalAny_ != null ? other.OptionalAny.Clone() : null; optionalAny_ = other.optionalAny_ != null ? other.optionalAny_.Clone() : null;
OptionalValue = other.optionalValue_ != null ? other.OptionalValue.Clone() : null; optionalValue_ = other.optionalValue_ != null ? other.optionalValue_.Clone() : null;
repeatedDuration_ = other.repeatedDuration_.Clone(); repeatedDuration_ = other.repeatedDuration_.Clone();
repeatedTimestamp_ = other.repeatedTimestamp_.Clone(); repeatedTimestamp_ = other.repeatedTimestamp_.Clone();
repeatedFieldmask_ = other.repeatedFieldmask_.Clone(); repeatedFieldmask_ = other.repeatedFieldmask_.Clone();
...@@ -3455,7 +3455,7 @@ namespace ProtobufTestMessages.Proto3 { ...@@ -3455,7 +3455,7 @@ namespace ProtobufTestMessages.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedMessage(NestedMessage other) : this() { public NestedMessage(NestedMessage other) : this() {
a_ = other.a_; a_ = other.a_;
Corecursive = other.corecursive_ != null ? other.Corecursive.Clone() : null; corecursive_ = other.corecursive_ != null ? other.corecursive_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -1740,9 +1740,9 @@ namespace UnitTest.Issues.TestProtos { ...@@ -1740,9 +1740,9 @@ namespace UnitTest.Issues.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ComplexOptionType2(ComplexOptionType2 other) : this() { public ComplexOptionType2(ComplexOptionType2 other) : this() {
Bar = other.bar_ != null ? other.Bar.Clone() : null; bar_ = other.bar_ != null ? other.bar_.Clone() : null;
baz_ = other.baz_; baz_ = other.baz_;
Fred = other.fred_ != null ? other.Fred.Clone() : null; fred_ = other.fred_ != null ? other.fred_.Clone() : null;
barney_ = other.barney_.Clone(); barney_ = other.barney_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2331,7 +2331,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -2331,7 +2331,7 @@ namespace UnitTest.Issues.TestProtos {
public Aggregate(Aggregate other) : this() { public Aggregate(Aggregate other) : this() {
i_ = other.i_; i_ = other.i_;
s_ = other.s_; s_ = other.s_;
Sub = other.sub_ != null ? other.Sub.Clone() : null; sub_ = other.sub_ != null ? other.sub_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -704,7 +704,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -704,7 +704,7 @@ namespace UnitTest.Issues.TestProtos {
public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() { public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
primitiveValue_ = other.primitiveValue_; primitiveValue_ = other.primitiveValue_;
primitiveArray_ = other.primitiveArray_.Clone(); primitiveArray_ = other.primitiveArray_.Clone();
MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null; messageValue_ = other.messageValue_ != null ? other.messageValue_.Clone() : null;
messageArray_ = other.messageArray_.Clone(); messageArray_ = other.messageArray_.Clone();
enumValue_ = other.enumValue_; enumValue_ = other.enumValue_;
enumArray_ = other.enumArray_.Clone(); enumArray_ = other.enumArray_.Clone();
......
...@@ -280,13 +280,13 @@ namespace Google.Protobuf.TestProtos { ...@@ -280,13 +280,13 @@ namespace Google.Protobuf.TestProtos {
singleBool_ = other.singleBool_; singleBool_ = other.singleBool_;
singleString_ = other.singleString_; singleString_ = other.singleString_;
singleBytes_ = other.singleBytes_; singleBytes_ = other.singleBytes_;
SingleNestedMessage = other.singleNestedMessage_ != null ? other.SingleNestedMessage.Clone() : null; singleNestedMessage_ = other.singleNestedMessage_ != null ? other.singleNestedMessage_.Clone() : null;
SingleForeignMessage = other.singleForeignMessage_ != null ? other.SingleForeignMessage.Clone() : null; singleForeignMessage_ = other.singleForeignMessage_ != null ? other.singleForeignMessage_.Clone() : null;
SingleImportMessage = other.singleImportMessage_ != null ? other.SingleImportMessage.Clone() : null; singleImportMessage_ = other.singleImportMessage_ != null ? other.singleImportMessage_.Clone() : null;
singleNestedEnum_ = other.singleNestedEnum_; singleNestedEnum_ = other.singleNestedEnum_;
singleForeignEnum_ = other.singleForeignEnum_; singleForeignEnum_ = other.singleForeignEnum_;
singleImportEnum_ = other.singleImportEnum_; singleImportEnum_ = other.singleImportEnum_;
SinglePublicImportMessage = other.singlePublicImportMessage_ != null ? other.SinglePublicImportMessage.Clone() : null; singlePublicImportMessage_ = other.singlePublicImportMessage_ != null ? other.singlePublicImportMessage_.Clone() : null;
repeatedInt32_ = other.repeatedInt32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone();
repeatedInt64_ = other.repeatedInt64_.Clone(); repeatedInt64_ = other.repeatedInt64_.Clone();
repeatedUint32_ = other.repeatedUint32_.Clone(); repeatedUint32_ = other.repeatedUint32_.Clone();
...@@ -1786,8 +1786,8 @@ namespace Google.Protobuf.TestProtos { ...@@ -1786,8 +1786,8 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NestedTestAllTypes(NestedTestAllTypes other) : this() { public NestedTestAllTypes(NestedTestAllTypes other) : this() {
Child = other.child_ != null ? other.Child.Clone() : null; child_ = other.child_ != null ? other.child_.Clone() : null;
Payload = other.payload_ != null ? other.Payload.Clone() : null; payload_ = other.payload_ != null ? other.payload_.Clone() : null;
repeatedChild_ = other.repeatedChild_.Clone(); repeatedChild_ = other.repeatedChild_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2342,7 +2342,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2342,7 +2342,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestForeignNested(TestForeignNested other) : this() { public TestForeignNested(TestForeignNested other) : this() {
ForeignNested = other.foreignNested_ != null ? other.ForeignNested.Clone() : null; foreignNested_ = other.foreignNested_ != null ? other.foreignNested_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2641,7 +2641,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2641,7 +2641,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestRecursiveMessage(TestRecursiveMessage other) : this() { public TestRecursiveMessage(TestRecursiveMessage other) : this() {
A = other.a_ != null ? other.A.Clone() : null; a_ = other.a_ != null ? other.a_.Clone() : null;
i_ = other.i_; i_ = other.i_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2807,7 +2807,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2807,7 +2807,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestMutualRecursionA(TestMutualRecursionA other) : this() { public TestMutualRecursionA(TestMutualRecursionA other) : this() {
Bb = other.bb_ != null ? other.Bb.Clone() : null; bb_ = other.bb_ != null ? other.bb_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2942,7 +2942,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2942,7 +2942,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestMutualRecursionB(TestMutualRecursionB other) : this() { public TestMutualRecursionB(TestMutualRecursionB other) : this() {
A = other.a_ != null ? other.A.Clone() : null; a_ = other.a_ != null ? other.a_.Clone() : null;
optionalInt32_ = other.optionalInt32_; optionalInt32_ = other.optionalInt32_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -3241,7 +3241,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3241,7 +3241,7 @@ namespace Google.Protobuf.TestProtos {
primitiveField_ = other.primitiveField_; primitiveField_ = other.primitiveField_;
stringField_ = other.stringField_; stringField_ = other.stringField_;
enumField_ = other.enumField_; enumField_ = other.enumField_;
MessageField = other.messageField_ != null ? other.MessageField.Clone() : null; messageField_ = other.messageField_ != null ? other.messageField_.Clone() : null;
repeatedPrimitiveField_ = other.repeatedPrimitiveField_.Clone(); repeatedPrimitiveField_ = other.repeatedPrimitiveField_.Clone();
repeatedStringField_ = other.repeatedStringField_.Clone(); repeatedStringField_ = other.repeatedStringField_.Clone();
repeatedEnumField_ = other.repeatedEnumField_.Clone(); repeatedEnumField_ = other.repeatedEnumField_.Clone();
...@@ -3546,7 +3546,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3546,7 +3546,7 @@ namespace Google.Protobuf.TestProtos {
myString_ = other.myString_; myString_ = other.myString_;
myInt_ = other.myInt_; myInt_ = other.myInt_;
myFloat_ = other.myFloat_; myFloat_ = other.myFloat_;
SingleNestedMessage = other.singleNestedMessage_ != null ? other.SingleNestedMessage.Clone() : null; singleNestedMessage_ = other.singleNestedMessage_ != null ? other.singleNestedMessage_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -204,15 +204,15 @@ namespace Google.Protobuf.TestProtos { ...@@ -204,15 +204,15 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestWellKnownTypes(TestWellKnownTypes other) : this() { public TestWellKnownTypes(TestWellKnownTypes other) : this() {
AnyField = other.anyField_ != null ? other.AnyField.Clone() : null; anyField_ = other.anyField_ != null ? other.anyField_.Clone() : null;
ApiField = other.apiField_ != null ? other.ApiField.Clone() : null; apiField_ = other.apiField_ != null ? other.apiField_.Clone() : null;
DurationField = other.durationField_ != null ? other.DurationField.Clone() : null; durationField_ = other.durationField_ != null ? other.durationField_.Clone() : null;
EmptyField = other.emptyField_ != null ? other.EmptyField.Clone() : null; emptyField_ = other.emptyField_ != null ? other.emptyField_.Clone() : null;
FieldMaskField = other.fieldMaskField_ != null ? other.FieldMaskField.Clone() : null; fieldMaskField_ = other.fieldMaskField_ != null ? other.fieldMaskField_.Clone() : null;
SourceContextField = other.sourceContextField_ != null ? other.SourceContextField.Clone() : null; sourceContextField_ = other.sourceContextField_ != null ? other.sourceContextField_.Clone() : null;
StructField = other.structField_ != null ? other.StructField.Clone() : null; structField_ = other.structField_ != null ? other.structField_.Clone() : null;
TimestampField = other.timestampField_ != null ? other.TimestampField.Clone() : null; timestampField_ = other.timestampField_ != null ? other.timestampField_.Clone() : null;
TypeField = other.typeField_ != null ? other.TypeField.Clone() : null; typeField_ = other.typeField_ != null ? other.typeField_.Clone() : null;
DoubleField = other.DoubleField; DoubleField = other.DoubleField;
FloatField = other.FloatField; FloatField = other.FloatField;
Int64Field = other.Int64Field; Int64Field = other.Int64Field;
...@@ -222,7 +222,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -222,7 +222,7 @@ namespace Google.Protobuf.TestProtos {
BoolField = other.BoolField; BoolField = other.BoolField;
StringField = other.StringField; StringField = other.StringField;
BytesField = other.BytesField; BytesField = other.BytesField;
ValueField = other.valueField_ != null ? other.ValueField.Clone() : null; valueField_ = other.valueField_ != null ? other.valueField_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -350,8 +350,8 @@ namespace Google.Protobuf.Reflection { ...@@ -350,8 +350,8 @@ namespace Google.Protobuf.Reflection {
enumType_ = other.enumType_.Clone(); enumType_ = other.enumType_.Clone();
service_ = other.service_.Clone(); service_ = other.service_.Clone();
extension_ = other.extension_.Clone(); extension_ = other.extension_.Clone();
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
SourceCodeInfo = other.sourceCodeInfo_ != null ? other.SourceCodeInfo.Clone() : null; sourceCodeInfo_ = other.sourceCodeInfo_ != null ? other.sourceCodeInfo_.Clone() : null;
syntax_ = other.syntax_; syntax_ = other.syntax_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -775,7 +775,7 @@ namespace Google.Protobuf.Reflection { ...@@ -775,7 +775,7 @@ namespace Google.Protobuf.Reflection {
enumType_ = other.enumType_.Clone(); enumType_ = other.enumType_.Clone();
extensionRange_ = other.extensionRange_.Clone(); extensionRange_ = other.extensionRange_.Clone();
oneofDecl_ = other.oneofDecl_.Clone(); oneofDecl_ = other.oneofDecl_.Clone();
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
reservedRange_ = other.reservedRange_.Clone(); reservedRange_ = other.reservedRange_.Clone();
reservedName_ = other.reservedName_.Clone(); reservedName_ = other.reservedName_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
...@@ -1099,7 +1099,7 @@ namespace Google.Protobuf.Reflection { ...@@ -1099,7 +1099,7 @@ namespace Google.Protobuf.Reflection {
public ExtensionRange(ExtensionRange other) : this() { public ExtensionRange(ExtensionRange other) : this() {
start_ = other.start_; start_ = other.start_;
end_ = other.end_; end_ = other.end_;
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -1597,7 +1597,7 @@ namespace Google.Protobuf.Reflection { ...@@ -1597,7 +1597,7 @@ namespace Google.Protobuf.Reflection {
defaultValue_ = other.defaultValue_; defaultValue_ = other.defaultValue_;
oneofIndex_ = other.oneofIndex_; oneofIndex_ = other.oneofIndex_;
jsonName_ = other.jsonName_; jsonName_ = other.jsonName_;
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2078,7 +2078,7 @@ namespace Google.Protobuf.Reflection { ...@@ -2078,7 +2078,7 @@ namespace Google.Protobuf.Reflection {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OneofDescriptorProto(OneofDescriptorProto other) : this() { public OneofDescriptorProto(OneofDescriptorProto other) : this() {
name_ = other.name_; name_ = other.name_;
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2245,7 +2245,7 @@ namespace Google.Protobuf.Reflection { ...@@ -2245,7 +2245,7 @@ namespace Google.Protobuf.Reflection {
public EnumDescriptorProto(EnumDescriptorProto other) : this() { public EnumDescriptorProto(EnumDescriptorProto other) : this() {
name_ = other.name_; name_ = other.name_;
value_ = other.value_.Clone(); value_ = other.value_.Clone();
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
reservedRange_ = other.reservedRange_.Clone(); reservedRange_ = other.reservedRange_.Clone();
reservedName_ = other.reservedName_.Clone(); reservedName_ = other.reservedName_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
...@@ -2658,7 +2658,7 @@ namespace Google.Protobuf.Reflection { ...@@ -2658,7 +2658,7 @@ namespace Google.Protobuf.Reflection {
public EnumValueDescriptorProto(EnumValueDescriptorProto other) : this() { public EnumValueDescriptorProto(EnumValueDescriptorProto other) : this() {
name_ = other.name_; name_ = other.name_;
number_ = other.number_; number_ = other.number_;
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -2852,7 +2852,7 @@ namespace Google.Protobuf.Reflection { ...@@ -2852,7 +2852,7 @@ namespace Google.Protobuf.Reflection {
public ServiceDescriptorProto(ServiceDescriptorProto other) : this() { public ServiceDescriptorProto(ServiceDescriptorProto other) : this() {
name_ = other.name_; name_ = other.name_;
method_ = other.method_.Clone(); method_ = other.method_.Clone();
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -3039,7 +3039,7 @@ namespace Google.Protobuf.Reflection { ...@@ -3039,7 +3039,7 @@ namespace Google.Protobuf.Reflection {
name_ = other.name_; name_ = other.name_;
inputType_ = other.inputType_; inputType_ = other.inputType_;
outputType_ = other.outputType_; outputType_ = other.outputType_;
Options = other.options_ != null ? other.Options.Clone() : null; options_ = other.options_ != null ? other.options_.Clone() : null;
clientStreaming_ = other.clientStreaming_; clientStreaming_ = other.clientStreaming_;
serverStreaming_ = other.serverStreaming_; serverStreaming_ = other.serverStreaming_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
......
...@@ -93,7 +93,7 @@ namespace Google.Protobuf.WellKnownTypes { ...@@ -93,7 +93,7 @@ namespace Google.Protobuf.WellKnownTypes {
methods_ = other.methods_.Clone(); methods_ = other.methods_.Clone();
options_ = other.options_.Clone(); options_ = other.options_.Clone();
version_ = other.version_; version_ = other.version_;
SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null;
mixins_ = other.mixins_.Clone(); mixins_ = other.mixins_.Clone();
syntax_ = other.syntax_; syntax_ = other.syntax_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
......
...@@ -123,7 +123,7 @@ namespace Google.Protobuf.WellKnownTypes { ...@@ -123,7 +123,7 @@ namespace Google.Protobuf.WellKnownTypes {
fields_ = other.fields_.Clone(); fields_ = other.fields_.Clone();
oneofs_ = other.oneofs_.Clone(); oneofs_ = other.oneofs_.Clone();
options_ = other.options_.Clone(); options_ = other.options_.Clone();
SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null;
syntax_ = other.syntax_; syntax_ = other.syntax_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -913,7 +913,7 @@ namespace Google.Protobuf.WellKnownTypes { ...@@ -913,7 +913,7 @@ namespace Google.Protobuf.WellKnownTypes {
name_ = other.name_; name_ = other.name_;
enumvalue_ = other.enumvalue_.Clone(); enumvalue_ = other.enumvalue_.Clone();
options_ = other.options_.Clone(); options_ = other.options_.Clone();
SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null;
syntax_ = other.syntax_; syntax_ = other.syntax_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
...@@ -1350,7 +1350,7 @@ namespace Google.Protobuf.WellKnownTypes { ...@@ -1350,7 +1350,7 @@ namespace Google.Protobuf.WellKnownTypes {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Option(Option other) : this() { public Option(Option other) : this() {
name_ = other.name_; name_ = other.name_;
Value = other.value_ != null ? other.Value.Clone() : null; value_ = other.value_ != null ? other.value_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
......
...@@ -133,7 +133,7 @@ void MessageFieldGenerator::WriteToString(io::Printer* printer) { ...@@ -133,7 +133,7 @@ void MessageFieldGenerator::WriteToString(io::Printer* printer) {
void MessageFieldGenerator::GenerateCloningCode(io::Printer* printer) { void MessageFieldGenerator::GenerateCloningCode(io::Printer* printer) {
printer->Print(variables_, printer->Print(variables_,
"$property_name$ = other.$has_property_check$ ? other.$property_name$.Clone() : null;\n"); "$name$_ = other.$has_property_check$ ? other.$name$_.Clone() : null;\n");
} }
void MessageFieldGenerator::GenerateFreezingCode(io::Printer* printer) { void MessageFieldGenerator::GenerateFreezingCode(io::Printer* printer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment