]
Hardy Ferentschik updated HHH-5147:
-----------------------------------
Fix Version/s: 3.6
EnumType speed up in initEnumValues()
-------------------------------------
Key: HHH-5147
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5147
Project: Hibernate Core
Issue Type: Patch
Components: annotations
Affects Versions: 3.6
Environment: Hibernate 3.5.1, Sun JDK 1.6.0_18
Reporter: Ondrej Medek
Assignee: Hardy Ferentschik
Priority: Minor
Fix For: 3.6
Attachments: EnumType.java.patch
Hi,
I have simplified and sped up the method EnumType.initEnumValues(). See the attached
patch.
Tested on Sun JDK 1.6.0_18
Note 1: I do not know, why the author (Emmanuel Bernard?) has used reflection. Maybe the
method Class.getEnumConstants() in not implemented by other JREs (IBM, BEA) or he just
didn't know this method.?
Note: the method getEnumConstants() in SUN JRE does use the reflection to look for method
"values()", too, but it's results are cached, so the second call to the
getEnumConstants() is fast. And because the results are cached inside the Enum class
itself, it does not cause any memory leaks like HHH-4317.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: