commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1388052 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
Date Thu, 20 Sep 2012 14:51:18 GMT
Author: sebb
Date: Thu Sep 20 14:51:18 2012
New Revision: 1388052

URL: http://svn.apache.org/viewvc?rev=1388052&view=rev
Log:
Explicit conversion to Integer; save the value for use later

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java?rev=1388052&r1=1388051&r2=1388052&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
Thu Sep 20 14:51:18 2012
@@ -355,7 +355,8 @@ public class FastDateParser implements D
      * @return A sorted array of the field key / value pairs
      */
     KeyValue[] getDisplayNames(int field) {
-        KeyValue[] fieldKeyValues= nameValues.get(field);
+        Integer fieldInt = Integer.valueOf(field);
+        KeyValue[] fieldKeyValues= nameValues.get(fieldInt);
         if(fieldKeyValues==null) {
             DateFormatSymbols symbols= new DateFormatSymbols(locale);
             switch(field) {
@@ -374,7 +375,7 @@ public class FastDateParser implements D
             default:
                 throw new IllegalArgumentException("Invalid field value "+field);
             }
-            KeyValue[] prior = nameValues.putIfAbsent(field, fieldKeyValues);
+            KeyValue[] prior = nameValues.putIfAbsent(fieldInt, fieldKeyValues);
             if(prior!=null) {
                 fieldKeyValues= prior;
             }



Mime
View raw message