Skip to content

Commit f77065d

Browse files
committed
Sync from Piper @316511779
PROTOBUF_SYNC_PIPER
1 parent 183cdec commit f77065d

File tree

142 files changed

+13217
-1116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+13217
-1116
lines changed

Diff for: CHANGES.txt

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,42 @@
11
Unreleased Changes
22

33
C++:
4+
* Removed deprecated unsafe arena string accessors
45
* Enabled heterogeneous lookup for std::string keys in maps.
5-
* Improved the randomness of map ordering.
6+
* Removed implicit conversion from StringPiece to std::string
7+
* Fix use-after-destroy bug when the Map is allocated in the arena.
8+
* Improved the randomness of map ordering
9+
* Added stack overflow protection for text format with unknown fields
10+
* Use std::hash for proto maps to help with portability.
11+
* Added more Windows macros to proto whitelist.
12+
* Arena constructors for map entry messages are now marked "explicit"
13+
(for regular messages they were already explicit).
614

715
Python:
16+
* Reject lowercase t for Timestamp json format. Fixes a conformance test.
817
* Improved the error message when AttributeError is returned from __getattr__
918
in EnumTypeWrapper.
19+
* Json format will print full_name directly for extensions.
20+
21+
Java:
22+
* Fixed a bug where setting optional proto3 enums with setFooValue() would
23+
not mark the value as present.
24+
25+
C#:
26+
* Dropped support for netstandard1.0 (replaced by support for netstandard1.1).
27+
This was required to modernize the parsing stack to use the `Span<byte>`
28+
type internally. (#7351)
29+
* Add `ParseFrom(ReadOnlySequence<byte>)` method to enable GC friendly
30+
parsing with reduced allocations and buffer copies. (#7351)
31+
* Add `GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE` define to make
32+
generated code compatible with old C# compilers (pre-roslyn compilers
33+
from .NET framework and old versions of mono) that do not support
34+
ref structs. (#7490)
35+
36+
2020-06-01 version 3.12.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
37+
38+
Objective-C
39+
* Tweak the union used for Extensions to support old generated code. #7573
1040

1141
2020-05-26 version 3.12.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
1242

Diff for: Protobuf.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# dependent projects use the :git notation to refer to the library.
66
Pod::Spec.new do |s|
77
s.name = 'Protobuf'
8-
s.version = '3.12.2'
8+
s.version = '3.12.3'
99
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
1010
s.homepage = 'https://github.com/protocolbuffers/protobuf'
1111
s.license = '3-Clause BSD License'

Diff for: conformance/failure_list_csharp.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
22
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
3-
Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator
43
Recommended.Proto2.JsonInput.FieldNameExtension.Validator

Diff for: conformance/failure_list_python.txt

-30
Original file line numberDiff line numberDiff line change
@@ -1,30 +0,0 @@
1-
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
2-
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
3-
Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
4-
Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
5-
Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
6-
Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
7-
Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
8-
Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
9-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[0].ProtobufOutput
10-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[0].ProtobufOutput
11-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[0].ProtobufOutput
12-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput
13-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[0].ProtobufOutput
14-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[0].ProtobufOutput
15-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[0].ProtobufOutput
16-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[0].ProtobufOutput
17-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput
18-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[0].ProtobufOutput
19-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[0].ProtobufOutput
20-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[0].ProtobufOutput
21-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[0].ProtobufOutput
22-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[0].ProtobufOutput
23-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[0].ProtobufOutput
24-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[0].ProtobufOutput
25-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput
26-
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[0].ProtobufOutput
27-
Required.Proto3.JsonInput.DoubleFieldTooSmall
28-
Required.Proto3.JsonInput.FloatFieldTooLarge
29-
Required.Proto3.JsonInput.FloatFieldTooSmall
30-
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool

Diff for: conformance/failure_list_python_cpp.txt

-13
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,3 @@
66
#
77
# TODO(haberman): insert links to corresponding bugs tracking the issue.
88
# Should we use GitHub issues or the Google-internal bug tracker?
9-
10-
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
11-
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
12-
Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
13-
Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
14-
Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
15-
Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
16-
Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
17-
Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
18-
Required.Proto3.JsonInput.DoubleFieldTooSmall
19-
Required.Proto3.JsonInput.FloatFieldTooLarge
20-
Required.Proto3.JsonInput.FloatFieldTooSmall
21-
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool

Diff for: csharp/Google.Protobuf.Tools.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Google Protocol Buffers tools</title>
66
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
77
<description>See project site for more info.</description>
8-
<version>3.12.2</version>
8+
<version>3.12.3</version>
99
<authors>Google Inc.</authors>
1010
<owners>protobuf-packages</owners>
1111
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>

Diff for: csharp/src/AddressBook/Addressbook.cs

+89-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ static AddressbookReflection() {
4949
/// <summary>
5050
/// [START messages]
5151
/// </summary>
52-
public sealed partial class Person : pb::IMessage<Person>, pb::IBufferMessage {
52+
public sealed partial class Person : pb::IMessage<Person>
53+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
54+
, pb::IBufferMessage
55+
#endif
56+
{
5357
private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person());
5458
private pb::UnknownFieldSet _unknownFields;
5559
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -256,9 +260,44 @@ public void MergeFrom(Person other) {
256260

257261
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
258262
public void MergeFrom(pb::CodedInputStream input) {
263+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
259264
input.ReadRawMessage(this);
265+
#else
266+
uint tag;
267+
while ((tag = input.ReadTag()) != 0) {
268+
switch(tag) {
269+
default:
270+
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
271+
break;
272+
case 10: {
273+
Name = input.ReadString();
274+
break;
275+
}
276+
case 16: {
277+
Id = input.ReadInt32();
278+
break;
279+
}
280+
case 26: {
281+
Email = input.ReadString();
282+
break;
283+
}
284+
case 34: {
285+
phones_.AddEntriesFrom(input, _repeated_phones_codec);
286+
break;
287+
}
288+
case 42: {
289+
if (lastUpdated_ == null) {
290+
LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
291+
}
292+
input.ReadMessage(LastUpdated);
293+
break;
294+
}
295+
}
296+
}
297+
#endif
260298
}
261299

300+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
262301
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
263302
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
264303
uint tag;
@@ -293,6 +332,7 @@ public void MergeFrom(pb::CodedInputStream input) {
293332
}
294333
}
295334
}
335+
#endif
296336

297337
#region Nested types
298338
/// <summary>Container for nested types declared in the Person message type.</summary>
@@ -304,7 +344,11 @@ public enum PhoneType {
304344
[pbr::OriginalName("WORK")] Work = 2,
305345
}
306346

307-
public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber>, pb::IBufferMessage {
347+
public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber>
348+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
349+
, pb::IBufferMessage
350+
#endif
351+
{
308352
private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber());
309353
private pb::UnknownFieldSet _unknownFields;
310354
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -441,9 +485,29 @@ public void MergeFrom(PhoneNumber other) {
441485

442486
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
443487
public void MergeFrom(pb::CodedInputStream input) {
488+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
444489
input.ReadRawMessage(this);
490+
#else
491+
uint tag;
492+
while ((tag = input.ReadTag()) != 0) {
493+
switch(tag) {
494+
default:
495+
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
496+
break;
497+
case 10: {
498+
Number = input.ReadString();
499+
break;
500+
}
501+
case 16: {
502+
Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
503+
break;
504+
}
505+
}
506+
}
507+
#endif
445508
}
446509

510+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
447511
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
448512
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
449513
uint tag;
@@ -463,6 +527,7 @@ public void MergeFrom(pb::CodedInputStream input) {
463527
}
464528
}
465529
}
530+
#endif
466531

467532
}
468533

@@ -474,7 +539,11 @@ public void MergeFrom(pb::CodedInputStream input) {
474539
/// <summary>
475540
/// Our address book file is just one of these.
476541
/// </summary>
477-
public sealed partial class AddressBook : pb::IMessage<AddressBook>, pb::IBufferMessage {
542+
public sealed partial class AddressBook : pb::IMessage<AddressBook>
543+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
544+
, pb::IBufferMessage
545+
#endif
546+
{
478547
private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
479548
private pb::UnknownFieldSet _unknownFields;
480549
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -579,9 +648,25 @@ public void MergeFrom(AddressBook other) {
579648

580649
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
581650
public void MergeFrom(pb::CodedInputStream input) {
651+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
582652
input.ReadRawMessage(this);
653+
#else
654+
uint tag;
655+
while ((tag = input.ReadTag()) != 0) {
656+
switch(tag) {
657+
default:
658+
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
659+
break;
660+
case 10: {
661+
people_.AddEntriesFrom(input, _repeated_people_codec);
662+
break;
663+
}
664+
}
665+
}
666+
#endif
583667
}
584668

669+
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
585670
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
586671
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
587672
uint tag;
@@ -597,6 +682,7 @@ public void MergeFrom(pb::CodedInputStream input) {
597682
}
598683
}
599684
}
685+
#endif
600686

601687
}
602688

0 commit comments

Comments
 (0)