[
https://issues.apache.org/jira/browse/CSV-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15307312#comment-15307312
]
Gary Gregory commented on CSV-184:
----------------------------------
That's not how a HashMap works. Once the map is over its load factory, its
internal size doubles.
For example:
Map m = new java.util.HashMap();
//The map is size() 0 and LF 75% but internally it is size 16.
for (int i = 0; i < 12; i++) {
m.put(i,i);
}
//The map now is size() 11 and the internal size is still < 75% and still
internally size 16.
m.put(12,12);
//The new element puts the map over the LF% so the map now is size() 12 and
internally it doubles to 32.
> CSVRecord toMap Method(LoadFactor for HashMap)
> ----------------------------------------------
>
> Key: CSV-184
> URL: https://issues.apache.org/jira/browse/CSV-184
> Project: Commons CSV
> Issue Type: Improvement
> Components: Parser
> Affects Versions: 1.4
> Reporter: Gaurav Agarwal
> Priority: Minor
>
> Set loadFactor for Hashmap Object to 1(Default : 0.75) as currently it will
> always resize the map when we are putting entries in it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)