Skip to content
Permalink
Browse files

Merge 3.9.x 201908071359 to master (#6484)

* Add changelog for 3.9.x

* Revert "Make php message class final to avoid mocking (#6277)" (#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 (#6351)

Forgot to set it previously.

* Update protobuf version (#6366)

* Drop building wheel for python 3.4 (#6406)

matthew-brett/multibuild#240

* Fix binary compatibility in FieldCodec factory methods (#6380) (#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 (#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 (#6413) (#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 (#6471)

generate_descriptor will handle that

* Update protobuf version (#6472)
  • Loading branch information...
anandolee committed Aug 9, 2019
1 parent 56988be commit 43156775be8227014df1ca86c75a8547770f6039
Showing with 943 additions and 271 deletions.
  1. +53 −0 CHANGES.txt
  2. +1 −1 Protobuf.podspec
  3. +1 −1 configure.ac
  4. +1 −1 csharp/Google.Protobuf.Tools.nuspec
  5. +755 −140 csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
  6. BIN csharp/src/Google.Protobuf.Test/testprotos.pb
  7. +9 −7 csharp/src/Google.Protobuf/Extension.cs
  8. +11 −21 csharp/src/Google.Protobuf/ExtensionRegistry.cs
  9. +6 −13 csharp/src/Google.Protobuf/ExtensionSet.cs
  10. +1 −1 csharp/src/Google.Protobuf/Google.Protobuf.csproj
  11. +1 −1 csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
  12. +1 −1 java/bom/pom.xml
  13. +1 −1 java/core/pom.xml
  14. +1 −1 java/lite/pom.xml
  15. +8 −2 java/pom.xml
  16. +1 −1 java/util/pom.xml
  17. +1 −1 js/package.json
  18. +3 −0 php/ext/google/protobuf/message.c
  19. +34 −6 php/ext/google/protobuf/package.xml
  20. +3 −1 php/ext/google/protobuf/protobuf.h
  21. +2 −2 php/ext/google/protobuf/storage.c
  22. +1 −1 php/src/Google/Protobuf/Internal/DescriptorProto.php
  23. +1 −1 php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php
  24. +1 −1 php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php
  25. +1 −1 php/src/Google/Protobuf/Internal/EnumDescriptorProto.php
  26. +1 −1 php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php
  27. +1 −1 php/src/Google/Protobuf/Internal/EnumOptions.php
  28. +1 −1 php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php
  29. +1 −1 php/src/Google/Protobuf/Internal/EnumValueOptions.php
  30. +1 −1 php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php
  31. +1 −1 php/src/Google/Protobuf/Internal/FieldDescriptorProto.php
  32. +1 −1 php/src/Google/Protobuf/Internal/FieldOptions.php
  33. +1 −1 php/src/Google/Protobuf/Internal/FileDescriptorProto.php
  34. +1 −1 php/src/Google/Protobuf/Internal/FileDescriptorSet.php
  35. +1 −1 php/src/Google/Protobuf/Internal/FileOptions.php
  36. +1 −1 php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php
  37. +1 −1 php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php
  38. +1 −1 php/src/Google/Protobuf/Internal/MessageOptions.php
  39. +1 −1 php/src/Google/Protobuf/Internal/MethodDescriptorProto.php
  40. +1 −1 php/src/Google/Protobuf/Internal/MethodOptions.php
  41. +1 −1 php/src/Google/Protobuf/Internal/OneofDescriptorProto.php
  42. +1 −1 php/src/Google/Protobuf/Internal/OneofOptions.php
  43. +1 −1 php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php
  44. +1 −1 php/src/Google/Protobuf/Internal/ServiceOptions.php
  45. +1 −1 php/src/Google/Protobuf/Internal/SourceCodeInfo.php
  46. +1 −1 php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php
  47. +1 −1 php/src/Google/Protobuf/Internal/UninterpretedOption.php
  48. +1 −1 php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php
  49. +2 −0 php/tests/generated_class_test.php
  50. +1 −1 protoc-artifacts/pom.xml
  51. +1 −1 python/google/protobuf/__init__.py
  52. +1 −1 ruby/google-protobuf.gemspec
  53. +1 −1 src/Makefile.am
  54. +1 −1 src/google/protobuf/any.pb.h
  55. +1 −1 src/google/protobuf/api.pb.h
  56. +1 −1 src/google/protobuf/compiler/php/php_generator.cc
  57. +1 −1 src/google/protobuf/compiler/plugin.pb.h
  58. +1 −1 src/google/protobuf/descriptor.pb.h
  59. +1 −1 src/google/protobuf/duration.pb.h
  60. +1 −1 src/google/protobuf/empty.pb.h
  61. +1 −1 src/google/protobuf/field_mask.pb.h
  62. +1 −1 src/google/protobuf/port_def.inc
  63. +1 −1 src/google/protobuf/source_context.pb.h
  64. +1 −1 src/google/protobuf/struct.pb.h
  65. +1 −1 src/google/protobuf/stubs/common.h
  66. +1 −1 src/google/protobuf/timestamp.pb.h
  67. +1 −1 src/google/protobuf/type.pb.h
  68. +1 −1 src/google/protobuf/wrappers.pb.h
  69. +1 −23 update_version.py
@@ -1,3 +1,56 @@
2019-06-28 version 3.9.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

C++
* Optimize and simplify implementation of RepeatedPtrFieldBase
* Don't create unnecessary unknown field sets.
* Remove branch from accessors to repeated field element array.
* Added delimited parse and serialize util.
* Reduce size by not emitting constants for fieldnumbers
* Fix a bug when comparing finite and infinite field values with explicit tolerances.
* TextFormat::Parser should use a custom Finder to look up extensions by number if one is provided.
* Add MessageLite::Utf8DebugString() to make MessageLite more compatible with Message.
* Fail fast for better performance in DescriptorPool::FindExtensionByNumber() if descriptor has no defined extensions.
* Adding the file name to help debug colliding extensions
* Added FieldDescriptor::PrintableNameForExtension() and DescriptorPool::FindExtensionByPrintableName().
The latter will replace Reflection::FindKnownExtensionByName().
* Replace NULL with nullptr
* Created a new Add method in repeated field that allows adding a range of elements all at once.
* Enabled enum name-to-value mapping functions for C++ lite
* Avoid dynamic initialization in descriptor.proto generated code
* Move stream functions to MessageLite from Message.
* Move all zero_copy_stream functionality to io_lite.
* Do not create array of matched fields for simple repeated fields
* Enabling silent mode by default to reduce make compilation noise. (#6237)

Java
* Expose TextFormat.Printer and make it configurable. Deprecate the static methods.
* Library for constructing google.protobuf.Struct and google.protobuf.Value
* Make OneofDescriptor extend GenericDescriptor.
* Expose streamingness of service methods from MethodDescriptor.
* Fix a bug where TextFormat fails to parse Any filed with > 1 embedded message sub-fields.
* Establish consistent JsonFormat behavior for nulls in oneofs, regardless of order.
* Update GSON version to 3.8.5. (#6268)
* Add `protobuf_java_lite` Bazel target. (#6177)

Python
* Change implementation of Name() for enums that allow aliases in proto2 in Python
to be in line with claims in C++ implementation (to return first value).
* Explicitly say what field cannot be set when the new value fails a type check.
* Duplicate register in descriptor pool will raise errors
* Add __slots__ to all well_known_types classes, custom attributes are not allowed anymore.
* text_format only present 8 valid digits for float fields by default

JavaScript
* Add Oneof enum to the list of goog.provide

PHP
* Make php message class final to avoid mocking. (#6277)
* Rename get/setXXXValue to get/setXXXWrapper. (#6295)

Ruby
* Remove to_hash methods. (#6166)


2019-04-29 version 3.8.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

C++
@@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.9.0-rc2'
s.version = '3.9.1'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License'
@@ -17,7 +17,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.)
AC_INIT([Protocol Buffers],[3.9.0-rc-1],[protobuf@googlegroups.com],[protobuf])
AC_INIT([Protocol Buffers],[3.9.1],[protobuf@googlegroups.com],[protobuf])

AM_MAINTAINER_MODE([enable])

@@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
<version>3.9.0-rc1</version>
<version>3.9.1</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>

Large diffs are not rendered by default.

Binary file not shown.
@@ -35,7 +35,7 @@
namespace Google.Protobuf
{
/// <summary>
/// Represents a non-generic extension definition
/// Represents a non-generic extension definition. This API is experimental and subject to change.
/// </summary>
public abstract class Extension
{
@@ -44,9 +44,9 @@ public abstract class Extension
/// <summary>
/// Internal use. Creates a new extension with the specified field number.
/// </summary>
protected Extension(int number)
protected Extension(int fieldNumber)
{
FieldNumber = number;
FieldNumber = fieldNumber;
}

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

/// <summary>
/// Represents a type-safe extension identifier used for getting and setting single extension values in <see cref="IExtendableMessage{T}"/> instances
/// Represents a type-safe extension identifier used for getting and setting single extension values in <see cref="IExtendableMessage{T}"/> instances.
/// This API is experimental and subject to change.
/// </summary>
/// <typeparam name="TTarget">The message type this field applies to</typeparam>
/// <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
/// <summary>
/// Creates a new extension identifier with the specified field number and codec
/// </summary>
public Extension(int number, FieldCodec<TValue> codec) : base(number)
public Extension(int fieldNumber, FieldCodec<TValue> codec) : base(fieldNumber)
{
this.codec = codec;
}
@@ -85,7 +86,8 @@ internal override IExtensionValue CreateValue()
}

/// <summary>
/// Represents a type-safe extension identifier used for getting repeated extension values in <see cref="IExtendableMessage{T}"/> instances
/// Represents a type-safe extension identifier used for getting repeated extension values in <see cref="IExtendableMessage{T}"/> instances.
/// This API is experimental and subject to change.
/// </summary>
/// <typeparam name="TTarget">The message type this field applies to</typeparam>
/// <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
/// <summary>
/// Creates a new repeated extension identifier with the specified field number and codec
/// </summary>
public RepeatedExtension(int number, FieldCodec<TValue> codec) : base(number)
public RepeatedExtension(int fieldNumber, FieldCodec<TValue> codec) : base(fieldNumber)
{
this.codec = codec;
}
@@ -38,7 +38,7 @@
namespace Google.Protobuf
{
/// <summary>
/// Provides extensions to messages while parsing
/// Provides extensions to messages while parsing. This API is experimental and subject to change.
/// </summary>
public sealed class ExtensionRegistry : ICollection<Extension>, IDeepCloneable<ExtensionRegistry>
{
@@ -67,9 +67,9 @@ private ExtensionRegistry(IDictionary<ObjectIntPair<Type>, Extension> collection
/// </summary>
bool ICollection<Extension>.IsReadOnly => false;

internal bool ContainsInputField(CodedInputStream stream, Type target, out Extension extension)
{
return extensions.TryGetValue(new ObjectIntPair<Type>(target, WireFormat.GetTagFieldNumber(stream.LastTag)), out extension);
internal bool ContainsInputField(CodedInputStream stream, Type target, out Extension extension)
{
return extensions.TryGetValue(new ObjectIntPair<Type>(target, WireFormat.GetTagFieldNumber(stream.LastTag)), out extension);
}

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

/// <summary>
/// Adds the specified extensions to the registry
/// </summary>
public void Add(params Extension[] newExtensions)
{
ProtoPreconditions.CheckNotNull(newExtensions, nameof(newExtensions));

Add((IEnumerable<Extension>)newExtensions);
}

/// <summary>
/// Adds the specified extensions to the reigstry
/// </summary>
public void Add(IEnumerable<Extension> newExtensions)
public void AddRange(IEnumerable<Extension> extensions)
{
ProtoPreconditions.CheckNotNull(newExtensions, nameof(newExtensions));
ProtoPreconditions.CheckNotNull(extensions, nameof(extensions));

foreach (var extension in newExtensions)
foreach (var extension in extensions)
Add(extension);
}

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

for (int i = 0; i < array.Length; i++)
{
Extension extension = array[i];
extensions.Add(new ObjectIntPair<Type>(extension.TargetType, extension.FieldNumber), extension);
for (int i = 0; i < array.Length; i++)
{
Extension extension = array[i];
extensions.Add(new ObjectIntPair<Type>(extension.TargetType, extension.FieldNumber), extension);
}
}

@@ -40,11 +40,11 @@ namespace Google.Protobuf
/// <summary>
/// Methods for managing <see cref="ExtensionSet{TTarget}"/>s with null checking.
///
/// Most users will not use this class directly
/// Most users will not use this class directly and its API is experimental and subject to change.
/// </summary>
public static class ExtensionSet
{
private static bool GetValue<TTarget>(ref ExtensionSet<TTarget> set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage<TTarget>
private static bool TryGetValue<TTarget>(ref ExtensionSet<TTarget> set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage<TTarget>
{
if (set == null)
{
@@ -60,7 +60,7 @@ public static class ExtensionSet
public static TValue Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
{
IExtensionValue value;
if (GetValue(ref set, extension, out value))
if (TryGetValue(ref set, extension, out value))
{
return ((ExtensionValue<TValue>)value).GetValue();
}
@@ -76,7 +76,7 @@ public static class ExtensionSet
public static RepeatedField<TValue> Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, RepeatedExtension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
{
IExtensionValue value;
if (GetValue(ref set, extension, out value))
if (TryGetValue(ref set, extension, out value))
{
return ((RepeatedExtensionValue<TValue>)value).GetValue();
}
@@ -111,7 +111,7 @@ public static class ExtensionSet
}

/// <summary>
/// Sets the value of the specified extension
/// Sets the value of the specified extension. This will make a new instance of ExtensionSet if the set is null.
/// </summary>
public static void Set<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension, TValue value) where TTarget : IExtendableMessage<TTarget>
{
@@ -140,14 +140,7 @@ public static class ExtensionSet
public static bool Has<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
{
IExtensionValue value;
if (GetValue(ref set, extension, out value))
{
return ((ExtensionValue<TValue>)value).HasValue;
}
else
{
return false;
}
return TryGetValue(ref set, extension, out value);
}

/// <summary>
@@ -4,7 +4,7 @@
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
<Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
<VersionPrefix>3.9.0-rc1</VersionPrefix>
<VersionPrefix>3.9.1</VersionPrefix>
<LangVersion>6</LangVersion>
<Authors>Google Inc.</Authors>
<TargetFrameworks>netstandard1.0;netstandard2.0;net45</TargetFrameworks>
@@ -407,7 +407,7 @@ private void CrossLink()

private static void AddAllExtensions(FileDescriptor[] dependencies, GeneratedClrTypeInfo generatedInfo, ExtensionRegistry registry)
{
registry.Add(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray());
registry.AddRange(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray());
}

private static IEnumerable<Extension> GetAllGeneratedExtensions(GeneratedClrTypeInfo generated)
@@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>3.9.0-rc-1</version>
<version>3.9.1</version>
<packaging>pom</packaging>

<name>Protocol Buffers [BOM]</name>
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.0-rc-1</version>
<version>3.9.1</version>
</parent>

<artifactId>protobuf-java</artifactId>
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.0-rc-1</version>
<version>3.9.1</version>
</parent>

<artifactId>protobuf-javalite</artifactId>
@@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.0-rc-1</version>
<version>3.9.1</version>
<packaging>pom</packaging>

<name>Protocol Buffers [Parent]</name>
@@ -142,6 +142,9 @@
<goals>
<goal>jar</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
</configuration>
</execution>
</executions>
</plugin>
@@ -188,13 +191,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
</configuration>
</execution>
</executions>
</plugin>
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.9.0-rc-1</version>
<version>3.9.1</version>
</parent>

<artifactId>protobuf-java-util</artifactId>
@@ -1,6 +1,6 @@
{
"name": "google-protobuf",
"version": "3.9.0-rc.1",
"version": "3.9.1",
"description": "Protocol Buffers for JavaScript",
"main": "google-protobuf.js",
"files": [
@@ -471,11 +471,14 @@ void Message_construct(zval* msg, zval* array_wrapper) {
if (upb_fielddef_containingoneof(field)) {
void* memory = slot_memory(intern->descriptor->layout,
message_data(intern), field);
uint32_t* oneof_case = slot_oneof_case(intern->descriptor->layout,
message_data(intern), field);
int property_cache_index =
intern->descriptor->layout->fields[upb_fielddef_index(field)]
.cache_index;
cached = OBJ_PROP(Z_OBJ_P(msg), property_cache_index);
*(CACHED_VALUE**)(memory) = cached;
*oneof_case = upb_fielddef_number(field);
} else {
zend_property_info* property_info;
PHP_PROTO_FAKE_SCOPE_BEGIN(Z_OBJCE_P(msg));

0 comments on commit 4315677

Please sign in to comment.
You can’t perform that action at this time.