Repository: freemarker
Updated Branches:
  refs/heads/3 a89a67713 -> ef409c2be


Renamed "staticText" langauge to "unparsed" to be consistent with 
UnparsedTemplateLanguage (f3u)


Project: http://git-wip-us.apache.org/repos/asf/freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/freemarker/commit/d1a727b7
Tree: http://git-wip-us.apache.org/repos/asf/freemarker/tree/d1a727b7
Diff: http://git-wip-us.apache.org/repos/asf/freemarker/diff/d1a727b7

Branch: refs/heads/3
Commit: d1a727b7ab8b5de43adcdac4b2b1b1cdf4e7063b
Parents: a89a677
Author: ddekany <ddek...@apache.org>
Authored: Sat Apr 14 16:09:00 2018 +0200
Committer: ddekany <ddek...@apache.org>
Committed: Sat Apr 14 16:09:00 2018 +0200

----------------------------------------------------------------------
 .../freemarker/core/TemplateGetEncodingTest.java      | 14 +++++++-------
 .../MutableParsingAndProcessingConfiguration.java     |  2 +-
 .../freemarker/core/UnparsedTemplateLanguage.java     |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/freemarker/blob/d1a727b7/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateGetEncodingTest.java
----------------------------------------------------------------------
diff --git 
a/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateGetEncodingTest.java
 
b/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateGetEncodingTest.java
index 8e993b9..c9263bc 100644
--- 
a/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateGetEncodingTest.java
+++ 
b/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateGetEncodingTest.java
@@ -40,23 +40,23 @@ public class TemplateGetEncodingTest {
             cfgB.setSourceEncoding(ISO_8859_2);
             MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
             tl.putBinaryTemplate("bin", "test");
-            tl.putBinaryTemplate("bin-static", "<#test>");
+            tl.putBinaryTemplate("bin-unparsed", "<#test>");
             tl.putTextTemplate("text", "test");
-            tl.putTextTemplate("text-static", "<#test>");
-            TemplateConfiguration.Builder staticTextTCB = new 
TemplateConfiguration.Builder();
-            staticTextTCB.setTemplateLanguage(UnparsedTemplateLanguage.F3UU);
+            tl.putTextTemplate("text-unparsed", "<#test>");
+            TemplateConfiguration.Builder unparsedTCB = new 
TemplateConfiguration.Builder();
+            unparsedTCB.setTemplateLanguage(UnparsedTemplateLanguage.F3UU);
             cfgB.setTemplateConfigurations(
                     new ConditionalTemplateConfigurationFactory(
-                            new FileNameGlobMatcher("*-static*"), 
staticTextTCB.build()));
+                            new FileNameGlobMatcher("*-unparsed*"), 
unparsedTCB.build()));
             cfgB.setTemplateLoader(tl);
             cfgB.setTemplateCacheStorage(new StrongCacheStorage());
         }
 
         Configuration cfg = cfgB.build();
         assertEquals(ISO_8859_2, 
cfg.getTemplate("bin").getActualSourceEncoding());
-        assertEquals(ISO_8859_2, 
cfg.getTemplate("bin-static").getActualSourceEncoding());
+        assertEquals(ISO_8859_2, 
cfg.getTemplate("bin-unparsed").getActualSourceEncoding());
         assertNull(cfg.getTemplate("text").getActualSourceEncoding());
-        assertNull(cfg.getTemplate("text-static").getActualSourceEncoding());
+        assertNull(cfg.getTemplate("text-unparsed").getActualSourceEncoding());
         assertNull(new Template(null, "test", cfg).getActualSourceEncoding());
         assertNull(Template.createPlainTextTemplate(null, "<#test>", 
cfg).getActualSourceEncoding());
     }

http://git-wip-us.apache.org/repos/asf/freemarker/blob/d1a727b7/freemarker-core/src/main/java/org/apache/freemarker/core/MutableParsingAndProcessingConfiguration.java
----------------------------------------------------------------------
diff --git 
a/freemarker-core/src/main/java/org/apache/freemarker/core/MutableParsingAndProcessingConfiguration.java
 
b/freemarker-core/src/main/java/org/apache/freemarker/core/MutableParsingAndProcessingConfiguration.java
index 0f6b83e..f5f3a0d 100644
--- 
a/freemarker-core/src/main/java/org/apache/freemarker/core/MutableParsingAndProcessingConfiguration.java
+++ 
b/freemarker-core/src/main/java/org/apache/freemarker/core/MutableParsingAndProcessingConfiguration.java
@@ -116,7 +116,7 @@ public abstract class 
MutableParsingAndProcessingConfiguration<
                 TemplateLanguage templateLanguage = 
Configuration.PREDEFINED_TEMPLATE_LANGUAGES_BY_EXTENSION.get(
                         value.toLowerCase());
                 if (templateLanguage == null) {
-                    if ("staticText".equals(value)) {
+                    if ("unparsed".equals(value)) {
                         templateLanguage = UnparsedTemplateLanguage.F3UU;
                     } else {
                         // TODO [FM3] Allow setting a custom template language 
by class name.

http://git-wip-us.apache.org/repos/asf/freemarker/blob/d1a727b7/freemarker-core/src/main/java/org/apache/freemarker/core/UnparsedTemplateLanguage.java
----------------------------------------------------------------------
diff --git 
a/freemarker-core/src/main/java/org/apache/freemarker/core/UnparsedTemplateLanguage.java
 
b/freemarker-core/src/main/java/org/apache/freemarker/core/UnparsedTemplateLanguage.java
index 0af1cbd..336dfd3 100644
--- 
a/freemarker-core/src/main/java/org/apache/freemarker/core/UnparsedTemplateLanguage.java
+++ 
b/freemarker-core/src/main/java/org/apache/freemarker/core/UnparsedTemplateLanguage.java
@@ -65,7 +65,7 @@ public final class UnparsedTemplateLanguage extends 
TemplateLanguage {
         }
         ASTStaticText root = new ASTStaticText(sb.toString());
         root.setFieldsForRootElement();
-        root.setLocation(template, -1, -1, -1, -1); // TODO [FM3] Positions 
are dummy
+        root.setLocation(template, 0, 0, 0, 0); // TODO [FM3] Positions are 
dummy
         
         return root;
     }

Reply via email to