XStream

Transient field is unmarshaled from an marshaled xml

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.2.2
  • Component/s: None
  • Labels:
    None

Description

A field is not transient when marshaled, then it
is changed to transient, and the unmarshaled
action will unserialize the field.

For example:

public class TryXstream {
private String tmpFiled = "just a string";
}

It is marshaled into
<org.simon.payment.TryXstream>
<tmpFiled>just a string</tmpFiled>
</org.simon.payment.TryXstream>

and change the field to transient

public class TryXstream {
private transient String tmpFiled = "another string";
}

then unmarshal from the xml, the tmpField will be set to "just a string"

Activity

Hide
Joerg Schaible added a comment -

XStream will ignore transient field now completely.

Show
Joerg Schaible added a comment - XStream will ignore transient field now completely.
Hide
Joerg Schaible added a comment -

The fix introduced the behaviour that XStream throws a ConversionException instead of silently unmarshal the transient field. This new bahaviour is in contradition with the XStream documentation, that states that an XML element for such a field is simply ignored. Therefore the issue was reopened.

Show
Joerg Schaible added a comment - The fix introduced the behaviour that XStream throws a ConversionException instead of silently unmarshal the transient field. This new bahaviour is in contradition with the XStream documentation, that states that an XML element for such a field is simply ignored. Therefore the issue was reopened.
Hide
Joerg Schaible added a comment -

XML elements for transient fields are now really ignored - not unserialized as it was done originally nor an exception is thrown. XStream behaves now in accordance with its FAQ.

Show
Joerg Schaible added a comment - XML elements for transient fields are now really ignored - not unserialized as it was done originally nor an exception is thrown. XStream behaves now in accordance with its FAQ.
Hide
Rene Schwietzke added a comment -

Validated bug fix for " XML elements for transient fields are now really ignored according to FAQ" with an own test case. Bug is resolved for me.

Show
Rene Schwietzke added a comment - Validated bug fix for " XML elements for transient fields are now really ignored according to FAQ" with an own test case. Bug is resolved for me.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: