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
Contributor

@Marcono1234 Marcono1234 commented Oct 11, 2021

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

@eamonnmcmanus eamonnmcmanus commented Oct 11, 2021

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
3 checks passed
@Marcono1234 Marcono1234 deleted the marcono1234/LongSerializationPolicy-inconsistency branch Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants