Simple bug in DomOutputCapsule writeSavableArrayList():
if the array is inited but contains nulls, you get a wrong XML (that indeed will create exceptions when decoded. Try with a BezierCurve()):
<?xml version='1.0' encoding='UTF-8'?>
<com.jme.curve.BezierCurve name='BezierCurve'>
<texBuf size='1'/>
</com.jme.curve.BezierCurve>
instead of
<?xml version='1.0' encoding='UTF-8'?>
<com.jme.curve.BezierCurve name='BezierCurve'>
<texBuf size='1'>
<null/>
</texBuf>
</com.jme.curve.BezierCurve>
Committers please fix as following:
public void writeSavableArrayList(ArrayList array, String name, ArrayList defVal) throws IOException {
if (array == null) {
return;
}
if (array.equals(defVal)) {
return;
}
Element old = currentElement;
Element el = appendElement(name);
currentElement = el;
el.setAttribute(XMLExporter.ATTRIBUTE_SIZE, String.valueOf(array.size()));
for (Object o : array) {
if(o == null) {
Element before = currentElement;
appendElement("null");
currentElement = before;
}
else if (o instanceof Savable) {
Savable s = (Savable) o;
write(s, s.getClassTag().getName(), null);
} else {
throw new ClassCastException("Not a Savable instance: " + o);
}
}
currentElement = old;
}
Cheers,
Mik