Skip to content

Commit

Permalink
Make allowed version of freemarker explicit
Browse files Browse the repository at this point in the history
The freemarker docs state, that it is not allowed to use Config#getVersion()
directly, to specify the version, that we think we are compatible with.

Therefore, let us specify the current version and update it, as we update
the dependency or the templates.
  • Loading branch information
FSchumacher committed Nov 8, 2020
1 parent f4be397 commit ac45fba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public void export(SampleContext context, File file,
addToContext(DATA_CTX_OVERALL_FILTER, configuration.getSampleFilter(), dataContext);

// Walk template directory to copy files and process templated ones
Configuration templateCfg = new Configuration(Configuration.getVersion());
Configuration templateCfg = new Configuration(Configuration.VERSION_2_3_30);
try {
templateCfg.setDirectoryForTemplateLoading(templateDirectory);
templateCfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private TemplateUtil() {
}

private static Configuration init() {
Configuration templateConfiguration = new Configuration(Configuration.getVersion());
Configuration templateConfiguration = new Configuration(Configuration.VERSION_2_3_30);
templateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name());
templateConfiguration.setInterpolationSyntax(Configuration.SQUARE_BRACKET_INTERPOLATION_SYNTAX);
templateConfiguration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
Expand Down

0 comments on commit ac45fba

Please sign in to comment.