commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r1687760 - in /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser: ASTNumberLiteral.java NumberParser.java
Date Fri, 26 Jun 2015 11:25:13 GMT
Author: henrib
Date: Fri Jun 26 11:25:12 2015
New Revision: 1687760

URL: http://svn.apache.org/r1687760
Log:
JEXL:
Fixing JEXL-158, using EN locale based format when stringifying a big decimal

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/ASTNumberLiteral.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/NumberParser.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/ASTNumberLiteral.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/ASTNumberLiteral.java?rev=1687760&r1=1687759&r2=1687760&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/ASTNumberLiteral.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/ASTNumberLiteral.java
Fri Jun 26 11:25:12 2015
@@ -16,10 +16,9 @@
  */
 package org.apache.commons.jexl3.parser;
 
-import java.text.DecimalFormat;
-
 public final class ASTNumberLiteral extends JexlNode implements JexlNode.Constant<Number>
{
-   private final NumberParser nlp;
+    private final NumberParser nlp;
+
     ASTNumberLiteral(int id) {
         super(id);
         nlp = new NumberParser();
@@ -30,8 +29,6 @@ public final class ASTNumberLiteral exte
         nlp = new NumberParser();
     }
 
-    static final DecimalFormat BIGDF = new DecimalFormat("0.0b");
-
     @Override
     public String toString() {
         return nlp.toString();

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/NumberParser.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/NumberParser.java?rev=1687760&r1=1687759&r2=1687760&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/NumberParser.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/parser/NumberParser.java
Fri Jun 26 11:25:12 2015
@@ -19,15 +19,16 @@ package org.apache.commons.jexl3.parser;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
 
 public final class NumberParser {
     /** The type literal value. */
     private Number literal = null;
     /** The expected class. */
     private Class<?> clazz = null;
-
-    static final DecimalFormat BIGDF = new DecimalFormat("0.0b");
-
+    /** JEXL locale-neutral big decimal format. */
+    static final DecimalFormat BIGDF = new DecimalFormat("0.0b", new DecimalFormatSymbols(Locale.ENGLISH));
 
     @Override
     public String toString() {



Mime
View raw message