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

ddekany pushed a commit to branch FREEMARKER-35
in repository https://gitbox.apache.org/repos/asf/freemarker.git

commit 9742e5e28dd63bc1df5c378fa5648e57ed8bd14b
Merge: 2a23b00b 52992c34
Author: ddekany <[email protected]>
AuthorDate: Mon Dec 18 14:42:07 2023 +0100

    Merge remote-tracking branch 'origin/2.3-gae' into FREEMARKER-35
    
    # Conflicts:
    #       src/main/java/freemarker/core/EvalUtil.java
    #       src/main/java/freemarker/template/Configuration.java

 README.md                                          |   7 +-
 .../java/freemarker/core/AddConcatExpression.java  | 261 ++++++++++++-
 .../core/BuiltInBannedWhenForcedAutoEscaping.java  |  25 ++
 .../core/BuiltInsForOutputFormatRelated.java       |   2 +-
 src/main/java/freemarker/core/Configurable.java    |   3 +-
 src/main/java/freemarker/core/Environment.java     |  36 ++
 src/main/java/freemarker/core/EvalUtil.java        |   9 +-
 src/main/java/freemarker/core/IfBlock.java         |  24 +-
 .../java/freemarker/core/ListElseContainer.java    |  21 +-
 src/main/java/freemarker/core/TemplateElement.java |   8 +-
 src/main/java/freemarker/core/TemplateObject.java  |  24 +-
 .../freemarker/core/TemplateProcessingTracer.java  |  95 +++++
 .../java/freemarker/template/Configuration.java    |  32 +-
 src/main/java/freemarker/template/Template.java    |  16 +-
 .../java/freemarker/template/_TemplateAPI.java     |   2 +
 src/main/javacc/FTL.jj                             |  62 ++-
 src/manual/en_US/book.xml                          | 125 +++++-
 .../freemarker/core/ConcatenatedSequenceTest.java  | 421 +++++++++++++++++++++
 .../java/freemarker/core/OutputFormatTest.java     |  42 +-
 .../core/TemplateProcessingTracerTest.java         | 245 ++++++++++++
 .../test/templatesuite/expected/comparisons.txt    |   1 -
 .../test/templatesuite/templates/comparisons.ftl   |  22 ++
 22 files changed, 1422 insertions(+), 61 deletions(-)

diff --cc src/main/java/freemarker/core/EvalUtil.java
index 3a313650,7bb95471..5d7348df
--- a/src/main/java/freemarker/core/EvalUtil.java
+++ b/src/main/java/freemarker/core/EvalUtil.java
@@@ -20,7 -20,7 +20,8 @@@
  package freemarker.core;
  
  import java.lang.reflect.InvocationTargetException;
 +import java.time.temporal.Temporal;
+ import java.text.Normalizer;
  import java.util.Date;
  
  import freemarker.ext.beans.BeanModel;
diff --cc src/main/java/freemarker/template/Configuration.java
index 0161d88f,8f2af85f..daf17490
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@@ -24,9 -24,9 +24,10 @@@ import java.io.IOException
  import java.io.Writer;
  import java.lang.reflect.InvocationTargetException;
  import java.net.URLConnection;
+ import java.text.Collator;
  import java.text.DecimalFormat;
  import java.text.SimpleDateFormat;
 +import java.time.temporal.Temporal;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.Date;
@@@ -984,14 -986,21 +994,29 @@@ public class Configuration extends Conf
       *       </li>
       *     </ul>
       *   </li>
 +     *   <li><p>
 +     *     2.3.33 (or higher):
 +     *     <ul>
 +     *       <li>{@link BeansWrapper} and {@link DefaultObjectWrapper} now 
wraps {@link Temporal}-s into
 +     *       {@link SimpleTemporal}. Before that, {@link Temporal}-s were 
treated as generic Java objects;
 +     *       see {@link BeansWrapper#BeansWrapper(Version)}.
 +     *     </ul>
 +     *   </li>
+      *   <li>
+      *       <p>
+      *       2.3.33 (or higher):
+      *       <ul>
+      *           <li><p>Comparing strings is now way faster. If your template 
does lot of string comparisons, this can
+      *           mean very significant speedup. We now use a simpler way of 
comparing strings, and because templates
+      *           were only ever allowed equality comparisons between strings 
(not less-than, or greater-than), it's very
+      *           unlikely to change the behavior of your templates. 
(Technically, what changes is that instead of using
+      *           Java's localized {@link Collator}-s, we switch to a simple 
binary comparison after UNICODE NFKC
+      *           normalization. So, in theory it's possible that for some 
locales two different but similarly looking
+      *           characters were treated as equal by the collator, but will 
count as different now. But it's very
+      *           unlikely that anyone wanted to depend on such fragile logic 
anyway. Note again that we still do UNICODE
+      *           normalization, so combining characters won't break your 
comparison.)</p></li>
+      *       </ul>
+      *   </li>
       * </ul>
       * 
       * @throws IllegalArgumentException
@@@ -2174,7 -2183,8 +2199,8 @@@
       * 
       * @param autoEscapingPolicy
       *          One of the {@link #ENABLE_IF_DEFAULT_AUTO_ESCAPING_POLICY},
-      *          {@link #ENABLE_IF_SUPPORTED_AUTO_ESCAPING_POLICY}, and {@link 
#DISABLE_AUTO_ESCAPING_POLICY} constants.  
+      *          {@link #ENABLE_IF_SUPPORTED_AUTO_ESCAPING_POLICY}, {@link 
#DISABLE_AUTO_ESCAPING_POLICY}, and
 -     *          {@link #FORCE_AUTO_ESCAPING_POLICY} constants.  
++     *          {@link #FORCE_AUTO_ESCAPING_POLICY} constants.
       * 
       * @see TemplateConfiguration#setAutoEscapingPolicy(int)
       * @see Configuration#setOutputFormat(OutputFormat)

Reply via email to