Initialize pre-filled HashMaps with large enough capacity

Empty Maps are preferably initialized without capacity (not initializing them at all or lazily initializing with default capacity when needed).

Issue: SPR-17105

(cherry picked from commit 4a147d26fc)
This commit is contained in:
Juergen Hoeller
2018-07-30 22:07:31 +02:00
parent 006db06d11
commit 91fa2ed0d4
19 changed files with 52 additions and 55 deletions

View File

@@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
public abstract class AttributeAccessorSupport implements AttributeAccessor, Serializable {
/** Map with String keys and Object values */
private final Map<String, Object> attributes = new LinkedHashMap<>(0);
private final Map<String, Object> attributes = new LinkedHashMap<>();
@Override