playframework/Play20 — pull request #385 by juretta (2012-07-16 07:58:04+00:00)
Title: Make Threads.withContextClassLoader more resilient to failure

`Threads.withContextClassLoader` does not restore the original context classloader properly if the function executed in the new context throws an exception.

Change `Threads.withContextClassLoader` to execute the function in a try block and restore the previous CL in the finally block (Note: finally is _not_ part of the try/catch expression so the return value is simply the return value of the function `b` execution).