Update vendored GSON dependency to latest available version #415
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.
Goal
The
JsonWriter
class was originally vendored in 2014, and has not been updated since then despite bug fixes to the GSON library.Design
It was originally suggested that we use the framework version of
JsonWriter
. However, this approach has several issues:final
, therefore cannot be extended in Java, meaning we would need to make substantial modifications to our implementation ofJsonStream
setSerializeNulls
is not present, meaning we would always serialize null values if we used the framework versionbeforeValue
method is private and therefore cannot be accessed, meaning we would need to make further alterations toJsonStream
to support serialising a file.Therefore the lowest risk approach seemed to be updating the vendored GSON dependency, rather than relying on the framework version.
Changeset
Updated the
JsonWriter
andJsonScope
classes to the latest available version on the GSON repository.SuppressAllWarnings
was used to suppress sites in the GSON code which violate our existing checkstyle/lint rules.Tests
Ran existing tests on CI.