You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2020/10/03 10:00:17 UTC

[sling-org-apache-sling-scripting-freemarker] branch master updated: SLING-9789 Silence the incompatible improvements error (checkCurrentVersionNotRecycled)

This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-freemarker.git


The following commit(s) were added to refs/heads/master by this push:
     new b42f72e  SLING-9789 Silence the incompatible improvements error (checkCurrentVersionNotRecycled)
b42f72e is described below

commit b42f72ee2a541f41cea6e751830e88268439a35f
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sat Oct 3 12:00:03 2020 +0200

    SLING-9789 Silence the incompatible improvements error (checkCurrentVersionNotRecycled)
---
 .../scripting/freemarker/internal/FreemarkerScriptEngineFactory.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/freemarker/internal/FreemarkerScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/freemarker/internal/FreemarkerScriptEngineFactory.java
index fa2ef8a..baaa133 100644
--- a/src/main/java/org/apache/sling/scripting/freemarker/internal/FreemarkerScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/freemarker/internal/FreemarkerScriptEngineFactory.java
@@ -27,6 +27,7 @@ import javax.script.ScriptEngineFactory;
 
 import freemarker.template.Configuration;
 import freemarker.template.TemplateModel;
+import freemarker.template.Version;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.sling.commons.osgi.SortingServiceTracker;
 import org.apache.sling.scripting.api.AbstractScriptEngineFactory;
@@ -77,7 +78,9 @@ public class FreemarkerScriptEngineFactory extends AbstractScriptEngineFactory {
     private final Logger logger = LoggerFactory.getLogger(FreemarkerScriptEngineFactory.class);
 
     public FreemarkerScriptEngineFactory() {
-        defaultConfiguration = new Configuration(Configuration.getVersion());
+        final String version = Configuration.getVersion().toString();
+        final Version incompatibleImprovements = new Version(version);
+        defaultConfiguration = new Configuration(incompatibleImprovements);
         defaultConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name());
     }