[improve][build] Upgrade Gson to 2.14.0 and json-smart to 2.6.0 - #26355
Merged
Conversation
- gson 2.13.2 -> 2.14.0
- json-smart 2.5.2 -> 2.6.0
Gson 2.14.0 contains behavior changes worth calling out for reviewers, since Gson parses
externally supplied JSON in several places (function and connector configuration, admin
CLI input, the Kubernetes runtime):
- Duplicate member names in a JSON object are now rejected. Input such as
{"foo": 1, "foo": 2} used to parse with last-key-wins and now throws.
- Strings parsed as integers must consist of ASCII characters.
- java.time types (Instant, Duration and friends) now have built-in adapters, so Gson no
longer reflects into their private fields. This removes the need for --add-opens for
those classes, and changes the serialized form for any field that previously went
through reflection.
- The internal nested types in GsonTypes (ParameterizedTypeImpl, GenericArrayTypeImpl,
WildcardTypeImpl) are no longer Serializable, and the unreleased com.google.gson.graph
package was removed.
jackson is deliberately left on the 2.21 LTS line and is not part of this change.
Neither Gson nor json-smart changes its Java 8 baseline.
Assisted-by: Claude Code (Opus 5)
nodece
approved these changes
Aug 18, 2026
void-ptr974
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Gson and json-smart are behind. Gson 2.14.0 in particular contains behaviour changes that are worth
landing on their own, separately from other dependency updates, so they are easy to bisect and
revert.
Modifications
gradle/libs.versions.toml:Plus the corresponding jar names in the server and shell distribution
LICENSE.bin.txtfiles.Gson 2.14.0 behaviour changes — please review with these in mind
Gson parses externally supplied JSON in several places in Pulsar (function and connector
configuration, admin CLI input, the Kubernetes runtime), so these are the changes that matter:
{"foo": 1, "foo": 2}previously parsed with last-key-wins and now throws.java.timetypes now have built-in adapters. Gson no longer reflects into the private fieldsof
Instant,Durationand friends. This removes the need for--add-opensfor those classes,and can change the serialized form of any such field that previously went through reflection.
GsonTypes(ParameterizedTypeImpl,GenericArrayTypeImpl,WildcardTypeImpl) are no longerSerializable, and the unreleasedcom.google.gson.graphpackage was removed.
Neither library changes its Java 8 baseline.
Jackson is not part of this change
Jackson stays on the 2.21 LTS line (2.21.6 / annotations 2.21). 2.22 was tried in #26101 and reverted
in #26166.
Verifying this change
This change is already covered by existing tests. Verified locally:
./gradlew sanityCheckand./gradlew checkBinaryLicensepulsar-functions-utilsfull test suite (154 tests) — greenpulsar-client-admin-originalfull test suite (64 tests) — greenBoth of those modules are heavy Gson users.
Does this pull request potentially affect one of the following parts:
Not a schema change in the Pulsar sense, but note the JSON parsing behaviour changes listed above.