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
This commit is contained in:
Juergen Hoeller
2018-07-30 22:07:31 +02:00
parent 457d586859
commit 4a147d26fc
19 changed files with 38 additions and 41 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