[ http://issues.apache.org/jira/browse/LANG-153?page=comments#action_12436019 ] Henri Yandell commented on LANG-153: ------------------------------------
LANG-76 seems to be the right place for Cedric's attached test; not this issue. > [lang] Can't XMLDecode an Enum > ------------------------------ > > Key: LANG-153 > URL: http://issues.apache.org/jira/browse/LANG-153 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 2.0 > Environment: Operating System: Windows 2000 > Platform: PC > Reporter: Kevin Gilpin > Fix For: 2.3 > > Attachments: CommonsLangBug33965Test.java > > > 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]