Skip to content

Conversation

Marcono1234
Copy link
Contributor

Gson does not actually use the specified LongSerializationPolicy but instead uses type adapters which emulate the behavior. However, previously Gson's implementation did not match LongSerializationPolicy regarding null handling.

Because it is rather unlikely that LongSerializationPolicy has been used on its own, this pull request adjusts its implementation to match Gson's behavior (instead of the other way around).

Gson does not actually use the specified LongSerializationPolicy but instead
uses type adapters which emulate the behavior. However, previously Gson's
implementation did not match LongSerializationPolicy regarding null handling.

Because it is rather unlikely that LongSerializationPolicy has been used on
its own, this commit adjusts its implementation to match Gson's behavior
(instead of the other way around).
@google-cla google-cla bot added the cla: yes label Oct 11, 2021
@eamonnmcmanus
Copy link
Member

Thanks! I checked that the tests of all of Google's internal projects that use Gson pass with this change.

@eamonnmcmanus eamonnmcmanus merged commit cd748df into google:master Oct 11, 2021
@Marcono1234 Marcono1234 deleted the marcono1234/LongSerializationPolicy-inconsistency branch October 11, 2021 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants