Consistent references to primitive types (in alphabetical order)

(cherry picked from commit 08dad4e)
This commit is contained in:
Juergen Hoeller
2018-03-29 17:33:13 +02:00
parent 5f6b04251e
commit 64f304c333
6 changed files with 100 additions and 103 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,12 +54,12 @@ public class TypeDescriptor implements Serializable {
private static final boolean streamAvailable = ClassUtils.isPresent(
"java.util.stream.Stream", TypeDescriptor.class.getClassLoader());
private static final Map<Class<?>, TypeDescriptor> commonTypesCache = new HashMap<Class<?>, TypeDescriptor>(18);
private static final Map<Class<?>, TypeDescriptor> commonTypesCache = new HashMap<Class<?>, TypeDescriptor>(32);
private static final Class<?>[] CACHED_COMMON_TYPES = {
boolean.class, Boolean.class, byte.class, Byte.class, char.class, Character.class,
double.class, Double.class, int.class, Integer.class, long.class, Long.class,
float.class, Float.class, short.class, Short.class, String.class, Object.class};
double.class, Double.class, float.class, Float.class, int.class, Integer.class,
long.class, Long.class, short.class, Short.class, String.class, Object.class};
static {
for (Class<?> preCachedClass : CACHED_COMMON_TYPES) {