[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-devs
Subject:    [jibx-devs] [jira] Resolved: (JIBX-408) Marshalling and
From:       "Dennis Sosnoski (JIRA)" <jira () codehaus ! org>
Date:       2011-02-14 7:49:22
Message-ID: 9509914.9808.1297669762227.JavaMail.haus-jira () codehaus01 ! managed ! contegix ! com
[Download RAW message or body]


     [ http://jira.codehaus.org/browse/JIBX-408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Dennis Sosnoski resolved JIBX-408.
----------------------------------

       Resolution: Fixed
    Fix Version/s: JiBX 1.2.3

Corrected the code to use name() as the default serialization method for enums, and \
to add an xmlValue() method when code generating enums where the XML text is \
different from the Java name (rather than overriding toString()).

> Marshalling and unmarshalling enums uses toString and valueOf by default, which is \
>                 wrong by definition of enum
> --------------------------------------------------------------------------------------------------------------
>  
> Key: JIBX-408
> URL: http://jira.codehaus.org/browse/JIBX-408
> Project: JiBX
> Issue Type: Bug
> Components: core
> Affects Versions: JiBX 1.2.2
> Reporter: Markus Sunela
> Assignee: Dennis Sosnoski
> Fix For: JiBX 1.2.3
> 
> 
> JiBX uses toString() method of an enum to marshall the enum and then again it uses \
> valueOf() to unmarshall it by default. The problem is, that while toString()-method \
> of an enum returns name() by default (that is the enum name as defined in the \
> source code), toString() is actually to be used to provide human readable \
> representation for the enum. On the other hand method name() always returns the \
> enum name as defined in the source code. Actually valueOf()-method needs to be \
> given this name, not the name returned by toString() in order to success. So the \
> right method pair is not toString() and valueOf() but name() and valueOf(). Using \
> name() and valueOf() it is possible to override the human readable representations \
> (eg. if locale changes) but still the XML-representation stays the same. Current \
> workaround is to use enum-value-method="name", but better solution would be fix the \
> problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: \
                http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
jibx-devs mailing list
jibx-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-devs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic