#1098 Importing SWF XML fails fixed

This commit is contained in:
honfika@gmail.com
2015-12-03 11:07:07 +01:00
parent 507cc4c29b
commit 2f75a7b4ed
2 changed files with 11 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.types.NamespaceSet;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.ecma.Undefined;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.SWFField;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.HashArrayList;
import com.jpexs.helpers.utf8.Utf8PrintWriter;
@@ -39,21 +40,29 @@ public class AVM2ConstantPool implements Cloneable {
private static final Logger logger = Logger.getLogger(AVM2ConstantPool.class.getName());
@SWFField
private HashArrayList<Long> constant_int = new HashArrayList<>();
@SWFField
private HashArrayList<Long> constant_uint = new HashArrayList<>();
@SWFField
private HashArrayList<Double> constant_double = new HashArrayList<>();
/* Only for some minor versions */
@SWFField
private HashArrayList<Decimal> constant_decimal = new HashArrayList<>();
@SWFField
private HashArrayList<String> constant_string = new HashArrayList<>();
@SWFField
private HashArrayList<Namespace> constant_namespace = new HashArrayList<>();
@SWFField
private HashArrayList<NamespaceSet> constant_namespace_set = new HashArrayList<>();
@SWFField
private HashArrayList<Multiname> constant_multiname = new HashArrayList<>();
public AVM2ConstantPool() {

View File

@@ -96,6 +96,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.HashArrayList;
import com.jpexs.helpers.ReflectionTools;
import java.io.IOException;
import java.io.StringReader;
@@ -205,7 +206,7 @@ public class SwfXmlImporter {
Field field = getField(cls, name);
Class childCls = field.getType();
if (List.class.isAssignableFrom(childCls)) {
List list = new ArrayList();
List list = HashArrayList.class.isAssignableFrom(childCls) ? new HashArrayList() : new ArrayList();
for (int j = 0; j < child.getChildNodes().getLength(); j++) {
Node childChildNode = child.getChildNodes().item(j);
if (childChildNode instanceof Element) {