commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Resolved: (LANG-153) [lang] Can't XMLDecode an Enum
Date Tue, 19 Sep 2006 21:44:23 GMT
     [ ]

Henri Yandell resolved LANG-153.

    Resolution: Duplicate

Resolving this as a duplicate of the LANG-76 class loading issue for Enums.

> [lang] Can't XMLDecode an Enum
> ------------------------------
>                 Key: LANG-153
>                 URL:
>             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:
> 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:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message