freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject incubator-freemarker git commit: Renamed the `localizedLookup` Configuration setting to `localizedLookup`.
Date Wed, 07 Jun 2017 22:11:45 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 a93023c76 -> 45a397092


Renamed the `localizedLookup` Configuration setting to `localizedLookup`.


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

Branch: refs/heads/3
Commit: 45a3970920c4769c4db38206ea35e10c6aa4ad96
Parents: a93023c
Author: ddekany <ddekany@apache.org>
Authored: Thu Jun 8 00:11:38 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Thu Jun 8 00:11:38 2017 +0200

----------------------------------------------------------------------
 FM3-CHANGE-LOG.txt                              |  3 +-
 .../core/CustomTemplateResolverTest.java        | 27 +++----
 .../core/TemplateLookupStrategyTest.java        |  6 +-
 .../DefaultTemplateResolverTest.java            |  4 +-
 .../apache/freemarker/core/Configuration.java   | 74 ++++++++++----------
 .../core/MutableProcessingConfiguration.java    |  4 +-
 .../org/apache/freemarker/core/Template.java    | 16 ++---
 .../freemarker/core/TemplateConfiguration.java  |  6 +-
 .../core/TemplateResolverDependenciesImpl.java  |  6 +-
 .../freemarker/core/TopLevelConfiguration.java  | 18 ++---
 .../templateresolver/TemplateLookupContext.java |  6 +-
 .../core/templateresolver/TemplateResolver.java |  4 +-
 .../TemplateResolverDependencies.java           |  4 +-
 .../impl/DefaultTemplateLookupStrategy.java     |  6 +-
 .../impl/DefaultTemplateResolver.java           | 12 ++--
 ...TemplateLoaderBasedTemplateLookupResult.java |  2 +-
 16 files changed, 100 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/FM3-CHANGE-LOG.txt
----------------------------------------------------------------------
diff --git a/FM3-CHANGE-LOG.txt b/FM3-CHANGE-LOG.txt
index 3766831..f8287c6 100644
--- a/FM3-CHANGE-LOG.txt
+++ b/FM3-CHANGE-LOG.txt
@@ -259,4 +259,5 @@ the FreeMarer 3 changelog here:
   - FM2 Configuration.${c}_NAMING_CONVENTION with NamingConvention.${c}
   - FM2 Configuration.${c}_TAG_SYNTAX with TagSyntax.${c}
   - FM2 Configuration.${c}_AUTO_ESCAPING_POLICY with AutoEscapingPolicy.${c}
-- Renamed the `cacheStorage` Configuration setting to `templateCacheStorage`.
\ No newline at end of file
+- Renamed the `cacheStorage` Configuration setting to `templateCacheStorage`.
+- Renamed the `localizedLookup` Configuration setting to `localizedLookup`.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core-test/src/test/java/org/apache/freemarker/core/CustomTemplateResolverTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/CustomTemplateResolverTest.java
b/freemarker-core-test/src/test/java/org/apache/freemarker/core/CustomTemplateResolverTest.java
index 7444e23..de4e16d 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/CustomTemplateResolverTest.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/CustomTemplateResolverTest.java
@@ -76,7 +76,7 @@ public class CustomTemplateResolverTest {
         Configuration cfg = new Configuration.Builder(Configuration.VERSION_3_0_0).build();
 
         assertNotNull(cfg.getTemplateLookupStrategy());
-        assertNotNull(cfg.getLocalizedLookup());
+        assertNotNull(cfg.getLocalizedTemplateLookup());
         assertNotNull(cfg.getTemplateCacheStorage());
         assertNotNull(cfg.getTemplateUpdateDelayMilliseconds());
         assertNotNull(cfg.getNamingConvention());
@@ -95,7 +95,7 @@ public class CustomTemplateResolverTest {
                 .build();
 
         assertNull(cfg.getTemplateLookupStrategy());
-        assertNull(cfg.getLocalizedLookup());
+        assertNull(cfg.getLocalizedTemplateLookup());
         assertNull(cfg.getTemplateCacheStorage());
         assertNull(cfg.getTemplateUpdateDelayMilliseconds());
         assertNull(cfg.getTemplateNameFormat());
@@ -115,7 +115,7 @@ public class CustomTemplateResolverTest {
                 .build();
 
         assertNull(cfg.getTemplateLookupStrategy());
-        assertNull(cfg.getLocalizedLookup());
+        assertNull(cfg.getLocalizedTemplateLookup());
         assertNull(cfg.getTemplateCacheStorage());
         assertNull(cfg.getTemplateUpdateDelayMilliseconds());
         assertNotNull(cfg.getNamingConvention()); //!
@@ -148,7 +148,7 @@ public class CustomTemplateResolverTest {
             // Expected
         }
         try {
-            new Configuration.Builder(Configuration.VERSION_3_0_0).localizedLookup(null).build();
+            new Configuration.Builder(Configuration.VERSION_3_0_0).localizedTemplateLookup(null).build();
             fail();
         } catch (ConfigurationSettingValueException e) {
             // Expected
@@ -167,8 +167,9 @@ public class CustomTemplateResolverTest {
     @Test
     public void testConfigurationValidityForCustomTemplateResolver() {
         for (String supportedSetting : new String[]{
-                TEMPLATE_LOADER_KEY, TEMPLATE_LOOKUP_STRATEGY_KEY, LOCALIZED_LOOKUP_KEY,
TEMPLATE_NAME_FORMAT_KEY,
-                TEMPLATE_CACHE_STORAGE_KEY, TEMPLATE_UPDATE_DELAY_KEY, TEMPLATE_CONFIGURATIONS_KEY
}) {
+                TEMPLATE_LOADER_KEY, TEMPLATE_LOOKUP_STRATEGY_KEY, LOCALIZED_TEMPLATE_LOOKUP_KEY,
+                TEMPLATE_NAME_FORMAT_KEY, TEMPLATE_CACHE_STORAGE_KEY, TEMPLATE_UPDATE_DELAY_KEY,
+                TEMPLATE_CONFIGURATIONS_KEY }) {
             {
                 Configuration.Builder cfgB = new Configuration.Builder(Configuration.VERSION_3_0_0)
                         .templateResolver(new CustomTemplateResolver(supportedSetting));
@@ -194,8 +195,8 @@ public class CustomTemplateResolverTest {
             cfgB.setTemplateLoader(new StringTemplateLoader());
         } else if (TEMPLATE_LOOKUP_STRATEGY_KEY.equals(setting)) {
             cfgB.setTemplateLookupStrategy(DefaultTemplateLookupStrategy.INSTANCE);
-        } else if (LOCALIZED_LOOKUP_KEY.equals(setting)) {
-            cfgB.setLocalizedLookup(true);
+        } else if (LOCALIZED_TEMPLATE_LOOKUP_KEY.equals(setting)) {
+            cfgB.setLocalizedTemplateLookup(true);
         } else if (TEMPLATE_NAME_FORMAT_KEY.equals(setting)) {
             cfgB.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         } else if (TEMPLATE_CACHE_STORAGE_KEY.equals(setting)) {
@@ -246,11 +247,11 @@ public class CustomTemplateResolverTest {
                 }
             }
 
-            if (LOCALIZED_LOOKUP_KEY.equals(supportedSetting)) {
-                assertNotNull(deps.getLocalizedLookup());
+            if (LOCALIZED_TEMPLATE_LOOKUP_KEY.equals(supportedSetting)) {
+                assertNotNull(deps.getLocalizedTemplateLookup());
             } else {
                 try {
-                    deps.getLocalizedLookup();
+                    deps.getLocalizedTemplateLookup();
                     fail();
                 } catch (IllegalStateException e) {
                     // Expected
@@ -382,8 +383,8 @@ public class CustomTemplateResolverTest {
         }
 
         @Override
-        public boolean supportsLocalizedLookupSetting() {
-            return LOCALIZED_LOOKUP_KEY.equals(supportedSetting);
+        public boolean supportsLocalizedTemplateLookupSetting() {
+            return LOCALIZED_TEMPLATE_LOOKUP_KEY.equals(supportedSetting);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
b/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
index ba6c806..2d385e2 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
@@ -136,7 +136,7 @@ public class TemplateLookupStrategyTest {
         try {
             new Configuration.Builder(Configuration.VERSION_3_0_0).templateLoader(tl)
                     .locale(new Locale("xx"))
-                    .localizedLookup(false).build()
+                    .localizedTemplateLookup(false).build()
                     .getTemplate("missing.ftl");
             fail();
         } catch (TemplateNotFoundException e) {
@@ -202,7 +202,7 @@ public class TemplateLookupStrategyTest {
             {
                 final Locale locale = new Locale("aa", "BB", "XX_XX");
                 final Template t = new Configuration.Builder(Configuration.VERSION_3_0_0).templateLoader(tl)
-                        .localizedLookup(false).build()
+                        .localizedTemplateLookup(false).build()
                         .getTemplate(templateName, locale);
                 assertEquals("test.ftl", t.getLookupName());
                 assertEquals("test.ftl", t.getSourceName());
@@ -316,7 +316,7 @@ public class TemplateLookupStrategyTest {
             cfgNoLocLU = new Configuration.Builder(Configuration.VERSION_3_0_0)
                     .templateLoader(tl)
                     .templateLookupStrategy(new DomainTemplateLookupStrategy())
-                    .localizedLookup(false)
+                    .localizedTemplateLookup(false)
                     .build();
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
index 9306af4..844b41b 100644
--- a/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
+++ b/freemarker-core-test/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
@@ -93,7 +93,7 @@ public class DefaultTemplateResolverTest {
                 .templateLoader(loader)
                 .templateCacheStorage(new StrongCacheStorage())
                 .templateUpdateDelayMilliseconds(100L)
-                .localizedLookup(false)
+                .localizedTemplateLookup(false)
                 .build();
         TemplateResolver tr = cfg.getTemplateResolver();
         assertThat(tr, instanceOf(DefaultTemplateResolver.class));
@@ -260,7 +260,7 @@ public class DefaultTemplateResolverTest {
                     .templateCacheStorage(new StrongCacheStorage())
                     .templateLoader(loader)
                     .templateUpdateDelayMilliseconds(0L)
-                    .localizedLookup(false)
+                    .localizedTemplateLookup(false)
                     .build();
             loader.clearEvents();
             loader.putTextTemplate("t.ftl", "v10");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java b/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java
index d674662..150f9d1 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/Configuration.java
@@ -146,7 +146,7 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
         // Must be sorted alphabetically!
         ExtendableBuilder.AUTO_ESCAPING_POLICY_KEY_SNAKE_CASE,
         ExtendableBuilder.INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE,
-        ExtendableBuilder.LOCALIZED_LOOKUP_KEY_SNAKE_CASE,
+        ExtendableBuilder.LOCALIZED_TEMPLATE_LOOKUP_KEY_SNAKE_CASE,
         ExtendableBuilder.NAMING_CONVENTION_KEY_SNAKE_CASE,
         ExtendableBuilder.OUTPUT_FORMAT_KEY_SNAKE_CASE,
         ExtendableBuilder.RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_SNAKE_CASE,
@@ -169,7 +169,7 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
         // Must be sorted alphabetically!
         ExtendableBuilder.AUTO_ESCAPING_POLICY_KEY_CAMEL_CASE,
         ExtendableBuilder.INCOMPATIBLE_IMPROVEMENTS_KEY_CAMEL_CASE,
-        ExtendableBuilder.LOCALIZED_LOOKUP_KEY_CAMEL_CASE,
+        ExtendableBuilder.LOCALIZED_TEMPLATE_LOOKUP_KEY_CAMEL_CASE,
         ExtendableBuilder.NAMING_CONVENTION_KEY_CAMEL_CASE,
         ExtendableBuilder.OUTPUT_FORMAT_KEY_CAMEL_CASE,
         ExtendableBuilder.RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_CAMEL_CASE,
@@ -244,7 +244,7 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
     private final TemplateNameFormat templateNameFormat;
     private final TemplateConfigurationFactory templateConfigurations;
     private final Long templateUpdateDelayMilliseconds;
-    private final Boolean localizedLookup;
+    private final Boolean localizedTemplateLookup;
     private final List<OutputFormat> registeredCustomOutputFormats;
     private final Map<String, OutputFormat> registeredCustomOutputFormatsByName;
     private final Map<String, Object> sharedVariables;
@@ -462,10 +462,10 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
                     templateResolver, TEMPLATE_LOOKUP_STRATEGY_KEY, templateLookupStrategy);
         }
 
-        localizedLookup = builder.getLocalizedLookup();
-        if (!templateResolver.supportsLocalizedLookupSetting()) {
+        localizedTemplateLookup = builder.getLocalizedTemplateLookup();
+        if (!templateResolver.supportsLocalizedTemplateLookupSetting()) {
             checkSettingIsNullForThisTemplateResolver(
-                    templateResolver, LOCALIZED_LOOKUP_KEY, localizedLookup);
+                    templateResolver, LOCALIZED_TEMPLATE_LOOKUP_KEY, localizedTemplateLookup);
         }
 
         templateNameFormat = builder.getTemplateNameFormat();
@@ -1369,13 +1369,13 @@ public final class Configuration implements TopLevelConfiguration,
CustomStateSc
      *            not {@code null}). This parameter also drives localized template lookup.
Assuming that you have
      *            specified {@code en_US} as the locale and {@code myTemplate.ftl} as the
name of the template, and the
      *            default {@link TemplateLookupStrategy} is used and
-     *            {@code #setLocalizedLookup(boolean) localized_lookup} is {@code true},
FreeMarker will first try to
+     *            {@code #setLocalizedTemplateLookup(boolean) localized_template_lookup}
is {@code true}, FreeMarker will first try to
      *            retrieve {@code myTemplate_en_US.html}, then {@code myTemplate.en.ftl},
and finally
      *            {@code myTemplate.ftl}. Note that that the template's locale will be {@code
en_US} even if it only
      *            finds {@code myTemplate.ftl}. Note that when the {@code locale} setting
is overridden with a
      *            {@link TemplateConfiguration} provided by {@link #getTemplateConfigurations()},
that overrides the
-     *            value specified here, but only after the localized lookup, that is, it
modifies the template
-     *            found by the localized lookup.
+     *            value specified here, but only after the localized template lookup, that
is, it modifies the template
+     *            found by the localized template lookup.
      * 
      * @param customLookupCondition
      *            This value can be used by a custom {@link TemplateLookupStrategy}; has
no effect with the default one.
@@ -1536,8 +1536,8 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
     }
 
     @Override
-    public Boolean getLocalizedLookup() {
-        return localizedLookup;
+    public Boolean getLocalizedTemplateLookup() {
+        return localizedTemplateLookup;
     }
 
     /**
@@ -1545,7 +1545,7 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
      * value in the {@link Configuration}.
      */
     @Override
-    public boolean isLocalizedLookupSet() {
+    public boolean isLocalizedTemplateLookupSet() {
         return true;
     }
 
@@ -1669,11 +1669,11 @@ public final class Configuration implements TopLevelConfiguration,
CustomStateSc
         /** Modern, camel case ({@code likeThis}) variation of the setting name. */
         public static final String SOURCE_ENCODING_KEY_CAMEL_CASE = "sourceEncoding";
         /** Legacy, snake case ({@code like_this}) variation of the setting name. */
-        public static final String LOCALIZED_LOOKUP_KEY_SNAKE_CASE = "localized_lookup";
+        public static final String LOCALIZED_TEMPLATE_LOOKUP_KEY_SNAKE_CASE = "localized_template_lookup";
         /** Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints.
*/
-        public static final String LOCALIZED_LOOKUP_KEY = LOCALIZED_LOOKUP_KEY_SNAKE_CASE;
+        public static final String LOCALIZED_TEMPLATE_LOOKUP_KEY = LOCALIZED_TEMPLATE_LOOKUP_KEY_SNAKE_CASE;
         /** Modern, camel case ({@code likeThis}) variation of the setting name. */
-        public static final String LOCALIZED_LOOKUP_KEY_CAMEL_CASE = "localizedLookup";
+        public static final String LOCALIZED_TEMPLATE_LOOKUP_KEY_CAMEL_CASE = "localizedTemplateLookup";
         /** Legacy, snake case ({@code like_this}) variation of the setting name. */
         public static final String WHITESPACE_STRIPPING_KEY_SNAKE_CASE = "whitespace_stripping";
         /** Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints.
*/
@@ -1801,8 +1801,8 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
         private boolean templateConfigurationsSet;
         private Long templateUpdateDelayMilliseconds;
         private boolean templateUpdateDelayMillisecondsSet;
-        private Boolean localizedLookup;
-        private boolean localizedLookupSet;
+        private Boolean localizedTemplateLookup;
+        private boolean localizedTemplateLookupSet;
 
         private Collection<OutputFormat> registeredCustomOutputFormats;
         private Map<String, Object> sharedVariables;
@@ -1839,8 +1839,8 @@ public final class Configuration implements TopLevelConfiguration, CustomStateSc
                     } else {
                         setSourceEncoding(Charset.forName(value));
                     }
-                } else if (LOCALIZED_LOOKUP_KEY_SNAKE_CASE.equals(name) || LOCALIZED_LOOKUP_KEY_CAMEL_CASE.equals(name))
{
-                    setLocalizedLookup(_StringUtil.getYesNo(value));
+                } else if (LOCALIZED_TEMPLATE_LOOKUP_KEY_SNAKE_CASE.equals(name) || LOCALIZED_TEMPLATE_LOOKUP_KEY_CAMEL_CASE.equals(name))
{
+                    setLocalizedTemplateLookup(_StringUtil.getYesNo(value));
                 } else if (WHITESPACE_STRIPPING_KEY_SNAKE_CASE.equals(name)
                         || WHITESPACE_STRIPPING_KEY_CAMEL_CASE.equals(name)) {
                     setWhitespaceStripping(_StringUtil.getYesNo(value));
@@ -2422,50 +2422,50 @@ public final class Configuration implements TopLevelConfiguration,
CustomStateSc
         }
 
         @Override
-        public Boolean getLocalizedLookup() {
-            return isLocalizedLookupSet() ? localizedLookup : getDefaultLocalizedLookupTRAware();
+        public Boolean getLocalizedTemplateLookup() {
+            return isLocalizedTemplateLookupSet() ? localizedTemplateLookup : getDefaultLocalizedTemplateLookupTRAware();
         }
 
         @Override
-        public boolean isLocalizedLookupSet() {
-            return localizedLookupSet;
+        public boolean isLocalizedTemplateLookupSet() {
+            return localizedTemplateLookupSet;
         }
 
-        private Boolean getDefaultLocalizedLookupTRAware() {
-            return isTemplateResolverSet() && !getTemplateResolver().supportsLocalizedLookupSetting()
? null
-                    : getDefaultLocalizedLookup();
+        private Boolean getDefaultLocalizedTemplateLookupTRAware() {
+            return isTemplateResolverSet() && !getTemplateResolver().supportsLocalizedTemplateLookupSetting()
? null
+                    : getDefaultLocalizedTemplateLookup();
         }
 
         /**
          * The default value when the {@link #getTemplateResolver() templateResolver} supports
this setting (otherwise
          * the default is hardwired to be {@code null} and this method isn't called).
          */
-        protected Boolean getDefaultLocalizedLookup() {
+        protected Boolean getDefaultLocalizedTemplateLookup() {
             return true;
         }
 
         /**
-         * Setter pair of {@link Configuration#getLocalizedLookup()}.
+         * Setter pair of {@link Configuration#getLocalizedTemplateLookup()}.
          */
-        public void setLocalizedLookup(Boolean localizedLookup) {
-            this.localizedLookup = localizedLookup;
-            localizedLookupSet = true;
+        public void setLocalizedTemplateLookup(Boolean localizedTemplateLookup) {
+            this.localizedTemplateLookup = localizedTemplateLookup;
+            localizedTemplateLookupSet = true;
         }
 
         /**
-         * Fluent API equivalent of {@link #setLocalizedLookup(Boolean)}
+         * Fluent API equivalent of {@link #setLocalizedTemplateLookup(Boolean)}
          */
-        public SelfT localizedLookup(Boolean localizedLookup) {
-            setLocalizedLookup(localizedLookup);
+        public SelfT localizedTemplateLookup(Boolean localizedTemplateLookup) {
+            setLocalizedTemplateLookup(localizedTemplateLookup);
             return self();
         }
 
         /**
          * Resets this setting to its initial state, as if it was never set.
          */
-        public void unsetLocalizedLookup() {
-            this.localizedLookup = null;
-            localizedLookupSet = false;
+        public void unsetLocalizedTemplateLookup() {
+            this.localizedTemplateLookup = null;
+            localizedTemplateLookupSet = false;
         }
 
         public Collection<OutputFormat> getRegisteredCustomOutputFormats() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java
index 3f3a488..d490bae 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/MutableProcessingConfiguration.java
@@ -1666,8 +1666,8 @@ public abstract class MutableProcessingConfiguration<SelfT extends
MutableProces
      *       <br>As the default value is the system default, which can change
      *       from one server to another, <b>you should always set this!</b>
      *       
-     *   <li><p>{@code "localized_lookup"}:
-     *       See {@link Configuration#getLocalizedLookup()}.
+     *   <li><p>{@code "localized_template_lookup"}:
+     *       See {@link Configuration#getLocalizedTemplateLookup()}.
      *       <br>String value: {@code "true"}, {@code "false"} (also the equivalents:
{@code "yes"}, {@code "no"},
      *       {@code "t"}, {@code "f"}, {@code "y"}, {@code "n"}).
      *       ASTDirCase insensitive.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java b/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java
index 3b99ddf..3a0122d 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/Template.java
@@ -576,7 +576,7 @@ public class Template implements ProcessingConfiguration, CustomStateScope
{
      * 
      * <p>
      * You should not use this name to indicate error locations, or to find the actual templates
in general, because
-     * localized lookup, acquisition and other lookup strategies can transform names before
they get to the
+     * localized template lookup, acquisition and other lookup strategies can transform names
before they get to the
      * {@link TemplateLoader} (the template storage) mechanism. Use {@link #getSourceName()}
for these purposes.
      * </p>
      * 
@@ -592,13 +592,13 @@ public class Template implements ProcessingConfiguration, CustomStateScope
{
     /**
      * The name that was actually used to load this template from the {@link TemplateLoader}
(or from other custom
      * storage mechanism). This is what should be shown in error messages as the error location.
This is usually the
-     * same as {@link #getLookupName()}, except when localized lookup, template acquisition
({@code *} step in the
-     * name), or other {@link TemplateLookupStrategy} transforms the requested name ({@link
#getLookupName()}) to a
-     * different final {@link TemplateLoader}-level name. For example, when you get a template
with name {@code "foo
-     * .ftl"} then because of localized lookup, it's possible that something like {@code
"foo_en.ftl"} will be loaded
-     * behind the scenes. While the template name will be still the same as the requested
template name ({@code "foo
-     * .ftl"}), errors should point to {@code "foo_de.ftl"}. Note that relative paths are
always resolved relatively
-     * to the {@code name}, not to the {@code sourceName}.
+     * same as {@link #getLookupName()}, except when localized template lookup, template
acquisition ({@code *} step
+     * in the name), or other {@link TemplateLookupStrategy} transforms the requested name
({@link #getLookupName()})
+     * to a different final {@link TemplateLoader}-level name. For example, when you get
a template with name {@code
+     * "foo .ftl"} then because of localized template lookup, it's possible that something
like {@code "foo_en.ftl"}
+     * will be loaded behind the scenes. While the template name will be still the same as
the requested template
+     * name ({@code "foo .ftl"}), errors should point to {@code "foo_de.ftl"}. Note that
relative paths are always
+     * resolved relatively to the {@code name}, not to the {@code sourceName}.
      */
     public String getSourceName() {
         return sourceName;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateConfiguration.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateConfiguration.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateConfiguration.java
index 2b9b0ab..f5d7457 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateConfiguration.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateConfiguration.java
@@ -45,9 +45,9 @@ import org.apache.freemarker.core.valueformat.TemplateNumberFormatFactory;
  * {@link TemplateConfiguration}-s anyway, this compromise was chosen.)
  * <p>
  * Note on the {@code locale} setting: When used with the standard template loading/caching
mechanism ({@link
- * Configuration#getTemplate(String)} and its overloads), localized lookup happens before
the {@code locale} specified
- * here could have effect. The {@code locale} will be only set in the template that the localized
lookup has already
- * found.
+ * Configuration#getTemplate(String)} and its overloads), localized template lookup happens
before the {@code locale}
+ * specified here could have effect. The {@code locale} will be only set in the template
that the localized
+ * template lookup has already found.
  * <p>
  * This class is immutable. Use {@link TemplateConfiguration.Builder} to create a new instance.
  *

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateResolverDependenciesImpl.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateResolverDependenciesImpl.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateResolverDependenciesImpl.java
index ee61d33..c6f2669 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateResolverDependenciesImpl.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/TemplateResolverDependenciesImpl.java
@@ -88,9 +88,9 @@ class TemplateResolverDependenciesImpl extends TemplateResolverDependencies
{
     }
 
     @Override
-    public Boolean getLocalizedLookup() {
-        checkSettingSupported(LOCALIZED_LOOKUP_KEY, templateResolver.supportsLocalizedLookupSetting());
-        return configuration.getLocalizedLookup();
+    public Boolean getLocalizedTemplateLookup() {
+        checkSettingSupported(LOCALIZED_TEMPLATE_LOOKUP_KEY, templateResolver.supportsLocalizedTemplateLookupSetting());
+        return configuration.getLocalizedTemplateLookup();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java
index abb2816..fed778e 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/TopLevelConfiguration.java
@@ -201,23 +201,23 @@ public interface TopLevelConfiguration extends ParsingAndProcessingConfiguration
      * Whether localized template lookup is enabled. The default is {@code true}, except
when the
      * {@link #getTemplateResolver() templateResolver} doesn't support this setting, in which
case it's {@code null}.
      * <p>
-     * With the default {@link TemplateLookupStrategy}, localized lookup works like this:
Let's say your locale setting
-     * is {@code Locale("en", "AU")}, and you call {@link Configuration#getTemplate(String)
cfg.getTemplate("foo.ftl")}.
-     * Then FreeMarker will look for the template under these names, stopping at the first
that exists:
-     * {@code "foo_en_AU.ftl"}, {@code "foo_en.ftl"}, {@code "foo.ftl"}. See the description
of the default value at
-     * {@link #getTemplateLookupStrategy()} for a more details. If you need to generate different
-     * template names, set your own a {@link TemplateLookupStrategy} implementation as the
value of the
-     * {@link #getTemplateLookupStrategy() templateLookupStrategy} setting.
+     * With the default {@link TemplateLookupStrategy}, localized template lookup works like
this: Let's say your
+     * locale setting is {@code Locale("en", "AU")}, and you call
+     * {@link Configuration#getTemplate(String) cfg.getTemplate("foo.ftl")}. Then FreeMarker
will look for the
+     * template under these names, stopping at the first that exists: {@code "foo_en_AU.ftl"},
{@code "foo_en.ftl"},
+     * {@code "foo.ftl"}. See the description of the default value at {@link #getTemplateLookupStrategy()}
for a more
+     * details. If you need to generate different template names, set your own a {@link TemplateLookupStrategy}
+     * implementation as the value of the {@link #getTemplateLookupStrategy() templateLookupStrategy}
setting.
      * <p>
      * If the {@link #getTemplateResolver() templateResolver} doesn't support this setting,
then it must be {@code
      * null}. These checks are postponed until the {@link Configuration} instance is created.
      */
-    Boolean getLocalizedLookup();
+    Boolean getLocalizedTemplateLookup();
 
     /**
      * Tells if this setting was explicitly set (otherwise its value will be the default
value).
      */
-    boolean isLocalizedLookupSet();
+    boolean isLocalizedTemplateLookupSet();
 
     /**
      * Shared variables are variables that are visible as top-level variables for all templates,
except where the data

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLookupContext.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLookupContext.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLookupContext.java
index 7926a1f..940aff7 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLookupContext.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLookupContext.java
@@ -58,7 +58,7 @@ public abstract class TemplateLookupContext<R extends TemplateLookupResult>
{
     /**
      * Finds the template source based on its <em>normalized</em> name; tries
localized variations going from most
      * specific to less specific, and for each variation it delegates to {@link #lookupWithAcquisitionStrategy(String)}.
-     * If {@code templateLocale} is {@code null} (typically, because {@link Configuration#getLocalizedLookup()}
is
+     * If {@code templateLocale} is {@code null} (typically, because {@link Configuration#getLocalizedTemplateLookup()}
is
      * {@code false})), then it's the same as calling {@link #lookupWithAcquisitionStrategy(String)}
directly. This is
      * the default strategy of FreeMarker (at least in 2.3.x), so for more information, see
      * {@link DefaultTemplateLookupStrategy#INSTANCE}.
@@ -81,8 +81,8 @@ public abstract class TemplateLookupContext<R extends TemplateLookupResult>
{
     }
 
     /**
-     * {@code null} if localized lookup is disabled (see {@link Configuration#getLocalizedLookup()}),
otherwise the
-     * locale requested.
+     * {@code null} if localized template lookup is disabled (see {@link Configuration#getLocalizedTemplateLookup()}),
+     * otherwise the locale requested.
      */
     public Locale getTemplateLocale() {
         return templateLocale;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
index 04d8a95..2dde324 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
@@ -247,8 +247,8 @@ public abstract class TemplateResolver {
 
     /**
      * Works like {@link #supportsTemplateLoaderSetting()}, but for the
-     * {@link Configuration#getLocalizedLookup() localizedLookup} setting.
+     * {@link Configuration#getLocalizedTemplateLookup() localizedTemplateLookup} setting.
      */
-    public abstract boolean supportsLocalizedLookupSetting();
+    public abstract boolean supportsLocalizedTemplateLookupSetting();
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolverDependencies.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolverDependencies.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolverDependencies.java
index ebc5cbb..ee7b4e4 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolverDependencies.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolverDependencies.java
@@ -71,9 +71,9 @@ public abstract class TemplateResolverDependencies {
     public abstract Long getTemplateUpdateDelayMilliseconds();
 
     /**
-     * @throws IllegalStateException if {@link TemplateResolver#supportsLocalizedLookupSetting()}
return {@code false}.
+     * @throws IllegalStateException if {@link TemplateResolver#supportsLocalizedTemplateLookupSetting()}
return {@code false}.
      */
-    public abstract Boolean getLocalizedLookup();
+    public abstract Boolean getLocalizedTemplateLookup();
 
     public abstract Charset getSourceEncoding();
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateLookupStrategy.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateLookupStrategy.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateLookupStrategy.java
index 185f5b9..9f74bbe 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateLookupStrategy.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateLookupStrategy.java
@@ -30,13 +30,13 @@ import org.apache.freemarker.core.templateresolver.TemplateLookupStrategy;
  * The default lookup strategy of FreeMarker.
  * 
  * <p>
- * Through an example: Assuming localized lookup is enabled and that a template is requested
for the name
+ * Through an example: Assuming localized template lookup is enabled and that a template
is requested for the name
  * {@code example.ftl} and {@code Locale("es", "ES", "Traditional_WIN")}, it will try the
following template names,
  * in this order: {@code "foo_en_AU_Traditional_WIN.ftl"}, {@code "foo_en_AU_Traditional.ftl"},
  * {@code "foo_en_AU.ftl"}, {@code "foo_en.ftl"}, {@code "foo.ftl"}. It stops at the first
variation where it finds
  * a template. (If the template name contains "*" steps, finding the template for the attempted
localized variation
- * happens with the template acquisition mechanism.) If localized lookup is disabled, it
won't try to add any locale
- * strings, so it just looks for {@code "foo.ftl"}.
+ * happens with the template acquisition mechanism.) If localized template lookup is disabled,
it won't try to add any
+ * locale strings, so it just looks for {@code "foo.ftl"}.
  * 
  * <p>
  * The generation of the localized name variation with the default lookup strategy, happens
like this: It removes

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
index 17401ee..5cebcb8 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
@@ -91,7 +91,7 @@ public class DefaultTemplateResolver extends TemplateResolver {
     private long templateUpdateDelayMilliseconds;
     private Charset sourceEncoding;
     private TemplateLanguage templateLanguage;
-    private boolean localizedLookup;
+    private boolean localizedTemplateLookup;
 
     @Override
     protected void initialize() throws ConfigurationException {
@@ -106,9 +106,9 @@ public class DefaultTemplateResolver extends TemplateResolver {
         checkDependencyNotNull(TEMPLATE_UPDATE_DELAY_KEY, templateUpdateDelayMilliseconds);
         this.templateUpdateDelayMilliseconds = templateUpdateDelayMilliseconds;
 
-        Boolean localizedLookup = deps.getLocalizedLookup();
-        checkDependencyNotNull(LOCALIZED_LOOKUP_KEY, localizedLookup);
-        this.localizedLookup = localizedLookup;
+        Boolean localizedTemplateLookup = deps.getLocalizedTemplateLookup();
+        checkDependencyNotNull(LOCALIZED_TEMPLATE_LOOKUP_KEY, localizedTemplateLookup);
+        this.localizedTemplateLookup = localizedTemplateLookup;
 
         this.templateLookupStrategy = deps.getTemplateLookupStrategy();
         checkDependencyNotNull(TEMPLATE_LOOKUP_STRATEGY_KEY, this.templateLookupStrategy);
@@ -222,7 +222,7 @@ public class DefaultTemplateResolver extends TemplateResolver {
     }
 
     @Override
-    public boolean supportsLocalizedLookupSetting() {
+    public boolean supportsLocalizedTemplateLookupSetting() {
         return true;
     }
 
@@ -768,7 +768,7 @@ public class DefaultTemplateResolver extends TemplateResolver {
         DefaultTemplateResolverTemplateLookupContext(String templateName, Locale templateLocale,
Object customLookupCondition,
                 TemplateLoadingSource cachedResultSource, Serializable cachedResultVersion,
                 TemplateLoaderSession session) {
-            super(templateName, localizedLookup ? templateLocale : null, customLookupCondition,
+            super(templateName, localizedTemplateLookup ? templateLocale : null, customLookupCondition,
                     cachedResultSource, cachedResultVersion);
             this.session = session;
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/45a39709/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/TemplateLoaderBasedTemplateLookupResult.java
----------------------------------------------------------------------
diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/TemplateLoaderBasedTemplateLookupResult.java
b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/TemplateLoaderBasedTemplateLookupResult.java
index fe7a54c..380fb18 100644
--- a/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/TemplateLoaderBasedTemplateLookupResult.java
+++ b/freemarker-core/src/main/java/org/apache/freemarker/core/templateresolver/impl/TemplateLoaderBasedTemplateLookupResult.java
@@ -64,7 +64,7 @@ public abstract class TemplateLoaderBasedTemplateLookupResult extends TemplateLo
          * @param templateSourceName
          *            The name of the matching template found. This is not necessarily the
same as the template name
          *            with which the template was originally requested. For example, one
may gets a template for the
-         *            {@code "foo.ftl"} name, but due to localized lookup the template is
actually loaded from
+         *            {@code "foo.ftl"} name, but due to localized template lookup the template
is actually loaded from
          *            {@code "foo_de.ftl"}. Then this parameter must be {@code "foo_de.ftl"},
not {@code "foo.ftl"}. Not
          *            {@code null}.
          * 



Mime
View raw message