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

Wrap DateFormat in a thread local instance. #494

Merged
merged 1 commit into from
Jan 26, 2017
Merged

Conversation

f2prateek
Copy link
Contributor

@f2prateek f2prateek commented Jan 26, 2017

From the docs:

https://developer.android.com/reference/java/text/SimpleDateFormat.html

Date formats are not synchronized. It is recommended to create
separate format instances for each thread. If multiple threads access
a format concurrently, it must be synchronized externally.

This is likely causing us to send invalid timestamps, as seen in some s3 buckets, e.g. 2016-12-23T00:0017:40+1300 and 2017-1-05T16:44:34+0800.

From the docs:

https://developer.android.com/reference/java/text/SimpleDateFormat.html

```
Date formats are not synchronized. It is recommended to create
separate format instances for each thread. If multiple threads access
a format concurrently, it must be synchronized externally.
```

This is causing us to send timestamps, such as:
`2016-12-23T00:0017:40+1300`, `2017-1-05T16:44:34+0800`
@f2prateek f2prateek merged commit 8edca47 into dev Jan 26, 2017
@f2prateek f2prateek deleted the fix-date-format branch January 26, 2017 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant