Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae e3ed32a1f -> 67a2ebd8a


Added a new Configuration.removeTemplateFromCache overload that has a Object 
customLookupCondition parameter. This is useful to manually evacuate a template 
from the cache that was get via a non-null custom lookup condition.


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

Branch: refs/heads/2.3-gae
Commit: 67a2ebd8a48a12185d15ba59bb2d5dd7bad73089
Parents: e3ed32a
Author: ddekany <ddek...@apache.org>
Authored: Tue Mar 20 20:08:35 2018 +0100
Committer: ddekany <ddek...@apache.org>
Committed: Tue Mar 20 20:08:35 2018 +0100

----------------------------------------------------------------------
 .../java/freemarker/template/Configuration.java | 44 ++++++++++++++------
 src/manual/en_US/book.xml                       |  9 ++++
 2 files changed, 41 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/67a2ebd8/src/main/java/freemarker/template/Configuration.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/Configuration.java 
b/src/main/java/freemarker/template/Configuration.java
index 8db9155..f0c6a0d 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -3056,55 +3056,75 @@ public class Configuration extends Configurable 
implements Cloneable, ParserConf
     }
     
     /**
-     * Equivalent to <tt>removeTemplateFromCache(name, thisCfg.getLocale(), 
thisCfg.getEncoding(thisCfg.getLocale()), true)</tt>.
+     * Equivalent to {@link
+     * #removeTemplateFromCache(String, Locale, Object, String, boolean)
+     * removeTemplateFromCache(name, thisCfg.getLocale(), null, 
thisCfg.getEncoding(thisCfg.getLocale()), true)}.
      * @since 2.3.19
      */
     public void removeTemplateFromCache(String name) throws IOException {
         Locale loc = getLocale();
-        removeTemplateFromCache(name, loc, getEncoding(loc), true);
+        removeTemplateFromCache(name, loc, null, getEncoding(loc), true);
     }
 
     /**
-     * Equivalent to <tt>removeTemplateFromCache(name, locale, 
thisCfg.getEncoding(locale), true)</tt>.
+     * Equivalent to {@link
+     * #removeTemplateFromCache(String, Locale, Object, String, boolean)
+     * removeTemplateFromCache(name, locale, null, 
thisCfg.getEncoding(locale), true)}.
      * @since 2.3.19
      */
     public void removeTemplateFromCache(String name, Locale locale) throws 
IOException {
-        removeTemplateFromCache(name, locale, getEncoding(locale), true);
+        removeTemplateFromCache(name, locale, null, getEncoding(locale), true);
     }
 
     /**
-     * Equivalent to <tt>removeTemplateFromCache(name, thisCfg.getLocale(), 
encoding, true)</tt>.
+     * Equivalent to {@link
+     * #removeTemplateFromCache(String, Locale, Object, String, boolean)
+     * removeTemplateFromCache(name, thisCfg.getLocale(), null, encoding, 
true)}.
      * @since 2.3.19
      */
     public void removeTemplateFromCache(String name, String encoding) throws 
IOException {
-        removeTemplateFromCache(name, getLocale(), encoding, true);
+        removeTemplateFromCache(name, getLocale(), null, encoding, true);
     }
 
     /**
-     * Equivalent to <tt>removeTemplateFromCache(name, locale, encoding, 
true)</tt>.
+     * Equivalent to {@link
+     * #removeTemplateFromCache(String, Locale, Object, String, boolean)
+     * removeTemplateFromCache(name, locale, null, encoding, true)}.
      * @since 2.3.19
      */
     public void removeTemplateFromCache(String name, Locale locale, String 
encoding) throws IOException {
-        removeTemplateFromCache(name, locale, encoding, true);
+        removeTemplateFromCache(name, locale, null, encoding, true);
     }
     
     /**
+     * Equivalent to {@link
+     * #removeTemplateFromCache(String, Locale, Object, String, boolean)
+     * removeTemplateFromCache(name, locale, null, encoding, parse)}.
+     * @since 2.3.19
+     */
+    public void removeTemplateFromCache(
+            String name, Locale locale, String encoding, boolean parse)
+    throws IOException {
+        removeTemplateFromCache(name, locale, null, encoding, parse);
+    }    
+
+    /**
      * Removes a template from the template cache, hence forcing the re-loading
      * of it when it's next time requested. This is to give the application
      * finer control over cache updating than {@link 
#setTemplateUpdateDelay(int)}
      * alone does.
      * 
      * <p>For the meaning of the parameters, see
-     * {@link #getTemplate(String, Locale, String, boolean)}.
+     * {@link #getTemplate(String, Locale, Object, String, boolean, boolean)}.
      * 
      * <p>This method is thread-safe and can be called while the engine 
processes templates.
      * 
-     * @since 2.3.19
+     * @since 2.3.28
      */
     public void removeTemplateFromCache(
-            String name, Locale locale, String encoding, boolean parse)
+            String name, Locale locale, Object customLookupCondition, String 
encoding, boolean parse)
     throws IOException {
-        cache.removeTemplate(name, locale, encoding, parse);
+        cache.removeTemplate(name, locale, customLookupCondition, encoding, 
parse);
     }    
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/67a2ebd8/src/manual/en_US/book.xml
----------------------------------------------------------------------
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index 0f49b3f..2a0ce2c 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -27710,6 +27710,15 @@ TemplateModel x = env.getVariable("x");  // get 
variable x</programlisting>
             </listitem>
 
             <listitem>
+              <para>Added a new
+              <literal>Configuration.removeTemplateFromCache</literal>
+              overload that has a <literal>Object
+              customLookupCondition</literal> parameter. This is useful to
+              manually evacuate a template from the cache that was get via a
+              non-<literal>null</literal> custom lookup condition.</para>
+            </listitem>
+
+            <listitem>
               <para>Added new property to
               <literal>BeansWrapper.MethodAppearanceDecision</literal>:
               <literal>replaceExistingProperty</literal>. This is useful when

Reply via email to