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
This commit is contained in:
parent
7be7d80dfe
commit
20295a04b9
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue