The pyi generator now includes Kythe annotations for:
* Extension field constants (e.g., `EXTENSION_FIELD`).
* Field number constants (e.g., `STRING_FIELD_FIELD_NUMBER`).
* `Create` methods in generated Stubby client classes.
These annotations allow the Python indexer to link these generated symbols back to their definitions in the `.proto` files.
PiperOrigin-RevId: 852971617
The annotations will be handled in a subsequent change.
The change to use java.lang.String.split() instead of Guava's Splitter does introduce behavior changes in the case of handling of degenerate/malformed FieldMask paths (paths like `a///`). The handling of malformed paths shape are already arbitrary and inconsistent between the different methods in this file, and callers should not construct such paths. In a future change we may consider validating and throwing an IllegalArgumentException on such malformed paths more explicitly.
https://github.com/protocolbuffers/protobuf/issues/21173
PiperOrigin-RevId: 795126095
Existing FieldMaskUtil#trim method behavior remains the same: unset primitive fields specified in the field mask will be explicitly set to their default values after trimming.
PiperOrigin-RevId: 754114689
Otherwise, protobuf_maven_dev may provide a different version from a transitive dep, which can result in the wrong version being selected (e.g. when used for bazel-generated maven artifacts).
Also updates protobuf_util_bundle to use protobuf_maven instead of protobuf_maven_dev which is probably more appropriate since its control the deps in the pom.xml file for maven users (though this is functionally the same rn).
Fixes https://github.com/protocolbuffers/protobuf/issues/20710
PiperOrigin-RevId: 738887165
This method has existed since Java 8, released in 2014.
Also adjust the tests so that they verify unsigned integer values that are too big for the signed counterpart (for example, 4294967295 which fits in `uint32` but not `int32`).
We don't use the parallel `Long.parseUnsignedLong` because the existing code handles inputs like `"1.0"`.
PiperOrigin-RevId: 723945649
For historical reasons, our internal copy of the codebase uses
`proto2_unittest` while the open source one uses `protobuf_unittest`. This adds
a lot of friction to syncing between the two, and there's no great reason to
keep maintaining this difference, so let's just go with `proto2_unittest`.
PiperOrigin-RevId: 721951543
Because not everything is supported in j2cl and j2objc some of the methods had to be marked as incompatible (reflection , String.format...)
PiperOrigin-RevId: 691368238
This fixes parsing of invalid second value long to throw the correct exception. Most users should already be handling ParseExceptions e.g. for invalid nanos
PiperOrigin-RevId: 686281774
The default name for the rules_jvm_external.maven rule is "maven". When not set, it defaults to "maven". For root modules also using rules_jvm_external, the name clash causes a warning:
```
DEBUG: $TMP/external/rules_jvm_external~/private/extensions/maven.bzl:154:14:
The maven repository 'maven' is used in two different bazel modules,
originally in '<my_workspace>' and now in 'protobuf'
```
Summarizing @shs96c in [1]:
> The common maven repo name allows rulesets to contribute to the user's JARs.
> However, this implies that maven is for the end user, not for transitive
> dependencies. If a ruleset needs private dependencies, it should use a custom
> namespace rather than the maven namespace.
Since protobuf is not contributing to user's JARs, we'll use a custom namespace. There's precedent for using a custom namespace for library modules:
- rules_jvm_external uses `rules_jvm_external_deps` instead of `maven`.
- rules_kotlin uses `kotlin_rules_maven` instead of `maven`.
[1]: https://github.com/bazel-contrib/rules_jvm_external/issues/916#issuecomment-1645527584Fixes#16839.
Closes#18641
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18641 from jschaf:joe/protobuf-maven bd2c62f311
PiperOrigin-RevId: 684625084
We mostly use generated pom files in our release currently, so we can delete all the files that aren't used and the tools to update them.
Note, java/bom/pom.xml java/pom.xml and java/protoc/pom.xml are all still used at release and java/kotlin/pom.xml is used for documentation so all of those need to stay for now.
PiperOrigin-RevId: 659664012
They are not needed after the rules are move into protobuf repo.
Except for the reference to toolchain type, which is currently in rules_proto and can be moved after the implementation is moved into protobuf repo.
PiperOrigin-RevId: 622176865
normalized timestamp.
Without this change, an input of `9223372036854775807, 2` leads to a java.lang.ArithmeticException: overflow.
PiperOrigin-RevId: 607359958