spullara/mustache.java — Issue #14: Guava v11 compliance
Author: asafary
Created: 2012-01-20 23:10:31+00:00
State: open

I've been trying to include mustache java in my project, but have encountered problems because of compliance with the latest version (11) of google java collections - [guava](http://code.google.com/p/guava-libraries/)

The problem is that guava replaced the API of [MapMaker](http://docs.guava-libraries.googlecode.com/git-history/v11.0.1/javadoc/com/google/common/collect/MapMaker.html) with that of [CacheBuilder](http://docs.guava-libraries.googlecode.com/git-history/v11.0.1/javadoc/com/google/common/cache/CacheBuilder.html).

The code can be made compliant easily without any substantial change to the Mustache.java class, however, for it to be truly compliant the recommendation is to replace the Map used for the templateFunctionCache with a [LoadingCache](http://docs.guava-libraries.googlecode.com/git-history/v11.0.1/javadoc/com/google/common/cache/LoadingCache.html) which means that loading objects into the cache requires a static MustacheBuilder instance for use in the [CacheLoader](http://docs.guava-libraries.googlecode.com/git-history/v11.0.1/javadoc/com/google/common/cache/CacheLoader.html)