Skip to content

Commit cbe02a2

Browse files
committed
GROOVY-7842 - MarkupTemplateEngine Totally Broken when used with a Security Manager (closes groovy#358)
When running under a Security Manager an exception would be thrown because the empty codebase value was added as a Permission name which can not be empty. So use the same codebase value that is used by GStringTemplateEngine and StreamingTemplateEngine for unnamed code sources.
1 parent 8408636 commit cbe02a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subprojects/groovy-templates/src/main/groovy/groovy/text/markup/MarkupTemplateEngine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private class MarkupTemplateMaker implements Template {
201201
@SuppressWarnings("unchecked")
202202
public MarkupTemplateMaker(final Reader reader, String sourceName, Map<String, String> modelTypes) {
203203
String name = sourceName != null ? sourceName : "GeneratedMarkupTemplate" + counter.getAndIncrement();
204-
templateClass = groovyClassLoader.parseClass(new GroovyCodeSource(reader, name, ""), modelTypes);
204+
templateClass = groovyClassLoader.parseClass(new GroovyCodeSource(reader, name, "x"), modelTypes);
205205
this.modeltypes = modelTypes;
206206
}
207207

0 commit comments

Comments
 (0)