Gson 2.14.0 #3019
eamonnmcmanus
announced in
Announcements
Gson 2.14.0
#3019
Replies: 1 comment
-
|
Thank you for the merge! I appreciate it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What's Changed
Add type adapters for
java.timeclasses by @eamonnmcmanus in Add type adapters forjava.timeclasses #2948When the
java.timeAPI is available, Gson automatically can read and write instances of classes likeInstantandDuration. The format it uses essentially freezes the JSON representation thatReflectiveTypeAdapterFactoryestablished by default, based on the private fields ofjava.timeclasses. That's not a great representation, but it is understandable. Changing it to anything else would break compatibility with systems that are expecting the current format.With this change, Gson no longer tries to access private fields of these classes using reflection. So it is no longer necessary to run with
--add-opensfor these classes on recent JDKs.Remove
com.google.gson.graphby @eamonnmcmanus in Removecom.google.gson.graph. #2990.This package was not part of any released artifact and depended on Gson internals in potentially problematic ways.
Validate that strings being parsed as integers consist of ASCII characters by @eamonnmcmanus in Validate that strings being parsed as integers consist of ASCII characters #2995
Previously, strings could contain non-ASCII Unicode digits and still be parsed as integers. That's inconsistent with how JSON numbers are treated.
Fix duplicate key detection when first value is null by @andrewstellman in Fix duplicate key detection when first value is null #3006
This could potentially break code that was relying on the incorrect behaviour. For example, this JSON string was previously accepted but will no longer be:
{"foo": null, "foo": bar}.Remove
Serializablefrom internalTypeimplementation classes. by @eamonnmcmanus in RemoveSerializablefrom internalTypeimplementation classes. #3011The nested classes
ParameterizedTypeImpl,GenericArrayTypeImpl, andWildcardTypeImplinGsonTypesare implementations of the corresponding types (withoutImpl) injava.lang.reflect. For some reason, they were serializable, even though thejava.lang.reflectimplementations are not. Having unnecessarily serializable classes could conceivably have been a security problem if they were part of a larger exploit using serialization. (We do not consider this a likely scenario and do not suggest that you need to update Gson just to get this change.)Add
LegacyProtoTypeAdapterFactory. by @eamonnmcmanus in AddLegacyProtoTypeAdapterFactory. #3014This is not part of any released artifact, but may be of use when trying to fix code that is currently accessing the internals of protobuf classes via reflection.
Make AppendableWriter do flush and close if delegation object supports by @MukjepScarlet in Make AppendableWriter do flush and close if delegation object supports #2925
Other less visible changes
new Gson()by @MukjepScarlet in Optimizenew Gson()#2864New Contributors
publicmodifiers #2944Full Changelog: gson-parent-2.13.2...gson-parent-2.14.0
This discussion was created from the release Gson 2.14.0.
Beta Was this translation helpful? Give feedback.
All reactions