Skip to content

Commit 4315677

Browse files
authored
Merge 3.9.x 201908071359 to master (protocolbuffers#6484)
* Add changelog for 3.9.x * Revert "Make php message class final to avoid mocking (protocolbuffers#6277)" (protocolbuffers#6324) This reverts commit 7f84a94. This is just temporary. Eventually, we still want to roll forward this change. Some users are complaining they need more time to clean up their code. * Update extract_includes.bat.in File io_win32.h is not in directory google\protobuf\stubs under directory google\protobuf\io * Set oneof case in array constructor (protocolbuffers#6351) Forgot to set it previously. * Update protobuf version (protocolbuffers#6366) * Drop building wheel for python 3.4 (protocolbuffers#6406) https://github.com/matthew-brett/multibuild/pull/240 * Fix binary compatibility in FieldCodec factory methods (protocolbuffers#6380) (protocolbuffers#6424) * Fix binary compatibility in FieldCodec factory messages * Make default value parameter for current factories required * Route old methods through default value overloads * Remove ExtensionRegistry.Add(params) overload * Rename ExtensionRegistry.Add(IEnumerable<Extension>) overload to AddRange * Edit naming of parameters in Extension classes * * Fix add API warnings to docs for extension APIs * Rename internal ExtensionSet.GetValue to TryGetValue * Disable javadoc error (protocolbuffers#6371) * Disable javadoc error Actual fixes of the javadoc will be followed up * Remove duplicated configuration * Update javadoc plugin version * Updated Bazel test script to use most recent Bazel version (protocolbuffers#6413) (protocolbuffers#6433) I'm not exactly sure why, but this fixes the failing Bazel presubmit test. Using the most recent version seems like a good idea anyway so that we can make sure we're compatible with any new Bazel changes. * [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl * No need to update version in generated code (protocolbuffers#6471) generate_descriptor will handle that * Update protobuf version (protocolbuffers#6472)
1 parent 56988be commit 4315677

Some content is hidden

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

69 files changed

+943
-271
lines changed

CHANGES.txt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
2019-06-28 version 3.9.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
2+
3+
C++
4+
* Optimize and simplify implementation of RepeatedPtrFieldBase
5+
* Don't create unnecessary unknown field sets.
6+
* Remove branch from accessors to repeated field element array.
7+
* Added delimited parse and serialize util.
8+
* Reduce size by not emitting constants for fieldnumbers
9+
* Fix a bug when comparing finite and infinite field values with explicit tolerances.
10+
* TextFormat::Parser should use a custom Finder to look up extensions by number if one is provided.
11+
* Add MessageLite::Utf8DebugString() to make MessageLite more compatible with Message.
12+
* Fail fast for better performance in DescriptorPool::FindExtensionByNumber() if descriptor has no defined extensions.
13+
* Adding the file name to help debug colliding extensions
14+
* Added FieldDescriptor::PrintableNameForExtension() and DescriptorPool::FindExtensionByPrintableName().
15+
The latter will replace Reflection::FindKnownExtensionByName().
16+
* Replace NULL with nullptr
17+
* Created a new Add method in repeated field that allows adding a range of elements all at once.
18+
* Enabled enum name-to-value mapping functions for C++ lite
19+
* Avoid dynamic initialization in descriptor.proto generated code
20+
* Move stream functions to MessageLite from Message.
21+
* Move all zero_copy_stream functionality to io_lite.
22+
* Do not create array of matched fields for simple repeated fields
23+
* Enabling silent mode by default to reduce make compilation noise. (#6237)
24+
25+
Java
26+
* Expose TextFormat.Printer and make it configurable. Deprecate the static methods.
27+
* Library for constructing google.protobuf.Struct and google.protobuf.Value
28+
* Make OneofDescriptor extend GenericDescriptor.
29+
* Expose streamingness of service methods from MethodDescriptor.
30+
* Fix a bug where TextFormat fails to parse Any filed with > 1 embedded message sub-fields.
31+
* Establish consistent JsonFormat behavior for nulls in oneofs, regardless of order.
32+
* Update GSON version to 3.8.5. (#6268)
33+
* Add `protobuf_java_lite` Bazel target. (#6177)
34+
35+
Python
36+
* Change implementation of Name() for enums that allow aliases in proto2 in Python
37+
to be in line with claims in C++ implementation (to return first value).
38+
* Explicitly say what field cannot be set when the new value fails a type check.
39+
* Duplicate register in descriptor pool will raise errors
40+
* Add __slots__ to all well_known_types classes, custom attributes are not allowed anymore.
41+
* text_format only present 8 valid digits for float fields by default
42+
43+
JavaScript
44+
* Add Oneof enum to the list of goog.provide
45+
46+
PHP
47+
* Make php message class final to avoid mocking. (#6277)
48+
* Rename get/setXXXValue to get/setXXXWrapper. (#6295)
49+
50+
Ruby
51+
* Remove to_hash methods. (#6166)
52+
53+
154
2019-04-29 version 3.8.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
255

356
C++

Protobuf.podspec

Lines changed: 1 addition & 1 deletion
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.9.0-rc2'
8+
s.version = '3.9.1'
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'

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AC_PREREQ(2.59)
1717
# In the SVN trunk, the version should always be the next anticipated release
1818
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
1919
# the size of one file name in the dist tarfile over the 99-char limit.)
20-
AC_INIT([Protocol Buffers],[3.9.0-rc-1],[[email protected]],[protobuf])
20+
AC_INIT([Protocol Buffers],[3.9.1],[[email protected]],[protobuf])
2121

2222
AM_MAINTAINER_MODE([enable])
2323

csharp/Google.Protobuf.Tools.nuspec

Lines changed: 1 addition & 1 deletion
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.9.0-rc1</version>
8+
<version>3.9.1</version>
99
<authors>Google Inc.</authors>
1010
<owners>protobuf-packages</owners>
1111
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>

csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs

Lines changed: 755 additions & 140 deletions
Large diffs are not rendered by default.
-709 Bytes
Binary file not shown.

csharp/src/Google.Protobuf/Extension.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
namespace Google.Protobuf
3636
{
3737
/// <summary>
38-
/// Represents a non-generic extension definition
38+
/// Represents a non-generic extension definition. This API is experimental and subject to change.
3939
/// </summary>
4040
public abstract class Extension
4141
{
@@ -44,9 +44,9 @@ public abstract class Extension
4444
/// <summary>
4545
/// Internal use. Creates a new extension with the specified field number.
4646
/// </summary>
47-
protected Extension(int number)
47+
protected Extension(int fieldNumber)
4848
{
49-
FieldNumber = number;
49+
FieldNumber = fieldNumber;
5050
}
5151

5252
internal abstract IExtensionValue CreateValue();
@@ -58,7 +58,8 @@ protected Extension(int number)
5858
}
5959

6060
/// <summary>
61-
/// Represents a type-safe extension identifier used for getting and setting single extension values in <see cref="IExtendableMessage{T}"/> instances
61+
/// Represents a type-safe extension identifier used for getting and setting single extension values in <see cref="IExtendableMessage{T}"/> instances.
62+
/// This API is experimental and subject to change.
6263
/// </summary>
6364
/// <typeparam name="TTarget">The message type this field applies to</typeparam>
6465
/// <typeparam name="TValue">The field value type of this extension</typeparam>
@@ -69,7 +70,7 @@ public sealed class Extension<TTarget, TValue> : Extension where TTarget : IExte
6970
/// <summary>
7071
/// Creates a new extension identifier with the specified field number and codec
7172
/// </summary>
72-
public Extension(int number, FieldCodec<TValue> codec) : base(number)
73+
public Extension(int fieldNumber, FieldCodec<TValue> codec) : base(fieldNumber)
7374
{
7475
this.codec = codec;
7576
}
@@ -85,7 +86,8 @@ internal override IExtensionValue CreateValue()
8586
}
8687

8788
/// <summary>
88-
/// Represents a type-safe extension identifier used for getting repeated extension values in <see cref="IExtendableMessage{T}"/> instances
89+
/// Represents a type-safe extension identifier used for getting repeated extension values in <see cref="IExtendableMessage{T}"/> instances.
90+
/// This API is experimental and subject to change.
8991
/// </summary>
9092
/// <typeparam name="TTarget">The message type this field applies to</typeparam>
9193
/// <typeparam name="TValue">The repeated field value type of this extension</typeparam>
@@ -96,7 +98,7 @@ public sealed class RepeatedExtension<TTarget, TValue> : Extension where TTarget
9698
/// <summary>
9799
/// Creates a new repeated extension identifier with the specified field number and codec
98100
/// </summary>
99-
public RepeatedExtension(int number, FieldCodec<TValue> codec) : base(number)
101+
public RepeatedExtension(int fieldNumber, FieldCodec<TValue> codec) : base(fieldNumber)
100102
{
101103
this.codec = codec;
102104
}

csharp/src/Google.Protobuf/ExtensionRegistry.cs

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
namespace Google.Protobuf
3939
{
4040
/// <summary>
41-
/// Provides extensions to messages while parsing
41+
/// Provides extensions to messages while parsing. This API is experimental and subject to change.
4242
/// </summary>
4343
public sealed class ExtensionRegistry : ICollection<Extension>, IDeepCloneable<ExtensionRegistry>
4444
{
@@ -67,9 +67,9 @@ private ExtensionRegistry(IDictionary<ObjectIntPair<Type>, Extension> collection
6767
/// </summary>
6868
bool ICollection<Extension>.IsReadOnly => false;
6969

70-
internal bool ContainsInputField(CodedInputStream stream, Type target, out Extension extension)
71-
{
72-
return extensions.TryGetValue(new ObjectIntPair<Type>(target, WireFormat.GetTagFieldNumber(stream.LastTag)), out extension);
70+
internal bool ContainsInputField(CodedInputStream stream, Type target, out Extension extension)
71+
{
72+
return extensions.TryGetValue(new ObjectIntPair<Type>(target, WireFormat.GetTagFieldNumber(stream.LastTag)), out extension);
7373
}
7474

7575
/// <summary>
@@ -82,24 +82,14 @@ public void Add(Extension extension)
8282
extensions.Add(new ObjectIntPair<Type>(extension.TargetType, extension.FieldNumber), extension);
8383
}
8484

85-
/// <summary>
86-
/// Adds the specified extensions to the registry
87-
/// </summary>
88-
public void Add(params Extension[] newExtensions)
89-
{
90-
ProtoPreconditions.CheckNotNull(newExtensions, nameof(newExtensions));
91-
92-
Add((IEnumerable<Extension>)newExtensions);
93-
}
94-
9585
/// <summary>
9686
/// Adds the specified extensions to the reigstry
9787
/// </summary>
98-
public void Add(IEnumerable<Extension> newExtensions)
88+
public void AddRange(IEnumerable<Extension> extensions)
9989
{
100-
ProtoPreconditions.CheckNotNull(newExtensions, nameof(newExtensions));
90+
ProtoPreconditions.CheckNotNull(extensions, nameof(extensions));
10191

102-
foreach (var extension in newExtensions)
92+
foreach (var extension in extensions)
10393
Add(extension);
10494
}
10595

@@ -134,10 +124,10 @@ void ICollection<Extension>.CopyTo(Extension[] array, int arrayIndex)
134124
if (array.Length - arrayIndex < Count)
135125
throw new ArgumentException("The provided array is shorter than the number of elements in the registry");
136126

137-
for (int i = 0; i < array.Length; i++)
138-
{
139-
Extension extension = array[i];
140-
extensions.Add(new ObjectIntPair<Type>(extension.TargetType, extension.FieldNumber), extension);
127+
for (int i = 0; i < array.Length; i++)
128+
{
129+
Extension extension = array[i];
130+
extensions.Add(new ObjectIntPair<Type>(extension.TargetType, extension.FieldNumber), extension);
141131
}
142132
}
143133

csharp/src/Google.Protobuf/ExtensionSet.cs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ namespace Google.Protobuf
4040
/// <summary>
4141
/// Methods for managing <see cref="ExtensionSet{TTarget}"/>s with null checking.
4242
///
43-
/// Most users will not use this class directly
43+
/// Most users will not use this class directly and its API is experimental and subject to change.
4444
/// </summary>
4545
public static class ExtensionSet
4646
{
47-
private static bool GetValue<TTarget>(ref ExtensionSet<TTarget> set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage<TTarget>
47+
private static bool TryGetValue<TTarget>(ref ExtensionSet<TTarget> set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage<TTarget>
4848
{
4949
if (set == null)
5050
{
@@ -60,7 +60,7 @@ private static bool GetValue<TTarget>(ref ExtensionSet<TTarget> set, Extension e
6060
public static TValue Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
6161
{
6262
IExtensionValue value;
63-
if (GetValue(ref set, extension, out value))
63+
if (TryGetValue(ref set, extension, out value))
6464
{
6565
return ((ExtensionValue<TValue>)value).GetValue();
6666
}
@@ -76,7 +76,7 @@ public static TValue Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extensi
7676
public static RepeatedField<TValue> Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, RepeatedExtension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
7777
{
7878
IExtensionValue value;
79-
if (GetValue(ref set, extension, out value))
79+
if (TryGetValue(ref set, extension, out value))
8080
{
8181
return ((RepeatedExtensionValue<TValue>)value).GetValue();
8282
}
@@ -111,7 +111,7 @@ public static RepeatedField<TValue> GetOrRegister<TTarget, TValue>(ref Extension
111111
}
112112

113113
/// <summary>
114-
/// Sets the value of the specified extension
114+
/// Sets the value of the specified extension. This will make a new instance of ExtensionSet if the set is null.
115115
/// </summary>
116116
public static void Set<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension, TValue value) where TTarget : IExtendableMessage<TTarget>
117117
{
@@ -140,14 +140,7 @@ public static void Set<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension
140140
public static bool Has<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
141141
{
142142
IExtensionValue value;
143-
if (GetValue(ref set, extension, out value))
144-
{
145-
return ((ExtensionValue<TValue>)value).HasValue;
146-
}
147-
else
148-
{
149-
return false;
150-
}
143+
return TryGetValue(ref set, extension, out value);
151144
}
152145

153146
/// <summary>

csharp/src/Google.Protobuf/Google.Protobuf.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
55
<Copyright>Copyright 2015, Google Inc.</Copyright>
66
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
7-
<VersionPrefix>3.9.0-rc1</VersionPrefix>
7+
<VersionPrefix>3.9.1</VersionPrefix>
88
<LangVersion>6</LangVersion>
99
<Authors>Google Inc.</Authors>
1010
<TargetFrameworks>netstandard1.0;netstandard2.0;net45</TargetFrameworks>

0 commit comments

Comments
 (0)