AsyncHttpClient/async-http-client — pull request #476 by slandelle (2014-02-07 12:07:59+00:00)
Title: Fast RFC2616 Date parser

This PR introduces the following changes:
* A very fast RFC2616 date parser that replaces the old SimpleDateFormat+ThreadLocal based implementation in `AsyncHttpProviderUtils.parseExpireField`. It uses a `TimeConverter` for converting date parts into a time. Default implementation is Calendar based, but one can pass a custom implementation in the config, such as a JodaTime or Java8 DateTime based one. Currently, only the Netty provider can use this user-defined TimeConverter because the Grizzly one uses static methods and singletons where I could not pass the config. Benchmark results:
* old impl: 1653 ops/s
* new impl w/ Calendar (default): 6587 ops/s
* new impl w/ JodaTime: 8307 ops/s
* It breaks the old Cookie behavior where `Expires` attribute was turned into a `Max-Age`. This behavior made testing a mess (Cookie.maxAge depended on currentTimeMillis). I separated both into dedicated attributes.
* It no longer supports multiple cookies inside the same `Set-Cookie` header. RFC6265 doesn't support this, as well as modern browsers that only pick the first one.
* It fixes a bug regarding `Set-Cookie2` header handling: it has precedence over regular `Set-Cookie`.