Protobuf Team Bot
6f86726f26
Rollback version validations in Protobuf Java Lite.
...
PiperOrigin-RevId: 601122259
11 months ago
Protobuf Team Bot
659b3e7102
Internal changes.
...
PiperOrigin-RevId: 600609161
11 months ago
Protobuf Team Bot
787447430f
Breaking Change: Remove unused helper methods for creating new mutable arraylists.
...
PiperOrigin-RevId: 600581644
11 months ago
Sandy Zhang
35a6730e61
Add private constructor for JavaEditionDefaults template
...
PiperOrigin-RevId: 600548126
11 months ago
Sandy Zhang
882e7843de
Mark descriptor features as volatile to avoid data races in double-checked locking
...
PiperOrigin-RevId: 600547519
11 months ago
Protobuf Team Bot
8b92099937
Checks that only lite or full binding could exist in a process.
...
PiperOrigin-RevId: 600537100
11 months ago
Sandy Zhang
65c65c2d04
Breaking Change: Use Editions features in Java full runtimes.
...
This change breaks compatibility with old generated code from previous major versions per the Cross Version Runtime policy: https://protobuf.dev/support/cross-version-runtime-guarantee . This includes old gencode from <4.26.x, which does not resolve features.
See https://protobuf.dev/news/2023-12-05/
PiperOrigin-RevId: 600487923
11 months ago
Protobuf Team Bot
c0d08bdcad
Breaking Change: Stop generating the "newInstance" method. This is not used anymore.
...
PiperOrigin-RevId: 600123108
11 months ago
Protobuf Team Bot
adacf6d0e1
Use char indexOf rather than String, which can have a fast path implementation
...
PiperOrigin-RevId: 599529561
11 months ago
Protobuf Team Bot
979c39178b
Format CodedInputStream & Test
...
PiperOrigin-RevId: 599528929
11 months ago
Protobuf Team Bot
854ca49520
Internal versioning changes.
...
PiperOrigin-RevId: 598625150
11 months ago
Protobuf Team Bot
3b9bd6db71
Breaking Change: Remove unused overload of AbstractMessageLite.addAll that worked on a Collection instead of a List.
...
PiperOrigin-RevId: 597869849
11 months ago
Protobuf Team Bot
9310d2e817
Breaking Change: Remove obsolete runtime internalBuildGeneratedFileFrom which was for backwards compatibility with old gencode.
...
Remove `sentinel.proto` and references to it.
This was announced in https://protobuf.dev/news/2023-12-05/ per our Cross-Version Runtime Guarantees: https://protobuf.dev/support/cross-version-runtime-guarantee/
PiperOrigin-RevId: 597849821
11 months ago
Sandy Zhang
519284a559
Remove LegacyDescriptorsUtil.java and JRuby's use of legacy descriptor APIs
...
This is not a breaking change since this has not been released yet.
PiperOrigin-RevId: 597824548
11 months ago
Protobuf Team Bot
94a2a44851
Breaking Change: remove unnecessary overloads of methods:
...
hasExtension
getExtensionCount
getExtension
PiperOrigin-RevId: 597702196
11 months ago
Protobuf Team Bot
5df0387224
Breaking Change: The base class for generated messages will be
...
GeneratedMessage, not GeneratedMessageV3.
Please rerun protoc on your .proto files to regenerate the binding code.
https://protobuf.dev/news/2023-12-05/
https://protobuf.dev/support/cross-version-runtime-guarantee/
To fix source compatibility with surrounding code make these replacements:
GeneratedMessageV3 --> GeneratedMessage
SingleFieldBuilderV3 --> SingleFieldBuilder
RepeatedFieldBuilderV3 --> RepeatedFieldBuilder
PiperOrigin-RevId: 597642289
11 months ago
Sandy Zhang
63623a688c
Remove public access to Java Edition APIs e.g. getEdition(), getEditionName().
...
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
11 months ago
Sandy Zhang
592ee9b192
Update to call descriptor outer class's getDescriptor() method instead of accessing internal descriptor variable directly.
...
PiperOrigin-RevId: 597355223
11 months ago
Protobuf Team Bot
b10d3f93b6
Avoid interface calls in hot loop
...
Before, every charAt would emit (on android):
```
0x00002104 adrp x17, #+0x1000 (addr 0x3000)
0x00002108 ldr w17, [x17, #20 ]
0x0000210c ldr x0, [x0, #128 ]
0x00002110 ldr x0, [x0, #328 ]
0x00002114 ldr lr, [x0, #24 ]
0x00002118 blr lr <-- Call into String.charAt(int)
```
Now, it emits the inlined implementation of charAt (branch is for possibly compressed strings):
```
0x000020b4 ldur w16, [x4, #-8]
0x000020b8 tbnz w16, #0 , #+0xc (addr 0x20c4)
0x000020bc ldrb w4, [x4, x0]
0x000020c0 b #+0x8 (addr 0x20c8)
0x000020c4 ldrh w4, [x4, x0, lsl #1 ]
```
PiperOrigin-RevId: 591147406
1 year ago
Protobuf Team Bot
220415ddfb
Swap order of masks when assigning bytes to byte[] elements.
...
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
1 year ago
Protobuf Team Bot
0a2f7757e3
Branch-free varint size calculation. On android art, compiles to:
...
```
int com.google.android.test.Outer.computeUInt32SizeNoTag(int) [24 bytes]
0x000024d0 mov w0, #0x160
0x000024d4 clz w1, w1
0x000024d8 add w1, w1, w1, lsl #3
0x000024dc sub w0, w0, w1
0x000024e0 lsr w0, w0, #6
0x000024e4 ret
```
versus existing:
```
int com.google.android.test.Outer.computeUInt32SizeNoTag(int) [72 bytes]
0x000022a0 and w0, w1, #0xffffff80
0x000022a4 cbnz w0, #+0xc (addr 0x22b0)
0x000022a8 mov w0, #0x1
0x000022ac b #+0x38 (addr 0x22e4)
0x000022b0 and w0, w1, #0xffffc000
0x000022b4 cbnz w0, #+0xc (addr 0x22c0)
0x000022b8 mov w0, #0x2
0x000022bc b #+0x28 (addr 0x22e4)
0x000022c0 and w0, w1, #0xffe00000
0x000022c4 cbnz w0, #+0xc (addr 0x22d0)
0x000022c8 mov w0, #0x3
0x000022cc b #+0x18 (addr 0x22e4)
0x000022d0 mov w2, #0x5
0x000022d4 mov w0, #0x4
0x000022d8 and w1, w1, #0xf0000000
0x000022dc cmp w1, #0x0 (0)
0x000022e0 csel w0, w2, w0, ne
0x000022e4 ret
```
PiperOrigin-RevId: 591113652
1 year ago
Sandy Zhang
e555bd23d0
Breaking change: Remove deprecated runtime methods for compatibility with old v2.x.x gencode.
...
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
1 year ago
Sandy Zhang
dfb8a4c3f7
Breaking change: Remove deprecated TextFormat print methods. These should be replaced by corresponding TextFormat.printer() methods.
...
These methods have been deprecated as of v3.9.0 (09cab821a9
).
PiperOrigin-RevId: 587088638
1 year ago
Protobuf Team Bot
fedcd62136
Prepare methods in RuntimeVersion for Protobuf Java cross-domain version validation. No changes to Protobuf Java gencode yet.
...
PiperOrigin-RevId: 587025016
1 year ago
Protobuf Team Bot
c8e01607ae
Support pretty printing proto2 Extensions inside of proto3 Anys in TextFormat.Printer.
...
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
1 year ago
Sandy Zhang
1aeacd4f4e
Breaking change: Lock down visibility for descriptor syntax APIs.
...
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
1 year ago
Sandy Zhang
80337cb884
Automated rollback of commit 30b6251dea
.
...
PiperOrigin-RevId: 586513152
1 year ago
Protobuf Team Bot
a2f92689da
Protobuf Java Cross-version validation in OSS.
...
PiperOrigin-RevId: 585139332
1 year ago
Protobuf Team Bot
318d310e64
Create `RuntimeVersion.java` that is updated with releases to prepare version check.
...
PiperOrigin-RevId: 584346836
1 year ago
Protobuf Team Bot
81607b267c
Fix FieldSet to not load lazy fields when the fields map is cloned. In particular, if MessageSet.Builder has build() called on it, but is then later further modified, we don't need to pre-load all lazy fields during this later modification.
...
PiperOrigin-RevId: 581941605
1 year ago
Protobuf Team Bot
2ec703fcc1
Preserve lazy fields when merging FieldSets. In particular, when calling toBuilder() on a MessageSet with lazily-parsed extensions, don't eagerly parse all extensions.
...
PiperOrigin-RevId: 580492290
1 year ago
Sandy Zhang
0f1ab75dbe
Add empty feature resolution method for FileDescriptor to Java runtime.
...
PiperOrigin-RevId: 579981476
1 year ago
Clayton Walker
d580fde63a
Add Automatic-Module-Name ( #14562 )
...
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 #12639
Closes #14562
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14562 from Sineaggi:add-automatic-module-name a27b3e6695
PiperOrigin-RevId: 579748655
1 year ago
Jie Luo
1231af10c7
merge 25.x to main ( #14617 )
...
Closes #14617
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14617 from anandolee:25.x ac86c5ef32
PiperOrigin-RevId: 578996979
1 year ago
Protobuf Team Bot
3ea774370a
Internal change
...
PiperOrigin-RevId: 578944754
1 year ago
Protobuf Team Bot
6b5d8db01f
Updating version.json and repo version numbers to: 25.0
1 year ago
Protobuf Team Bot
287374e5eb
Replace try-catch Blocks with assertThrows() in GeneratedMessageTest
...
PiperOrigin-RevId: 574887696
1 year ago
Protobuf Team Bot
ba1aab2baf
Updating version.json and repo version numbers to: 25.0-rc2
1 year ago
Protobuf Team Bot
896f3d8ced
Updating version.json and repo version numbers to: 25.0-rc1
1 year ago
Sandy Zhang
6889aed460
Check-in bootstrapped Java features for Bazel and CMake
...
PiperOrigin-RevId: 573014410
1 year ago
Mike Kruskal
58722b10c9
Internal change
...
PiperOrigin-RevId: 572987133
1 year ago
Protobuf Team Bot
e5e7863189
Create the destination map bigger than the source map for MapFieldList.copy().
...
PiperOrigin-RevId: 570766040
1 year ago
Mike Kruskal
5b340ded2b
Specify proto2/proto3 defaults on feature specs.
...
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
1 year ago
Sandy Zhang
1f720d9d8a
Move Java runtime protos to correct OSS directory
...
PiperOrigin-RevId: 570129858
1 year ago
Protobuf Team Bot
e33e0d2ba5
Add `ABSL_ATTRIBUTE_LIFETIME_BOUND` attribute on generated oneof accessors.
...
This allows the compiler to statically detect use-after-free bugs.
PiperOrigin-RevId: 569504371
1 year ago
Sandy Zhang
30b6251dea
Automated rollback of commit 2a55706f9d
.
...
PiperOrigin-RevId: 569253919
1 year ago
Mike Kruskal
65419eef0d
Flip the names of edition_enum and edition.
...
We will be using the enum edition from now on, and the string field will be removed ASAP.
PiperOrigin-RevId: 568554147
1 year ago
Sandy Zhang
81068e8e8c
Internal change
...
PiperOrigin-RevId: 566426899
1 year ago
Protobuf Team Bot
785c82dbde
Fix a bad cast in put<X>BuilderIfAbsent when already present due to using the result of put() directly (which is null if it currently has no value)
...
PiperOrigin-RevId: 565425310
1 year ago
Protobuf Team Bot
47cec39ab3
Fix a NPE in put<X>BuilderIfAbsent due to using the result of put() directly (which is null if it currently has no value)
...
PiperOrigin-RevId: 564509304
1 year ago