dropwizard/dropwizard — pull request #607 by vietnq (2014-06-05 15:29:31+00:00)
Title: Fix view renderers are recreated in every request

As of v0.7.0, the list viewRenderers is not cloned but using jersey ServiceFinder directly. However, ServiceFinder iterator always creates a new instance when iterating through viewRenderers. As a result, the renderer must be reconfigured every time the view is requested.
For example, turning DEBUG mode for freemarker in config.yaml
```
loggers:
freemarker: DEBUG
```
Then it can be seen that freemarker is not able to cache templates and the configuration in FreemarkerViewRenderer is always refreshed.
```
DEBUG [2014-06-05 15:10:17,746] freemarker.cache: Could not find template in cache, creating new one; id=[".../SimpleView.ftl"["en_US",UTF-8,parsed] ]
DEBUG [2014-06-05 15:10:17,749] freemarker.cache: Compiling FreeMarker template ".../SimpleView.ftl"["en_US",UTF-8,parsed] from "file:/.../SimpleView.ftl"
0:0:0:0:0:0:0:1 - - [05/Jun/2014:15:10:10 +0000] "GET /say/hello HTTP/1.1" 200 - "-" 7459
0:0:0:0:0:0:0:1 - - [05/Jun/2014:15:10:23 +0000] "GET /say/hello HTTP/1.1" 200 - "-" 24
DEBUG [2014-06-05 15:10:23,705] freemarker.cache: Could not find template in cache, creating new one; id=[".../SimpleView.ftl"["en_US",UTF-8,parsed] ]
DEBUG [2014-06-05 15:10:23,708] freemarker.cache: Compiling FreeMarker template ".../SimpleView.ftl"["en_US",UTF-8,parsed] from "file:/.../SimpleView.ftl"
```
This patch reverts to use of ImmutableList which is working in v0.6.
```
DEBUG [2014-06-05 15:25:36,093] freemarker.cache: Could not find template in cache, creating new one; id=[".../SimpleView.ftl"["en_US",UTF-8,parsed] ]
DEBUG [2014-06-05 15:25:36,095] freemarker.cache: Compiling FreeMarker template ".../SimpleView.ftl"["en_US",UTF-8,parsed] from "file:/.../SimpleView.ftl"
0:0:0:0:0:0:0:1 - - [05/Jun/2014:15:25:35 +0000] "GET /say/hello HTTP/1.1" 200 - "-" 343
DEBUG [2014-06-05 15:25:42,357] freemarker.cache: ".../SimpleView.ftl"["en_US",UTF-8,parsed] using cached since file:/.../SimpleView.ftl didn't change.
0:0:0:0:0:0:0:1 - - [05/Jun/2014:15:25:42 +0000] "GET /say/hello HTTP/1.1" 200 - "-" 6
```
--
Quoc-Viet Nguyen