Giter Club home page Giter Club logo

mustache.java's Introduction

Mustache.java Build Status

Mustache.java is not designed to allow untrusted parties to provide templates. It may be possible to lock it down to provide that safely, but by default it is UNSAFE. Use the SafeMustacheFactory and whitelist all templates and partials.

As of release 0.9.0 mustache.java is now Java 8 only. For Java 6/7 support use 0.8.x.

There are no external dependencies and the compiler library is ~100k.

Mustache.java is a derivative of mustache.js.

There is a Google Group for support and questions: http://groups.google.com/group/mustachejava

Github CI: https://github.com/spullara/mustache.java/actions/workflows/maven.yml

API documentation: http://spullara.github.io/mustache/apidocs/

Largest production deployment of Mustache.java:

  • Twitter (the web site, email, syndicated widgets, etc)

Thanks to YourKit for many performance improvements:

YourKit is kindly supporting the mustache.java open source project with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products:

Request for contributions:

  • Real world benchmarks that matter - currently benchmarking based on Twitter templates
  • Documentation
  • Bug reports / fixes
  • API feedback
  • Optimizations

Documentation:

  • Javadocs
  • Mustache.js manual
  • Passes all of the mustache specification tests modulo whitespace differences
  • Biggest difference between mustache.js and mustache.java is optional concurrent evaluation
  • Data is provided by objects in an array of scopes and are accessed via non-private fields, methods or maps
  • Any Iterable can be used for list-like behaviors
  • Returning a Callable allows for concurrent evaluation if an ExecutorService is configured
  • Template inheritance is supported by this implementation, see mustache/spec#38 (eg. {{<super}}{{$content}}...{{/content}}{{/super}})
  • Additional functions/lambdas (eg. {{#func1}}...{{/func1}}) are implemented using Function from Java 8 (post-substitution)
  • Use TemplateFunction if you want mustache.java to reparse the results of your function/lambda (pre-substitution)
  • Both default and manually configured classpath based and file system based template roots are supported
  • A compiled and invokedynamic version is available. Performance improvements are often application specific.
  • The handlebar server will render templates + json data for quick mockups of templates by designers
  • Completely pluggable system for overriding almost all the behavior in the compilation and rendering process
  • You can pull out sample data from live systems using the CapturingMustacheVisitor for mocks and tests
  • The DecoratedCollection can provide first / last / index for elements in a collection
  • The invert call can take text and a template and solve for the data

Performance:

  • See the com.github.mustachejavabenchmarks package in the compiler module
  • Compiles 4000+ timeline.html templates per second per core
  • Renders 3000+ of 50 tweet timelines per second per core on 2011 Macbook Pro / MacPro hardware
  • New codegen module generates code for guards and mustaches
  • The indy module uses the codegen module and invokedynamic to compile templates down to bytecode

Build suggestions:

  • Don't build, use Maven dependencies
  • If you must build but not test:
  • If you must build and test but not benchmark:
    • CI=1 mvn clean install -pl :compiler -am
  • If you must build, test and benchmark:
    • mvn clean install

Maven dependency information (ie. for most common cases you will just need the compiler module):

Java 8+:

<dependency>
  <groupId>com.github.spullara.mustache.java</groupId>
  <artifactId>compiler</artifactId>
  <version>0.9.10</version>
</dependency>

Java 6/7:

<dependency>
  <groupId>com.github.spullara.mustache.java</groupId>
  <artifactId>compiler</artifactId>
  <version>0.8.18</version>
</dependency>

Example template file:

{{#items}}
Name: {{name}}
Price: {{price}}
  {{#features}}
  Feature: {{description}}
  {{/features}}
{{/items}}

Might be powered by some backing code:

public class Context {
  List<Item> items() {
    return Arrays.asList(
      new Item("Item 1", "$19.99", Arrays.asList(new Feature("New!"), new Feature("Awesome!"))),
      new Item("Item 2", "$29.99", Arrays.asList(new Feature("Old."), new Feature("Ugly.")))
    );
  }

  static class Item {
    Item(String name, String price, List<Feature> features) {
      this.name = name;
      this.price = price;
      this.features = features;
    }
    String name, price;
    List<Feature> features;
  }

  static class Feature {
    Feature(String description) {
       this.description = description;
    }
    String description;
  }
}

And would result in:

Name: Item 1
Price: $19.99
  Feature: New!
  Feature: Awesome!
Name: Item 2
Price: $29.99
  Feature: Old.
  Feature: Ugly.

Evaluation of the template proceeds serially. For instance, if you have blocking code within one of your callbacks, the system will pause while executing them:

static class Feature {
  Feature(String description) {
    this.description = description;
  }

  String description() throws InterruptedException {
    Thread.sleep(1000);
    return description;
  }
}

If you change description to return a Callable instead it will automatically be executed in a separate thread if you have provided an ExecutorService when you created your MustacheFactory.

Callable<String> description() throws InterruptedException {
  return new Callable<String>() {

    @Override
    public String call() throws Exception {
      Thread.sleep(1000);
      return description;
    }
  };
}

This enables scheduled tasks, streaming behavior and asynchronous i/o. Check out the example module in order to see a complete end-to-end example:

package mustachejava;

import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheFactory;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.List;

public class Example {

  List<Item> items() {
    return Arrays.asList(
      new Item("Item 1", "$19.99", Arrays.asList(new Feature("New!"), new Feature("Awesome!"))),
      new Item("Item 2", "$29.99", Arrays.asList(new Feature("Old."), new Feature("Ugly.")))
    );
  }

  static class Item {
    Item(String name, String price, List<Feature> features) {
      this.name = name;
      this.price = price;
      this.features = features;
    }

    String name, price;
    List<Feature> features;
  }

  static class Feature {
    Feature(String description) {
      this.description = description;
    }

    String description;
  }

  public static void main(String[] args) throws IOException {
    MustacheFactory mf = new DefaultMustacheFactory();
    Mustache mustache = mf.compile("template.mustache");
    mustache.execute(new PrintWriter(System.out), new Example()).flush();
  }
}

An alternative approach for providing variables would be to use a Map object, like:

  public static void main(String[] args) throws IOException {
    HashMap<String, Object> scopes = new HashMap<String, Object>();
    scopes.put("name", "Mustache");
    scopes.put("feature", new Feature("Perfect!"));

    Writer writer = new OutputStreamWriter(System.out);
    MustacheFactory mf = new DefaultMustacheFactory();
    Mustache mustache = mf.compile(new StringReader("{{name}}, {{feature.description}}!"), "example");
    mustache.execute(writer, scopes);
    writer.flush();
  }

License

FOSSA Status

mustache.java's People

Contributors

asaf avatar bwbecker avatar c089 avatar caniszczyk avatar ceefour avatar cjerdonek avatar davidsantiago avatar dpoetzsch avatar fhd avatar fupgang avatar gw0 avatar hendriksp avatar hyehayes-google avatar ianlevesque avatar ilaborie avatar jwils avatar kanru avatar kevinsawicki avatar kevinwright avatar kirbyclover avatar mbooth101 avatar michaeldfallen avatar mrb avatar nicoulaj avatar pvande avatar rhowe avatar rustyx avatar schmitch avatar sps avatar spullara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mustache.java's Issues

"Failed to read" with IOException from malformed mustache tag

Thanks for this excellent port of Mustache and for your useful additions.

I spent a few minutes trying to figure out what in my template was causing a "Failed to read" MustacheException at line 235 of MustacheParser. Apparently an IOException triggers that particular MustacheException.

The root cause ended up being this malformed mustache tag: {{$value}}{/value}}

I'm not sure if you're inclined to spend much time identifying malformed tags, but if you are, a more specific error message would be appreciated. Thanks!

Problem with resolvePartialPath on Windows

From ffce20daabe477d3d1aec9be8cb104769c45c8ea Mon Sep 17 00:00:00 2001
From: fesse
Date: Thu, 1 Aug 2013 17:13:21 +0200
Subject: [PATCH] Problem with resolvePartialPath on Windows

When having .mustache templates in a jar file under Windows the
following code doesn't find the template.
(This is not a problem under GNU/Linux)

Example:
resourceRoot = /abc/def/ghi

resolvePartialPath() gives \templates\mytemplates.mustache

Removing the File and getPath() eliminates this problem and
creates a valid path.

A new file creation is done in getReader(String resourceName)
if needed so this shouldn't break anything else I hope.


---
 .../src/main/java/com/github/mustachejava/DefaultMustacheFactory.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/src/main/java/com/github/mustachejava/DefaultMustacheFactory.java b/compiler/src/main/java/com/github/mustachejava/DefaultMustacheFactory.java
index e559882..b802647 100644
--- a/compiler/src/main/java/com/github/mustachejava/DefaultMustacheFactory.java
+++ b/compiler/src/main/java/com/github/mustachejava/DefaultMustacheFactory.java
@@ -93,9 +93,9 @@ public class DefaultMustacheFactory implements MustacheFactory {
   public String resolvePartialPath(String dir, String name, String extension) {
     String path;
     if (name.startsWith("/")) {
-      path = new File(name + extension).getPath();
+      path = name + extension;
     } else {
-      path = new File(dir + name + extension).getPath();
+      path = dir + name + extension;
     }
     return path;
   }
-- 
1.8.1.2

Maven jars incompatible with Java 1.5

I have included this dependency

<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>0.6</version>
</dependency>

But my app server, Glassfish 2 running with JRE 1.5 throws am exception that seems to indicate that the library is incompatible with Java 5: nested exception is java.lang.UnsupportedClassVersionError: PWC1651: Class com.sampullara.mustache.Mustache has unsupported major or minor version numbers, which are greater than those found in the Java Runtime Environment version 1.5.0_22

Sorry if that is really a Maven issue, but I found no workaround yet.

Maven build fails due to com.github.mustachejava.SpecTest

Steps to repro:

  1. download from github as zip.
  2. unzip
  3. mvn package

Mac OS X Lion 10.7.3

Tests in error:
delimiters(com.github.mustachejava.SpecTest)
interpolations(com.github.mustachejava.SpecTest)
sections(com.github.mustachejava.SpecTest)
inverted(com.github.mustachejava.SpecTest)
partials(com.github.mustachejava.SpecTest)
lambdas(com.github.mustachejava.SpecTest)

Hard-coded sm & em in DefaultMustacheVisitor prevents change of markers

CASE: You wish to change the sm & em used from "{{", "}}" to: "{", "}". This is true for your main template as well as any included partial templates (to keep the standard).

DefaultMustacheFactory.compile(Reader reader, String file, String sm, String em) provides for this case and it works for the main template, however if you use a Partial tag via {> partialName} then replacement of {variableName} tags inside partial template fails.

This is due to the DefaultMustacheVisitor with hard-coded sm & em params for TemplateContext in: DefaultMustacheVisitor.partial(TemplateContext tc, final String variable).

The tc param to DefaultMustacheVisitor.partial(TemplateContext tc, final String variable) serves as a template for the partialTC which is created. Suggested fix is to use the sm & em from tc and also apply them to partialTC.

CURRENT CODE:
public void partial(TemplateContext tc, final String variable) {
TemplateContext partialTC = new TemplateContext("{{", "}}", tc.file(), tc.line(), tc.startOfLine());
list.add(new PartialCode(partialTC, df, variable));
}

SUGGESTED FIX:
public void partial(TemplateContext tc, final String variable) {
TemplateContext partialTC = new TemplateContext(tc.startChars(), tc.endChars(), tc.file(), tc.line(), tc.startOfLine());
list.add(new PartialCode(partialTC, df, variable));
}

Bug with recursive partials

When trying to use a recursive partial (ie partial that has itself as a partial), for instance example.mustache:

{{#someCondition}}
    {{>example}}
{{/someCondition}}

Mustache fails with a StackOverflowError in DefaultCode.clone():

java.lang.StackOverflowError
    at com.github.mustachejava.codes.DefaultCode.clone(DefaultCode.java:26)
    at com.github.mustachejava.codes.DefaultCode.clone(DefaultCode.java:30)
    at com.github.mustachejava.codes.DefaultCode.clone(DefaultCode.java:30)
    at com.github.mustachejava.codes.DefaultCode.clone(DefaultCode.java:30)
    ...

\r\n is escaped to \n

It seems to me that \r\n gets replaces by \n, "\r" is being removed

Is there any specific reason to that?

MustacheFactory mustacheFactory = new DefaultMustacheFactory();
Mustache mustache = mustacheFactory.compile(new StringReader(email.getBody()), "cpu.template.email");
StringWriter writer = new StringWriter();
try {
mustache.execute(writer, emailVariables).flush();
}
catch(IOException exception){
LOG.error("Error processing emailBody:" + email.getBody(), exception);
}

Partial context question

I'm new to mustache in general and mustache.java in particular and am struggling with understanding partial contexts. Here's a demo scope of my template:

{
  "receiver" : 
    {
      "address": { "street" : "someStreet" } 
    }
}

Whereas the templates look like this:

main.mustache:

{{#receiver}}ย 
  {{> address }}
{{/receiver}

address.mustache:
<h2>{{street}}ย </h2>

From my understanding of the mustache docs i would have expected the address.mustache template be in the address scope, where i have direct access to the street member of the address object. However, the content of the <h2> tag is empty.

Am i misunderstanding the partial idea?

Treat empty string as false

The official mustache implementation treats empty strings as false. You can try this on http://mustache.github.com/#demo
with the following example:

Template:

Some text

{{#empty_string}}
<p>{{empty_string}}</p>
{{/empty_string}}

Data:

{
  "empty_string": ""
}

Should result in:

Some text

(Though this could also be an implication of what Ruby treats as false, I know this is different in Java)

Support private fields accessor

In the description of the project it says that data is read from non-private fields.
In many situations it would be convenient to read data in the templating system directly from private fields, accessed by reflection

nested context not working

Hi there,

I'm using Groovy, and Maps to represent the scope data, and if we take the example from the documentation:

{{#items}}
Name: {{name}}
Price: {{price}}
    {{#features}}
        Feature: {{description}}
    {{/features}}
{{/items}}

in the features section, referencing the description does not work for me, and I am forced to use {{ features.description }}

Guava v11 compliance

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

The problem is that guava replaced the API of MapMaker with that of CacheBuilder.

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 which means that loading objects into the cache requires a static MustacheBuilder instance for use in the CacheLoader

Template compilation failing on Windows 7/java version "1.6.0_18"

A fresh checkout of the master branch yields the following result with mvn test:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building mustache.java
[INFO]    task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 76 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: c:\git\mustache.java\target\surefire-reports

---
##  T E S T S

Running com.sampullara.mustache.RuntimeJavaCompilerTest
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:272)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:236)
    at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:250)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:444)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:44)
    at com.sampullara.mustache.RuntimeJavaCompilerTest.testClassLoader(RuntimeJavaCompilerTest.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\test-classes\array_of_strings.html
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 41 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.4 sec <<< FAILURE!
Running com.sampullara.mustache.CompilerTest
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testSimple(CompilerTest.java:38)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 54 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache1
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testSimple(CompilerTest.java:38)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testSetWriter(CompilerTest.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 54 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache3
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testSetWriter(CompilerTest.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testSimple2(CompilerTest.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 54 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache5
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testSimple2(CompilerTest.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testEscaped(CompilerTest.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 53 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache6
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testEscaped(CompilerTest.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testUnescaped(CompilerTest.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 53 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache7
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testUnescaped(CompilerTest.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testInverted(CompilerTest.java:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 54 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache9
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testInverted(CompilerTest.java:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testComments(CompilerTest.java:139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache10
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 53 more
    at com.sampullara.mustache.CompilerTest.testComments(CompilerTest.java:139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testPartial(CompilerTest.java:153)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://c:\git\mustache.java\target\classes\com\sampullara\mustache\Mustache$1.class
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.parseAuthority(URI.java:3147)
    at java.net.URI$Parser.parseHierarchical(URI.java:3058)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.(URI.java:578)
    at java.net.URI.create(URI.java:840)
    ... 53 more
java.lang.ClassNotFoundException: com.sampullara.mustaches.Mustache11
    at java.lang.ClassLoader.findClass(ClassLoader.java:359)
    at com.sampullara.util.RuntimeJavaCompiler$CompilerClassLoader.findClass(RuntimeJavaCompiler.java:175)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:256)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testPartial(CompilerTest.java:153)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
An exception has occurred in the compiler (1.6.0_18). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:842)
    at com.sampullara.util.RuntimeJavaCompiler$JavaClassFromFile.(RuntimeJavaCompiler.java:69)
    at com.sampullara.util.RuntimeJavaCompiler$ClassLoaderFileManager.list(RuntimeJavaCompiler.java:283)
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2123)
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$PackageSymbol.flags(Symbol.java:601)
    at com.sun.tools.javac.comp.Attr.checkId(Attr.java:2120)
    at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1899)
    at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:527)
    at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
    at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
    at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
    at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:451)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
    at com.sampullara.util.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:58)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:255)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.compile(MustacheCompiler.java:154)
    at com.sampullara.mustache.MustacheCompiler.parseFile(MustacheCompiler.java:82)
    at com.sampullara.mustache.CompilerTest.testComplex(CompilerTest.java:200)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.

Parsing a broken template doesn't throw exceptions

I just tried using the MustacheBuilder deliberately passing a broken template for a test case and noticed the the #parse method never failed, calling:

new MustacheBuilder().parse("This is {{broken");

quite happily returns a Mustache object.

Is it correct that this doesn't fail? If the intent of the caller was that they WANTED the {{broken to be rendered, should the {{ be escaped? Or do we need some form of Strict mode for the parser?

Compiling with maven fails because of test jar dep

This took me some time to figure out, but the instructions below did not work. There is a dependency to the compiler test jar (and other test jars) that are not built if you run test.skip.

You might consider either changing the pom dependencies or building the test jar. Anywhich way, it would be nice if the compile worked without errors.

If you must build but not test:
git clone https://github.com/spullara/mustache.java.git
set your JAVA_HOME to a JDK 7 JDK
mvn -Dmaven.test.skip=true clean install

Conditions in mustache.

I have two lists of data:
Fruits : Apple Orange Bananen Kiwi Durian
Selection : Orange Kiwi
I want to generate :
Apple
Orange - selected
Bananen
Kiwi - selected
Durian

I have full control over the Java and can add Code as needed. How do I do that?

add support of {{key}} and {{value}}

It would be nice to be able to display all keys of the map or all fields of the object.

Map map = new HashMap()
map.put("a", "qqq");
map.put("b", "www");

{{#map}}
{{key}} = {{value}}
{{/map}}}

Scala Maps don't work

FYI, I'm trying to use play-2-mustache plugin which uses mustache.java and Scala maps reflection isn't working. An option is returned instead of the value object. This may be a twitter library issue in the end, but wanted to let people know. java.util.HashMap work of course so that's what we're using for now.

dot-notation supported (mustache 0.4)

Sorry for posting an issue about this, but I'm trying to find info on whether the recently introduced dot-notation (Mustache 0.4) is already present (or is worked on) in the java-version?

Thanks.

Maps with enums as keys

I'm trying to write a template to extract values from a map with enums as keys. This works fine for string keys, but the enum keys don't seem to work as I expect. Here's the template:

{
    "name": "{{name}}",
    "enum": {
        {{#enumKeys}}
        "one": [
            {{#ONE}}
            {
                "num": "{{index}}",
                "value": "{{value}}"
            }{{^last}},{{/last}}
            {{/ONE}}
        ]
        {{/enumKeys}}
    }
}

and the code:

public class MapEnumTest {

    public enum Test {ONE,TWO}

    public String name() {
        return "Test";
    }

    public Map<Test, List<String>> enumKeys() {

        List<String> one = new ArrayList<String>();
        one.add("1");
        one.add("one");

        List<String> two = new ArrayList<String>();
        two.add("2");
        two.add("two");

        HashMap<Test, List<String>> map = new HashMap<Test, List<String>>();
        map.put(Test.ONE, one);
        map.put(Test.TWO, two);

        return map;
    }

    public static void main(String[] args) {

        DefaultMustacheFactory mustacheFactory = new DefaultMustacheFactory();
        mustacheFactory.setObjectHandler(new ReflectionObjectHandler() {
            @Override
            public Object coerce(Object object) {
                if (object instanceof Collection) {
                    return new DecoratedCollection((Collection) object);
                }
                else {
                    return super.coerce(object);
                }
            }
        });
        Mustache mustache = mustacheFactory.compile("mapEnum.mustache");

        try {
            mustache.execute(new PrintWriter(System.out), new MapEnumTest()).flush();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
}

and the output:

{
    "name": "Test",
    "enum": {
        "one": [
        ]
    }
}

Is this something that I'm doing wrong, or is this a limitation w/ mustache.java?

no build instructions or jar file

I did a git clone, and I don't see any jar file or build instructions.

I see a pom file. I'm not too familiar with maven (and am not intending to use it anywhere else, so please don't make us learn too much about it).

I installed maven and tried typing 'mvn compile', which took ages downloading stuff, gave lots of warnings like "Authorization failed: Access denied to: http://repository.jboss.org/maven2/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom", eventually said "succeeded," but didn't produce a jar file. Is there some simple way to get a jar file containing everything I need to try out mustache in my own non-maven project?

Add cache turn off support

I'm using mustache.java for spring mvc as view resolver, by forked project from mustache.java-spring-webmvc. (My Repo)

SpringViewResolver support caching, and Mustache.java support too. So I modify my mustache template file when WAS is running, but view is not changing until cache expiring or restart server when i turned off cache option of SpringViewResolver.

DefaultMustachFactory is using cache default and others too.

How to I turn off caching mustache.java?
Is there any option for turn off cache?

Thank you for making this module. I love this.

Fail on missing attributes

We just switched from Velocity to Mustache because we wanted a template engine that throws errors when a template refers to variables that don't exist.

It turns out that Mustache.java doesn't do this either (it just logs). Would you accept a patch for this? Would it be against the Mustache spec? Alternatively we could make this strict behaviour configurable.

Broken tests

Tests in error:
SimpleSpecTest>SpecTest.interpolations:25->SpecTest.getSpec:210 ยป NullPointer
SimpleSpecTest>SpecTest.inverted:40->SpecTest.getSpec:210 ยป NullPointer
SimpleSpecTest>SpecTest.partials:45->SpecTest.getSpec:210 ยป NullPointer
SimpleSpecTest>SpecTest.lambdas:50->SpecTest.getSpec:210 ยป NullPointer
SimpleSpecTest>SpecTest.sections:30->SpecTest.getSpec:210 ยป NullPointer
SimpleSpecTest>SpecTest.delimiters:35->SpecTest.getSpec:210 ยป NullPointer
SpecTest.interpolations:25->getSpec:210 ยป NullPointer
SpecTest.inverted:40->getSpec:210 ยป NullPointer
SpecTest.partials:45->getSpec:210 ยป NullPointer
SpecTest.lambdas:50->getSpec:210 ยป NullPointer
SpecTest.sections:30->getSpec:210 ยป NullPointer
SpecTest.delimiters:35->getSpec:210 ยป NullPointer

Tests run: 167, Failures: 0, Errors: 12, Skipped: 0

It looks like some files are missed: interpolation.json, sections.json, delimiters.json, inverted.json, etc..

Auto removal of whitespace (minification) of HTML.

Maybe it would be nice that the compiler has an options to remove whitespace and thus minify the HTML.

I am aware that this might cause issues in browsers. But it also decreases the number of bytes sent to the user.

But then again, the official mustache spec doesnt support minification. Maybe I should use a different library?

Bug on function where variable is used?

I want to create a basic function toUpperCase().

I made a sample but it does not work. I think it is a bug.

This my code

public static void main(String[] args)
{
    Map<String, Object> scopes = new HashMap<String, Object>();
    scopes.put("map", new HashMap<String, String>(){{put("key", "value");}});
    final Function<String, String> upperFunction = new TemplateFunction()
    {

        @Override
        public String apply(String aInput)
        {
            return aInput.toUpperCase();
        }
    };
    scopes.put("upper", upperFunction);


    Writer writer = new OutputStreamWriter(System.out);
    MustacheFactory mf = new DefaultMustacheFactory();
    Mustache mustache = mf.compile(new StringReader("map.key={{map.key}}{{#upper}}, in #upper map.key={{map.key}}{{/upper}} \n" +
            "in #map{{#map}}, in #upper {{#upper}} keyInUpper={{key}} {{/upper}} {{/map}} "), "example");

    mustache.execute(writer, scopes);
    try
    {
        writer.flush();
    }
    catch (IOException e)
    {
        //
    }
}

This is the output

map.key=value, IN #UPPER MAP.KEY=
in #map, in #upper KEYINUPPER=

should be

map.key=value, IN #UPPER MAP.KEY=VALUE
in #map, in #upper KEYINUPPER=VALUE

Tell me if it is a bug or what is wrong in my code.

Windows like line breaks in templates

If a template contains a Windows line break \r\n then the compiled Mustache file will be invalid. Special care is needed for \r character.

Easiest resolution is this pacth for the current version (spullara-mustache.java-b1d5190) for com.sampullara.mustache.MustacheCompiler:

129a130,132
>         if (c == '\r') {
>           continue;
>         }

browsable javadoc api available

it would be nice to have browsable version of javadoc available of the latest released version (possibly refferenced directly in the README.md)

As currently I had to go for source files reading.

Precompile templates to classes

Since the compiler infrastructure is already in place, it would be nice to have a utility to precompile templates into .class files. This could avoid potential problems on environments where a compiler is not available.

Resolve partials, but not other variables

To help designers deal with common elements easier a mechanism is needed that allows them to edit a mustache template in its "complete", but unresolved form. I propose a new method for the MustacheFactory:

 MustacheFactory mc = new DefaultMustacheFactory(rootDir);
 mc.resolve(filename,startMarker,endMarker,outputStream);

with the following signature:

public void resolve(String filename, String startMarker, String endMarker, OutputStream outputStream);

start/end Marker are Strings that get inserted before/after the content of a resolved partial. inside the string a marker (e.g. %s ) will carry the filename of the inserted partial.

So a call:

MustacheFactory mc = new DefaultMustacheFactory(rootDir);
FileOutputStream outputStream = new FileOutputStream("index.html");
 mc.resolve("index.mustache","<mustache name=\"%s\">","</mustache>",outputStream);

would use:
index.mustache

<html> {{> header}} <body><h1>Hello World</h1>{{maincontent}}</body></html>

header.mustache

<head><title>{{pageTitle}}</title><meta ...></head>

and produce:
index.html

<html> <mustache name="header"><head><title>{{pageTitle}}</title><meta ...></head></mustache> <body><h1>Hello World</h1>{{maincontent}}</body></html>

I would take care of splitting it back up. It seems like a small step, but when you edit a lot of content that makes much much sense.

Jackson dependancy in builder

The pom has jackson as a dependancy for builder, but I don't believe that is necessary. (correct me if I'm wrong).

Working with abstract types

Using 0.8.6, template compilation fails when processing list of object whose field is an interface or an abstract type.

Try :

public class MustacheTester {

    static abstract class AbstractFoo {
        public abstract String getValue();
    }

    static class Foo extends AbstractFoo {
        @Override
        public String getValue() {
            return "I am Foo";
        }
    }

    static class Bar extends AbstractFoo {
        @Override
        public String getValue() {
            return "I am Bar";
        }
    }

    static class Container {
        public final AbstractFoo foo;
        public Container(final AbstractFoo foo) {
            this.foo = foo;
        }
    }

    public static void main(String[] args) throws IOException {
        final List<Container> containers = new ArrayList<Container>();
        containers.add(new Container(new Foo()));
        containers.add(new Container(new Bar()));
        HashMap<String, Object> scopes = new HashMap<String, Object>();
        Writer writer = new OutputStreamWriter(System.out);
        MustacheFactory mf = new DefaultMustacheFactory();
        Mustache mustache = mf.compile(new StringReader("{{#containers}} {{foo.value}} {{/containers}}"), "example");
        scopes.put("containers", containers);
        mustache.execute(writer, scopes);
        writer.flush();
    }
}

This code throws an 'IllegalArgumentException: object is not an instance of declaring class' on mf.compile.

Note that if the two containers are built with the same field type (let's say two Foo), evrything works fine and output print "I am Foo I am Foo" as expected.

If the field concrete type of elements in a list are different (wich could be in the cas of abstract types or interfaces), mustache throws IllegalArgumentException.

This may not be a bug, but if not it could be a nice new feature!

Sometimes (?) we get java.lang.AssertionError: Unexpected guard failure: [com.github.mustachejava.reflect.MissingWrapper@1de0a172] at com.github.mustachejava.reflect.GuardedBinding.createAndGet(GuardedBinding.java:88)

using com.github.spullara.mustache.java v0.8.12

HTTP Status 500 - javax.servlet.ServletException: Throwable

type Exception report

message javax.servlet.ServletException: Throwable

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.soluvas.web.site.SiteException: javax.servlet.ServletException: Throwable
    id.co.bippo.springapp.SoluvasAtmosphereHandler.onRequest(SoluvasAtmosphereHandler.java:78)
    org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:259)
    org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
    org.atmosphere.container.Tomcat7CometSupport.service(Tomcat7CometSupport.java:88)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.doService(Tomcat7AsyncSupportWithWebSocket.java:63)
    org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:87)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.service(Tomcat7AsyncSupportWithWebSocket.java:59)
    org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1441)
    org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:361)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    java.lang.Thread.run(Thread.java:722)

root cause

javax.servlet.ServletException: Throwable
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.doFilter(SoluvasAtmosphereHandler.java:174)
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.invokeFilterChain(SoluvasAtmosphereHandler.java:158)
    id.co.bippo.springapp.SoluvasAtmosphereHandler.onRequest(SoluvasAtmosphereHandler.java:76)
    org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:259)
    org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
    org.atmosphere.container.Tomcat7CometSupport.service(Tomcat7CometSupport.java:88)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.doService(Tomcat7AsyncSupportWithWebSocket.java:63)
    org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:87)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.service(Tomcat7AsyncSupportWithWebSocket.java:59)
    org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1441)
    org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:361)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    java.lang.Thread.run(Thread.java:722)

root cause

javax.servlet.ServletException: Throwable
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.doFilter(SoluvasAtmosphereHandler.java:174)
    org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
    org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.doFilter(SoluvasAtmosphereHandler.java:172)
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.invokeFilterChain(SoluvasAtmosphereHandler.java:158)
    id.co.bippo.springapp.SoluvasAtmosphereHandler.onRequest(SoluvasAtmosphereHandler.java:76)
    org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:259)
    org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
    org.atmosphere.container.Tomcat7CometSupport.service(Tomcat7CometSupport.java:88)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.doService(Tomcat7AsyncSupportWithWebSocket.java:63)
    org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:87)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.service(Tomcat7AsyncSupportWithWebSocket.java:59)
    org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1441)
    org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:361)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    java.lang.Thread.run(Thread.java:722)
root cause

java.lang.AssertionError: Unexpected guard failure: [com.github.mustachejava.reflect.MissingWrapper@1de0a172] [{category=null, appManifest=org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler@1e5a62d5, webAddress=org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler@400e9d84}]
    com.github.mustachejava.reflect.GuardedBinding.createAndGet(GuardedBinding.java:88)
    com.github.mustachejava.reflect.GuardedBinding.get(GuardedBinding.java:74)
    com.github.mustachejava.codes.DefaultCode.get(DefaultCode.java:103)
    com.github.mustachejava.codes.ValueCode.execute(ValueCode.java:52)
    com.github.mustachejava.codes.DefaultMustache.run(DefaultMustache.java:30)
    com.github.mustachejava.codes.DefaultCode.execute(DefaultCode.java:119)
    com.github.mustachejava.codes.DefaultCode.execute(DefaultCode.java:108)
    org.soluvas.web.site.pagemeta.impl.PageMetaImpl.renderMustache(PageMetaImpl.java:738)
    org.soluvas.web.site.pagemeta.impl.PageMetaImpl.toText(PageMetaImpl.java:710)
    org.soluvas.web.site.RulesPageMetaProvider.get(RulesPageMetaProvider.java:95)
    sun.reflect.GeneratedMethodAccessor236.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:601)
    org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:435)
    com.sun.proxy.$Proxy102.get(Unknown Source)
    org.soluvas.web.bootstrap.BootstrapPage$1.load(BootstrapPage.java:239)
    org.soluvas.web.bootstrap.BootstrapPage$1.load(BootstrapPage.java:228)
    org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:121)
    org.apache.wicket.model.AbstractPropertyModel.getInnermostModelOrObject(AbstractPropertyModel.java:269)
    org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:83)
    org.apache.wicket.AttributeModifier.getReplacementOrNull(AttributeModifier.java:226)
    org.apache.wicket.AttributeModifier.replaceAttributeValue(AttributeModifier.java:182)
    org.apache.wicket.AttributeModifier.onComponentTag(AttributeModifier.java:164)
    org.apache.wicket.Component.renderComponentTag(Component.java:3969)
    org.apache.wicket.Component.internalRenderComponent(Component.java:2539)
    org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1493)
    org.apache.wicket.Component.internalRender(Component.java:2378)
    org.apache.wicket.Component.render(Component.java:2306)
    org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390)
    org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554)
    org.apache.wicket.Page.onRender(Page.java:876)
    org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:142)
    org.apache.wicket.Component.internalRender(Component.java:2378)
    org.apache.wicket.Component.render(Component.java:2306)
    org.apache.wicket.Page.renderPage(Page.java:1010)
    org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:116)
    org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:196)
    org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
    org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:861)
    org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
    org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
    org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
    org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
    org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
    org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
    org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.doFilter(SoluvasAtmosphereHandler.java:172)
    org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
    org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.doFilter(SoluvasAtmosphereHandler.java:172)
    id.co.bippo.springapp.SoluvasAtmosphereHandler$CustomFilterChain.invokeFilterChain(SoluvasAtmosphereHandler.java:158)
    id.co.bippo.springapp.SoluvasAtmosphereHandler.onRequest(SoluvasAtmosphereHandler.java:76)
    org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:259)
    org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
    org.atmosphere.container.Tomcat7CometSupport.service(Tomcat7CometSupport.java:88)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.doService(Tomcat7AsyncSupportWithWebSocket.java:63)
    org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:87)
    org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.service(Tomcat7AsyncSupportWithWebSocket.java:59)
    org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1441)
    org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:361)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    java.lang.Thread.run(Thread.java:722)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.

Apache Tomcat/7.0.30

Original issue: soluvas/soluvas-web#29

Another recursive partials issue

I saw issue 53, but there appears to be another case where this happens.

If I have the following templates:
parent.mustache

{{> child.mustache}}

child.mustache

{{> parent.mustache}}

I get this:
Exception in thread "main" java.lang.StackOverflowError
at java.lang.String.length(String.java:623)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:414)
at java.lang.StringBuffer.append(StringBuffer.java:237)
at java.io.StringWriter.write(StringWriter.java:101)
at com.github.mustachejava.codes.DefaultCode.appendText(DefaultCode.java:155)
at com.github.mustachejava.codes.DefaultCode.execute(DefaultCode.java:119)
at com.github.mustachejava.codes.DefaultMustache.run(DefaultMustache.java:30)
at com.github.mustachejava.codes.DefaultCode.execute(DefaultCode.java:119)
at com.github.mustachejava.codes.PartialCode.execute(PartialCode.java:51)
at com.github.mustachejava.codes.DefaultMustache.run(DefaultMustache.java:30)
at com.github.mustachejava.codes.DefaultCode.execute(DefaultCode.java:119)

Obviously, this is an undesirable manifestation; it would be better if this could be handled gracefully. For what it's worth, handlebars-java does handle this gracefully.

This is present using 0.8.11 and 0.8.12.

Dot notation lookup fails with NPE

In 0.7.4, dot notation lookup will fail with a NullPointerException if an object before the end of the dotted path is null. I will send a pull request with a test case.

Switch threads executor service for Akka

I noticed that the author did something I did a couple of years go where you make parts of the template load asynchronously.
Granted I did this by customizing velocity but I too used the ExecutorService, ConcurrentHashMaps and custom Future objects)

While this seems like a good idea it is a bad idea for a web site. One of the drawback with Java Servlet containers are the sheer number of threads you are going to use. Also thread context switching is not cheap.

So you might want to take a look at Akka http://akka.io/ which supposedly fixes this issue with event driven actor architecture and cooperative threads (supposedly).

Also you will want to look at: http://www.facebook.com/note.php?note_id=389414033919 (I mean to add this but forgot the name)

Make Handlebar and Indy separated projects

There's no need for the "compiler" project structure to contain Handlebar or Indy.
The dependency between the projects is more justified as a core project that provides an API (compiler) and two client projects (handlebar is an API client and indy a plugin).

The solution for this problem is to discard the main pom.xml file, move handlebar and indy each to another repo, leave the directory structure with compiler and example.

This way the development of Handlebar and Indy does not directly depends on the development of the core project and issues / pull requests can be more precisely directed to the project that it's wishing to change.

Mustache.java should not fail when tostring of an object returns null

test case:

public static class ObjectWithPropertyWithNullToString {

        public Object property = new Object() {
            @Override
            public String toString() {
                return null;
            }
        };

    }

    @Test
    public void shouldNotFailWhenToStringReturnsNull() throws Exception {
        String template = "{{property}}";
        Mustache mustache = new DefaultMustacheFactory().compile(new StringReader(template), "");

        StringWriter stringWriter = new StringWriter();
        mustache.execute(stringWriter, new ObjectWithPropertyWithNullToString()).flush();

        String result = stringWriter.getBuffer().toString();
        Assert.assertEquals("", result);
    }

fails with:

Caused by: java.lang.NullPointerException
    at com.github.mustachejava.util.HtmlEscaper.escape(HtmlEscaper.java:15)
    at com.github.mustachejava.DefaultMustacheFactory.encode(DefaultMustacheFactory.java:119)
    at com.github.mustachejava.codes.ValueCode.execute(ValueCode.java:116)
    at com.github.mustachejava.codes.ValueCode.execute(ValueCode.java:60)

Trim whitespace between templates

Given the following template:

<span>{{text}}</span>

and expecting a common editor behaviour of adding a new line to the end of the file. (Git, for example, will warm about no newline. GitHub surfaces it in their UI too: a96ab39#diff-076256f0d16c1a2f0484b4c998008a1cR4). The resulting HTML will include a newline, which is a problem in Tweets that want to preserve source whitespace for formatting.

At the moment, I have to configure Vim not to add newlines to the end of a mustache file, but I think the trimming should take place in Mustache.java.

{{.}} causes ArrayIndexOutOfBoundsException with no scopes

If a template is executed with no scopes passed in and contains a {{.}} tag, "ArrayIndexOutOfBoundsException: -1" is thrown. This behaviour seems inconsistent with other tags, which simply do not render if the tag key does not exist.

Auto recompile on file change.

It would be nice to ensure that the default factory could be enabled to NOT cache the templates. This was done in on older version. Is there a way to do this (without implementing my own factory).

Thanks for the work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.