mikeldi created Bug XSTR-701
Issue Type: Bug Bug
Affects Versions: 1.4.2
Assignee: Joerg Schaible
Components: Core
Created: 28/May/12 9:12 AM
Description:

When trying to do a fromXML() with an element with 2 addImplicitCollection
and the first element is empty, the firs type elements are created into the second element list.

this is an example of problematic XML:
<test>
<basePath>C:/WrkFld/ChkOut_mlatorre/Batch Test/Base</basePath>
<projectPath>C:/WrkFld/ChkOut_mlatorre/Batch Test</projectPath>
<file name="a.txt"/>
<file name="b.txt"/>
<dataBase name="a.txt">
<select>A,B,C</select>
<from>Table1, Table2</from>
</dataBase>
<dataBase name="b.txt">
<select>*</select>
<from>Table</from>
<where>a>b</where>
</dataBase>
</test>

the root element is defined like this:

public class XMLTest { private String basePath; private String projectPath; private List<XMLFile> files; private List<XMLDataBase> dataBases; }

and this is the xstream "configuration":

xstream = new XStream();
xstream.alias("test", XMLTest.class);
xstream.addImplicitCollection(XMLTest.class, "files");
xstream.addImplicitCollection(XMLTest.class, "dataBases");
xstream.alias("dataBase", XMLDataBase.class);
xstream.alias("file", XMLFile.class);
xstream.useAttributeFor(XMLFile.class, "name");
xstream.useAttributeFor(XMLDataBase.class, "name");

Expected result:
2 XMLDataBase Objects with their data saved into the dataBases List.
2 XMLFile Objects with their name saved into the files List.

Obtained result:
2 XMLDataBase Objects with their data saved into the dataBases List. (OK)
2 XMLFile Objects with their name saved into the dataBases List. (NOT OK)
empty files List. (NOT OK)

Project: XStream
Priority: Major Major
Reporter: mikeldi
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to