You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2021/10/23 22:51:10 UTC

[freemarker] branch 2.3-gae updated (e34c270 -> b5d2d40)

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

ddekany pushed a change to branch 2.3-gae
in repository https://gitbox.apache.org/repos/asf/freemarker.git.


    from e34c270  [FREEMARKER-187] Build failed on some systems due to character encoding issue
     new 172bffc  Updated version to 2.3.32-SNAPSHOT
     new 054b290  [FREEMARKER-190]: Updated dom4j version used during FreeMarker project compilation from 1.3 to 2.1.3. Users can still use FreeMarker with dom4j 1.3 (mostly just luck, but it works). We were forced to do this because old dom4j versions have security vulnerabilities, and although FreeMarker is not affected by them (like we do not pull in dom4j as dependency into the projects of our users), we were flagged as vulnerable at certain places for merely supporting 1.3.
     new ec74c48  Fixed mistake in legacy XML wrapper documentation
     new b5d2d40  This is related to freemarker.ext.xml, which is the very old, long deprecated XML wrapper (the commonly used one is freemarker.ext.dom), which almost nobody uses, or maybe truly nobody. Still, now the _registerNamespace key works, doing what the documentation always stated. Before this fix it just behaved as if it was the name of an element you are looking for.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ivy.xml                                            |  6 +-
 .../java/freemarker/ext/xml/NodeListModel.java     | 19 +++---
 .../java/freemarker/template/Configuration.java    |  3 +
 .../java/freemarker/template/_TemplateAPI.java     |  1 +
 src/main/resources/freemarker/version.properties   |  8 +--
 src/manual/en_US/book.xml                          | 73 +++++++++++++++++-----
 .../template/DefaultObjectWrapperTest.java         |  1 +
 7 files changed, 79 insertions(+), 32 deletions(-)

[freemarker] 02/04: [FREEMARKER-190]: Updated dom4j version used during FreeMarker project compilation from 1.3 to 2.1.3. Users can still use FreeMarker with dom4j 1.3 (mostly just luck, but it works). We were forced to do this because old dom4j versions have security vulnerabilities, and although FreeMarker is not affected by them (like we do not pull in dom4j as dependency into the projects of our users), we were flagged as vulnerable at certain places for merely supporting 1.3.

Posted by dd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 054b2907974751970ca7fc3629d9f03a460d5144
Author: ddekany <dd...@apache.org>
AuthorDate: Sat Oct 23 23:37:05 2021 +0200

    [FREEMARKER-190]: Updated dom4j version used during FreeMarker project compilation from 1.3 to 2.1.3. Users can still use FreeMarker with dom4j 1.3 (mostly just luck, but it works). We were forced to do this because old dom4j versions have security vulnerabilities, and although FreeMarker is not affected by them (like we do not pull in dom4j as dependency into the projects of our users), we were flagged as vulnerable at certain places for merely supporting 1.3.
---
 ivy.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ivy.xml b/ivy.xml
index e21534f..dad9ff2 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -93,14 +93,14 @@
     <dependency org="jaxen" name="jaxen" rev="1.0-FCS" conf="build.base->default" />
     <dependency org="saxpath" name="saxpath" rev="1.0-FCS" conf="build.base->default" />
     <dependency org="xalan" name="xalan" rev="2.7.0" conf="build.base->default">
-      <!-- The lowerst supported xml-apis version depends on JDK version; prevent any collosion: -->
+      <!-- The lowerst supported xml-apis version depends on JDK version; prevent any collision: -->
       <exclude org="xml-apis" module="xml-apis" />
     </dependency>
-    <dependency org="dom4j" name="dom4j" rev="1.3" conf="build.base->default" /> <!-- legacy -->
+    <dependency org="org.dom4j" name="dom4j" rev="2.1.3" conf="build.base->default" /> <!-- legacy -->
     <dependency org="jdom" name="jdom" rev="1.0b8" conf="build.base->default" /> <!-- legacy -->
 
     <dependency org="ant" name="ant" rev="1.6.5" conf="build.base->default">
-      <!-- The lowerst supported xml-apis version depends on JDK version; prevent any collosion: -->
+      <!-- The lowerst supported xml-apis version depends on JDK version; prevent any collision: -->
       <exclude org="xml-apis" module="xml-apis" />
     </dependency>
     

[freemarker] 04/04: This is related to freemarker.ext.xml, which is the very old, long deprecated XML wrapper (the commonly used one is freemarker.ext.dom), which almost nobody uses, or maybe truly nobody. Still, now the _registerNamespace key works, doing what the documentation always stated. Before this fix it just behaved as if it was the name of an element you are looking for.

Posted by dd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b5d2d40fa5743ae98c3dc96b6df0d390388af249
Author: ddekany <dd...@apache.org>
AuthorDate: Sun Oct 24 00:45:01 2021 +0200

    This is related to freemarker.ext.xml, which is the very old, long deprecated XML wrapper (the commonly used one is freemarker.ext.dom), which almost nobody uses, or maybe truly nobody. Still, now the _registerNamespace key works, doing what the documentation always stated. Before this fix it just behaved as if it was the name of an element you are looking for.
---
 .../java/freemarker/ext/xml/NodeListModel.java     | 13 ++++---
 src/manual/en_US/book.xml                          | 41 +++++++++++++++-------
 2 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/src/main/java/freemarker/ext/xml/NodeListModel.java b/src/main/java/freemarker/ext/xml/NodeListModel.java
index a1ef241..30c792a 100644
--- a/src/main/java/freemarker/ext/xml/NodeListModel.java
+++ b/src/main/java/freemarker/ext/xml/NodeListModel.java
@@ -327,12 +327,16 @@ implements
      *       <td>register a XML namespace with the specified prefix and URI for
      *         the current node list and all node lists that are derived from 
      *         the current node list. After registering, you can use the
-     *         <tt>nodelist[&quot;prefix:localname&quot;]</tt> or 
-     *         <tt>nodelist[&quot;@prefix:localname&quot;]</tt> syntaxes to 
-     *         reach elements and attributes whose names are namespace-scoped.
+     *         <tt>nodelist[&quot;prefix:localname&quot;]</tt>, or
+     *         <tt>nodelist[&quot;@prefix:localname&quot;]</tt> syntax
+     *          (or <tt>nodelist.prefix\:localname</tt>, or <tt>nodelist.@prefix\:localname</tt>)
+     *         to reach elements, and attributes whose names are namespace-scoped.
      *         Note that the namespace prefix need not match the actual prefix 
      *         used by the XML document itself since namespaces are compared 
-     *         solely by their URI.</td>
+     *         solely by their URI. Also note that if you do {@code doc.elem1._registerNamespace(...)},
+     *         and then later you use {@code doc.elem1} again, it will not have the prefix registered,
+     *         because each time you use {@code doc.elem1}, it gives a completely new object. In this
+     *         example, you certainly should have used {@code doc._registerNamespace(...)}.
      *     </tr>
      *     <tr>
      *       <td><tt>_text</tt></td>
@@ -394,6 +398,7 @@ implements
                 if (namespaces.isShared()) {
                     namespaces = (Namespaces) namespaces.clone();
                 }
+                return namespaces;
             }
         }
         // Last, do a named child element or attribute lookup 
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index d44b9a8..4604f2f 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -12367,12 +12367,20 @@ grant codeBase "file:/path/to/freemarker.jar"
                 <td>register a XML namespace with the specified prefix and URI
                 for the current node list and all node lists that are derived
                 from the current node list. After registering, you can use the
-                <literal>nodelist["prefix:localname"]</literal> or
-                <literal>nodelist["@prefix:localname"]</literal> syntaxes to
-                reach elements and attributes whose names are
-                namespace-scoped. Note that the namespace prefix need not
-                match the actual prefix used by the XML document itself since
-                namespaces are compared solely by their URI.</td>
+                <literal>nodelist["prefix:localname"]</literal>, or
+                <literal>nodelist["@prefix:localname"]</literal> syntax (or
+                <literal>nodelist.prefix\:localname</literal>, or
+                <literal>nodelist.@prefix\:localname</literal>) to reach
+                elements, and attributes whose names are namespace-scoped.
+                Note that the namespace prefix need not match the actual
+                prefix used by the XML document itself since namespaces are
+                compared solely by their URI. Also note that if you do
+                <literal>doc.elem1._registerNamespace(<replaceable>...</replaceable>)</literal>,
+                and then later you use <literal>doc.elem1</literal> again, it
+                will not have the prefix registered, because each time you use
+                <literal>doc.elem1</literal>, it gives a completely new
+                object. In this example, you certainly should have used
+                <literal>doc._registerNamespace(<replaceable>...</replaceable>)</literal>.</td>
               </tr>
 
               <tr>
@@ -29417,7 +29425,13 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
 
           <itemizedlist>
             <listitem>
-              <para>TODO</para>
+              <para>This is related to <literal>freemarker.ext.xml</literal>,
+              which is the very old, long deprecated XML wrapper (the commonly
+              used one is <literal>freemarker.ext.dom</literal>), which almost
+              nobody uses, or maybe truly nobody. Still, now the
+              <literal>_registerNamespace</literal> key works, doing what the
+              documentation always stated. Before this fix it just behaved as
+              if it was the name of an element you are looking for.</para>
             </listitem>
           </itemizedlist>
         </section>
@@ -29431,12 +29445,13 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
               xlink:href="https://issues.apache.org/jira/browse/FREEMARKER-190">FREEMARKER-190</link>:
               Updated dom4j version used during FreeMarker project compilation
               from 1.3 to 2.1.3. Users can still use FreeMarker with dom4j 1.3
-              (mostly just luck, but it works). We were forced to do this
-              because old dom4j versions have security vulnerabilities, and
-              although FreeMarker is not affected by them (like we do not pull
-              in dom4j as dependency into the projects of our users), we were
-              flagged as vulnerable at certain places for merely supporting
-              1.3.</para>
+              (mostly just luck, but it works), also anyway almost nobody uses
+              FreeMarker's dom4j support (which is long deprecated). We were
+              forced to do this change because old dom4j versions have
+              security vulnerabilities, and although FreeMarker is not
+              affected by them (like we do not pull in dom4j as dependency
+              into the projects of our users), we were flagged as vulnerable
+              at certain places for merely supporting 1.3.</para>
             </listitem>
           </itemizedlist>
         </section>

[freemarker] 03/04: Fixed mistake in legacy XML wrapper documentation

Posted by dd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ec74c4865e2e93ff569209edb1de2f55d45a87c3
Author: ddekany <dd...@apache.org>
AuthorDate: Sat Oct 23 23:37:45 2021 +0200

    Fixed mistake in legacy XML wrapper documentation
---
 .../java/freemarker/ext/xml/NodeListModel.java     |  6 ---
 src/manual/en_US/book.xml                          | 46 +++++++++++++++++-----
 2 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/src/main/java/freemarker/ext/xml/NodeListModel.java b/src/main/java/freemarker/ext/xml/NodeListModel.java
index 2f96767..a1ef241 100644
--- a/src/main/java/freemarker/ext/xml/NodeListModel.java
+++ b/src/main/java/freemarker/ext/xml/NodeListModel.java
@@ -254,12 +254,6 @@ implements
      *         to same node types as <tt>_parent</tt>.</td>
      *     </tr>  
      *     <tr>
-     *       <td><tt>_cname</tt></td>
-     *       <td>the canonical names of current nodes (namespace URI + local 
-     *         name), one string per node (non-recursive). Applicable to 
-     *         elements and attributes</td>
-     *     </tr>  
-     *     <tr>
      *       <td><tt>_content</tt></td>
      *       <td>the complete content of current nodes, including children 
      *         elements, text, entity references, and processing instructions 
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index 49d3f03..d44b9a8 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -8974,7 +8974,8 @@ cfg.setTemplateLoader(mtl);</programlisting>
         </section>
 
         <section>
-          <title>Customizing the behavior regarding TemplateException-s</title>
+          <title>Customizing the behavior regarding
+          TemplateException-s</title>
 
           <para><literal>TemplateException</literal>-s thrown during the
           template processing are handled by the
@@ -12271,14 +12272,6 @@ grant codeBase "file:/path/to/freemarker.jar"
               </tr>
 
               <tr>
-                <td><literal>_cname</literal></td>
-
-                <td>the canonical names of current nodes (namespace URI +
-                local name), one string per node (non-recursive). Applicable
-                to elements and attributes</td>
-              </tr>
-
-              <tr>
                 <td><literal>_content</literal></td>
 
                 <td>the complete content of current nodes, including children
@@ -29414,6 +29407,41 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
     <appendix xml:id="app_versions">
       <title>Version history</title>
 
+      <section xml:id="versions_2_3_32">
+        <title>2.3.32</title>
+
+        <para>Release date: TODO</para>
+
+        <section>
+          <title>Changes on the FTL side</title>
+
+          <itemizedlist>
+            <listitem>
+              <para>TODO</para>
+            </listitem>
+          </itemizedlist>
+        </section>
+
+        <section>
+          <title>Changes on the Java side</title>
+
+          <itemizedlist>
+            <listitem>
+              <para><link
+              xlink:href="https://issues.apache.org/jira/browse/FREEMARKER-190">FREEMARKER-190</link>:
+              Updated dom4j version used during FreeMarker project compilation
+              from 1.3 to 2.1.3. Users can still use FreeMarker with dom4j 1.3
+              (mostly just luck, but it works). We were forced to do this
+              because old dom4j versions have security vulnerabilities, and
+              although FreeMarker is not affected by them (like we do not pull
+              in dom4j as dependency into the projects of our users), we were
+              flagged as vulnerable at certain places for merely supporting
+              1.3.</para>
+            </listitem>
+          </itemizedlist>
+        </section>
+      </section>
+
       <section xml:id="versions_2_3_31">
         <title>2.3.31</title>
 

[freemarker] 01/04: Updated version to 2.3.32-SNAPSHOT

Posted by dd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 172bffc2603b20ab902642d0da25d921dbdbdc45
Author: ddekany <dd...@apache.org>
AuthorDate: Sat Oct 23 11:29:15 2021 +0200

    Updated version to 2.3.32-SNAPSHOT
---
 src/main/java/freemarker/template/Configuration.java            | 3 +++
 src/main/java/freemarker/template/_TemplateAPI.java             | 1 +
 src/main/resources/freemarker/version.properties                | 8 ++++----
 src/test/java/freemarker/template/DefaultObjectWrapperTest.java | 1 +
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/main/java/freemarker/template/Configuration.java b/src/main/java/freemarker/template/Configuration.java
index eb189ee..ed47cba 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -475,6 +475,9 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
     /** FreeMarker version 2.3.31 (an {@link #Configuration(Version) incompatible improvements break-point}) */
     public static final Version VERSION_2_3_31 = new Version(2, 3, 31);
 
+    /** FreeMarker version 2.3.31 (an {@link #Configuration(Version) incompatible improvements break-point}) */
+    public static final Version VERSION_2_3_32 = new Version(2, 3, 32);
+
     /** The default of {@link #getIncompatibleImprovements()}, currently {@link #VERSION_2_3_0}. */
     public static final Version DEFAULT_INCOMPATIBLE_IMPROVEMENTS = Configuration.VERSION_2_3_0;
     /** @deprecated Use {@link #DEFAULT_INCOMPATIBLE_IMPROVEMENTS} instead. */
diff --git a/src/main/java/freemarker/template/_TemplateAPI.java b/src/main/java/freemarker/template/_TemplateAPI.java
index 5ff74de..a43842f 100644
--- a/src/main/java/freemarker/template/_TemplateAPI.java
+++ b/src/main/java/freemarker/template/_TemplateAPI.java
@@ -55,6 +55,7 @@ public class _TemplateAPI {
     public static final int VERSION_INT_2_3_29 = Configuration.VERSION_2_3_29.intValue();
     public static final int VERSION_INT_2_3_30 = Configuration.VERSION_2_3_30.intValue();
     public static final int VERSION_INT_2_3_31 = Configuration.VERSION_2_3_31.intValue();
+    public static final int VERSION_INT_2_3_32 = Configuration.VERSION_2_3_32.intValue();
     public static final int VERSION_INT_2_4_0 = Version.intValueFor(2, 4, 0);
 
     /**
diff --git a/src/main/resources/freemarker/version.properties b/src/main/resources/freemarker/version.properties
index 9c39042..efb9805 100644
--- a/src/main/resources/freemarker/version.properties
+++ b/src/main/resources/freemarker/version.properties
@@ -56,11 +56,11 @@
 #   continue working without modification or recompilation.
 # - When the major version number is increased, major backward
 #   compatibility violations are allowed, but still should be avoided.
-version=2.3.31
+version=2.3.32-nightly_@timestampInVersion@
 # This exists as for Maven we use "-SNAPSHOT" for nightly releases,
 # and no _nightly_@timestampInVersion@. For final releases it's the
 # same as "version".
-mavenVersion=2.3.31
+mavenVersion=2.3.32-SNAPSHOT
 
 # Version string that conforms to OSGi
 # ------------------------------------
@@ -73,7 +73,7 @@ mavenVersion=2.3.31
 #   2.4.0.rc01
 #   2.4.0.pre01
 #   2.4.0.nightly_@timestampInVersion@
-versionForOSGi=2.3.31.stable
+versionForOSGi=2.3.32.nightly_@timestampInVersion@
 
 # Version string that conforms to legacy MF
 # -----------------------------------------
@@ -92,7 +92,7 @@ versionForOSGi=2.3.31.stable
 # "97 denotes "nightly", 98 denotes "pre", 99 denotes "rc" build.
 # In general, for the nightly/preview/rc Y of version 2.X, the versionForMf is
 # 2.X-1.(99|98).Y. Note the X-1.
-versionForMf=2.3.31
+versionForMf=2.3.31.97
 
 # The date of the build.
 # This should be automatically filled by the building tool (Ant).
diff --git a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java b/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
index d9924f1..17c6702 100644
--- a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
+++ b/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
@@ -103,6 +103,7 @@ public class DefaultObjectWrapperTest {
         expected.add(Configuration.VERSION_2_3_27); // no non-BC change in 2.3.29
         expected.add(Configuration.VERSION_2_3_27); // no non-BC change in 2.3.30
         expected.add(Configuration.VERSION_2_3_27); // no non-BC change in 2.3.31
+        expected.add(Configuration.VERSION_2_3_27); // no non-BC change in 2.3.32
 
         List<Version> actual = new ArrayList<>();
         for (int i = _TemplateAPI.VERSION_INT_2_3_0; i <= Configuration.getVersion().intValue(); i++) {