commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject [1/2] [text] Use Category.FORMAT for Locale.getDefault() to fix test failures when locale not set to en
Date Thu, 02 Mar 2017 01:47:03 GMT
Repository: commons-text
Updated Branches:
  refs/heads/master dc10b4c10 -> 61a0be4ee


Use Category.FORMAT for Locale.getDefault() to fix test failures when locale not set to en


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/3a641403
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/3a641403
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/3a641403

Branch: refs/heads/master
Commit: 3a641403fc496591f60c68d68cc28784a617e2c9
Parents: dc10b4c
Author: Bruno P. Kinoshita <brunodepaulak@yahoo.com.br>
Authored: Wed Mar 1 10:32:27 2017 +1300
Committer: Bruno P. Kinoshita <brunodepaulak@yahoo.com.br>
Committed: Wed Mar 1 10:32:27 2017 +1300

----------------------------------------------------------------------
 .../java/org/apache/commons/text/ExtendedMessageFormat.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/3a641403/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java b/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
index 2a08bbf..372ae34 100644
--- a/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
+++ b/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Locale;
+import java.util.Locale.Category;
 import java.util.Map;
 import java.util.Objects;
 
@@ -117,7 +118,7 @@ public class ExtendedMessageFormat extends MessageFormat {
      * @throws IllegalArgumentException in case of a bad pattern.
      */
     public ExtendedMessageFormat(final String pattern) {
-        this(pattern, Locale.getDefault());
+        this(pattern, Locale.getDefault(Category.FORMAT));
     }
 
     /**
@@ -140,7 +141,7 @@ public class ExtendedMessageFormat extends MessageFormat {
      */
     public ExtendedMessageFormat(final String pattern,
                                  final Map<String, ? extends FormatFactory> registry)
{
-        this(pattern, Locale.getDefault(), registry);
+        this(pattern, Locale.getDefault(Category.FORMAT), registry);
     }
 
     /**


Mime
View raw message