//java:core, //java:lite, and //java:util shouldn't have this extra dependency. For now, we just add a separate version but we will look into using the java_library in protobuf_versioned_java_library in the future.
PiperOrigin-RevId: 527643325
These changes hid public APIs that are deprecated in advance of protobuf editions. They will be fully removed in a future release. Any uses of them should be migrated to the future-facing feature helpers we provide on descriptor classes.
PiperOrigin-RevId: 527422059
This should reduce some unnecessary branching off of syntax for ManifestSchemaFactory for CODE_SIZE optimization for full using schemas.
PiperOrigin-RevId: 526039969
Syntax will become meaningless once we migrate to editions. In the meantime, we've implemented APIs to expose the differences between proto2 and proto3 in terms of the features we plan to release in edition 2023.
PiperOrigin-RevId: 520433607
This will be used to make the method and enum to package-private and later to visibility-restrict other deprecated APIs for editions to prevent backslide.
PiperOrigin-RevId: 518028723
No need for a loop that that calls tryConsumeString or tryConsumeByteString repeatedly, since ConsumeByteString already loops itself.
PiperOrigin-RevId: 517202228
This fixes the following issue:
- In `FieldSet#getMessageSetSerializedSize` we delegate to `LazyField` for getting its size.
- Before this change, in `FieldSet#writeMessageTo` we do not delegate to LazyField's `byteString` method. Instead, we call `getValue` on the `FieldSet`.
- It's not guaranteed that `fieldSet.getSerializedSize() == fieldSet.getValue().getSerializedSize()`.
In particular, this can lead us to run into the message "Serializing com.google.protobuf.DynamicMessage to a byte array threw an IOException (should never happen)" because of mispredicted output size.
We fix the issue by following similar logic to `MessageSetSchema`- if "getSerializedSize" delegates to the LazyField, then the serializer should as well.
PiperOrigin-RevId: 516658372
This documents Java's non-conformant behavior where closedness is determined by the field rather than the enum definition.
PiperOrigin-RevId: 512627297
* Fix mutability bug in Java proto lite: sub-messages inside of oneofs were not
being set as immutable. This would allow code to get a builder for a
sub-message and modify the original (supposedly immutable) copy.
PiperOrigin-RevId: 511598810
* Add casts to make protobuf compatible with Java 1.8 runtime.
Fix for: https://github.com/protocolbuffers/protobuf/issues/11393
PiperOrigin-RevId: 511807920
---------
Co-authored-by: Protobuf Team Bot <protobuf-github-bot@google.com>
being set as immutable. This would allow code to get a builder for a
sub-message and modify the original (supposedly immutable) copy.
PiperOrigin-RevId: 511598810