diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 56dd79bfc..e1bff8d17 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -1119,6 +1119,7 @@ public final class SWF implements SWFContainerItem, Timelined { * * @param fis Input stream * @param fos Output stream + * @param compression * @return True on success */ public static boolean compress(InputStream fis, OutputStream fos, SWFCompression compression) { @@ -1683,11 +1684,11 @@ public final class SWF implements SWFContainerItem, Timelined { ip = nextip; } List> r = new ArrayList<>(); - r.add(new ArrayList()); - r.add(new ArrayList()); - r.add(new ArrayList()); + r.add(new ArrayList<>()); + r.add(new ArrayList<>()); + r.add(new ArrayList<>()); try { - ((GraphSourceItemContainer) ins).translateContainer(r, stack, output, new HashMap(), new HashMap(), new HashMap()); + ((GraphSourceItemContainer) ins).translateContainer(r, stack, output, new HashMap<>(), new HashMap<>(), new HashMap<>()); } catch (EmptyStackException ex) { } @@ -1777,14 +1778,14 @@ public final class SWF implements SWFContainerItem, Timelined { private static void getVariables(List> variables, List functions, HashMap strings, HashMap usageTypes, ActionGraphSource code, int addr, String path) throws InterruptedException { ActionLocalData localData = new ActionLocalData(); - getVariables(null, localData, new TranslateStack(path), new ArrayList(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList(), usageTypes, path); + getVariables(null, localData, new TranslateStack(path), new ArrayList<>(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList<>(), usageTypes, path); } private List> getVariables(List> variables, HashMap actionsMap, List functions, HashMap strings, HashMap usageTypes, ASMSource src, String path) throws InterruptedException { List> ret = new ArrayList<>(); ActionList actions = src.getActions(); actionsMap.put(src, actions); - getVariables(variables, functions, strings, usageTypes, new ActionGraphSource(actions, version, new HashMap(), new HashMap(), new HashMap()), 0, path); + getVariables(variables, functions, strings, usageTypes, new ActionGraphSource(actions, version, new HashMap<>(), new HashMap<>(), new HashMap<>()), 0, path); return ret; } @@ -1856,7 +1857,7 @@ public final class SWF implements SWFContainerItem, Timelined { sc.setModified(true); } } - deobfuscation.deobfuscateInstanceNames(true, deobfuscated, renameType, tags, new HashMap()); + deobfuscation.deobfuscateInstanceNames(true, deobfuscated, renameType, tags, new HashMap<>()); return deobfuscated.size(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 5e3f64ae2..81e625ae8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -674,7 +674,7 @@ public class AVM2Code implements Cloneable { } public void calculateDebugFileLine(ABC abc) { - calculateDebugFileLine(null, 0, 0, abc, new HashSet()); + calculateDebugFileLine(null, 0, 0, abc, new HashSet<>()); } private boolean calculateDebugFileLine(String debugFile, int debugLine, int pos, ABC abc, Set seen) { @@ -701,7 +701,7 @@ public class AVM2Code implements Cloneable { //This avoids bogus functions used in obfuscation or special compilers that can lead to infinite recursion. if ((pos + 1 < code.size()) && !(code.get(pos + 1).definition instanceof PopIns)) { MethodBody innerBody = abc.findBody(ins.operands[0]); - innerBody.getCode().calculateDebugFileLine(debugFile, debugLine, 0, abc, new HashSet()); + innerBody.getCode().calculateDebugFileLine(debugFile, debugLine, 0, abc, new HashSet<>()); } } @@ -1355,7 +1355,7 @@ public class AVM2Code implements Cloneable { if (code.get(k).definition instanceof KillIns) { int regid = code.get(k).operands[0]; if (!killedRegs.containsKey(regid)) { - killedRegs.put(regid, new HashSet()); + killedRegs.put(regid, new HashSet<>()); } killedRegs.get(regid).add(k); } @@ -1890,7 +1890,7 @@ public class AVM2Code implements Cloneable { } } // Declarations - injectDeclarations(list, new boolean[regCount], new ArrayList(), abc, body); + injectDeclarations(list, new boolean[regCount], new ArrayList<>(), abc, body); int lastPos = list.size() - 1; if (lastPos < 0) { @@ -2205,7 +2205,7 @@ public class AVM2Code implements Cloneable { localData.refs = refs; localData.code = this; int ret = 0; - ret += removeTraps(constants, trait, info, body, localData, new AVM2GraphSource(this, false, -1, -1, new HashMap(), new ScopeStack(), abc, body, new HashMap(), new ArrayList<>(), new HashMap(), refs), 0, path, refs); + ret += removeTraps(constants, trait, info, body, localData, new AVM2GraphSource(this, false, -1, -1, new HashMap<>(), new ScopeStack(), abc, body, new HashMap<>(), new ArrayList<>(), new HashMap<>(), refs), 0, path, refs); removeIgnored(constants, trait, info, body); removeDeadCode(constants, trait, info, body); @@ -2928,7 +2928,7 @@ public class AVM2Code implements Cloneable { } public static boolean isDirectAncestor(int currentIp, int ancestor, HashMap> refs) { - return isDirectAncestor(currentIp, ancestor, refs, new ArrayList()); + return isDirectAncestor(currentIp, ancestor, refs, new ArrayList<>()); } private static boolean isDirectAncestor(int currentIp, int ancestor, HashMap> refs, List visited) { @@ -3250,7 +3250,7 @@ public class AVM2Code implements Cloneable { public static int removeTraps(AVM2ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, AVM2LocalData localData, AVM2GraphSource code, int addr, String path, HashMap> refs) throws InterruptedException { HashMap decisions = new HashMap<>(); - removeTraps(refs, false, false, localData, new TranslateStack(path), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path, 0); + removeTraps(refs, false, false, localData, new TranslateStack(path), new ArrayList<>(), code, code.adr2pos(addr), new HashMap<>(), new HashMap<>(), decisions, path, 0); int cnt = 0; for (AVM2Instruction src : decisions.keySet()) { Decision dec = decisions.get(src); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java index 8cf518ccb..77f344082 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java @@ -314,7 +314,7 @@ public class AVM2ConstantPool { } public int getQnameId(String name, int namespaceKind, String namespaceName, boolean add) { - return getMultinameId(new Multiname(Multiname.QNAME, getStringId(name, add), getNamespaceId(new Namespace(namespaceKind, getStringId(namespaceName, add)), 0, add), 0, 0, new ArrayList()), add); + return getMultinameId(new Multiname(Multiname.QNAME, getStringId(name, add), getNamespaceId(new Namespace(namespaceKind, getStringId(namespaceName, add)), 0, add), 0, 0, new ArrayList<>()), add); } public int getPublicQnameId(String name, boolean add) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 30d4c75a5..0646e50fc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -348,7 +348,7 @@ public class AVM2Graph extends Graph { if (!ncatchedCommands.isEmpty() && (ncatchedCommands.get(0) instanceof SetLocalAVM2Item)) { SetLocalAVM2Item sl = (SetLocalAVM2Item) ncatchedCommands.get(0); if (sl.value.getNotCoerced() instanceof ExceptionAVM2Item) { - finCatchName = AVM2Item.localRegName(new HashMap(), sl.regIndex); + finCatchName = AVM2Item.localRegName(new HashMap<>(), sl.regIndex); } } } @@ -515,7 +515,7 @@ public class AVM2Graph extends Graph { if (ins.definition instanceof LookupSwitchIns) { break; } - ins.translate(localData, sstack, new ArrayList(), staticOperation, path); + ins.translate(localData, sstack, new ArrayList<>(), staticOperation, path); } if (numPart.nextParts.size() > 1) { break; @@ -556,7 +556,7 @@ public class AVM2Graph extends Graph { if (ins.definition instanceof LookupSwitchIns) { break; } - ins.translate(localData, sstack, new ArrayList(), staticOperation, path); + ins.translate(localData, sstack, new ArrayList<>(), staticOperation, path); } if (numPart.nextParts.size() > 1) { break; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index edb0a65b0..8ffab106d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -142,7 +142,7 @@ public class InstructionDefinition implements Serializable { protected boolean isRegisterCompileTime(int regId, int ip, HashMap> refs, AVM2Code code) { Set previous = new HashSet<>(); - AVM2Code.getPreviousReachableIps(ip, refs, previous, new HashSet()); + AVM2Code.getPreviousReachableIps(ip, refs, previous, new HashSet<>()); for (int p : previous) { if (p < 0) { continue; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java index 659707794..30834edd6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java @@ -104,8 +104,8 @@ public class InitVectorAVM2Item extends AVM2Item { public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { AVM2SourceGenerator g = (AVM2SourceGenerator) generator; List ret = toSourceMerge(localData, generator, - ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, g.abc.constants.getStringId("Vector", true), 0, g.abc.constants.getNamespaceSetId(new NamespaceSet(new int[]{g.abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, g.abc.constants.getStringId("__AS3__.vec", true)), 0, true)}), true), 0, new ArrayList()), true)), - ins(new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, g.abc.constants.getStringId("Vector", true), 0, allNsSet(g.abc), 0, new ArrayList()), true)), + ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, g.abc.constants.getStringId("Vector", true), 0, g.abc.constants.getNamespaceSetId(new NamespaceSet(new int[]{g.abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, g.abc.constants.getStringId("__AS3__.vec", true)), 0, true)}), true), 0, new ArrayList<>()), true)), + ins(new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, g.abc.constants.getStringId("Vector", true), 0, allNsSet(g.abc), 0, new ArrayList<>()), true)), subtype, ins(new ApplyTypeIns(), 1), new IntegerValueAVM2Item(null, (long) arguments.size()), diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java index f09bd92e8..4c8a5f772 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java @@ -75,11 +75,11 @@ public class DeletePropertyAVM2Item extends AVM2Item { } if (p instanceof IndexAVM2Item) { IndexAVM2Item ind = (IndexAVM2Item) p; - return ind.toSource(localData, generator, true, false, new ArrayList(), true, false); + return ind.toSource(localData, generator, true, false, new ArrayList<>(), true, false); } if (p instanceof NamespacedAVM2Item) { NamespacedAVM2Item n = (NamespacedAVM2Item) p; - return n.toSource(localData, generator, true, false, new ArrayList(), true, false); + return n.toSource(localData, generator, true, false, new ArrayList<>(), true, false); } throw new CompilationException("Not a property", line); //TODO: handle line better way diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 6619dbf0d..9d5dcccad 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -184,7 +184,7 @@ public class AVM2SourceGenerator implements SourceGenerator { return GraphTargetItem.toSourceMerge(localData, this, item.object, - ins(new GetDescendantsIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.getStringId(item.nameStr, true), 0, nsset, 0, new ArrayList()), true)) + ins(new GetDescendantsIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.getStringId(item.nameStr, true), 0, nsset, 0, new ArrayList<>()), true)) ); } @@ -327,7 +327,7 @@ public class AVM2SourceGenerator implements SourceGenerator { ins(new CheckFilterIns()), NameAVM2Item.generateCoerce(localData, this, TypeItem.UNBOUNDED), AssignableAVM2Item.setTemp(localData, this, collectionReg), - ins(new GetLexIns(), abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId("XMLList", true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList()), true)), + ins(new GetLexIns(), abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId("XMLList", true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList<>()), true)), ins(new PushStringIns(), abc.constants.getStringId("", true)), ins(new ConstructIns(), 1), xmlListSetTemp @@ -354,7 +354,7 @@ public class AVM2SourceGenerator implements SourceGenerator { for (int i = 0; i < item.openedNamespaces.size(); i++) { nss[i] = item.openedNamespaces.get(i); } - trueBody.add(ins(new SetPropertyIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, 0, 0, abc.constants.getNamespaceSetId(new NamespaceSet(nss), true), 0, new ArrayList()), true))); + trueBody.add(ins(new SetPropertyIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, 0, 0, abc.constants.getNamespaceSetId(new NamespaceSet(nss), true), 0, new ArrayList<>()), true))); forBody.add(ins(new IfFalseIns(), insToBytes(trueBody).length)); forBody.addAll(trueBody); forBody.add(ins(new PopScopeIns())); @@ -725,14 +725,14 @@ public class AVM2SourceGenerator implements SourceGenerator { ret.add(ins(new NewObjectIns(), 0)); ret.add(ins(new PushWithIns())); scope = localData.scopeStack.size(); - localData.scopeStack.add(new PropertyAVM2Item(null, item.functionName, abc, allABCs, new ArrayList(), localData.callStack)); + localData.scopeStack.add(new PropertyAVM2Item(null, item.functionName, abc, allABCs, new ArrayList<>(), localData.callStack)); } ret.add(ins(new NewFunctionIns(), method(true, false, localData.callStack, localData.pkg, item.needsActivation, item.subvariables, 0 /*Set later*/, item.hasRest, item.line, localData.currentClass, null, false, localData, item.paramTypes, item.paramNames, item.paramValues, item.body, item.retType))); if (!item.functionName.isEmpty()) { ret.add(ins(new DupIns())); ret.add(ins(new GetScopeObjectIns(), scope)); ret.add(ins(new SwapIns())); - ret.add(ins(new SetPropertyIns(), abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(item.functionName, true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(localData.pkg, true)), 0, true), 0, 0, new ArrayList()), true))); + ret.add(ins(new SetPropertyIns(), abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(item.functionName, true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(localData.pkg, true)), 0, true), 0, 0, new ArrayList<>()), true))); ret.add(ins(new PopScopeIns())); localData.scopeStack.remove(localData.scopeStack.size() - 1); } @@ -754,7 +754,7 @@ public class AVM2SourceGenerator implements SourceGenerator { int finallyEx = -1; for (NameAVM2Item e : item.catchExceptions2) { ABCException aex = new ABCException(); - aex.name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(e.getVariableName(), true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList()), true); + aex.name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(e.getVariableName(), true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList<>()), true); aex.type_index = typeName(localData, e.type); newex.add(aex); } @@ -1210,18 +1210,18 @@ public class AVM2SourceGenerator implements SourceGenerator { Trait[] st = generateTraitsPhase1(name, superName, true, localData, traitItems, classInfo.static_traits, class_index); generateTraitsPhase2(importedClasses, pkg, traitItems, it, openedNamespaces, localData); generateTraitsPhase2(importedClasses, pkg, traitItems, st, openedNamespaces, localData); - generateTraitsPhase3(initScope, isInterface, name, superName, false, localData, traitItems, instanceInfo.instance_traits, it, new HashMap(), class_index); - generateTraitsPhase3(initScope, isInterface, name, superName, true, localData, traitItems, classInfo.static_traits, st, new HashMap(), class_index); + generateTraitsPhase3(initScope, isInterface, name, superName, false, localData, traitItems, instanceInfo.instance_traits, it, new HashMap<>(), class_index); + generateTraitsPhase3(initScope, isInterface, name, superName, true, localData, traitItems, classInfo.static_traits, st, new HashMap<>(), class_index); int init = 0; if (constructor == null || isInterface) { - instanceInfo.iinit_index = init = method(false, isInterface, new ArrayList(), pkg, false, new ArrayList(), initScope + 1, false, 0, isInterface ? null : name, extendsVal != null ? extendsVal.toString() : null, true, localData, new ArrayList(), new ArrayList<>(), new ArrayList(), new ArrayList(), TypeItem.UNBOUNDED/*?? FIXME*/); + instanceInfo.iinit_index = init = method(false, isInterface, new ArrayList<>(), pkg, false, new ArrayList<>(), initScope + 1, false, 0, isInterface ? null : name, extendsVal != null ? extendsVal.toString() : null, true, localData, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), TypeItem.UNBOUNDED/*?? FIXME*/); } else { MethodAVM2Item m = (MethodAVM2Item) constructor; - instanceInfo.iinit_index = init = method(false, false, new ArrayList(), pkg, m.needsActivation, m.subvariables, initScope + 1, m.hasRest, m.line, name, extendsVal != null ? extendsVal.toString() : null, true, localData, m.paramTypes, m.paramNames, m.paramValues, m.body, TypeItem.UNBOUNDED/*?? FIXME*/); + instanceInfo.iinit_index = init = method(false, false, new ArrayList<>(), pkg, m.needsActivation, m.subvariables, initScope + 1, m.hasRest, m.line, name, extendsVal != null ? extendsVal.toString() : null, true, localData, m.paramTypes, m.paramNames, m.paramValues, m.body, TypeItem.UNBOUNDED/*?? FIXME*/); } //Class initializer - int staticMi = method(false, false, new ArrayList(), pkg, staticNeedsActivation, sinitVariables, initScope + (implementsStr.isEmpty() ? 0 : 1), false, 0, isInterface ? null : name, superName, false, localData, new ArrayList(), new ArrayList<>(), new ArrayList(), staticInit, TypeItem.UNBOUNDED); + int staticMi = method(false, false, new ArrayList<>(), pkg, staticNeedsActivation, sinitVariables, initScope + (implementsStr.isEmpty() ? 0 : 1), false, 0, isInterface ? null : name, superName, false, localData, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), staticInit, TypeItem.UNBOUNDED); MethodBody sinitBody = abc.findBody(staticMi); List sinitcode = new ArrayList<>(); @@ -1320,14 +1320,14 @@ public class AVM2SourceGenerator implements SourceGenerator { InterfaceAVM2Item iai = (InterfaceAVM2Item) cls; ii.flags |= InstanceInfo.CLASS_INTERFACE; ii.flags |= InstanceInfo.CLASS_SEALED; - generateClass(iai.importedClasses, new ArrayList(), false, new ArrayList(), iai.openedNamespaces, namespace, initScope, pkg, ci, ii, localData, true, iai.name, null, null, iai.superInterfaces, null, iai.methods, class_index); + generateClass(iai.importedClasses, new ArrayList<>(), false, new ArrayList<>(), iai.openedNamespaces, namespace, initScope, pkg, ci, ii, localData, true, iai.name, null, null, iai.superInterfaces, null, iai.methods, class_index); } return abc.instance_info.size() - 1; } public int traitName(int namespace, String var) { - return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str(var), namespace, 0, 0, new ArrayList()), true); + return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str(var), namespace, 0, 0, new ArrayList<>()), true); } public int typeName(SourceGeneratorLocalData localData, GraphTargetItem type) throws CompilationException { @@ -1376,7 +1376,7 @@ public class AVM2SourceGenerator implements SourceGenerator { public int propertyName(GraphTargetItem name) { if (name instanceof NameAVM2Item) { NameAVM2Item va = (NameAVM2Item) name; - return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str(va.getVariableName()), namespace(Namespace.KIND_PACKAGE, ""), 0, 0, new ArrayList()), true); + return abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str(va.getVariableName()), namespace(Namespace.KIND_PACKAGE, ""), 0, 0, new ArrayList<>()), true); } throw new RuntimeException("no prop"); //FIXME } @@ -1408,7 +1408,7 @@ public class AVM2SourceGenerator implements SourceGenerator { public int method(boolean subMethod, boolean isInterface, List callStack, String pkg, boolean needsActivation, List subvariables, int initScope, boolean hasRest, int line, String className, String superType, boolean constructor, SourceGeneratorLocalData localData, List paramTypes, List paramNames, List paramValues, List body, GraphTargetItem retType) throws CompilationException { //Reference hasArgs = new Reference<>(Boolean.FALSE); //calcRegisters(localData,needsActivation,paramNames,subvariables,body, hasArgs); - SourceGeneratorLocalData newlocalData = new SourceGeneratorLocalData(new HashMap(), 1, true, 0); + SourceGeneratorLocalData newlocalData = new SourceGeneratorLocalData(new HashMap<>(), 1, true, 0); newlocalData.currentClass = className; newlocalData.pkg = localData.pkg; newlocalData.callStack.addAll(localData.callStack); @@ -1672,14 +1672,14 @@ public class AVM2SourceGenerator implements SourceGenerator { for (int i = 1; i < slotNames.size(); i++) { TraitSlotConst tsc = new TraitSlotConst(); tsc.slot_id = slotId++; - tsc.name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(slotNames.get(i), true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE_INTERNAL, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList()), true); + tsc.name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(slotNames.get(i), true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE_INTERNAL, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList<>()), true); tsc.type_index = typeName(localData, new TypeItem(slotTypes.get(i))); mbody.traits.traits.add(tsc); } for (int i = 1; i < paramRegCount; i++) { - NameAVM2Item param = new NameAVM2Item(new TypeItem(registerTypes.get(i)), 0, registerNames.get(i), null, false, new ArrayList()); + NameAVM2Item param = new NameAVM2Item(new TypeItem(registerTypes.get(i)), 0, registerNames.get(i), null, false, new ArrayList<>()); param.setRegNumber(i); - NameAVM2Item d = new NameAVM2Item(new TypeItem(registerTypes.get(i)), 0, registerNames.get(i), param, true, new ArrayList()); + NameAVM2Item d = new NameAVM2Item(new TypeItem(registerTypes.get(i)), 0, registerNames.get(i), param, true, new ArrayList<>()); d.setSlotScope(slotScope); d.setSlotNumber(slotNames.indexOf(registerNames.get(i))); declarations.add(d); @@ -1691,7 +1691,7 @@ public class AVM2SourceGenerator implements SourceGenerator { localData.exceptions = new ArrayList<>(); localData.callStack.add(mbody); - List src = body == null ? new ArrayList() : generate(localData, body); + List src = body == null ? new ArrayList<>() : generate(localData, body); mbody.method_info = abc.addMethodInfo(mi); mi.setBody(mbody); @@ -1709,7 +1709,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if (tsc.type_index > 0) { type = new TypeItem(abc.constants.constant_multiname.get(tsc.type_index).getNameWithNamespace(abc.constants)); } - NameAVM2Item d = new NameAVM2Item(type, 0, tsc.getName(abc).getName(abc.constants, new ArrayList<>(), true), NameAVM2Item.getDefaultValue("" + type), true, new ArrayList()); + NameAVM2Item d = new NameAVM2Item(type, 0, tsc.getName(abc).getName(abc.constants, new ArrayList<>(), true), NameAVM2Item.getDefaultValue("" + type), true, new ArrayList<>()); d.setSlotNumber(tsc.slot_id); d.setSlotScope(slotScope); mbodyCode.addAll(0, toInsList(d.toSourceIgnoreReturnValue(localData, this))); @@ -1870,9 +1870,9 @@ public class AVM2SourceGenerator implements SourceGenerator { private int genNs(List importedClasses, String pkg, String custom, int namespace, List openedNamespaces, SourceGeneratorLocalData localData, int line) throws CompilationException { if (custom != null) { - PropertyAVM2Item prop = new PropertyAVM2Item(null, custom, abc, allABCs, openedNamespaces, new ArrayList()); + PropertyAVM2Item prop = new PropertyAVM2Item(null, custom, abc, allABCs, openedNamespaces, new ArrayList<>()); Reference value = new Reference<>(null); - prop.resolve(localData, new Reference(null), new Reference(null), new Reference<>(0), value); + prop.resolve(localData, new Reference<>(null), new Reference<>(null), new Reference<>(0), value); boolean resolved = true; if (value.getVal() == null) { resolved = false; @@ -1941,12 +1941,12 @@ public class AVM2SourceGenerator implements SourceGenerator { if (item instanceof ClassAVM2Item) { InstanceInfo instanceInfo = abc.instance_info.get(((TraitClass) traits[k]).class_info); instanceInfo.name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(((ClassAVM2Item) item).className, true), - abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList()), true); + abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList<>()), true); if (((ClassAVM2Item) item).extendsOp != null) { instanceInfo.super_index = typeName(localData, ((ClassAVM2Item) item).extendsOp); } else { - instanceInfo.super_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str("Object"), namespace(Namespace.KIND_PACKAGE, ""), 0, 0, new ArrayList()), true); + instanceInfo.super_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, str("Object"), namespace(Namespace.KIND_PACKAGE, ""), 0, 0, new ArrayList<>()), true); } instanceInfo.interfaces = new int[((ClassAVM2Item) item).implementsOp.size()]; for (int i = 0; i < ((ClassAVM2Item) item).implementsOp.size(); i++) { @@ -1956,7 +1956,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if (item instanceof InterfaceAVM2Item) { InstanceInfo instanceInfo = abc.instance_info.get(((TraitClass) traits[k]).class_info); instanceInfo.name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(((InterfaceAVM2Item) item).name, true), - abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList()), true); + abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList<>()), true); instanceInfo.interfaces = new int[((InterfaceAVM2Item) item).superInterfaces.size()]; for (int i = 0; i < ((InterfaceAVM2Item) item).superInterfaces.size(); i++) { @@ -1969,7 +1969,7 @@ public class AVM2SourceGenerator implements SourceGenerator { public int superIntName(SourceGeneratorLocalData localData, GraphTargetItem un) throws CompilationException { if (un instanceof UnresolvedAVM2Item) { - ((UnresolvedAVM2Item) un).resolve(null, new ArrayList(), new ArrayList<>(), abc, allABCs, new ArrayList(), new ArrayList()); + ((UnresolvedAVM2Item) un).resolve(null, new ArrayList<>(), new ArrayList<>(), abc, allABCs, new ArrayList<>(), new ArrayList<>()); un = ((UnresolvedAVM2Item) un).resolved; } if (!(un instanceof TypeItem)) { //not applyType @@ -1978,7 +1978,7 @@ public class AVM2SourceGenerator implements SourceGenerator { TypeItem sup = (TypeItem) un; int propId = resolveType(localData, sup, abc, allABCs); int[] nss = new int[]{abc.constants.constant_multiname.get(propId).namespace_index}; - return abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.constant_multiname.get(propId).name_index, 0, abc.constants.getNamespaceSetId(new NamespaceSet(nss), true), 0, new ArrayList()), true); + return abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.constant_multiname.get(propId).name_index, 0, abc.constants.getNamespaceSetId(new NamespaceSet(nss), true), 0, new ArrayList<>()), true); } @@ -2001,10 +2001,10 @@ public class AVM2SourceGenerator implements SourceGenerator { if (mai.isStatic() != generateStatic) { continue; } - ((TraitMethodGetterSetter) traits[k]).method_info = method(false, isInterface, new ArrayList(), mai.pkg, mai.needsActivation, mai.subvariables, methodInitScope + (mai.isStatic() ? 0 : 1), mai.hasRest, mai.line, className, superName, false, localData, mai.paramTypes, mai.paramNames, mai.paramValues, mai.body, mai.retType); + ((TraitMethodGetterSetter) traits[k]).method_info = method(false, isInterface, new ArrayList<>(), mai.pkg, mai.needsActivation, mai.subvariables, methodInitScope + (mai.isStatic() ? 0 : 1), mai.hasRest, mai.line, className, superName, false, localData, mai.paramTypes, mai.paramNames, mai.paramValues, mai.body, mai.retType); } else if (item instanceof FunctionAVM2Item) { FunctionAVM2Item fai = (FunctionAVM2Item) item; - ((TraitFunction) traits[k]).method_info = method(false, isInterface, new ArrayList(), fai.pkg, fai.needsActivation, fai.subvariables, methodInitScope, fai.hasRest, fai.line, className, superName, false, localData, fai.paramTypes, fai.paramNames, fai.paramValues, fai.body, fai.retType); + ((TraitFunction) traits[k]).method_info = method(false, isInterface, new ArrayList<>(), fai.pkg, fai.needsActivation, fai.subvariables, methodInitScope, fai.hasRest, fai.line, className, superName, false, localData, fai.paramTypes, fai.paramNames, fai.paramValues, fai.body, fai.retType); } } } @@ -2144,7 +2144,7 @@ public class AVM2SourceGenerator implements SourceGenerator { ScriptInfo si = new ScriptInfo(); localData.currentScript = si; Trait[] traitArr = generateTraitsPhase1(null, null, true, localData, commands, si.traits, class_index); - generateTraitsPhase2(new ArrayList(), null/*FIXME*/, commands, traitArr, new ArrayList(), localData); + generateTraitsPhase2(new ArrayList<>(), null/*FIXME*/, commands, traitArr, new ArrayList<>(), localData); MethodInfo mi = new MethodInfo(new int[0], 0, 0, 0, new ValueKind[0], new int[0]); MethodBody mb = new MethodBody(abc); mb.method_info = abc.addMethodInfo(mi); @@ -2166,7 +2166,7 @@ public class AVM2SourceGenerator implements SourceGenerator { traitScope++; } else { NamespaceSet nsset = new NamespaceSet(new int[]{abc.constants.constant_multiname.get(tc.name_index).namespace_index}); - mbCode.add(ins(new FindPropertyStrictIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.constant_multiname.get(tc.name_index).name_index, 0, abc.constants.getNamespaceSetId(nsset, true), 0, new ArrayList()), true))); + mbCode.add(ins(new FindPropertyStrictIns(), abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.constant_multiname.get(tc.name_index).name_index, 0, abc.constants.getNamespaceSetId(nsset, true), 0, new ArrayList<>()), true))); } if (abc.instance_info.get(tc.class_info).isInterface()) { mbCode.add(ins(new PushNullIns())); @@ -2218,7 +2218,7 @@ public class AVM2SourceGenerator implements SourceGenerator { abc.constants.getMultinameId( new Multiname(Multiname.QNAME, abc.constants.getStringId(superName.getName(a.constants, new ArrayList<>(), true), true), - abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants, true), true)), 0, true), 0, 0, new ArrayList()), true) + abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants, true), true)), 0, true), 0, 0, new ArrayList<>()), true) ); } } @@ -2436,7 +2436,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if (item instanceof UnresolvedAVM2Item) { String fullClass = localData.getFullClass(); - item = ((UnresolvedAVM2Item) item).resolve(new TypeItem(fullClass), new ArrayList(), new ArrayList<>(), abc, allABCs, new ArrayList(), new ArrayList()); + item = ((UnresolvedAVM2Item) item).resolve(new TypeItem(fullClass), new ArrayList<>(), new ArrayList<>(), abc, allABCs, new ArrayList<>(), new ArrayList<>()); } if (item instanceof TypeItem) { typeItem = item; @@ -2447,7 +2447,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } if (typeItem instanceof UnresolvedAVM2Item) { String fullClass = localData.getFullClass(); - typeItem = ((UnresolvedAVM2Item) typeItem).resolve(new TypeItem(fullClass), new ArrayList(), new ArrayList<>(), abc, allABCs, new ArrayList(), new ArrayList()); + typeItem = ((UnresolvedAVM2Item) typeItem).resolve(new TypeItem(fullClass), new ArrayList<>(), new ArrayList<>(), abc, allABCs, new ArrayList<>(), new ArrayList<>()); } if (!(typeItem instanceof TypeItem)) { @@ -2487,7 +2487,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } } if (name_index == 0) { - name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(name, true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList()), true); + name_index = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(name, true), abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId(pkg, true)), 0, true), 0, 0, new ArrayList<>()), true); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index ad78e4ed0..0dc79bf08 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -171,7 +171,7 @@ public class ActionScript3Parser { } GraphTargetItem t = name(thisType, pkg, needsActivation, true, openedNamespaces, null, false, false, variables, importedClasses); - t = applyType(thisType, pkg, needsActivation, importedClasses, openedNamespaces, t, new HashMap(), false, false, variables); + t = applyType(thisType, pkg, needsActivation, importedClasses, openedNamespaces, t, new HashMap<>(), false, false, variables); return t; } @@ -287,7 +287,7 @@ public class ActionScript3Parser { s = lex(); GraphTargetItem ns = null; if (s.type == SymbolType.NAMESPACE_OP) { - ns = new UnresolvedAVM2Item(new ArrayList(), importedClasses, false, null, lexer.yyline(), new DottedChain(propName), null, openedNamespaces); + ns = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, false, null, lexer.yyline(), new DottedChain(propName), null, openedNamespaces); variables.add((UnresolvedAVM2Item) ns); s = lex(); if (s.type == SymbolType.BRACKET_OPEN) { @@ -305,7 +305,7 @@ public class ActionScript3Parser { if (ns != null) { ret = new NamespacedAVM2Item(ns, propName, propItem, ret, attr, openedNamespaces, null); } else { - ret = new PropertyAVM2Item(ret, (attr ? "@" : "") + propName, abc, otherABCs, openedNamespaces, new ArrayList()); + ret = new PropertyAVM2Item(ret, (attr ? "@" : "") + propName, abc, otherABCs, openedNamespaces, new ArrayList<>()); } s = lex(); } @@ -375,7 +375,7 @@ public class ActionScript3Parser { GraphTargetItem ret = null; if (!name.parts.isEmpty()) { - UnresolvedAVM2Item unr = new UnresolvedAVM2Item(new ArrayList(), importedClasses, typeOnly, null, lexer.yyline(), name, null, openedNamespaces); + UnresolvedAVM2Item unr = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, typeOnly, null, lexer.yyline(), name, null, openedNamespaces); //unr.setIndex(index); variables.add(unr); ret = unr; @@ -385,7 +385,7 @@ public class ActionScript3Parser { if (attr) { nsname = nsname.substring(1); } - UnresolvedAVM2Item ns = new UnresolvedAVM2Item(new ArrayList(), importedClasses, typeOnly, null, lexer.yyline(), new DottedChain(nsname), null, openedNamespaces); + UnresolvedAVM2Item ns = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, typeOnly, null, lexer.yyline(), new DottedChain(nsname), null, openedNamespaces); variables.add(ns); ret = new NamespacedAVM2Item(ns, nsprop, nspropItem, ret, attr, openedNamespaces, null); } @@ -529,7 +529,7 @@ public class ActionScript3Parser { Reference needsActivation2 = new Reference<>(false); if (!isInterface) { expectedType(SymbolType.CURLY_OPEN); - body = commands(thisType, pkg, needsActivation2, importedClasses, openedNamespaces, new Stack(), new HashMap(), new HashMap(), true, isMethod, 0, subvariables); + body = commands(thisType, pkg, needsActivation2, importedClasses, openedNamespaces, new Stack<>(), new HashMap<>(), new HashMap<>(), true, isMethod, 0, subvariables); expectedType(SymbolType.CURLY_CLOSE); } else { expectedType(SymbolType.SEMICOLON); @@ -576,7 +576,7 @@ public class ActionScript3Parser { } if (inPkg || classNameStr != null) { if (s.type == SymbolType.CURLY_OPEN) { - staticInitializer.addAll(commands(thisType, pkg, sinitNeedsActivation, importedClasses, openedNamespaces, new Stack(), new HashMap(), new HashMap(), true, false, 0, sinitVariables)); + staticInitializer.addAll(commands(thisType, pkg, sinitNeedsActivation, importedClasses, openedNamespaces, new Stack<>(), new HashMap<>(), new HashMap<>(), true, false, 0, sinitVariables)); expectedType(SymbolType.CURLY_CLOSE); s = lex(); } @@ -676,13 +676,13 @@ public class ActionScript3Parser { GraphTargetItem extendsTypeStr = null; s = lex(); if (s.type == SymbolType.EXTENDS) { - extendsTypeStr = type(thisType, pkg, new Reference<>(false), importedClasses, subNamespaces, new ArrayList()); + extendsTypeStr = type(thisType, pkg, new Reference<>(false), importedClasses, subNamespaces, new ArrayList<>()); s = lex(); } List implementsTypeStrs = new ArrayList<>(); if (s.type == SymbolType.IMPLEMENTS) { do { - GraphTargetItem implementsTypeStr = type(thisType, pkg, new Reference<>(false), importedClasses, subNamespaces, new ArrayList()); + GraphTargetItem implementsTypeStr = type(thisType, pkg, new Reference<>(false), importedClasses, subNamespaces, new ArrayList<>()); implementsTypeStrs.add(implementsTypeStr); s = lex(); } while (s.type == SymbolType.COMMA); @@ -691,7 +691,7 @@ public class ActionScript3Parser { if (customAccess != null) { throw new AVM2ParseException("Class cannot have custom namespace", lexer.yyline()); } - traits.add((classTraits(scriptName, publicNs, pkg, importedClasses, isDynamic, isFinal, subNamespaces, pkg, namespace, false, classTypeStr, extendsTypeStr, implementsTypeStrs, new ArrayList()))); + traits.add((classTraits(scriptName, publicNs, pkg, importedClasses, isDynamic, isFinal, subNamespaces, pkg, namespace, false, classTypeStr, extendsTypeStr, implementsTypeStrs, new ArrayList<>()))); expectedType(SymbolType.CURLY_CLOSE); break; case INTERFACE: @@ -716,7 +716,7 @@ public class ActionScript3Parser { if (s.type == SymbolType.EXTENDS) { do { - GraphTargetItem intExtendsTypeStr = type(thisType, pkg, new Reference<>(false), importedClasses, openedNamespaces, new ArrayList()); + GraphTargetItem intExtendsTypeStr = type(thisType, pkg, new Reference<>(false), importedClasses, openedNamespaces, new ArrayList<>()); intExtendsTypeStrs.add(intExtendsTypeStr); s = lex(); } while (s.type == SymbolType.COMMA); @@ -725,7 +725,7 @@ public class ActionScript3Parser { if (customAccess != null) { throw new AVM2ParseException("Interface cannot have custom namespace", lexer.yyline()); } - traits.add((classTraits(scriptName, publicNs, pkg, importedClasses, false, isFinal, openedNamespaces, pkg, namespace, true, intTypeStr, null, intExtendsTypeStrs, new ArrayList()))); + traits.add((classTraits(scriptName, publicNs, pkg, importedClasses, false, isFinal, openedNamespaces, pkg, namespace, true, intTypeStr, null, intExtendsTypeStrs, new ArrayList<>()))); expectedType(SymbolType.CURLY_CLOSE); break; @@ -769,7 +769,7 @@ public class ActionScript3Parser { } constr = (method(pkg, false, customAccess, new Reference<>(false), importedClasses, false, false, thisType, openedNamespaces, false, namespace, "", true, constrVariables)); } else { - MethodAVM2Item ft = method(pkg, isInterface, customAccess, new Reference<>(false), importedClasses, isOverride, isFinal, thisType, openedNamespaces, isStatic, namespace, fname, true, new ArrayList()); + MethodAVM2Item ft = method(pkg, isInterface, customAccess, new Reference<>(false), importedClasses, isOverride, isFinal, thisType, openedNamespaces, isStatic, namespace, fname, true, new ArrayList<>()); if (isGetter) { if (!ft.paramTypes.isEmpty()) { @@ -850,7 +850,7 @@ public class ActionScript3Parser { s = lex(); GraphTargetItem type = null; if (s.type == SymbolType.COLON) { - type = type(thisType, pkg, new Reference<>(false), importedClasses, openedNamespaces, new ArrayList()); + type = type(thisType, pkg, new Reference<>(false), importedClasses, openedNamespaces, new ArrayList<>()); s = lex(); } else { type = TypeItem.UNBOUNDED; @@ -859,7 +859,7 @@ public class ActionScript3Parser { GraphTargetItem value = null; if (s.type == SymbolType.ASSIGN) { - value = expression(thisType, pkg, new Reference<>(false), importedClasses, openedNamespaces, new HashMap(), false, false, true, isStatic || isConst ? sinitVariables : constrVariables); + value = expression(thisType, pkg, new Reference<>(false), importedClasses, openedNamespaces, new HashMap<>(), false, false, true, isStatic || isConst ? sinitVariables : constrVariables); s = lex(); } GraphTargetItem tar; @@ -929,7 +929,7 @@ public class ActionScript3Parser { List names = new ArrayList<>(); List namespaces = new ArrayList<>(); //FIXME for Private classes in script!!! - AVM2SourceGenerator.parentNamesAddNames(abc, otherABCs, AVM2SourceGenerator.resolveType(new SourceGeneratorLocalData(new HashMap(), 0, false, 0), ((TypeItem) ((UnresolvedAVM2Item) extendsStr).resolve(null, new ArrayList(), new ArrayList<>(), abc, otherABCs, new ArrayList(), new ArrayList())), abc, otherABCs), indices, names, namespaces); + AVM2SourceGenerator.parentNamesAddNames(abc, otherABCs, AVM2SourceGenerator.resolveType(new SourceGeneratorLocalData(new HashMap<>(), 0, false, 0), ((TypeItem) ((UnresolvedAVM2Item) extendsStr).resolve(null, new ArrayList<>(), new ArrayList<>(), abc, otherABCs, new ArrayList<>(), new ArrayList<>())), abc, otherABCs), indices, names, namespaces); for (int i = 0; i < names.size(); i++) { if (namespaces.get(i).isEmpty()) { continue; @@ -1583,7 +1583,7 @@ public class ActionScript3Parser { UnresolvedAVM2Item ui = (UnresolvedAVM2Item) a; if (ui.getVariableName().equals(e.getVariableName())) { try { - ui.resolve(null, new ArrayList(), new ArrayList<>(), abc, otherABCs, new ArrayList(), variables); + ui.resolve(null, new ArrayList<>(), new ArrayList<>(), abc, otherABCs, new ArrayList<>(), variables); } catch (CompilationException ex) { // ignore } @@ -1606,7 +1606,7 @@ public class ActionScript3Parser { for (NameAVM2Item e : catchExceptions) { if (ui.getVariableName().equals(e.getVariableName())) { try { - ui.resolve(null, new ArrayList(), new ArrayList<>(), abc, otherABCs, new ArrayList(), variables); + ui.resolve(null, new ArrayList<>(), new ArrayList<>(), abc, otherABCs, new ArrayList<>(), variables); } catch (CompilationException ex) { // ignore } @@ -2341,7 +2341,7 @@ public class ActionScript3Parser { openedNamespaces.add(publicNs = abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId("", true)), 0, true)); List items = new ArrayList<>(); - traits(fileName, true, new ArrayList(), new Reference<>(false), new ArrayList(), new ArrayList(), scriptPrivateNs, 0, publicNs, 0, 0, openedNamespaces, null, null, false, items); + traits(fileName, true, new ArrayList<>(), new Reference<>(false), new ArrayList<>(), new ArrayList<>(), scriptPrivateNs, 0, publicNs, 0, 0, openedNamespaces, null, null, false, items); return items; } @@ -2358,7 +2358,7 @@ public class ActionScript3Parser { public void addScriptFromTree(List items, boolean documentClass, int classPos) throws AVM2ParseException, CompilationException { AVM2SourceGenerator gen = new AVM2SourceGenerator(abc, otherABCs); SourceGeneratorLocalData localData = new SourceGeneratorLocalData( - new HashMap(), 0, Boolean.FALSE, 0); + new HashMap<>(), 0, Boolean.FALSE, 0); localData.documentClass = documentClass; abc.script_info.add(gen.generateScriptInfo(localData, items, classPos)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index 9c63b46b6..5b7817d48 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -95,7 +95,7 @@ public class CallAVM2Item extends AVM2Item { nobj.setRegNumber(0); obj = nobj; } - PropertyAVM2Item p = new PropertyAVM2Item(obj, n.getVariableName(), g.abc, g.allABCs, n.openedNamespaces, new ArrayList()); + PropertyAVM2Item p = new PropertyAVM2Item(obj, n.getVariableName(), g.abc, g.allABCs, n.openedNamespaces, new ArrayList<>()); p.setAssignedValue(n.getAssignedValue()); callable = p; } @@ -127,7 +127,7 @@ public class CallAVM2Item extends AVM2Item { Reference outPropType = new Reference<>(null); Reference outPropValue = new Reference<>(null); if (cname != null && AVM2SourceGenerator.searchPrototypeChain(true, allAbcs, pkgName, cname, prop.propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue) && (localData.currentClass.equals("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal()))) { - NameAVM2Item nobj = new NameAVM2Item(new TypeItem(localData.getFullClass()), 0, "this", null, false, new ArrayList()); + NameAVM2Item nobj = new NameAVM2Item(new TypeItem(localData.getFullClass()), 0, "this", null, false, new ArrayList<>()); nobj.setRegNumber(0); obj = nobj; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java index c53214d2d..6b51fe95e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java @@ -97,7 +97,7 @@ public class IndexAVM2Item extends AssignableAVM2Item { Reference index_temp = new Reference<>(-1); Reference val_temp = new Reference<>(-1); AVM2SourceGenerator g = (AVM2SourceGenerator) generator; - int indexPropIndex = g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.MULTINAMELA : Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList()), true); + int indexPropIndex = g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.MULTINAMELA : Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList<>()), true); return toSourceMerge(localData, generator, object, dupSetTemp(localData, generator, obj_temp), @@ -119,7 +119,7 @@ public class IndexAVM2Item extends AssignableAVM2Item { public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator, boolean needsReturn, boolean call, List callargs, boolean delete, boolean construct) throws CompilationException { AVM2SourceGenerator g = (AVM2SourceGenerator) generator; - int indexPropIndex = g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.MULTINAMELA : Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList()), true); + int indexPropIndex = g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.MULTINAMELA : Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList<>()), true); Reference ret_temp = new Reference<>(-1); if (assignedValue != null) { @@ -147,11 +147,11 @@ public class IndexAVM2Item extends AssignableAVM2Item { @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { - return toSource(localData, generator, true, false, new ArrayList(), false, false); + return toSource(localData, generator, true, false, new ArrayList<>(), false, false); } @Override public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { - return toSource(localData, generator, false, false, new ArrayList(), false, false); + return toSource(localData, generator, false, false, new ArrayList<>(), false, false); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java index 610e6ccda..166cc1ab6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java @@ -117,14 +117,14 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { if (name != null) { return toSourceMerge(localData, generator, ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), - ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList()), true)), + ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), dupSetTemp(localData, generator, name_temp), ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), dupSetTemp(localData, generator, ns_temp), //Start get original //getTemp(localData, generator, ns_temp), generateCoerce(generator, "Namespace"), ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(variableName, true), 0, 0, 0, new ArrayList()), true)), //getTemp(localData, generator, ns_temp), generateCoerce(generator, "Namespace"), - ins(new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList()), true)), + ins(new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList<>()), true)), !isInteger ? ins(new ConvertDIns()) : null, //End get original (!post) ? (decrement ? ins(isInteger ? new DecrementIIns() : new DecrementIns()) : ins(isInteger ? new IncrementIIns() : new IncrementIns())) : null, @@ -134,7 +134,7 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { getTemp(localData, generator, name_temp), getTemp(localData, generator, ns_temp), getTemp(localData, generator, ret_temp), - ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList()), true)), + ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.MULTINAMEL, 0, 0, allNsSet(g.abc), 0, new ArrayList<>()), true)), killTemp(localData, generator, Arrays.asList(ret_temp, name_temp, ns_temp)) ); } else { @@ -168,20 +168,20 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { if (name == null) { if (assignedValue != null) { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), nameItem, ins(new ConvertSIns()), assignedValue, needsReturn ? dupSetTemp(localData, generator, ret_temp) : null, - ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList()), true)), + ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), needsReturn ? getTemp(localData, generator, ret_temp) : null, killTemp(localData, generator, Arrays.asList(ns_temp, index_temp, ret_temp)) ); } else { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), call ? dupSetTemp(localData, generator, obj_temp) : null, ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), nameItem, ins(new ConvertSIns()), construct ? callargs : null, - ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList()), true), construct ? callargs.size() : null), + ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true), construct ? callargs.size() : null), call ? getTemp(localData, generator, obj_temp) : null, call ? callargs : null, call ? ins(new CallIns(), callargs.size()) : null, @@ -192,20 +192,20 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { } else { if (assignedValue != null) { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), assignedValue, needsReturn ? dupSetTemp(localData, generator, ret_temp) : null, - ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList()), true)), + ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), needsReturn ? getTemp(localData, generator, ret_temp) : null, killTemp(localData, generator, Arrays.asList(ns_temp, index_temp, ret_temp)) ); } else { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), call ? dupSetTemp(localData, generator, obj_temp) : null, ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), construct ? callargs : null, - ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList()), true), construct ? callargs.size() : null), + ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true), construct ? callargs.size() : null), call ? getTemp(localData, generator, obj_temp) : null, call ? callargs : null, call ? ins(new CallIns(), callargs.size()) : null, @@ -218,11 +218,11 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { - return toSource(localData, generator, true, false, new ArrayList(), false, false); + return toSource(localData, generator, true, false, new ArrayList<>(), false, false); } @Override public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { - return toSource(localData, generator, false, false, new ArrayList(), false, false); + return toSource(localData, generator, false, false, new ArrayList<>(), false, false); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index 473897e7d..70b664b01 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -230,7 +230,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { propType = outPropType.getVal(); propIndex = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(propertyName, true), - abc.constants.getNamespaceId(new Namespace(outPropNsKind.getVal(), abc.constants.getStringId(outPropNs.getVal(), true)), outPropNsIndex.getVal(), true), 0, 0, new ArrayList()), true + abc.constants.getNamespaceId(new Namespace(outPropNsKind.getVal(), abc.constants.getStringId(outPropNs.getVal(), true)), outPropNsIndex.getVal(), true), 0, 0, new ArrayList<>()), true ); propValue = outPropValue.getVal(); @@ -252,7 +252,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { propType = multinameToType(tsc.type_index, abc.constants); propIndex = tsc.name_index; if (!localData.traitUsages.containsKey(b)) { - localData.traitUsages.put(b, new ArrayList()); + localData.traitUsages.put(b, new ArrayList<>()); } localData.traitUsages.get(b).add(i); } @@ -348,7 +348,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { propType = outPropType.getVal(); propIndex = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(propertyName, true), - abc.constants.getNamespaceId(new Namespace(outPropNsKind.getVal(), abc.constants.getStringId(outPropNs.getVal(), true)), outPropNsIndex.getVal(), true), 0, 0, new ArrayList()), true + abc.constants.getNamespaceId(new Namespace(outPropNsKind.getVal(), abc.constants.getStringId(outPropNs.getVal(), true)), outPropNsIndex.getVal(), true), 0, 0, new ArrayList<>()), true ); propValue = outPropValue.getVal(); break loopobjType; @@ -372,7 +372,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { } propIndex = abc.constants.getMultinameId(new Multiname(attr ? (pname.isEmpty() ? Multiname.MULTINAMELA : Multiname.MULTINAMEA) : Multiname.MULTINAME, abc.constants.getStringId("*".equals(pname) ? null : pname, true), 0, //Note: name = * is for .@* attribute - attr && pname.isEmpty() ? abc.constants.getNamespaceSetId(new NamespaceSet(new int[]{abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE_INTERNAL, abc.constants.getStringId(localData.pkg, true)), 0, true)}), true) : allNsSet(), 0, new ArrayList()), true); + attr && pname.isEmpty() ? abc.constants.getNamespaceSetId(new NamespaceSet(new int[]{abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE_INTERNAL, abc.constants.getStringId(localData.pkg, true)), 0, true)}), true) : allNsSet(), 0, new ArrayList<>()), true); propType = TypeItem.UNBOUNDED; objType = TypeItem.UNBOUNDED; propValue = null; @@ -558,7 +558,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { Reference propType = new Reference<>(null); Reference propIndex = new Reference<>(0); Reference outPropValue = new Reference<>(null); - resolve(new SourceGeneratorLocalData(new HashMap(), 0, false, 0)/*???*/, objType, propType, propIndex, outPropValue); + resolve(new SourceGeneratorLocalData(new HashMap<>(), 0, false, 0)/*???*/, objType, propType, propIndex, outPropValue); return propType.getVal(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java index 30c1d7dc1..deb31dd4c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java @@ -303,7 +303,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { ret.setRegNumber(n.getRegNumber()); resolved = ret; for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList()); + resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); if (i == parts.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -325,7 +325,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { TypeItem ret = new TypeItem(imp); resolved = ret; for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList()); + resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); if (i == parts.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -355,7 +355,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { TypeItem ret = new TypeItem(fname); resolved = ret; for (int j = i + 1; j < parts.size(); j++) { - resolved = new PropertyAVM2Item(resolved, parts.get(j), abc, otherAbcs, openedNamespaces, new ArrayList()); + resolved = new PropertyAVM2Item(resolved, parts.get(j), abc, otherAbcs, openedNamespaces, new ArrayList<>()); if (j == parts.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -400,7 +400,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { }*/ resolved = ret; for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList()); + resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); if (i == parts.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -423,7 +423,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { NameAVM2Item ret = new NameAVM2Item(thisType, line, parts.get(0), null, false, openedNamespaces); resolved = ret; for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList()); + resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); if (i == parts.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -446,7 +446,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { GraphTargetItem ret = new NameAVM2Item(t, line, parts.get(0), null, false, openedNamespaces); resolved = ret; for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList()); + resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); if (i == parts.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java index 0f3614b82..9a2d34df6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java @@ -62,7 +62,7 @@ public class XMLAVM2Item extends AVM2Item { public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { AVM2SourceGenerator g = (AVM2SourceGenerator) generator; return toSourceMerge(localData, generator, - ins(new GetLexIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.QNAME, g.abc.constants.getStringId("XML", true), g.abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, g.abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList()), true)), + ins(new GetLexIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.QNAME, g.abc.constants.getStringId("XML", true), g.abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, g.abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList<>()), true)), value, ins(new ConstructIns(), 1) ); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java index 21aa19a6b..ea0b83d4b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java @@ -97,7 +97,7 @@ public class InstanceInfo { } writer.appendNoHilight(modifiers + objType); - writer.hilightSpecial(abc.constants.getMultiname(name_index).getName(abc.constants, new ArrayList()/* No full names here*/, false), HighlightSpecialType.CLASS_NAME); + writer.hilightSpecial(abc.constants.getMultiname(name_index).getName(abc.constants, new ArrayList<>()/* No full names here*/, false), HighlightSpecialType.CLASS_NAME); if (super_index > 0) { String typeName = abc.constants.getMultiname(super_index).getNameWithNamespace(abc.constants).toPrintableString(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index 7f9046fad..dae5c7fe7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -268,7 +268,7 @@ public final class MethodBody implements Cloneable { public Void call() throws InterruptedException { MethodBody converted = convertMethodBody(path, isStatic, scriptIndex, classIndex, abc, trait, constants, method_info, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits); HashMap localRegNames = getLocalRegNames(abc); - convertedItems = converted.getCode().toGraphTargetItems(path, isStatic, scriptIndex, classIndex, abc, constants, method_info, converted, localRegNames, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits, Graph.SOP_USE_STATIC, new HashMap(), converted.getCode().visitCode(converted)); + convertedItems = converted.getCode().toGraphTargetItems(path, isStatic, scriptIndex, classIndex, abc, constants, method_info, converted, localRegNames, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits, Graph.SOP_USE_STATIC, new HashMap<>(), converted.getCode().visitCode(converted)); Graph.graphToString(convertedItems, writer, LocalData.create(constants, localRegNames, fullyQualifiedNames)); return null; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index 9772861ed..e2761c88e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -195,7 +195,7 @@ public abstract class Trait implements Serializable { Multiname name = getName(abc); Namespace ns = name.getNamespace(abc.constants); String packageName = ns.getName(abc.constants, false); - String objectName = name.getName(abc.constants, new ArrayList(), false); + String objectName = name.getName(abc.constants, new ArrayList<>(), false); return new ClassPath(packageName, objectName); //assume not null name } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 50196a425..9d2a3ed16 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -319,7 +319,7 @@ public class TraitClass extends Trait implements TraitWithSlot { TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(tm.name_index), ignorePackage, fullyQualifiedNames); if (tm.method_info != 0) { - parseImportsUsagesFromMethodInfo(abc, tm.method_info, imports, uses, ignorePackage, fullyQualifiedNames, new ArrayList()); + parseImportsUsagesFromMethodInfo(abc, tm.method_info, imports, uses, ignorePackage, fullyQualifiedNames, new ArrayList<>()); } } parseImportsUsagesFromMultiname(abc, imports, uses, t.getName(abc), ignorePackage, fullyQualifiedNames); @@ -348,13 +348,13 @@ public class TraitClass extends Trait implements TraitWithSlot { parseImportsUsagesFromTraits(abc, abc.class_info.get(class_info).static_traits, imports, uses, packageName, fullyQualifiedNames); //static initializer - parseImportsUsagesFromMethodInfo(abc, abc.class_info.get(class_info).cinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList()); + parseImportsUsagesFromMethodInfo(abc, abc.class_info.get(class_info).cinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList<>()); //instance parseImportsUsagesFromTraits(abc, abc.instance_info.get(class_info).instance_traits, imports, uses, packageName, fullyQualifiedNames); //instance initializer - parseImportsUsagesFromMethodInfo(abc, abc.instance_info.get(class_info).iinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList()); + parseImportsUsagesFromMethodInfo(abc, abc.instance_info.get(class_info).iinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList<>()); return imports; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index b39c8cb52..6361a2c67 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -113,7 +113,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { writer.newLine(); } } - assignedValue.toString(writer, LocalData.create(abc.constants, new HashMap(), fullyQualifiedNames)); + assignedValue.toString(writer, LocalData.create(abc.constants, new HashMap<>(), fullyQualifiedNames)); if (parent instanceof TraitClass) { writer.endMethod(); writer.endTrait(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index d538d4478..d5878e724 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -488,7 +488,7 @@ public abstract class Action implements GraphSourceItem { continue; } if (!containers.containsKey(addr)) { - containers.put(addr, new ArrayList()); + containers.put(addr, new ArrayList<>()); } containers.get(addr).add(cnt); } @@ -737,7 +737,7 @@ public abstract class Action implements GraphSourceItem { } public static List actionsToTree(List actions, int version, int staticOperation, String path) throws InterruptedException { - return actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); + return actionsToTree(new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path); } /** @@ -937,7 +937,7 @@ public abstract class Action implements GraphSourceItem { } for (long size : cnt.getContainerSizes()) { if (size == 0) { - outs.add(new ArrayList()); + outs.add(new ArrayList<>()); continue; } List out; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java index 77ebd74d8..a99e38871 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -61,7 +61,7 @@ import java.util.Map; public class ActionGraph extends Graph { public ActionGraph(List code, HashMap registerNames, HashMap variables, HashMap functions, int version) { - super(new ActionGraphSource(code, version, registerNames, variables, functions), new ArrayList()); + super(new ActionGraphSource(code, version, registerNames, variables, functions), new ArrayList<>()); //this.version = version; /*heads = makeGraph(code, new ArrayList()); for (GraphPart head : heads) { @@ -120,7 +120,7 @@ public class ActionGraph extends Graph { break; } } else { - target = new DirectValueActionItem(null, 0, st.target, new ArrayList()); + target = new DirectValueActionItem(null, 0, st.target, new ArrayList<>()); targetStart = t; targetStartItem = it; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java index cd203075e..423d48bdf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionList.java @@ -179,7 +179,7 @@ public class ActionList extends ArrayList { public void saveToFile(String fileName) { File file = new File(fileName); try (FileTextWriter writer = new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) { - Action.actionsToString(new ArrayList(), 0, this, SWF.DEFAULT_VERSION, ScriptExportMode.PCODE, writer); + Action.actionsToString(new ArrayList<>(), 0, this, SWF.DEFAULT_VERSION, ScriptExportMode.PCODE, writer); } catch (IOException ex) { Logger.getLogger(ActionList.class.getName()).log(Level.SEVERE, null, ex); } @@ -187,7 +187,7 @@ public class ActionList extends ArrayList { @Override public String toString() { - return Action.actionsToString(new ArrayList(), 0, this, SWF.DEFAULT_VERSION, ScriptExportMode.PCODE); + return Action.actionsToString(new ArrayList<>(), 0, this, SWF.DEFAULT_VERSION, ScriptExportMode.PCODE); } public String toSource() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java index 23e54f0de..84172694e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionListReader.java @@ -137,7 +137,7 @@ public class ActionListReader { Map nextOffsets = new HashMap<>(); Action entryAction = readActionListAtPos(listeners, null, sis, actionMap, nextOffsets, - ip, 0, endIp, path, false, new ArrayList()); + ip, 0, endIp, path, false, new ArrayList<>()); if (actionMap.isEmpty()) { return new ActionList(); @@ -239,9 +239,9 @@ public class ActionListReader { // Map of the actions. Use TreeMap to sort the keys in ascending order Map actionMap = new TreeMap<>(); Map nextOffsets = new HashMap<>(); - readActionListAtPos(new ArrayList(), null, + readActionListAtPos(new ArrayList<>(), null, sis, actionMap, nextOffsets, - startIp, startIp, endIp + 1, "", false, new ArrayList()); + startIp, startIp, endIp + 1, "", false, new ArrayList<>()); return new ArrayList<>(actionMap.values()); } @@ -293,14 +293,14 @@ public class ActionListReader { } deobfustaceActionListAtPosRecursive(listeners, - new ArrayList(), - new HashMap>(), + new ArrayList<>(), + new HashMap<>(), new ActionLocalData(), new TranslateStack(path), new ConstantPool(), actionMap, ip, retMap, ip, endIp, path, - new HashMap(), false, - new HashMap>(), + new HashMap<>(), false, + new HashMap<>(), version, 0, maxRecursionLevel); ActionList ret = new ActionList(); @@ -800,7 +800,7 @@ public class ActionListReader { } if (debugMode) { - String atos = a.getASMSource(new ActionList(), new HashSet(), ScriptExportMode.PCODE); + String atos = a.getASMSource(new ActionList(), new HashSet<>(), ScriptExportMode.PCODE); if (a instanceof GraphSourceItemContainer) { atos = a.toString(); } @@ -888,10 +888,10 @@ public class ActionListReader { } else if (!(a instanceof GraphSourceItemContainer)) { //return in for..in, TODO:Handle this better way if (((a instanceof ActionEquals) || (a instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) { - stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); + stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>())); } if ((a instanceof ActionStoreRegister) && stack.isEmpty()) { - stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); + stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>())); } a.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, path); } @@ -920,7 +920,7 @@ public class ActionListReader { List> output2s = new ArrayList<>(); for (long size : cnt.getContainerSizes()) { if (size == 0) { - output2s.add(new ArrayList()); + output2s.add(new ArrayList<>()); continue; } ActionLocalData localData2; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java index 06e412127..dc7fc4b49 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java @@ -122,7 +122,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple { byte[] actionBytes = Action.actionsToBytes(actions, true, SWF.DEFAULT_VERSION); try { SWFInputStream rri = new SWFInputStream(swf, actionBytes); - ActionList newActions = ActionListReader.readActionList(new ArrayList(), rri, SWF.DEFAULT_VERSION, 0, actionBytes.length, "", -1); + ActionList newActions = ActionListReader.readActionList(new ArrayList<>(), rri, SWF.DEFAULT_VERSION, 0, actionBytes.length, "", -1); actions.setActions(newActions); } catch (IOException | InterruptedException ex) { Logger.getLogger(ActionDeobfuscator.class.getName()).log(Level.SEVERE, null, ex); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java index b5eb0a780..25c7cc0e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java @@ -392,9 +392,9 @@ public class ActionScript2Parser { } if (s.type == SymbolType.ASSIGN) { if (isStatic) { - staticVars.add(new MyEntry(pushConst(ident), expression(false, false, true, variables))); + staticVars.add(new MyEntry<>(pushConst(ident), expression(false, false, true, variables))); } else { - vars.add(new MyEntry(pushConst(ident), expression(false, false, true, variables))); + vars.add(new MyEntry<>(pushConst(ident), expression(false, false, true, variables))); } s = lex(); } @@ -1850,7 +1850,7 @@ public class ActionScript2Parser { ActionSourceGenerator gen = new ActionSourceGenerator(swfVersion, constantPool); List ret = new ArrayList<>(); SourceGeneratorLocalData localData = new SourceGeneratorLocalData( - new HashMap(), 0, Boolean.FALSE, 0); + new HashMap<>(), 0, Boolean.FALSE, 0); List srcList = gen.generate(localData, tree); for (GraphSourceItem s : srcList) { if (s instanceof Action) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index f8f203340..d54f73c72 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -582,7 +582,7 @@ public class ActionSourceGenerator implements SourceGenerator { } while (item instanceof GetMemberActionItem); if (item instanceof GetVariableActionItem) { GetVariableActionItem v = (GetVariableActionItem) item; - item = new GetMemberActionItem(null, new GetVariableActionItem(null, new DirectValueActionItem(null, 0, "_global", new ArrayList())), v.name); + item = new GetMemberActionItem(null, new GetVariableActionItem(null, new DirectValueActionItem(null, 0, "_global", new ArrayList<>())), v.name); if (mem != null) { mem.object = item; } @@ -682,7 +682,7 @@ public class ActionSourceGenerator implements SourceGenerator { if (constructor == null) { List val = new ArrayList<>(); - val.add(new ActionDefineFunction("", new ArrayList(), 0, SWF.DEFAULT_VERSION)); + val.add(new ActionDefineFunction("", new ArrayList<>(), 0, SWF.DEFAULT_VERSION)); if (!isInterface) { val.add(new ActionStoreRegister(1)); } @@ -734,7 +734,7 @@ public class ActionSourceGenerator implements SourceGenerator { if (constr.isEmpty()) { List val = new ArrayList<>(); - val.add(new ActionDefineFunction("", new ArrayList(), 0, SWF.DEFAULT_VERSION)); + val.add(new ActionDefineFunction("", new ArrayList<>(), 0, SWF.DEFAULT_VERSION)); if (!isInterface) { val.add(new ActionStoreRegister(1)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index 2163c730a..fe267e33a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -148,7 +148,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta @Override public void translateContainer(List> content, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions) { - FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, 1, new ArrayList()); + FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, 1, new ArrayList<>()); //ActionGraph.translateViaGraph(regNames, variables, functions, code, version) stack.push(fti); functions.put(functionName, fti); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 2677650ca..33bf86221 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -288,7 +288,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont @Override public void translateContainer(List> content, TranslateStack stack, List output, HashMap regNames, HashMap variables, HashMap functions) { - FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, getFirstRegister(), new ArrayList()); + FunctionActionItem fti = new FunctionActionItem(this, functionName, paramNames, content.get(0), constantPool, getFirstRegister(), new ArrayList<>()); functions.put(functionName, fti); stack.push(fti); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java index b8b1d732b..5fdb1d958 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java @@ -98,7 +98,7 @@ public class FontHelper { continue; } if (!ret.containsKey(fam)) { - ret.put(fam, new HashMap()); + ret.put(fam, new HashMap<>()); } ret.get(fam).put(f.getFontName(Locale.ENGLISH), f); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index 526a866f8..a7ea9aeae 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -275,7 +275,7 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer { return timeline; } - timeline = new Timeline(swf, this, new ArrayList(), buttonId, getRect()); + timeline = new Timeline(swf, this, new ArrayList<>(), buttonId, getRect()); initTimeline(timeline); return timeline; } @@ -283,7 +283,7 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer { @Override public void resetTimeline() { if (timeline != null) { - timeline.reset(swf, this, new ArrayList(), buttonId, getRect()); + timeline.reset(swf, this, new ArrayList<>(), buttonId, getRect()); initTimeline(timeline); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index 0f78cfcd9..9b912eb14 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -364,7 +364,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { return timeline; } - timeline = new Timeline(swf, this, new ArrayList(), buttonId, getRect()); + timeline = new Timeline(swf, this, new ArrayList<>(), buttonId, getRect()); initTimeline(timeline); return timeline; } @@ -372,7 +372,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { @Override public void resetTimeline() { if (timeline != null) { - timeline.reset(swf, this, new ArrayList(), buttonId, getRect()); + timeline.reset(swf, this, new ArrayList<>(), buttonId, getRect()); initTimeline(timeline); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index 9dd8b3d2f..773623af0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -83,7 +83,7 @@ public class Graph { if (heads != null) { return; } - heads = makeGraph(code, new ArrayList(), alternateEntries); + heads = makeGraph(code, new ArrayList<>(), alternateEntries); int time = 1; List ordered = new ArrayList<>(); List visited = new ArrayList<>(); @@ -870,7 +870,7 @@ public class Graph { private void markLevels(String path, BaseLocalData localData, GraphPart part, List allParts, List loops) throws InterruptedException { clearLoops(loops); - markLevels(path, localData, part, allParts, loops, new ArrayList(), 1, new ArrayList(), 0); + markLevels(path, localData, part, allParts, loops, new ArrayList<>(), 1, new ArrayList<>(), 0); clearLoops(loops); } @@ -1021,7 +1021,7 @@ public class Graph { private void getLoops(BaseLocalData localData, GraphPart part, List loops, List stopPart) throws InterruptedException { clearLoops(loops); - getLoops(localData, part, loops, stopPart, true, 1, new ArrayList()); + getLoops(localData, part, loops, stopPart, true, 1, new ArrayList<>()); clearLoops(loops); } @@ -1841,7 +1841,7 @@ public class Graph { checkContinueAtTheEnd(finalComm, currentLoop); } if (!finalComm.isEmpty()) { - ret.add(index, li = new ForItem(expr.src, currentLoop, new ArrayList(), exprList.get(exprList.size() - 1), finalComm, commands)); + ret.add(index, li = new ForItem(expr.src, currentLoop, new ArrayList<>(), exprList.get(exprList.size() - 1), finalComm, commands)); } else { ret.add(index, li = new WhileItem(expr.src, currentLoop, exprList, commands)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java index 5c96b3830..1a588fe77 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java @@ -174,7 +174,7 @@ public class GraphPart implements Serializable { for (Loop l : loops) { l.leadsToMark = 0; } - return leadsTo(localData, gr, code, part, new ArrayList(), loops); + return leadsTo(localData, gr, code, part, new ArrayList<>(), loops); } public GraphPart(int start, int end) { @@ -279,7 +279,7 @@ public class GraphPart implements Serializable { } public boolean containsPart(GraphPart what) { - return containsPart(this, what, new ArrayList()); + return containsPart(this, what, new ArrayList<>()); } public List getSubParts() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java index d68832969..814acad44 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphSource.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.BaseLocalData; @@ -93,7 +94,7 @@ public abstract class GraphSource implements Serializable { HashMap> refs = new HashMap<>(); int siz = size(); for (int i = 0; i < siz; i++) { - refs.put(i, new ArrayList()); + refs.put(i, new ArrayList<>()); } visitCode(0, 0, refs, -1); int pos = 0; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java index 84ff19bc6..77f4320ed 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java @@ -47,7 +47,7 @@ public class TypeItem extends GraphTargetItem { } public TypeItem(DottedChain fullTypeName) { - this(fullTypeName, new ArrayList()); + this(fullTypeName, new ArrayList<>()); } public TypeItem(DottedChain fullTypeName, List subtypes) { diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java index 164946db8..97cc1f76e 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java @@ -58,7 +58,7 @@ public class ActionScript2DeobfuscatorTest extends ActionStript2TestBase { HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false); List actions = par.actionsFromString(str); byte[] hex = Action.actionsToBytes(actions, true, SWF.DEFAULT_VERSION); - ActionList list = ActionListReader.readActionListTimeout(new ArrayList(), new SWFInputStream(swf, hex), SWF.DEFAULT_VERSION, 0, hex.length, ""); + ActionList list = ActionListReader.readActionListTimeout(new ArrayList<>(), new SWFInputStream(swf, hex), SWF.DEFAULT_VERSION, 0, hex.length, ""); Action.actionsToSource(null, list, "", writer); return writer.toString(); }