commit 5fda5abda3dee5f7a102c85860594bff8d8610bd Author: Protobuf Team Bot Date: Tue Oct 22 13:02:24 2024 -0700 Updating version.json and repo version numbers to: 28.3 commit fe30f9a1d14e8f2b85987d4eed5c5594e6cf801f Author: zhangskz Date: Mon Oct 21 12:33:55 2024 -0400 Mute the minor version warning https://github.com/protocolbuffers/protobuf/issues/18096 (#18923) PiperOrigin-RevId: 676977787 Co-authored-by: Protobuf Team Bot commit d82fb4710c08b763064c27dee3849af499641ffa Author: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Wed Oct 16 11:08:05 2024 -0700 Populate Kotlin Manifest Files (#18859) * Give Kotlin jars an OSGi Manifest (#18812) Extend our Java OSGi library to have a version that works for Kotlin. Add a `protobuf_versioned_kt_jvm_library` that creates a bundle with the OSGi manifest and call that instead of `kt_jvm_library` for all our kotlin maven release targets. Closes #18812 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18812 from deannagarcia:kotlinOSGi 81bab06f61983c6aff6d3d009faf76c99371a358 PiperOrigin-RevId: 686220820 * Use old name of rules_kotlin commit 3b62d78dc70d2b43af5998d427452246279363c7 Author: Protobuf Team Bot Date: Thu Oct 10 13:20:48 2024 -0700 Re-export includingDefaultValueFields in deprecated state for important Cloud customer. PiperOrigin-RevId: 684555053 commit 3ea568a9b6107ebf0d617c476f53a31490fd3182 Author: Protobuf Team Bot Date: Mon Oct 7 12:22:20 2024 -0700 cherrypick restoration of mutableCopy helpers commit c4124f9ec9185c6e9a9fdca4e41a00a1223ddca5 Author: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Wed Sep 18 15:35:48 2024 -0700 Fix packed reflection handling bug in edition 2023. (#18405) This is a very narrow edge case where touching a packed extension via generated APIs first, and then doing so reflectively will trigger a DCHECK. Otherwise, reflective APIs will work but not use packed encoding for the extension. This was likely a pre-existing bug dating back to proto3, where it would only be visible on custom options (the only extensions allowed in proto3). To help qualify this and uncover similar issues, unittest.proto was migrated to editions. This turned up some other minor issues in DebugString and python. PiperOrigin-RevId: 675785611 commit 061326b00b072a6985b515fa6e305809777e08eb Author: Protobuf Team Bot Date: Wed Sep 18 12:49:17 2024 -0700 Updating version.json and repo version numbers to: 28.3-dev commit 9fff46d7327c699ef970769d5c9fd0e44df08fc7 Author: Protobuf Team Bot Date: Wed Sep 18 12:49:16 2024 -0700 Updating version.json and repo version numbers to: 28.2 commit ac9fb5b4c71b0dd80985b27684e265d1f03abf46 Author: Protobuf Team Bot Date: Tue Sep 17 12:03:36 2024 -0700 Add recursion check when parsing unknown fields in Java. PiperOrigin-RevId: 675657198 commit 9a5f5fe752a20cbac2e722b06949ac985abdd534 Author: Protobuf Team Bot Date: Thu Jul 18 07:41:01 2024 -0700 Internal change PiperOrigin-RevId: 653615736 commit 50a7745a4ac5c34e14a83a050af5d093615fff85 Author: Protobuf Team Bot Date: Fri Aug 16 16:57:47 2024 -0700 Internal change PiperOrigin-RevId: 663919912 commit 5b0e54384a7468e71369582cdb7e3babe20a7d9b Author: zhangskz Date: Wed Sep 18 14:09:39 2024 -0400 Fix cord handling in DynamicMessage and oneofs. (#18373) * Fix cord handling in DynamicMessage and oneofs. This fixes a memory corruption vulnerability for anyone using cord with dynamically built descriptor pools. * Silence expected ubsan failures from absl::Cord --------- Co-authored-by: Mike Kruskal commit f2401a1e25f60e62a4c8130f0361ec0d0541c856 Author: Protobuf Team Bot Date: Tue Sep 10 13:36:11 2024 -0700 Updating version.json and repo version numbers to: 28.2-dev commit 10ef3f77683f77fb3c059bf47725c27b3ff41e63 Author: Protobuf Team Bot Date: Tue Sep 10 13:36:10 2024 -0700 Updating version.json and repo version numbers to: 28.1 commit 976ab4188131c4fc9a9adfebea3ba9bc05459543 Author: Protobuf Team Bot Date: Wed Aug 28 09:12:10 2024 -0700 Updating version.json and repo version numbers to: 28.1-dev commit 439c42c735ae1efed57ab7771986f2a3c0b99319 Author: Protobuf Team Bot Date: Wed Aug 28 09:12:09 2024 -0700 Updating version.json and repo version numbers to: 28.0 commit 6bf01c51a0b92278958f0169d330d64a08dbb4ec Author: Sandy Zhang Date: Mon Aug 19 08:26:01 2024 -0700 Binary compatibility shims for GeneratedMessageV3, SingleFieldBuilderV3, RepeatedFieldBuilderV3, and their nested classes to restore binary compatibility with <=v3.x.x generated code built against v3.x.x prior to v4.26.0 breaking release. 3.x.x descriptor.proto generated code is *not* supported with 4.x.x runtime, since this results in an ODR violation with the descriptor.proto built into the 4.x.x runtime. This is expected to result in undefined behavior / failures. Tested against //java/core:v25_generated_message_test_jar (binary compatibility) and //java/core:v25_generated_message_test_srcjar (source compatibility) PiperOrigin-RevId: 664819152 commit aaf5f798c0c40787e82dacc80df47dd96519dbd5 Author: Deanna Garcia Date: Mon Aug 5 13:31:31 2024 -0700 Remove unused pom.xml files. 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 commit e3e43446f2d847a26fb11a7e2b03d75c1a98ba65 Author: Protobuf Team Bot Date: Thu Jul 11 15:14:14 2024 -0700 Updating version.json and repo version numbers to: 28.0-dev commit e70d04d915b83d644a7a525b6ed6df22fb27e96e Author: Protobuf Team Bot Date: Thu Jul 11 15:14:13 2024 -0700 Updating version.json and repo version numbers to: 28.0-rc1 commit 1a18882a5d233be28d9104e5be96b6f9d7f60fb6 Author: Mark Hansen Date: Tue Jul 9 18:02:30 2024 -0700 Avoid iterator allocation in FieldSet.isInitialized PiperOrigin-RevId: 650814506 commit 08a0994f4b11912f7dd81ad668a5649e83d9680e Author: Mark Hansen Date: Tue Jul 9 17:45:54 2024 -0700 Avoid allocations in FieldSet.Builder.mergeFromField - Pre-size ArrayList - Avoid iterator allocation PiperOrigin-RevId: 650811055 commit 2f3b4603a1e36779ac9196610fe28a5e30f41c56 Author: Mark Hansen Date: Tue Jul 9 17:13:46 2024 -0700 Avoid an iterator allocation in FieldSet.Builder.setField Fix some rawtypes warnings too. PiperOrigin-RevId: 650804398 commit cc5eccfb2866f6bbcac047a107e75a5175bd1460 Author: Mark Hansen Date: Tue Jul 9 17:10:52 2024 -0700 Avoid iterator allocations in FieldSet.computeFieldSize PiperOrigin-RevId: 650803788 commit 8daad6ddd4bf83e294080aece013bfc0ed034a3e Author: Mark Hansen Date: Tue Jul 9 16:53:20 2024 -0700 Avoid iterator allocations in FieldSet.writeField This is a performance optimisation. PiperOrigin-RevId: 650799480 commit b54a6aa9d35982a77a741eeea6503c52f8b7bd36 Author: Protobuf Team Bot Date: Tue Jul 9 15:06:07 2024 -0700 Remove unused static field. PiperOrigin-RevId: 650770379 commit 7f798cd8b9b345e2a4f692fa08c4f5edfe18ad38 Author: Éamonn McManus Date: Tue Jul 9 08:35:47 2024 -0700 Simplify a confusing test method in `MapLiteTest`. Looking at the code history, this test used to try two different ways to construct a proto containing map fields, and check that the resulting protos were the same. One of the ways was to obtain mutable `Map` objects for the fields, and modify those. When that possibility was removed from the proto API, the test code that used it was changed to use the other way, map-modifying methods directly on the proto class. But the end result is that the test method here was just doing the same thing twice and checking that it got the same result. PiperOrigin-RevId: 650639933 commit fba8024963b8884cfa0d3903b3b0cbed27587f02 Author: Sandy Zhang Date: Mon Jul 8 15:49:12 2024 -0700 Mark obsolete UnknownFieldParseException as deprecated This exception is unused and will be removed in the next breaking release (v5.x.x). PiperOrigin-RevId: 650399456 commit ee96b56e467375a8db2bb8c3b74cd5a37825ceb6 Author: Mark Hansen Date: Sun Jul 7 20:39:29 2024 -0700 Fix rawtypes warning suppression in FieldSet PiperOrigin-RevId: 650106954 commit 761d49a27067f74c56818e979b979bd3942a27cc Author: Mark Hansen Date: Sun Jul 7 18:46:10 2024 -0700 Add overload for LazyStringArrayList.add(String): boolean This is a performance optimisation that avoids us going through from AbstractList.add(E) to LazyStringArrayList.add(int index, String) and then having to call the index-based add in ArrayList, which has more bookkeeping around moving elements across if necessary. We can avoid that bookkeeping by adding this overload. Also, group together overloads to squash a style warning. PiperOrigin-RevId: 650089286 commit 229c958a5c9417129942959c9819f7f4ffa4c8a3 Author: Mark Hansen Date: Sun Jul 7 18:29:02 2024 -0700 Hoist SmallSortedMap.getNumArrayEntries() outside loops over array entries This should slightly speed things up. Should be safe: these operations don't change the number of entries inside the loop. PiperOrigin-RevId: 650087172 commit 27d8304aa8410cde4a8e1d9ab9134cd3cd2bcc77 Author: Protobuf Team Bot Date: Tue Jul 2 09:53:03 2024 -0700 Add a warning for gencode that is one major version older than runtime PiperOrigin-RevId: 648750618 commit e08414ca109a013d7eb15f1908ada280a6329138 Author: Mark Hansen Date: Fri Jun 28 14:19:48 2024 -0700 Remove obsolete javadoc in SmallSortedMap: parameter arraySize has been deleted PiperOrigin-RevId: 647796308 commit aca4cfcf7e7bb48d48fd337fa2e5a54d4878a35a Author: Sandy Zhang Date: Thu Jun 20 12:15:03 2024 -0700 Clean up test case to set features using custom descriptor directly instead of via reparse. PiperOrigin-RevId: 645116300 commit 7122ba1d0a93532324ab29cf05bd3fa4fd99e45e Author: Mark Hansen Date: Thu Jun 20 08:36:52 2024 -0700 Java: Deprecate newExtensionWriter. New usages should use newExtensionSerializer, which can avoid allocations for empty field sets. PiperOrigin-RevId: 645044533 commit 0812bbfcf520ec325227c0d91f2decf4bd20be1c Author: Mark Hansen Date: Mon Jun 17 16:41:15 2024 -0700 Add new runtime API that serializes empty extensions without allocating I've made a new name for the interface, ExtensionSerializer, so we can keep ExtensionWriter in the same place for backwards-compatibility for a little while. PiperOrigin-RevId: 644172922 commit 32b94fef51cf6c76a21f8d1c321ef123ea26c94e Author: Sandy Zhang Date: Mon Jun 17 15:33:54 2024 -0700 Cleanup imports and comments in V3 stubs. PiperOrigin-RevId: 644154501 commit 4d8be99f2bef888921fee52e400a27e72593e1b2 Author: Sandy Zhang Date: Mon Jun 17 14:33:18 2024 -0700 Add stubs for GeneratedMessageV3, RepeatedFieldBuilderV3, SingleFieldBuilderV3 for compatibility with older <4.26.x gencode. These classes are deprecated and will be removed in the next breaking change. Users should update gencode to >= 4.26.x which uses GeneratedMessage instead of GeneratedMessageV3. Tested with //compatibility:java_conformance_v3.25.0 which builds the runtime against 3.25.0 gencode. PiperOrigin-RevId: 644136172 commit 415a147189fff5417b18ecc515b8197a085a0d2c Author: Sandy Zhang Date: Mon Jun 17 08:16:24 2024 -0700 Reserialize all unresolved features using java features from the generated pool in case of descriptors from the custom pool. This extends previous workaround for java features in unknown fields, to include features extensions that are known but use a mismatched descriptor. This can happen when users bring their own descriptors via buildFrom. PiperOrigin-RevId: 644013578 commit 40ffd46cec1291e1320e46a134c47dd23a74ff43 Author: Mike Kruskal Date: Fri Jun 14 11:32:46 2024 -0700 Automated rollback of commit a30b25578a0435c9c692f9a54b7b060a234dc6b3. PiperOrigin-RevId: 643407401 commit 071d5351eb4f8ef9d87624a04b87c738ca80ec57 Author: Mike Kruskal Date: Fri Jun 14 10:53:06 2024 -0700 Fix data race in crosslink. This was introduced by the previous fix for delimited inheritance, and was never released. This fix removes all getType() calls from crosslink, where it's not safe to inspect the message type, which is still a placeholder, until after crosslinking. Using the inferred type is not necessary since we treat messages and groups the same during crosslink. PiperOrigin-RevId: 643394981 commit a30b25578a0435c9c692f9a54b7b060a234dc6b3 Author: Mike Kruskal Date: Thu Jun 13 17:31:37 2024 -0700 Automated rollback of commit 901b2e548c0c7b52ce824423fd92fef870ba6e2e. PiperOrigin-RevId: 643173753 commit 901b2e548c0c7b52ce824423fd92fef870ba6e2e Author: Mike Kruskal Date: Thu Jun 13 12:15:11 2024 -0700 Reorganize our bootstrapped feature gencode. PiperOrigin-RevId: 643082031 commit 8beb9705e495c57d55f6547c523d5817336ac35f Author: Mike Kruskal Date: Wed Jun 12 17:32:26 2024 -0700 Fix delimited inheritance in all languages. This was previously fixed in C++ (https://github.com/protocolbuffers/protobuf/issues/16549), but not ported to other languages. Delimited field encoding can be inherited by fields where it's invalid, such as non-messages and maps. In these cases, the encoding should be ignored and length-prefixed should be used. PiperOrigin-RevId: 642792988 commit 1cb534f3c0f8eab21d97ed8a5c58040918943ada Author: Éamonn McManus Date: Mon Jun 10 12:04:31 2024 -0700 Remove obsolete lint directive. PiperOrigin-RevId: 641979671 commit 3fe3459973a311677349906a013c461044b61f88 Author: Protobuf Team Bot Date: Thu Jun 6 10:29:03 2024 -0700 Internal change PiperOrigin-RevId: 640943875 commit 9f182da9a4fabdabde43b96bcccd9a88a16315d3 Author: Protobuf Team Bot Date: Wed Jun 5 14:26:46 2024 -0700 Internal change PiperOrigin-RevId: 640649818 commit a1e78a52e610db390f30897bb635146f8e801aaa Author: Protobuf Team Bot Date: Tue Jun 4 14:59:00 2024 -0700 Deprecate Java ShortDebugString API in favor of emittingSingleLine printer option. PiperOrigin-RevId: 640293284 commit c12c73212d40d212957db4893c4c2bf2a0e012b9 Author: Protobuf Team Bot Date: Fri May 31 05:25:33 2024 +0000 Auto-generate files after cl/638902499 commit fac847c5c5d85524fb27e8fb4a4205286bb7c44c Author: Mark Hansen Date: Thu May 30 21:11:30 2024 -0700 Full java runtime: Avoid allocating ArrayList iterators when serializing UnknownFieldSet Use old-style for loop instead. This should speed up processes that serialize many unknown fields, and reduce some GC pressure. PiperOrigin-RevId: 638889708 commit ae95fa330e42bb3d9fdd9ff597ec7a0d17dd9674 Author: Mark Hansen Date: Thu May 30 17:16:58 2024 -0700 Replace boxed boolean with primitive boolean Avoids having to call Boolean.booleanValue when passing to method. PiperOrigin-RevId: 638837295 commit bd7078debcd40823ed29a0ab197435c82b248043 Author: Mike Kruskal Date: Thu May 30 12:47:42 2024 -0700 Move back deprecation of java utf8 feature to 2024. This doesn't change the support window of the feature, but will make edition 2023 slightly less noisy. PiperOrigin-RevId: 638750805 commit 68d908768fc19a14ea2db39a24a8c04a23e29541 Author: Sandy Zhang Date: Thu May 30 11:08:35 2024 -0700 Reparse unknown features using extension registry containing Java features. This should not be needed for generated code, but may be needed for user calls to the public buildFrom method. FileDescriptorProto should really be parsed with java features in the extension registry (like other extensions), but we can handle this in Java runtime to ease editions adoption. PiperOrigin-RevId: 638715579 commit 89c27bf011432b6f6d9c6ef9f75556c1b8080c7a Author: Mark Hansen Date: Wed May 29 20:49:10 2024 -0700 Remove unused constructor argument GeneratedMessage.RealOneofAccessor.oneOfIndex PiperOrigin-RevId: 638505565 commit 4814bda38cd83d08beea3bf809d8c97b4a8e6219 Author: Protobuf Team Bot Date: Wed May 29 14:16:17 2024 -0700 Automated rollback of commit 05e5107d98452f3c1db2737a3c72c8e54f7a4ba0. PiperOrigin-RevId: 638409590 commit 05e5107d98452f3c1db2737a3c72c8e54f7a4ba0 Author: Mark Hansen Date: Tue May 28 17:47:32 2024 -0700 Avoid allocating new ExtensionWriters when serializing messages with no extensions This should speed up serializing Extendable Messages (messages with extension ranges declared in their schema) if those message instances have no extensions set inside them at runtime. PiperOrigin-RevId: 638087120 commit 433ca3e6a1252725894f941581814d282c7ad575 Author: Mike Kruskal Date: Tue May 28 12:52:53 2024 -0700 Internal changes PiperOrigin-RevId: 637993561 commit ee98ba2c18486938952a7748765f2e8e119e7fc4 Author: Mark Hansen Date: Thu May 23 17:06:36 2024 -0700 Remove unused constructor argument "descriptor" from GeneratedMessage.SingularFieldAccessor.ReflectionInvoker PiperOrigin-RevId: 636724038 commit f16c59c5a86150dc511cb484574eb409b222475c Author: Mark Hansen Date: Thu May 23 17:03:16 2024 -0700 Remove unused constructor argument "descriptor" from GeneratedMessage.RepeatedFieldAccessor.ReflectionInvoker PiperOrigin-RevId: 636723040 commit 16e0a63077bbfe889b7150543c5f176e0f637682 Author: Mark Hansen Date: Tue May 21 22:25:24 2024 -0700 Remove field SmallSortedMap.maxArraySize It's always set to 16 in production code. Except for when it's set to 0 for the immutable empty SmallSortedMap, but the number doesn't change anything for that immutable empty map (it's always empty, it will never hit the max). This should save 4 bytes of memory per SmallSortedMap. PiperOrigin-RevId: 636035193 commit c05be324da89b9fbdf3ef7adc26fb541a7352e98 Author: Mark Hansen Date: Tue May 21 22:21:45 2024 -0700 Delete unused method SmallSortedSet.getOverflowEntriesDescending PiperOrigin-RevId: 636034500 commit 3ba72807a675424ccee05648f6baaf43c2bc339b Author: Mark Hansen Date: Tue May 21 22:06:00 2024 -0700 Avoid allocating FieldSet iterator if FieldSet is empty This saves some allocations during writing out messages with extensions declared in the common case of empty FieldSet. PiperOrigin-RevId: 636031501 commit fa4bab26e48f2384844d328abe49f70ab5d85a36 Author: Protobuf Team Bot Date: Mon May 20 11:22:34 2024 -0700 Internal changes/optimizations PiperOrigin-RevId: 635516715 commit 11c27dfa4b4dd2f79b722897bc04a297c2a35c26 Author: Sandy Zhang Date: Fri May 17 09:40:32 2024 -0700 Lazily resolve features for proto2 and proto3 for compatibility with old open source gencode that does not invoke feature resolution from gencode static init. PiperOrigin-RevId: 634804242 commit a521e6e1524d94a392c2503140ad2f071edebba9 Author: Protobuf Team Bot Date: Thu May 16 19:07:12 2024 -0700 Internal chanegs PiperOrigin-RevId: 634600978 commit 24751b405a34786b89bd2cb4cec65e3b803043aa Author: Protobuf Team Bot Date: Wed May 15 12:59:42 2024 -0700 Add legacy Java TextFormat APIs PiperOrigin-RevId: 634047851 commit 05781615a13d521279823c7eb2b5799c8765c7c9 Author: Protobuf Team Bot Date: Wed May 15 09:35:22 2024 -0700 Internal changes/optimizations PiperOrigin-RevId: 633982805 commit dde03553c92867184ff5d351b7f087c052f39459 Author: Protobuf Team Bot Date: Tue May 14 13:01:17 2024 -0700 Internal change PiperOrigin-RevId: 633679764 commit bb68eb22dde9fbefc0413b7c3f836b03d062df4c Author: Protobuf Team Bot Date: Tue May 14 12:36:44 2024 -0700 Implement new Debug API with redaction. Implement emittingSingleLine TextFormat printer option. PiperOrigin-RevId: 633672722 commit c6e2778f9173ed925746197310f4d11e5f46df96 Author: Mark Hansen Date: Tue May 14 12:17:28 2024 -0700 Replace SmallSortedMap.EmptySet with equivalent Collections.emptySet() This reduces our code weight by a little (3 classes). Collections.emptySet also has a singleton empty iterator, so it doesn't allocate. PiperOrigin-RevId: 633667264 commit f7a866a9ead95176fa5022fe3d00ff2a69b8b993 Author: Mark Hansen Date: Sun May 12 17:08:19 2024 -0700 Make IntArrayList consistent with other primitive array lists, using code generator PiperOrigin-RevId: 633042614 commit c99cf4bbfaf71f735cd0dea7d6fc0b2c1a589ed2 Author: Sandy Zhang Date: Fri May 10 08:48:01 2024 -0700 Add `java` to reserved names to escape extensions to `java_`. This may break existing references to gencode for extensions named `java`. This prevents shadowing of `java.lang` package commonly used in protobuf gencode. Existing extensions named `java` may or may not previously fail to compile depending on if the contents of their .proto result in gencode using `java.lang`. This is needed to fix `java_features.proto` lite gencode since enum gencode uses `java.lang`. Fields named `java` should already be escaped. *Warning: This may break user code for existing protos with extensions named `java`. References to the extension should be renamed to use `java_` e.g. registry.add(GeneratedClassName.java_)* PiperOrigin-RevId: 632508249 commit 4b7c2d43818a71e0c6975fcf3a1f1e0f1533ce3c Author: Mark Hansen Date: Fri May 10 08:33:09 2024 -0700 Avoid allocating TreeMap in UnknownFieldSet.Builder.asMap If UnknownFieldSet is empty PiperOrigin-RevId: 632504647 commit 8c6e5b79636673435c9a8afe51dd2ffe4a2c7f4b Author: Mark Hansen Date: Fri May 10 08:29:52 2024 -0700 Avoid allocating iterator in TextFormat printing UnknownFieldSet PiperOrigin-RevId: 632503842 commit fefec687536234a46f96d0c6e209dabceaf18466 Author: Protobuf Team Bot Date: Thu May 9 15:52:11 2024 -0700 Internal changes/optimizations PiperOrigin-RevId: 632294209 commit af1ecc03531461900c1c9b8499aa64f5900bca27 Author: Protobuf Team Bot Date: Thu May 9 15:16:16 2024 -0700 Add a check to ensure that the byte limit is not negative. PiperOrigin-RevId: 632284538 commit 5584c934bf6ea873d8d96ce462896a3573401d2a Author: Protobuf Team Bot Date: Mon May 6 19:09:05 2024 -0700 Update AbstractMessageLite.addAll so that it won't throw when input is a LazyStringArrayList with byte[] elements. Accidentally run into an error when I'm doing protoA.addAllFieldA(protoB.getMutableFieldAList()) PiperOrigin-RevId: 631257710 commit c56bddd7074d3c62c94ca494e2e9983dbc98da6d Author: Mark Hansen Date: Mon May 6 17:35:05 2024 -0700 Add UnknownFieldSet.isEmpty Allows callers to check if field set is empty without cloning the map PiperOrigin-RevId: 631237925 commit d0b016fcfcd00a0e48d006f06868b8fb9876974a Author: Mark Hansen Date: Mon May 6 17:26:29 2024 -0700 Java full runtime: Avoid allocating when calling asMap on empty UnknownFieldSet PiperOrigin-RevId: 631235442 commit f5979918571af01751afa40d9c41cb6070f56f99 Author: Protobuf Team Bot Date: Mon May 6 16:03:04 2024 -0700 Return the default instance when parsing from an empty byte[]. PiperOrigin-RevId: 631213831 commit 4c8da99c4865bc7e07ec629c2d1ad32ac576554b Author: Sandy Zhang Date: Mon May 6 14:33:20 2024 -0700 Deprecate building from source with Maven to be removed in 4.28.x. Most users should use the *pre-built* artifacts, or should build from source with Bazel instead. PiperOrigin-RevId: 631187695 commit 4f12891b87a99ecabdc1e1039d0587094e9b57cd Author: Mark Hansen Date: Thu May 2 18:13:35 2024 -0700 Java full runtime: Avoid allocating iterator if UnknownFieldSet's TreeMap is empty I also considered using Collections.emptyNavigableMap(), which I thought might use a specialized allocation free empty iterator, but it allocates, and its clone() method isn't nicely exposed. PiperOrigin-RevId: 630234849 commit 39a1c6a46e6921577cab24440fb16e7a1e903f63 Author: Éamonn McManus Date: Wed May 1 12:47:43 2024 -0700 In the Kotlin DSL, reference builder methods with property syntax. Instead of _builder.getFoo() and _builder.setFoo(value), the generated code now uses _builder.foo and _builder.foo = value. When compiling against the Java Proto API, this makes no difference, since the Kotlin compiler treats Java methods getFoo/setFoo as defining a Kotlin property foo. But if a compatible proto API is implemented in Kotlin then there is no such equivalence. Such an implementation would have to define either both forms or just the one that the DSL uses. For a Kotlin API it is more natural to use properties. Similarly, the generated Java methods getFoosList(), getFoosCount(), getFoosMap(), and getEnumValue() are accessed via property names (foosList, foosCount, foosMap, enumValue). (This is the second application of this change. The first had to be rolled back because it didn't handle conflict-resolution names correctly.) PiperOrigin-RevId: 629807104 commit fb054c8e4141b0fe50c33d237a6650d98a412de8 Author: Mark Hansen Date: Tue Apr 30 18:05:14 2024 -0700 Java Proto lite: avoid boxing Integers accessing enum lists Provide a specialization for ListAdapter that avoids boxing ints into Integers. Use this for repeated enum accessors. In practice, the ints for most enums will fit into the JDK's "boxed int cache", avoiding extra allocations. For large enum numbers, they won't fit, and would allocate. Removing the boxing should also slightly speed up code. PiperOrigin-RevId: 629583247 commit c24e7529eb7a709285a5e61d8d05a347576de7c6 Author: Éamonn McManus Date: Tue Apr 30 07:24:51 2024 -0700 Automated rollback of commit e9c9970eb4ac488d9fb94e8dea6945d3881c405d. PiperOrigin-RevId: 629405086 commit e9c9970eb4ac488d9fb94e8dea6945d3881c405d Author: Éamonn McManus Date: Mon Apr 29 16:25:34 2024 -0700 In the Kotlin DSL, reference builder methods with property syntax. Instead of `_builder.getFoo()` and `_builder.setFoo(value)`, the generated code now uses `_builder.foo` and `_builder.foo = value`. When compiling against the Java Proto API, this makes no difference, since the Kotlin compiler treats Java methods `getFoo`/`setFoo` as defining a Kotlin property `foo`. But if a compatible proto API is implemented in Kotlin then there is no such equivalence. Such an implementation would have to define either both forms or just the one that the DSL uses. For a Kotlin API it is more natural to use properties. Similarly, the generated Java methods `getFoosList()`, `getFoosCount()`, `getFoosMap()`, and `getEnumValue()` are accessed via property names (`foosList`, `foosCount`, `foosMap`, `enumValue`). PiperOrigin-RevId: 629220383 commit de6aba9f639ced3dce03310121aa69c914eb7b0e Author: Protobuf Team Bot Date: Sun Apr 28 17:27:38 2024 -0700 Java Proto Lite: Serialize repeated enums without allocating Serialize repeated enums without allocating PiperOrigin-RevId: 628915124 commit eaee04d89719ed8e0fde96b6d37cf741d866f511 Author: Protobuf Team Bot Date: Mon Apr 22 16:02:13 2024 -0700 Avoid boxing when serializing primitive lists in CodedOutputStreamWriter Previously, these List.get methods returned Object, forcing boxing, and (if not in the primitive's box cache) allocation, with all the cost that entails. I've taken the approach of duplicating methods to specialise for primitives, like BinaryWriter does for non-lite protos. I initially considered checking the class of the list on every iteration of the loop, but that feels wasteful, when we can check it once at the start of the loop. This also means we have the same behaviour as serverside protos. At the cost of a few more methods, but hopefully they're trivially inlineable, so hopefully leading to a small dex increase without really increasing the method count. Given this is a public API, I don't think we can remove the List overloads either. PiperOrigin-RevId: 627183583 commit 971f88aa636b5f996775cc37394bc717f17ca0b3 Author: Protobuf Team Bot Date: Fri Apr 19 15:07:28 2024 -0700 Improve C++, Python, Java runtime version representations to avoid merge conflicts during release. PiperOrigin-RevId: 626480269 commit 95877d85691e30fab092a8b070548286aa64da7e Author: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu Apr 18 10:40:11 2024 -0700 Updating version.json and repo version numbers to: 28-dev (#16555) Closes #16555 PiperOrigin-RevId: 626081638 commit 57a6e8df1c8dd44962b4d3357ba93e7291d79191 Author: Mike Kruskal Date: Wed Apr 17 16:31:41 2024 -0700 Add dedicated tests to lock down that overridable defaults never change. Once an edition is released these should be fixed forever. On the other hand, the fixed defaults may see new features included as we change legacy behaviors in future editions. PiperOrigin-RevId: 625842071 commit 6afdd5a135fddd58d3d1e0b45c9ee36f3e6a4bf2 Author: Protobuf Team Bot Date: Wed Apr 17 22:09:39 2024 +0000 Auto-generate files after cl/625815212 commit c755d9ac1af597f654b6ed38fecc0dc9f0b78628 Author: Protobuf Team Bot Date: Wed Apr 17 08:14:24 2024 -0700 Add `load()` statements for the Bazel builtin top-level java symbols Loads are being added in preparation for moving the symbols out of Bazel and into `rules_java`. PiperOrigin-RevId: 625688195 commit db5814e4ffd25485538cec474ac340aef9ea709e Author: Mike Kruskal Date: Tue Apr 16 19:15:46 2024 -0700 Use newly split feature defaults in plugins and runtimes. The new fields fixed_features and overridable_features can be simply merged to recover the old aggregate defaults. By splitting them though, plugins and runtimes get some extra information about lifetimes for enforcement. PiperOrigin-RevId: 625527117 commit ea81024ddf764cba2b39c3581cefe294f9a41391 Author: Mike Kruskal Date: Tue Apr 16 11:11:03 2024 -0700 Refactor editions infrastructure to a top-level directory. The only public target here is the edition defaults helper macro, which can be used by external runtimes and plugins. None of this code is C++-specific though, and should be organized higher up. Appropriate aliases are also placed at the top level for public targets PiperOrigin-RevId: 625392504 commit a5be8bdb9fd2095bdc04e010824f0daa796216da Author: Protobuf Team Bot Date: Mon Apr 15 21:44:54 2024 +0000 Auto-generate files after cl/625084569 commit 7d87a1780a17b05afd38f882c28d846e96c5470b Author: Mike Kruskal Date: Thu Apr 11 14:14:43 2024 -0700 Hook up staleness tests to non-bootstrap edition defaults PiperOrigin-RevId: 623936729 commit 77f62de93e2e84d6aab0364629919779970fb9f1 Author: Mike Kruskal Date: Wed Apr 10 20:24:06 2024 -0700 Define lifetimes of edition 2023 features PiperOrigin-RevId: 623690798 commit a94f57bd69e9a5999ba67736e4d70a9d7f96aaf5 Author: Protobuf Team Bot Date: Tue Apr 9 22:58:08 2024 -0700 Check that size is non-negative when reading string or bytes in StreamDecoder. This ensures that StreamDecoder throws a InvalidProtocolBufferException instead of an IllegalStateException on some invalid input. All other implementations of CodedInputStream already do this check. PiperOrigin-RevId: 623383287 commit 29c69ff00b58b60e67fcf40fd810009bd39b86c6 Author: Mike Kruskal Date: Fri Apr 5 13:00:59 2024 -0700 Fix text-format delimited field handling This updates all our text parsers and serializers to better handle tag-delimited fields under editions. Under proto2, groups were the only tag-delimited fields possible, and the group name (i.e. the message type) was guaranteed to be unique. Text-format and various generators used this instead of the synthetic field name (lower-cased group name) to represent these fields. Under editions, we've removed group syntax and allowed any message field to be tag-delimited. This breaks those cases when adding new tag-delimited fields where the message type might not be unique or correspond to the field name. Code generators have already been fixed to treat "group-like" fields using the old behavior, and treat new fields like any other sub-message. This change addresses the text-format issue. Text parsers will accept *either* the type or field name for "group-like" fields, and only the field name for every other message field. Text serializers will continue to emit the message name for "group-like" fields, but also use the field name for everything else. This creates some awkward capitalization behavior for fields that happen to *look* like proto2 groups, but it won't lead to any conflicts or invalid encodings. A feature will likely be added to edition 2024 to allow for migration off this legacy behavior. PiperOrigin-RevId: 622260327 commit 21d75f861cdbc03b0a6b235a9ccf3ba0e1f09b32 Author: Protobuf Team Bot Date: Fri Apr 5 07:45:26 2024 -0700 Remove references to rules_proto 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 commit 1ebec9a4c3adbfc37edcf77fc0bb83983c03f4f0 Author: Protobuf Team Bot Date: Wed Apr 3 09:05:59 2024 -0700 Add `load()` statements for the builtin Bazel java rules Loads are being added in preparation for moving the rules out of Bazel and into `rules_java`. PiperOrigin-RevId: 621541265 commit 83ec410d3005e850d5a8ef79e389b71ab7eebce6 Author: Protobuf Team Bot Date: Tue Mar 26 18:50:37 2024 -0700 Internal change PiperOrigin-RevId: 619377672 commit 6c45efd2975416804e82b4b9ed48ad962b442c2a Author: Sandy Zhang Date: Tue Mar 26 13:40:36 2024 -0700 Fix validateFeatures to be called after resolved features are actually set to this.features PiperOrigin-RevId: 619296935 commit 274bc7f26ff9da996714cf5cd011a7edaf6ce34c Author: Sandy Zhang Date: Mon Mar 25 17:58:04 2024 -0700 Move java_features.proto to java/core/srce/main/resources This also fixes maven to package this correctly as google/protobuf/java_features.proto (same dir as WKT/descriptor.proto) instead of com/google/protobuf/java_features.proto. Fixes https://github.com/protocolbuffers/protobuf/issues/16155 PiperOrigin-RevId: 619015714 commit b36458fd80af11f66362722591309e9e78867296 Author: Liam Miller-Cushon Date: Mon Mar 25 11:42:34 2024 -0700 Make `NioByteString` private member class of `ByteString` PiperOrigin-RevId: 618910772 commit 9ce51d1ed819a627aac964f445d354e0212338e1 Author: Sandy Zhang Date: Mon Mar 25 08:57:57 2024 -0700 Set label to REQUIRED for descriptors with LEGACY_REQUIRED feature. Ensures isOptional() does not return true for LEGACY_REQUIRED fields which would otherwise get the optional label applied by default (non-optional fields still get the optional label). Adds validation to feature resolution instead of cross link, which is too early to have FieldPresence.LEGACY_REQUIRED resolved. PiperOrigin-RevId: 618857590 commit 369732a581f44adc5a4dc5a03c866e9c7f04dc14 Author: Sandy Zhang Date: Fri Mar 22 14:55:29 2024 -0700 Add java_features.proto to kotlin_mvn release PiperOrigin-RevId: 618295219 commit 500c953d105d0447479be259a5fb0b6f7124e978 Author: Sandy Zhang Date: Fri Mar 22 12:08:23 2024 -0700 Enable editions support for Java Lite. java_features.proto and descriptor.proto should now both be included in the Java Lite and Kotlin Lite maven releases. Fixes https://github.com/protocolbuffers/protobuf/issues/7331 PiperOrigin-RevId: 618251348 commit 821e854b5a350bbf9e3e5f34abc3d666bef09fdd Author: Protobuf Team Bot Date: Thu Mar 21 15:43:05 2024 -0700 Automated Code Change PiperOrigin-RevId: 617984990 commit 0e167e796fcdaea0a761cdddbc21f59c925a75cf Author: Mike Kruskal Date: Thu Mar 21 12:49:08 2024 -0700 Disallow all feature types except enum and boolean. Features are designed as temporary migration tools, and any unbounded type leaves the system open to unexpected use. Features should have a fixed set of values, with well defined behaviors. PiperOrigin-RevId: 617933544 commit 925de189ecb8aa9b7dcd733ad46c651c12ca42d2 Author: Sandy Zhang Date: Tue Mar 19 12:12:42 2024 -0700 Fix mistake in osgi.bzl to actually use list source_jars. Bazel 7 updated java_out.source_jars to return a Depset. Release images are still on Bazel 6, but cloudtops were updated to Bazel 7 already. PiperOrigin-RevId: 617253874 commit 2c07ea5317128d24ad5e7a790f55437b6058f810 Author: Liam Miller-Cushon Date: Mon Mar 18 14:47:17 2024 -0700 Suppress a warning about a class initializer cycle PiperOrigin-RevId: 616953542 commit 742ddf1155af35c9e29013c2d2ece350322a579e Author: Sam Gammon Date: Fri Mar 15 19:31:38 2024 -0700 fix(java): fixup test codegen for maven build (#16176) ## Summary Fixes and closes protocolbuffers/protobuf#16170 by adding missing test-gen mappings and exclusions. Recent [changes](https://github.com/protocolbuffers/protobuf/pull/15362) to Protocol Buffers, along with the addition of the _Editions_ feature, have evolved ahead of Maven; running the build on `main` shows build errors related to the testsuite. ## Changelog - fix: missing test-gen mappings - fix: missing test exclusions Closes #16176 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16176 from sgammon:fix/issue-16170 2be118cf9ac01fb47a843ebec6734ee689e13439 PiperOrigin-RevId: 616310039 commit 1e808d5ececc34220a87b83ab95a88ceb2598de8 Author: Sandy Zhang Date: Fri Mar 15 15:36:12 2024 -0700 Remove extra whitespace line in JavaEditionDefaults template PiperOrigin-RevId: 616261718 commit dc484c131e5e9fa50a005f0ffbdf1c18928b2216 Author: Mike Kruskal Date: Wed Mar 6 16:10:49 2024 -0800 Fix has_presence to account for proto3 extensions in Java. PiperOrigin-RevId: 613373080 commit f1d3f28ecab5462a8d73bac3b3b56d9c3fe82d31 Author: Protobuf Team Bot Date: Wed Mar 6 12:03:34 2024 -0800 Automated rollback of commit 976a6eb6a4f462c6bb0b2a87fcd95f0aeb17eedb. PiperOrigin-RevId: 613296331 commit 9f001a965872b1c82e0f61e53aefb92109357213 Author: Sandy Zhang Date: Tue Mar 5 14:36:14 2024 -0800 Fix descriptor to access type via getType() s.t. messages using delimited encoding are consistently treated as groups for Java lite. This should fix InvalidWireTypeException in the case of getLiteType() not treating messages with delimited encoding as groups: http://shortn/_2TEPuwIj6P getJavaType() and needsUtf8Check() changes are no-ops since the type is the same regardless, but these are updated for consistency. PiperOrigin-RevId: 612972996 commit 0070ac118863d7bfd12fa3eeab09e78178e41c65 Author: Protobuf Team Bot Date: Tue Feb 27 09:59:56 2024 -0800 Make UnsafeByteOperations stable; removing experimental annotation. PiperOrigin-RevId: 610787227 commit 8a17f5ddeb3cd56033869f29e161aee6ea39a244 Author: Sandy Zhang Date: Tue Feb 27 09:48:00 2024 -0800 Resolve features directly in setProto instead of temporarily setting to null. Avoid potential races with other threads reading features that do not share a lock while features are temporarily null. Special handling for proto1 mutable should not actually be needed, since setProto doesn't update dependency protos. PiperOrigin-RevId: 610783483 commit eb10ebd169593600e57106d6cdc84d6ad226f9a8 Author: Sandy Zhang Date: Fri Feb 23 14:36:51 2024 -0800 Fix features inheritance of oneof fields and extensions and fix/move unit tests to actually run. JUnit4 does not support nested tests so these weren't running. Fixes setup problems and test logic. Oneof fields now inherit from their oneof, and top-level extensions inherit from top-level file when parent descriptor is null. PiperOrigin-RevId: 609840087 commit 5d876c9fec1a6f2feb0750694f803f89312bffff Author: Protobuf Team Bot Date: Thu Feb 22 13:56:47 2024 -0800 Point to released versions in Java Protobuf (lite) READMEs instead of the the next, unreleased version. https://github.com/protocolbuffers/protobuf/issues/15878 PiperOrigin-RevId: 609488730 commit 976a6eb6a4f462c6bb0b2a87fcd95f0aeb17eedb Author: Protobuf Team Bot Date: Thu Feb 15 14:33:19 2024 -0800 Rolling back while figuring out why some tests failed. PiperOrigin-RevId: 607458035 commit 1f9b71e9dd33d73209fa8c9e682c4523047cda3a Author: Protobuf Team Bot Date: Thu Feb 15 09:30:47 2024 -0800 Check if the number of seconds is valid for a timestamp before creating a normalized timestamp. Without this change, an input of `9223372036854775807, 2` leads to a java.lang.ArithmeticException: overflow. PiperOrigin-RevId: 607359958 commit 89bea3685671299fa0ea78f8b60f69e2822026fb Author: Ian Baker Date: Tue Feb 13 23:18:27 2024 -0800 Document that `Timestamps.parse` might emit zero fractional digits PiperOrigin-RevId: 606870523 commit 3ab1276bbb5c629a509103f1da2abd72a3a25e08 Author: aiuto Date: Tue Feb 13 09:06:30 2024 -0800 Update Bazel references to rules_pkg to the supported file locations. (#15780) WIP: I want to see this pass CI first. Fixes: #15779 3 scripted transforms: ``` -load("@rules_pkg//:mappings.bzl", ...) +load("@rules_pkg//pkg:mappings.bzl", ...) ``` ``` -load("@rules_pkg//:pkg.bzl", "pkg_tar") +load("@rules_pkg//pkg:tar.bzl", "pkg_tar") ``` ``` -load("@rules_pkg//:pkg.bzl", "pkg_zip") +load("@rules_pkg//pkg:zip.bzl", "pkg_zip") ``` Closes #15780 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15780 from aiuto:rules_pkg a6302763410752e1d21ab263c86ad6340aba5229 PiperOrigin-RevId: 606641398 commit c98bdc2bdc0a85b34910730c34d33b2e7bee1600 Author: Jiri Pechanec Date: Mon Feb 5 20:33:13 2024 -0800 Add missing generated file (#15693) The proto file is required for Java test. Otherwise it fails with ``` [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project protobuf-java: Compilation failure: Compilation failure: [ERROR] /tmp/protocolbuffers-protobuf-3.25.2/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[46,25] cannot find symbol [ERROR] symbol: class UnittestRetention [ERROR] location: package protobuf_unittest [ERROR] /tmp/protocolbuffers-protobuf-3.25.2/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[550,27] cannot find symbol [ERROR] symbol: variable UnittestRetention [ERROR] location: class com.google.protobuf.DescriptorsTest [ERROR] /tmp/protocolbuffers-protobuf-3.25.2/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[551,37] cannot find symbol [ERROR] symbol: variable UnittestRetention [ERROR] location: class com.google.protobuf.DescriptorsTest [ERROR] /tmp/protocolbuffers-protobuf-3.25.2/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[552,37] cannot find symbol [ERROR] symbol: variable UnittestRetention [ERROR] location: class com.google.protobuf.DescriptorsTest [ERROR] /tmp/protocolbuffers-protobuf-3.25.2/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[553,37] cannot find symbol [ERROR] symbol: variable UnittestRetention [ERROR] location: class com.google.protobuf.DescriptorsTest [ERROR] -> [Help 1] ``` Closes #15693 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15693 from jpechane:add-missing-file 9293fabf1f97630761afd3fddab0156547be45c1 PiperOrigin-RevId: 604518500 commit 5d4fd7ef84573e7fcaa305286165e38314b4684f Author: Luke Sandberg Date: Mon Feb 5 19:43:46 2024 -0800 Clarify docs on MapFieldReflectionAccessorInternal and add tests for the mutability of lists returned from `getAllFields()` PiperOrigin-RevId: 604508075 commit 34a04c1fd51f799f94f8cd5c6eec0124e43761af Author: Chris Kennelly Date: Mon Feb 5 15:50:56 2024 -0800 Remove lazy=true from repeated fields. This is currently a no-op in protoc. PiperOrigin-RevId: 604457261 commit 26995798757fbfef5cf6648610848e389db1fecf Author: Protobuf Team Bot Date: Mon Feb 5 11:31:58 2024 -0800 Breaking change: Remove the deprecated always_print_primitive_fields option from Java, Python and C++ JSON parsers. The replacement always_print_without_presence_fields should be used instead, which is very similar but has consistent handling of optional fields by not affecting them. PiperOrigin-RevId: 604381178 commit 986d691d77f2734a63659c77a8464e2fe0475262 Author: Protobuf Team Bot Date: Mon Feb 5 10:54:30 2024 -0800 use "proto3_optional" option as signal that a field has presence. This is technically redundant with the synthetic oneof container, but simplifies some tooling. PiperOrigin-RevId: 604368850 commit 7d43131a0a3a2a7640208849eeac016c6c61374e Author: Protobuf Team Bot Date: Mon Feb 5 05:51:51 2024 -0800 Rename the 'includingDefaultValueWithoutPresenceFields' and 'always_print_without_presence_fields' to 'alwaysPrintFieldsWithNoPresence' in the Cpp, Py and Java JSON serializers for consistency. PiperOrigin-RevId: 604292220 commit 2faa9d1a5fb89ed3f4486d340e9db3bf39e4c2ad Author: Sandy Zhang Date: Fri Feb 2 19:57:36 2024 -0800 Force descriptor initialization of dependencies *before* internalUpdateFileDescriptor(). This fixes an edge-case where EnumDescriptor for a custom option may be unresolved if used in the same file, since adding the field to ExtensionRegistry doesn't trigger its static init block if the Enum is imported from a dependency. Also renames feature resolution methods exposed from gencode. Private resolveAllFeaturesInternal() method may be renamed back to resolveAllFeatures() in a followup change. PiperOrigin-RevId: 603852391 commit 9252b64ef3887e869999752010d553f068338a60 Author: Sandy Zhang Date: Fri Feb 2 15:23:49 2024 -0800 Automated rollback of commit 0ee34d35def2f07a4a5365b68af7ddeba8114df6. PiperOrigin-RevId: 603802046 commit 3924ea28cc47b901b1c6c580ed5d22613f0a0676 Author: Protobuf Team Bot Date: Fri Feb 2 10:45:38 2024 -0800 Automated rollback of commit 531d4372f4ebe92dcbe8a921c7d2f97a16dd8be5. PiperOrigin-RevId: 603728275 commit 0ee34d35def2f07a4a5365b68af7ddeba8114df6 Author: lowasser Date: Thu Feb 1 17:27:39 2024 -0800 Simplify (and optimize) Descriptors.FileDescriptor.latin1Cat. PiperOrigin-RevId: 603529248 commit d111589bc05f0c11d9d2b0e230bc3217f24feb40 Author: Protobuf Team Bot Date: Thu Feb 1 12:32:06 2024 -0800 Add a new 'includingDefaultValueWithoutPresenceFields' option to the Java parser which is intended to replace the current 'includingDefaultValueFields'. The old flag accidentally had inconsistent behavior between proto2 optional and proto3 optional fields, the new flag treats them consistently (and is consistent with the preexisting behavior of the Go JSON serializer). includingDefaultValueFields is now deprecated and will be removed in an upcoming release. PiperOrigin-RevId: 603449195 commit 44ec9d9e86ebdd410a4b613682fb57506d6a113b Author: Protobuf Team Bot Date: Tue Jan 30 10:32:12 2024 -0800 Automated rollback of commit 58baeb4c3b664f8918d24cef5151083d9da9767c. PiperOrigin-RevId: 602770552 commit 531d4372f4ebe92dcbe8a921c7d2f97a16dd8be5 Author: Luke Sandberg Date: Tue Jan 30 08:37:21 2024 -0800 Internal change PiperOrigin-RevId: 602736730 commit 58baeb4c3b664f8918d24cef5151083d9da9767c Author: Protobuf Team Bot Date: Tue Jan 30 06:50:19 2024 -0800 Add a new 'includingDefaultValueWithoutPresenceFields' option to the Java parser which is intended to replace the current 'includingDefaultValueFields'. The old flag accidentally had inconsistent behavior between proto2 optional and proto3 optional fields, the new flag treats them consistently (and is consistent with the preexisting behavior of the Go JSON serializer). PiperOrigin-RevId: 602711486 commit 85938aa654879153203c2def0be594e0be4a563d Author: Sandy Zhang Date: Thu Jan 25 18:36:56 2024 -0800 Update internalUpdateFileDescriptor() to synchronize setProto() and resolveAllFeatures() to avoid data races. PiperOrigin-RevId: 601628994 commit 9146ce6ddba3b74ad16a0f440f9cf9d73ba282c7 Author: Dennis Shao <67387070+shaod2@users.noreply.github.com> Date: Thu Jan 25 09:16:31 2024 -0800 Updating version.json and repo version numbers to: 27-dev (#15590) Closes #15590 PiperOrigin-RevId: 601468713 commit 17729cc5e50bf9ca68361aca03905c3d32749f74 Author: Sandy Zhang Date: Wed Jan 24 12:31:28 2024 -0800 Call ExtensionRegistry.add for JavaFeaturesProto.java directly. PiperOrigin-RevId: 601200193 commit 6f86726f26f90f27d316492f3d20b0043782d051 Author: Protobuf Team Bot Date: Wed Jan 24 08:03:03 2024 -0800 Rollback version validations in Protobuf Java Lite. PiperOrigin-RevId: 601122259 commit 303239d74d07daf49ecdba6e23e41c8fe5a9b41e Author: Sandy Zhang Date: Mon Jan 22 16:51:03 2024 -0800 Drop Protobuf support for Android KitKat per EOL and add existing minimum Java 1.8 in Maven pom.xmls See https://android-developers.googleblog.com/2023/07/google-play-services-discontinuing-updates-for-kitkat.html for more details on Android KitKat EOL. PiperOrigin-RevId: 600609333 commit 659b3e7102209590c940d84632959be1540a80a0 Author: Protobuf Team Bot Date: Mon Jan 22 16:50:21 2024 -0800 Internal changes. PiperOrigin-RevId: 600609161 commit 787447430fc9a69c071393e85a380b664d261ab4 Author: Protobuf Team Bot Date: Mon Jan 22 15:03:46 2024 -0800 Breaking Change: Remove unused helper methods for creating new mutable arraylists. PiperOrigin-RevId: 600581644 commit 35a6730e616912e0b5ca06ecd484de0337b71a44 Author: Sandy Zhang Date: Mon Jan 22 13:10:11 2024 -0800 Add private constructor for JavaEditionDefaults template PiperOrigin-RevId: 600548126 commit 882e7843ded60f3f38a153ef779b66ea1215d0a3 Author: Sandy Zhang Date: Mon Jan 22 13:08:12 2024 -0800 Mark descriptor features as volatile to avoid data races in double-checked locking PiperOrigin-RevId: 600547519 commit 8b92099937ab8c1eb780d4893d3f5fcaf3ee22c0 Author: Protobuf Team Bot Date: Mon Jan 22 12:33:02 2024 -0800 Checks that only lite or full binding could exist in a process. PiperOrigin-RevId: 600537100 commit 65c65c2d04b293225db150029d005056a9f078b8 Author: Sandy Zhang Date: Mon Jan 22 09:54:16 2024 -0800 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 commit c0d08bdcade9d44698015b85c9c23343ca1319b7 Author: Protobuf Team Bot Date: Sat Jan 20 12:52:42 2024 -0800 Breaking Change: Stop generating the "newInstance" method. This is not used anymore. PiperOrigin-RevId: 600123108 commit adacf6d0e17bb90d37965a5901478ddce23656c6 Author: Protobuf Team Bot Date: Thu Jan 18 09:22:38 2024 -0800 Use char indexOf rather than String, which can have a fast path implementation PiperOrigin-RevId: 599529561 commit 979c39178b567a534b389bf4bc195628e30dc4b4 Author: Protobuf Team Bot Date: Thu Jan 18 09:20:40 2024 -0800 Format CodedInputStream & Test PiperOrigin-RevId: 599528929 commit 9188b39fb7e09df87bd2fed31fb756de70ff510f Author: Joshua Haberman Date: Wed Jan 17 10:33:50 2024 -0800 Shorten our license headers into an abbreviated form that references LICENSE instead of including it in full. PiperOrigin-RevId: 599218886 commit 854ca495205db43b5eae9ae9e7d75a3a1a1a7fd3 Author: Protobuf Team Bot Date: Mon Jan 15 09:26:31 2024 -0800 Internal versioning changes. PiperOrigin-RevId: 598625150 commit 3b9bd6db71d20832980e579e0b9b03eb39e96a1f Author: Protobuf Team Bot Date: Fri Jan 12 09:55:53 2024 -0800 Breaking Change: Remove unused overload of AbstractMessageLite.addAll that worked on a Collection instead of a List. PiperOrigin-RevId: 597869849 commit 9310d2e817a987878b03f8b5215fdbfea766ad23 Author: Protobuf Team Bot Date: Fri Jan 12 08:41:07 2024 -0800 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 commit 519284a55961fca339d69d516c31bd62082c177b Author: Sandy Zhang Date: Fri Jan 12 06:25:02 2024 -0800 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 commit 94a2a448518403341b8aa71335ab1123fbdcccd8 Author: Protobuf Team Bot Date: Thu Jan 11 18:07:11 2024 -0800 Breaking Change: remove unnecessary overloads of methods: hasExtension getExtensionCount getExtension PiperOrigin-RevId: 597702196 commit 5df0387224e8e3b7c04f48c6f25a8ec1fc957a10 Author: Protobuf Team Bot Date: Thu Jan 11 13:38:38 2024 -0800 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 commit 63623a688c0f4329cfe4161bbaa2666f34c2be33 Author: Sandy Zhang Date: Wed Jan 10 14:50:05 2024 -0800 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 commit 592ee9b192d8f7369d52d3082a42c7620039c12e Author: Sandy Zhang Date: Wed Jan 10 14:22:07 2024 -0800 Update to call descriptor outer class's getDescriptor() method instead of accessing internal descriptor variable directly. PiperOrigin-RevId: 597355223 commit 4ec9170bcdfaba23c15fbbc90917e6316a99cc86 Author: Adam Cozzette Date: Thu Dec 28 14:40:25 2023 -0800 Fix layering check for usage of gtest To satisfy the layering check, we need to depend on :gtest for the headers, in addition to :gtest_main which provides the main() function. There are a bunch of formatting changes as a side effect of this, but they should be harmless. PiperOrigin-RevId: 594318263 commit b10d3f93b689a0b39fbc861d8d367491b4442a4f Author: Protobuf Team Bot Date: Thu Dec 14 22:16:21 2023 -0800 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 commit 220415ddfb59d16c9309e5bae37bed3be0943a25 Author: Protobuf Team Bot Date: Thu Dec 14 19:17:14 2023 -0800 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 commit 0a2f7757e38b07c2e40c5c885a7100e8c16eb40f Author: Protobuf Team Bot Date: Thu Dec 14 18:54:05 2023 -0800 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 commit 2d7376ea378b14548b1d417df285a0a5c84957ba Author: Protobuf Team Bot Date: Thu Dec 14 02:38:22 2023 -0800 Internal change PiperOrigin-RevId: 590871044 commit e555bd23d077216ea40006c45eeaaa5aa385d921 Author: Sandy Zhang Date: Fri Dec 1 13:18:30 2023 -0800 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 commit dfb8a4c3f75910d37095a990706c0ae2c2e26b0f Author: Sandy Zhang Date: Fri Dec 1 12:38:32 2023 -0800 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 (https://github.com/protocolbuffers/protobuf/commit/09cab821a96c52b7b3482bd993177a33098012a8). PiperOrigin-RevId: 587088638 commit fedcd62136ee291ef4acc82e32e84e287e44419a Author: Protobuf Team Bot Date: Fri Dec 1 09:01:02 2023 -0800 Prepare methods in RuntimeVersion for Protobuf Java cross-domain version validation. No changes to Protobuf Java gencode yet. PiperOrigin-RevId: 587025016 commit c8e01607aec4c09f510aa7e0d5df6a204e74189e Author: Protobuf Team Bot Date: Thu Nov 30 15:38:35 2023 -0800 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 commit 1aeacd4f4eb4e0aa05d6336e2988a565e475e9a0 Author: Sandy Zhang Date: Wed Nov 29 19:32:22 2023 -0800 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 commit 80337cb88481c636d136e3db2330e7d5a9759f2d Author: Sandy Zhang Date: Wed Nov 29 18:53:44 2023 -0800 Automated rollback of commit 30b6251dea7a0ff1713a97d7e7d29a48e4880f59. PiperOrigin-RevId: 586513152 commit a2f92689dac8a7dbea584919c7de52d6a28d66d1 Author: Protobuf Team Bot Date: Fri Nov 24 13:24:18 2023 -0800 Protobuf Java Cross-version validation in OSS. PiperOrigin-RevId: 585139332 commit 318d310e645306a895be53a985f34feb49acf579 Author: Protobuf Team Bot Date: Tue Nov 21 09:24:50 2023 -0800 Create `RuntimeVersion.java` that is updated with releases to prepare version check. PiperOrigin-RevId: 584346836 commit 81607b267c5a2bf5928eef1e6fe7b3753c34f4cd Author: Protobuf Team Bot Date: Mon Nov 13 06:35:04 2023 -0800 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 commit 2ec703fcc16c0afbd3e2644c84ad750260b215ed Author: Protobuf Team Bot Date: Wed Nov 8 04:58:29 2023 -0800 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 commit 0f1ab75dbef64ec7508425af59c9ddd584e6aa75 Author: Sandy Zhang Date: Mon Nov 6 15:51:28 2023 -0800 Add empty feature resolution method for FileDescriptor to Java runtime. PiperOrigin-RevId: 579981476 commit d580fde63aa8ea5c6f4619396e68aaf017fc9d61 Author: Clayton Walker Date: Mon Nov 6 00:22:39 2023 -0800 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 a27b3e6695acb4f1f253422fd2d324bb1b3f6669 PiperOrigin-RevId: 579748655 commit 1231af10c7e55c303fc1260c4ed79f43a294adbb Author: Jie Luo Date: Thu Nov 2 15:28:01 2023 -0700 merge 25.x to main (#14617) Closes #14617 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14617 from anandolee:25.x ac86c5ef32da07fe624428806beabab3bcc1ea0e PiperOrigin-RevId: 578996979 commit 3ea774370aedab4ef132e8b6b3c59c8ade56094b Author: Protobuf Team Bot Date: Thu Nov 2 12:34:51 2023 -0700 Internal change PiperOrigin-RevId: 578944754 commit a077f68b1c9fa20d87605468b5f68ab169370626 Merge: cfd4223b1 76305620a Author: Jie Luo Date: Thu Nov 2 11:07:24 2023 -0700 Merge branch 'main' into 25.x commit 287374e5eb76a3feb12a8d156d61ca16d1e68b93 Author: Protobuf Team Bot Date: Thu Oct 19 08:53:42 2023 -0700 Replace try-catch Blocks with assertThrows() in GeneratedMessageTest PiperOrigin-RevId: 574887696