Fixed
Details
Assignee
Hardy FerentschikHardy FerentschikReporter
Ondrej MedekOndrej MedekComponents
Fix versions
Priority
Minor
Details
Details
Assignee
Hardy Ferentschik
Hardy FerentschikReporter
Ondrej Medek
Ondrej MedekComponents
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
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.