EnumType speed up in initEnumValues()

Description

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.

Activity

Steve EbersoleMarch 21, 2011 at 7:09 PM

Bulk closing stale resolved issues

Hardy FerentschikMay 26, 2010 at 1:10 PM

Applied patch and removed some obsolete code and comments

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created April 22, 2010 at 12:08 PM
Updated April 22, 2015 at 6:24 PM
Resolved May 26, 2010 at 1:10 PM

Flag notifications