From ed15f742fd4eacc14b06908112ac4ca6ae4c0f90 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 30 May 2014 11:31:51 +0100 Subject: [PATCH] Fix bug in GroovyTemplate convenience It was ignoring the engine argument in the 3 arg version of template(). --- .../java/org/springframework/boot/groovy/GroovyTemplate.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java index 3cf674bf34e..3cc91f82d9e 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java @@ -49,15 +49,14 @@ public abstract class GroovyTemplate { public static String template(TemplateEngine engine, String name, Map model) throws IOException, CompilationFailedException, ClassNotFoundException { - Writable writable = getTemplate(name).make(model); + Writable writable = getTemplate(engine, name).make(model); StringWriter result = new StringWriter(); writable.writeTo(result); return result.toString(); } - private static Template getTemplate(String name) throws CompilationFailedException, + private static Template getTemplate(TemplateEngine engine, String name) throws CompilationFailedException, ClassNotFoundException, IOException { - GStringTemplateEngine engine = new GStringTemplateEngine(); File file = new File("templates", name); if (file.exists()) {