[
https://jira.codehaus.org/browse/XSTR-688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Timur KHALMUKHAMEDOV updated XSTR-688:
--------------------------------------
Attachment: XStreamShouldSerializeMemberTest.java
unit test
> When unmarshal XML, xSream pass incorrect "definedIn" in
> Mapper.shouldSerializeMember
> -------------------------------------------------------------------------------------
>
> Key: XSTR-688
> URL: https://jira.codehaus.org/browse/XSTR-688
> Project: XStream
> Issue Type: Bug
> Components: Converters
> Affects Versions: 1.4.2
> Reporter: Timur KHALMUKHAMEDOV
> Assignee: Joerg Schaible
> Priority: Blocker
> Attachments: XStreamShouldSerializeMemberTest.java
>
>
> When unmarshaling an XML the XStream verify if the field must be deserialized
> using *Mapper.+shouldSerializeMember+*_(java.lang.Class definedIn,
> java.lang.String fieldName)_
> The verification done by
> {color:blue}*com.thoughtworks.xstream.converters.reflection.+AbstractReflectionConverter+*.+doUnmarshal+_(final
> Object result, final HierarchicalStreamReader reader, final
> UnmarshallingContext context)_{color}
> The problem is that the class passed in *+shouldSerializeMember+* as
> "definedIn" parameter is incorrect.
> +Example+:
> {code:java}
> class A{String a;}
> class B extends A{String b;}
> {code}
> (!) when unmarshaling the instance of the +class B+ and verifying field
> "+String a+" , xStream pass into shouldSerializeMember the +class B+ as
> "*definedIn*" instead of +class A+.
> ---
> The problem is in the class
> *com.thoughtworks.xstream.converters.reflection.+AbstractReflectionConverter+*
> at line 302.
> I suggest to you to change this line:
> bq. "|| !mapper.shouldSerializeMember({color:red}classDefiningField != null ?
> classDefiningField : result.getClass(){color}, fieldName)) {"
> by
> bq. "||
> !mapper.shouldSerializeMember({color:red}field.getDeclaringClass(){color},
> fieldName)) {"
> Failing unit test:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
<a
href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>
</p>