aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.02k stars 548 forks source link

fix(all): Don't return incorrect date format instance #3576

Closed mattcreaser closed 1 month ago

mattcreaser commented 1 month ago

Issue #, if available:

Description of changes: The DateJsonUnmarshaller.getInstance() function is supposed to return an instance that can unmarshall UNIX_TIMESTAMP dates, but due to a logic error it if any other piece of code used a different format when calling DateJsonUnmarshaller getInstance(format) then that format would be returned instead.

This change ensures that the version without arguments always returns an unmarshaller for UNIX_TIMESTAMP.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.