Skip to content

Fix LongSerializationPolicy null handling being inconsistent with Gson#1990

Merged
eamonnmcmanus merged 1 commit into
google:masterfrom
Marcono1234:marcono1234/LongSerializationPolicy-inconsistency
Oct 11, 2021
Merged

Fix LongSerializationPolicy null handling being inconsistent with Gson#1990
eamonnmcmanus merged 1 commit into
google:masterfrom
Marcono1234:marcono1234/LongSerializationPolicy-inconsistency

Conversation

@Marcono1234

Copy link
Copy Markdown
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
Copy Markdown
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