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 2019/01/25 20:43:08 UTC

[freemarker] branch 2.3-gae updated (2d968a2 -> a643276)

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 2d968a2  (Manual typos)
     new 3c8f10b  Extended big decimal format parameter "multiplier" was incorrectly written as "multipier". Now both words are recognized.
     new a643276  (Other places where "multipier" was written instead of "multiplier"... these are just internal things though.)

The 2 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:
 .../java/freemarker/core/ExtendedDecimalFormatParser.java | 15 +++++++++------
 src/main/java/freemarker/template/Configuration.java      | 14 +++++++-------
 src/main/misc/overloadedNumberRules/README.txt            |  2 +-
 src/manual/en_US/book.xml                                 |  6 ++++++
 .../java/freemarker/core/ExtendedDecimalFormatTest.java   |  4 +++-
 5 files changed, 26 insertions(+), 15 deletions(-)


[freemarker] 01/02: Extended big decimal format parameter "multiplier" was incorrectly written as "multipier". Now both words are recognized.

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 3c8f10bee02011f6012650af9cc5e4bb6a845af8
Author: ddekany <dd...@apache.org>
AuthorDate: Fri Jan 25 21:40:44 2019 +0100

    Extended big decimal format parameter "multiplier" was incorrectly written as "multipier". Now both words are recognized.
---
 .../java/freemarker/core/ExtendedDecimalFormatParser.java | 15 +++++++++------
 src/manual/en_US/book.xml                                 |  6 ++++++
 .../java/freemarker/core/ExtendedDecimalFormatTest.java   |  4 +++-
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/main/java/freemarker/core/ExtendedDecimalFormatParser.java b/src/main/java/freemarker/core/ExtendedDecimalFormatParser.java
index 0c3286a..03d71eb 100644
--- a/src/main/java/freemarker/core/ExtendedDecimalFormatParser.java
+++ b/src/main/java/freemarker/core/ExtendedDecimalFormatParser.java
@@ -34,6 +34,7 @@ class ExtendedDecimalFormatParser {
     
     private static final String PARAM_ROUNDING_MODE = "roundingMode";
     private static final String PARAM_MULTIPIER = "multipier";
+    private static final String PARAM_MULTIPLIER = "multiplier";
     private static final String PARAM_DECIMAL_SEPARATOR = "decimalSeparator";
     private static final String PARAM_MONETARY_DECIMAL_SEPARATOR = "monetaryDecimalSeparator";
     private static final String PARAM_GROUP_SEPARATOR = "groupingSeparator";
@@ -93,16 +94,18 @@ class ExtendedDecimalFormatParser {
                 parser.roundingMode = parsedValue;
             }
         });
-        m.put(PARAM_MULTIPIER, new ParameterHandler() {
+        ParameterHandler multiplierParamHandler = new ParameterHandler() {
             public void handle(ExtendedDecimalFormatParser parser, String value)
                     throws InvalidParameterValueException {
                 try {
-                    parser.multipier = Integer.valueOf(value);
+                    parser.multiplier = Integer.valueOf(value);
                 } catch (NumberFormatException e) {
                     throw new InvalidParameterValueException("Malformed integer.");
                 }
             }
-        });
+        };
+        m.put(PARAM_MULTIPLIER, multiplierParamHandler);
+        m.put(PARAM_MULTIPIER, multiplierParamHandler);
         m.put(PARAM_DECIMAL_SEPARATOR, new ParameterHandler() {
             public void handle(ExtendedDecimalFormatParser parser, String value)
                     throws InvalidParameterValueException {
@@ -211,7 +214,7 @@ class ExtendedDecimalFormatParser {
 
     private final DecimalFormatSymbols symbols;
     private RoundingMode roundingMode;
-    private Integer multipier;
+    private Integer multiplier;
 
     static DecimalFormat parse(String formatString, Locale locale) throws ParseException {
         return new ExtendedDecimalFormatParser(formatString, locale).parse();
@@ -244,8 +247,8 @@ class ExtendedDecimalFormatParser {
             _JavaVersions.JAVA_6.setRoundingMode(decimalFormat, roundingMode);
         }
 
-        if (multipier != null) {
-            decimalFormat.setMultiplier(multipier.intValue());
+        if (multiplier != null) {
+            decimalFormat.setMultiplier(multiplier.intValue());
         }
 
         return decimalFormat;
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index 38cd1f0..161b52c 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -27893,6 +27893,12 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
               configuration. See <link linkend="ref_builtin_truncate">the
               reference</link> for more details.</para>
             </listitem>
+
+            <listitem>
+              <para>Extended big decimal format parameter
+              <quote>multiplier</quote> was incorrectly written as
+              <quote>multipier</quote>. Now both words are recognized.</para>
+            </listitem>
           </itemizedlist>
         </section>
 
diff --git a/src/test/java/freemarker/core/ExtendedDecimalFormatTest.java b/src/test/java/freemarker/core/ExtendedDecimalFormatTest.java
index 17a699e..04b86d3 100644
--- a/src/test/java/freemarker/core/ExtendedDecimalFormatTest.java
+++ b/src/test/java/freemarker/core/ExtendedDecimalFormatTest.java
@@ -225,7 +225,9 @@ public class ExtendedDecimalFormatTest extends TemplateTest {
 
         assertFormatted("0.##;; multipier=100", 12.345, "1234.5");
         assertFormatted("0.##;; multipier=1000", 12.345, "12345");
-        
+        assertFormatted("0.##;; multiplier=100", 12.345, "1234.5");
+        assertFormatted("0.##;; multiplier=1000", 12.345, "12345");
+
         assertFormatted(",##0.##;; groupingSeparator=_ decimalSeparator=D", 12345.1, "12_345D1", 1, "1");
         
         assertFormatted("0.##E0;; exponentSeparator='*10^'", 12345.1, "1.23*10^4");


[freemarker] 02/02: (Other places where "multipier" was written instead of "multiplier"... these are just internal things though.)

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 a643276ab2af3d29bd3a4e5a2c3300139cd1b32b
Author: ddekany <dd...@apache.org>
AuthorDate: Fri Jan 25 21:43:01 2019 +0100

    (Other places where "multipier" was written instead of "multiplier"... these are just internal things though.)
---
 src/main/java/freemarker/template/Configuration.java | 14 +++++++-------
 src/main/misc/overloadedNumberRules/README.txt       |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main/java/freemarker/template/Configuration.java b/src/main/java/freemarker/template/Configuration.java
index 98ce116..2f19645 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -3308,25 +3308,25 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
                 }
             } else if (TEMPLATE_UPDATE_DELAY_KEY_SNAKE_CASE.equals(name)
                     || TEMPLATE_UPDATE_DELAY_KEY_CAMEL_CASE.equals(name)) {
-                long multipier;
+                long multiplier;
                 String valueWithoutUnit;
                 if (value.endsWith("ms")) {
-                    multipier = 1;
+                    multiplier = 1;
                     valueWithoutUnit = rightTrim(value.substring(0, value.length() - 2));
                 } else if (value.endsWith("s")) {
-                    multipier = 1000;
+                    multiplier = 1000;
                     valueWithoutUnit = rightTrim(value.substring(0, value.length() - 1));
                 } else if (value.endsWith("m")) {
-                    multipier = 1000 * 60;
+                    multiplier = 1000 * 60;
                     valueWithoutUnit = rightTrim(value.substring(0, value.length() - 1));
                 } else if (value.endsWith("h")) {
-                    multipier = 1000 * 60 * 60;
+                    multiplier = 1000 * 60 * 60;
                     valueWithoutUnit = rightTrim(value.substring(0, value.length() - 1));
                 } else {
-                    multipier = 1000;  // Default is seconds for backward compatibility
+                    multiplier = 1000;  // Default is seconds for backward compatibility
                     valueWithoutUnit = value;
                 }
-                setTemplateUpdateDelayMilliseconds(Integer.parseInt(valueWithoutUnit) * multipier);
+                setTemplateUpdateDelayMilliseconds(Integer.parseInt(valueWithoutUnit) * multiplier);
             } else if (TAG_SYNTAX_KEY_SNAKE_CASE.equals(name) || TAG_SYNTAX_KEY_CAMEL_CASE.equals(name)) {
                 if ("auto_detect".equals(value) || "autoDetect".equals(value)) {
                     setTagSyntax(AUTO_DETECT_TAG_SYNTAX);
diff --git a/src/main/misc/overloadedNumberRules/README.txt b/src/main/misc/overloadedNumberRules/README.txt
index 47f078b..34f6aeb 100644
--- a/src/main/misc/overloadedNumberRules/README.txt
+++ b/src/main/misc/overloadedNumberRules/README.txt
@@ -31,4 +31,4 @@ Usage:
 6. Copy-pase its content into `OverloadedNumberUtil.java`.
 7. Ensure that the value of OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE
    still matches the value coming from the ODS and the cellValue
-   multipier coming from generator.ftl.
\ No newline at end of file
+   multiplier coming from generator.ftl.
\ No newline at end of file