lookfirst/sardine — pull request #186 by jochenberger (2014-09-22 10:25:08+00:00)
Title: don't subclass @ThreadLocal@ to prevent leaking a whole classloader structure

Fix for #165.
The problem is how the date parsers are initialized to ThreadLocal subclass instances. Thoes classes reference the webapp's classloader. The ThreadLocal subclasses in turn are referenced by each Thread instance (that's how ThreadLocals are implemented, they have a "helper-Map" in each Thread instance, so the leak is actually not some tiny SimpleDateFormat instances but the whole webapp's classloader with a bunch of class definitions and statically referenced parts of the webapp.