[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-5147) EnumType speed up in initEnumValues()

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Apr 22 07:02:34 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard updated HHH-5147:
----------------------------------

       Assignee: Hardy Ferentschik
    Component/s: annotations

> 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
>         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: 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