Open MuffinTheMan opened 2 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
@eamonnmcmanus, do you think we should add the java.sql.Date
pattern (new SimpleDateFormat("MMM d, yyyy")
) as fallback for deserialization to DefaultDateTypeAdapter
? Similar / instead of what is proposed currently by this pull request, see discussion above.
That pattern would then have to be enabled always, even if SqlTypesSupport.SUPPORTS_SQL_TYPES
is false
, in case users start relying on this pattern for deserialization even when not using java.sql.Date
, to avoid failures when those users run on a JDK without SQL types.
Purpose
Adds support for a deserialization scenario where a "timeless"
java.util.Date
was serialized like"Jan 1, 1970"
(Gson's default behavior) but cannot then be deserialized. It seems to make sense that Gson's deserializer should be able to handle deserializing what it serialized itself by default.Description
This example demonstrates the issue: