From 20295a04b93d492ffa3d6a297b5dbbe7c833a151 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Thu, 20 Sep 2012 14:51:18 +0000 Subject: [PATCH] Explicit conversion to Integer; save the value for use later git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1388052 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/lang3/time/FastDateParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 35bb6e8c8..5fced119c 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java @@ -355,7 +355,8 @@ public class FastDateParser implements DateParser, Serializable { * @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 DateParser, Serializable { 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; }