Editions should not be used to make semantic decisions -- specific helpers (e.g. FieldDescriptor.hasPresence()) should be used instead. FileDescriptorProto can be used to access editions for *non semantic* purposes, incl. with ProtoFileUti.
These APIs have not been released yet and are thus non-breaking.
PiperOrigin-RevId: 597362543
Masking a byte by 0xFF does nothing, and the optimizer can see that. I don't think these 0xFF masks do anything in java... but they're in a lot of places so if we remove them entirely it'll be in another CL.
Before (android):
```
ldr w3, [x1, #12]
and w4, w2, #0x7f
orr w4, w4, #0x80
add w5, w3, #0x1 (1)
sxtb w4, w4
```
after:
```
ldr w3, [x1, #12]
orr w4, w2, #0x80
add w5, w3, #0x1 (1)
sxtb w4, w4
```
PiperOrigin-RevId: 591117756
These methods were deprecated as of 3.0.0 and were originally added for compatibility with gencode from old major versions (v2.x.x.) which are long out of our Cross Version Runtime Guarantees: https://protobuf.dev/support/cross-version-runtime-guarantee/
PiperOrigin-RevId: 587099512
In Java, in order to include Extensions inside a proto message, the ExtensionRegistry for the extensions must be included during deserialization, otherwise they are treated as unknown fields.
This change adds support for providing an ExtensionRegistry for TextFormat.Printer which is then used during Any deserialization.
PiperOrigin-RevId: 586807633
Users should migrate to corresponding feature accessors (e.g. FieldDescriptor.hasPresence, EnumDescriptor.isClosed) instead of deriving these based on syntax, which will break after under Editions (https://protobuf.dev/editions/overview/)
PiperOrigin-RevId: 586518687
Adds Automatic-Module-Name after it was lost during the maven-bazel migration (and subsequent re-addition of osgi bundle support).
Updates OsgiWrapper to support adding the Automatic-Module-Name header to the list of properties supported by the `osgi_java_library` rule.
Fixes#12639Closes#14562
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14562 from Sineaggi:add-automatic-module-name a27b3e6695
PiperOrigin-RevId: 579748655
This hooks up legacy proto2/proto3 editions, but prohibits them from being used in proto files. These will be hooked up directly to `syntax` declarations in a later change.
PiperOrigin-RevId: 570746314
The edition specification in proto files will remain unchanged, but it will be immediately converted to an enum by the parser. This gives us more control over the valid set of editions and simplifies ordering (just an integer comparison now). We plan to release exactly one edition per year.
PiperOrigin-RevId: 563261375
This will make the text format parser reject inputs that have a nesting depth
greater than 150. We will soon lower this number down to 100 for consistency
with other implementations.
For use cases that rely on parsing deeply nested text protos, it is possible to
create a Parser with a custom recursion limit like this:
`TextFormat.Parser.newBuilder().setRecursionLimit(i).build()`.
PiperOrigin-RevId: 552543574
`ConsumeFieldValue()` has some special logic for handling Any fields, but this
does not seem to be necessary since `mergeField` can handle Any fields on its
own. This CL therefore deletes the Any-related logic from
`ConsumeFieldValue()`.
PiperOrigin-RevId: 552540364
Currently this corner case (discovered by fuzzing) is not considered. The code throws `ArrayIndexOutOfBoundsException` which can escape `protobuf.toString()` method.
PiperOrigin-RevId: 550514062