[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6004) StructuredCacheEntry shall pass correct expected map size and loadFactor for HashMap constructor
Sergey Vladimirov (JIRA)
noreply at atlassian.com
Fri Mar 11 02:30:08 EST 2011
StructuredCacheEntry shall pass correct expected map size and loadFactor for HashMap constructor
------------------------------------------------------------------------------------------------
Key: HHH-6004
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6004
Project: Hibernate Core
Issue Type: Improvement
Components: caching (L2)
Affects Versions: 3.6.0
Reporter: Sergey Vladimirov
There is a code in StructuredCacheEntry::structure that supposed to optimize usage of HashMap and not allow resizing of HashMap. But it doesn't work. To check put a breakpoint at hashmap::resize and call for StructuredCacheEntry::structure method:
at java.util.HashMap.resize(HashMap.java:462)
at java.util.HashMap.addEntry(HashMap.java:755)
at java.util.HashMap.put(HashMap.java:385)
at org.hibernate.cache.entry.StructuredCacheEntry.structure(StructuredCacheEntry.java:67)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:195)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982)
I believe the line
Map map = new HashMap(names.length+2);
shall be rewritten as
Map map = new HashMap(names.length+3, 1.0);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list