Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0
-
None
-
None
-
Operating System: Windows 2000
Platform: PC
-
33965
Description
I am encoding and decoding Enums using java.beans.XMLEncoder/Decoder.
When an Enum is decoded, I am using the following to get the instance. The
enumClass name and the enum name are stored in the serialized XML file, then
used to restore the bean at read time
return EnumUtils.getEnum(enumClass, name);
The problem is that the Enum.cEnumClasses map may not contain an entry for the
Enum class yet, despite the fact that the Class for the enum has been loaded.
If I loop through the Class.fields using reflection and get(null) the value for
each one, then the cEnumClasses is populated and getEnum works.
Attachments
Attachments
Issue Links
- duplicates
-
LANG-76 [lang] EnumUtils.getEnum() doesn't work well in 1.5
- Closed