提交 c75caf93 编写于 作者: K Kohsuke Kawaguchi

bug fix when there's no children nor value

上级 9a59ada8
......@@ -377,7 +377,7 @@ public class XStreamDOM {
if (dom.value!=null)
w.setValue(dom.value);
else {
for (XStreamDOM c : dom.children) {
for (XStreamDOM c : Util.fixNull(dom.children)) {
marshal(c, w, context);
}
}
......
......@@ -80,4 +80,11 @@ public class XStreamDOMTest extends TestCase {
assertEquals(IOUtils.toString(getClass().getResourceAsStream("XStreamDOMTest.data1.xml")).trim(),xml.trim());
}
public void testNoChild() {
String[] in = new String[0];
XStreamDOM dom = XStreamDOM.from(xs, in);
System.out.println(xs.toXML(dom));
String[] out = dom.unmarshal(xs);
assertEquals(in.length, out.length);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册