Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LongSerializationPolicy null handling being inconsistent with Gson #1990

Conversation

Marcono1234
Copy link
Collaborator

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