You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2017/10/09 20:30:10 UTC

[lang] [LANG-1357] org.apache.commons.lang3.time.FastDateParser should use toUpperCase(Locale)

Repository: commons-lang
Updated Branches:
  refs/heads/master 00feb98f8 -> 448549121


[LANG-1357] org.apache.commons.lang3.time.FastDateParser should use
toUpperCase(Locale)

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

Branch: refs/heads/master
Commit: 44854912194177d67cdfa1dc765ba684eb013a4c
Parents: 00feb98
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Oct 9 14:30:07 2017 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Oct 9 14:30:07 2017 -0600

----------------------------------------------------------------------
 src/changes/changes.xml                                 |  1 +
 .../org/apache/commons/lang3/time/FastDateParser.java   | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/44854912/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 187b5f0..7265657 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -50,6 +50,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action issue="LANG-1346" type="update" dev="pschumacher">Remove deprecation from RandomStringUtils</action>
     <action issue="LANG-1350" type="fix" dev="ggregory" due-to="Brett Kail">ConstructorUtils.invokeConstructor(Class, Object...) regression</action>
     <action issue="LANG-1349" type="fix" dev="pschumacher" due-to="Naman Nigam">EqualsBuilder#isRegistered: swappedPair construction bug</action>
+    <action issue="LANG-1357" type="fix" dev="ggregory" due-to="BruceKuiLiu">org.apache.commons.lang3.time.FastDateParser should use toUpperCase(Locale)</action>
   </release>
 
   <release version="3.6" date="2017-06-08" description="New features and bug fixes. Requires Java 7.">

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/44854912/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
index ac60d21..8511bba 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
@@ -887,15 +887,15 @@ public class FastDateParser implements DateParser, Serializable {
          * {@inheritDoc}
          */
         @Override
-        void setCalendar(final FastDateParser parser, final Calendar cal, final String value) {
-            if (value.charAt(0) == '+' || value.charAt(0) == '-') {
-                final TimeZone tz = TimeZone.getTimeZone("GMT" + value);
+        void setCalendar(final FastDateParser parser, final Calendar cal, final String timeZone) {
+            if (timeZone.charAt(0) == '+' || timeZone.charAt(0) == '-') {
+                final TimeZone tz = TimeZone.getTimeZone("GMT" + timeZone);
                 cal.setTimeZone(tz);
-            } else if (value.regionMatches(true, 0, "GMT", 0, 3)) {
-                final TimeZone tz = TimeZone.getTimeZone(value.toUpperCase());
+            } else if (timeZone.regionMatches(true, 0, "GMT", 0, 3)) {
+                final TimeZone tz = TimeZone.getTimeZone(timeZone.toUpperCase(Locale.ROOT));
                 cal.setTimeZone(tz);
             } else {
-                final TzInfo tzInfo = tzNames.get(value.toLowerCase(locale));
+                final TzInfo tzInfo = tzNames.get(timeZone.toLowerCase(locale));
                 cal.set(Calendar.DST_OFFSET, tzInfo.dstOffset);
                 cal.set(Calendar.ZONE_OFFSET, tzInfo.zone.getRawOffset());
             }