Diamond interface

This commit is contained in:
honfika@gmail.com
2015-06-04 08:20:06 +02:00
parent 75ce6c72fa
commit da99aa3f39
28 changed files with 129 additions and 129 deletions

View File

@@ -1671,7 +1671,7 @@ public final class SWF implements SWFContainerItem, Timelined {
// for..in return
if (((ins instanceof ActionEquals) || (ins instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) {
stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<String>()));
stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>()));
}
if (ins instanceof ActionConstantPool) {

View File

@@ -580,7 +580,7 @@ public class ABC {
MethodBody bod=bodies.get(bodyIdxFromMethodIdx.get(script_info.get(i).init_index));
GraphTextWriter t=new HighlightedTextWriter(Configuration.getCodeFormatting(),false);
try {
bod.toString("script", ScriptExportMode.PCODE, this, null, constants, method_info, t, new ArrayList<String>());
bod.toString("script", ScriptExportMode.PCODE, this, null, constants, method_info, t, new ArrayList<>());
} catch (InterruptedException ex) {
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, null, ex);
}
@@ -714,11 +714,11 @@ public class ABC {
public MethodBody findBodyByClassAndName(String className, String methodName) {
for (int i = 0; i < instance_info.size(); i++) {
if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList<String>(), true))) {
if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList<>(), true))) {
for (Trait t : instance_info.get(i).instance_traits.traits) {
if (t instanceof TraitMethodGetterSetter) {
TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t;
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<String>(), true))) {
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<>(), true))) {
for (MethodBody body : bodies) {
if (body.method_info == t2.method_info) {
return body;
@@ -731,11 +731,11 @@ public class ABC {
}
}
for (int i = 0; i < class_info.size(); i++) {
if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList<String>(), true))) {
if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList<>(), true))) {
for (Trait t : class_info.get(i).static_traits.traits) {
if (t instanceof TraitMethodGetterSetter) {
TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t;
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<String>(), true))) {
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<>(), true))) {
for (MethodBody body : bodies) {
if (body.method_info == t2.method_info) {
return body;
@@ -881,19 +881,19 @@ public class ABC {
output = new Utf8PrintWriter(os);
constants.dump(output);
for (int i = 0; i < method_info.size(); i++) {
output.println("MethodInfo[" + i + "]:" + method_info.get(i).toString(constants, new ArrayList<String>()));
output.println("MethodInfo[" + i + "]:" + method_info.get(i).toString(constants, new ArrayList<>()));
}
for (int i = 0; i < metadata_info.size(); i++) {
output.println("MetadataInfo[" + i + "]:" + metadata_info.get(i).toString(constants));
}
for (int i = 0; i < instance_info.size(); i++) {
output.println("InstanceInfo[" + i + "]:" + instance_info.get(i).toString(this, new ArrayList<String>()));
output.println("InstanceInfo[" + i + "]:" + instance_info.get(i).toString(this, new ArrayList<>()));
}
for (int i = 0; i < class_info.size(); i++) {
output.println("ClassInfo[" + i + "]:" + class_info.get(i).toString(this, new ArrayList<String>()));
output.println("ClassInfo[" + i + "]:" + class_info.get(i).toString(this, new ArrayList<>()));
}
for (int i = 0; i < script_info.size(); i++) {
output.println("ScriptInfo[" + i + "]:" + script_info.get(i).toString(this, new ArrayList<String>()));
output.println("ScriptInfo[" + i + "]:" + script_info.get(i).toString(this, new ArrayList<>()));
}
for (int i = 0; i < bodies.size(); i++) {
output.println("MethodBody[" + i + "]:"); //+ bodies[i].toString(this, constants, method_info));
@@ -1008,7 +1008,7 @@ public class ABC {
if (classId > -1) {
for (Trait t : instance_info.get(classId).instance_traits.traits) {
if (t instanceof TraitMethodGetterSetter) {
if (t.getName(this).getName(constants, new ArrayList<String>(), true).equals(methodName)) {
if (t.getName(this).getName(constants, new ArrayList<>(), true).equals(methodName)) {
return ((TraitMethodGetterSetter) t).method_info;
}
}
@@ -1021,7 +1021,7 @@ public class ABC {
if (classId > -1) {
for (Trait t : instance_info.get(classId).instance_traits.traits) {
if (t instanceof TraitMethodGetterSetter) {
if (t.getName(this).getName(constants, new ArrayList<String>(), true).equals(methodName)) {
if (t.getName(this).getName(constants, new ArrayList<>(), true).equals(methodName)) {
return findBodyIndex(((TraitMethodGetterSetter) t).method_info);
}
}

View File

@@ -98,7 +98,7 @@ public class ScriptPack extends AS3ClassTreeItem {
Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc);
Namespace ns = name.getNamespace(abc.constants);
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
scriptName = name.getName(abc.constants, new ArrayList<String>(), false);
scriptName = name.getName(abc.constants, new ArrayList<>(), false);
}
}
return scriptName;
@@ -112,7 +112,7 @@ public class ScriptPack extends AS3ClassTreeItem {
Namespace ns = name.getNamespace(abc.constants);
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
packageName = ns.getName(abc.constants);
scriptName = name.getName(abc.constants, new ArrayList<String>());
scriptName = name.getName(abc.constants, new ArrayList<>());
}
}
return packageName.equals("") ? scriptName : packageName + "." + scriptName;
@@ -139,9 +139,9 @@ public class ScriptPack extends AS3ClassTreeItem {
Multiname name = trait.getName(abc);
Namespace ns = name.getNamespace(abc.constants);
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
trait.convertPackaged(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
trait.convertPackaged(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<>(), parallel);
} else {
trait.convert(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
trait.convert(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<>(), parallel);
}
}
}
@@ -157,9 +157,9 @@ public class ScriptPack extends AS3ClassTreeItem {
Multiname name = trait.getName(abc);
Namespace ns = name.getNamespace(abc.constants);
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
trait.toStringPackaged(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
trait.toStringPackaged(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<>(), parallel);
} else {
trait.toString(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
trait.toString(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<>(), parallel);
}
first = false;

View File

@@ -1018,10 +1018,10 @@ public class AVM2Code implements Cloneable {
offsets.add((long) body.exceptions[e].target);
writer.appendNoHilight(" type ");
writer.hilightSpecial(body.exceptions[e].type_index == 0 ? "null" : constants.getMultiname(body.exceptions[e].type_index).toString(constants, new ArrayList<String>()), HighlightSpecialType.TRY_TYPE, e);
writer.hilightSpecial(body.exceptions[e].type_index == 0 ? "null" : constants.getMultiname(body.exceptions[e].type_index).toString(constants, new ArrayList<>()), HighlightSpecialType.TRY_TYPE, e);
writer.appendNoHilight(" name ");
writer.hilightSpecial(body.exceptions[e].name_index == 0 ? "null" : constants.getMultiname(body.exceptions[e].name_index).toString(constants, new ArrayList<String>()), HighlightSpecialType.TRY_NAME, e);
writer.hilightSpecial(body.exceptions[e].name_index == 0 ? "null" : constants.getMultiname(body.exceptions[e].name_index).toString(constants, new ArrayList<>()), HighlightSpecialType.TRY_NAME, e);
writer.newLine();
}
@@ -1079,7 +1079,7 @@ public class AVM2Code implements Cloneable {
continue;
}
writer.append("", ins2.mappedOffset > -1 ? ins2.mappedOffset : ofs);
writer.appendNoHilight(ins2.toStringNoAddress(constants, new ArrayList<String>()) + " ;copy from " + Helper.formatAddress(pos2adr((Integer) o)));
writer.appendNoHilight(ins2.toStringNoAddress(constants, new ArrayList<>()) + " ;copy from " + Helper.formatAddress(pos2adr((Integer) o)));
writer.newLine();
outputMap.add((Integer) o);
} else if (o instanceof ControlFlowTag) {
@@ -1115,7 +1115,7 @@ public class AVM2Code implements Cloneable {
if (ins.changeJumpTo > -1) {
writer.appendNoHilight(ins.definition.instructionName + " ofs" + Helper.formatAddress(pos2adr(ins.changeJumpTo)));
} else {
writer.appendNoHilight(ins.toStringNoAddress(constants, new ArrayList<String>()));
writer.appendNoHilight(ins.toStringNoAddress(constants, new ArrayList<>()));
}
}
writer.newLine();
@@ -1930,7 +1930,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<Integer, GraphTargetItem>(), new ScopeStack(), abc, body, new HashMap<Integer, String>(), new ArrayList<String>(), new HashMap<Integer, Integer>(), refs), 0, path, refs);
ret += removeTraps(constants, trait, info, body, localData, new AVM2GraphSource(this, false, -1, -1, new HashMap<Integer, GraphTargetItem>(), new ScopeStack(), abc, body, new HashMap<Integer, String>(), new ArrayList<>(), new HashMap<Integer, Integer>(), refs), 0, path, refs);
removeIgnored(constants, trait, info, body);
removeDeadCode(constants, trait, info, body);

View File

@@ -426,7 +426,7 @@ public class AVM2ConstantPool {
}
for (int i = 1; i < constant_multiname.size(); i++) {
writer.println("Multiname[" + i + "]=" + constant_multiname.get(i).toString(this, new ArrayList<String>()));
writer.println("Multiname[" + i + "]=" + constant_multiname.get(i).toString(this, new ArrayList<>()));
}
}
@@ -434,7 +434,7 @@ public class AVM2ConstantPool {
if (index == 0) {
return "null";
}
return constant_multiname.get(index).toString(this, new ArrayList<String>());
return constant_multiname.get(index).toString(this, new ArrayList<>());
}
public String namespaceToString(int index) {

View File

@@ -1200,14 +1200,14 @@ public class AVM2SourceGenerator implements SourceGenerator {
generateTraitsPhase3(initScope, isInterface, name, superName, true, localData, traitItems, classInfo.static_traits, st, new HashMap<Trait, Integer>(), class_index);
int init = 0;
if (constructor == null || isInterface) {
instanceInfo.iinit_index = init = method(false, isInterface, new ArrayList<MethodBody>(), pkg, false, new ArrayList<AssignableAVM2Item>(), initScope + 1, false, 0, isInterface ? null : name, extendsVal != null ? extendsVal.toString() : null, true, localData, new ArrayList<GraphTargetItem>(), new ArrayList<String>(), new ArrayList<GraphTargetItem>(), new ArrayList<GraphTargetItem>(), TypeItem.UNBOUNDED/*?? FIXME*/);
instanceInfo.iinit_index = init = method(false, isInterface, new ArrayList<MethodBody>(), pkg, false, new ArrayList<AssignableAVM2Item>(), initScope + 1, false, 0, isInterface ? null : name, extendsVal != null ? extendsVal.toString() : null, true, localData, new ArrayList<GraphTargetItem>(), new ArrayList<>(), new ArrayList<GraphTargetItem>(), new ArrayList<GraphTargetItem>(), TypeItem.UNBOUNDED/*?? FIXME*/);
} else {
MethodAVM2Item m = (MethodAVM2Item) constructor;
instanceInfo.iinit_index = init = method(false, false, new ArrayList<MethodBody>(), 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<MethodBody>(), pkg, staticNeedsActivation, sinitVariables, initScope + (implementsStr.isEmpty() ? 0 : 1), false, 0, isInterface ? null : name, superName, false, localData, new ArrayList<GraphTargetItem>(), new ArrayList<String>(), new ArrayList<GraphTargetItem>(), staticInit, TypeItem.UNBOUNDED);
int staticMi = method(false, false, new ArrayList<MethodBody>(), pkg, staticNeedsActivation, sinitVariables, initScope + (implementsStr.isEmpty() ? 0 : 1), false, 0, isInterface ? null : name, superName, false, localData, new ArrayList<GraphTargetItem>(), new ArrayList<>(), new ArrayList<GraphTargetItem>(), staticInit, TypeItem.UNBOUNDED);
MethodBody sinitBody = abc.findBody(staticMi);
List<AVM2Instruction> sinitcode = new ArrayList<>();
@@ -1695,7 +1695,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, true));
}
NameAVM2Item d = new NameAVM2Item(type, 0, tsc.getName(abc).getName(abc.constants, new ArrayList<String>(), true), NameAVM2Item.getDefaultValue("" + type), true, new ArrayList<Integer>());
NameAVM2Item d = new NameAVM2Item(type, 0, tsc.getName(abc).getName(abc.constants, new ArrayList<>(), true), NameAVM2Item.getDefaultValue("" + type), true, new ArrayList<Integer>());
d.setSlotNumber(tsc.slot_id);
d.setSlotScope(slotScope);
mbodyCode.addAll(0, toInsList(d.toSourceIgnoreReturnValue(localData, this)));
@@ -1957,7 +1957,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<GraphTargetItem>(), new ArrayList<String>(), abc, allABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>());
((UnresolvedAVM2Item) un).resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<>(), abc, allABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>());
un = ((UnresolvedAVM2Item) un).resolved;
}
if (!(un instanceof TypeItem)) { //not applyType
@@ -2132,7 +2132,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<String>(), null/*FIXME*/, commands, traitArr, new ArrayList<Integer>(), localData);
generateTraitsPhase2(new ArrayList<>(), null/*FIXME*/, commands, traitArr, new ArrayList<Integer>(), localData);
MethodInfo mi = new MethodInfo(new int[0], 0, 0, 0, new ValueKind[0], new int[0]);
MethodBody mb = new MethodBody();
mb.method_info = abc.addMethodInfo(mi);
@@ -2160,7 +2160,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
mbCode.add(ins(new PushNullIns()));
} else {
parentNamesAddNames(abc, allABCs, abc.instance_info.get(tc.class_info).name_index, parents, new ArrayList<String>(), new ArrayList<String>());
parentNamesAddNames(abc, allABCs, abc.instance_info.get(tc.class_info).name_index, parents, new ArrayList<>(), new ArrayList<>());
for (int i = parents.size() - 1; i >= 1; i--) {
mbCode.add(ins(new GetLexIns(), parents.get(i)));
mbCode.add(ins(new PushScopeIns()));
@@ -2205,7 +2205,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
indices.add(
abc.constants.getMultinameId(
new Multiname(Multiname.QNAME,
abc.constants.getStringId(superName.getName(a.constants, new ArrayList<String>(), true), true),
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<Integer>()), true)
);
}
@@ -2261,7 +2261,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
for (Trait t : ii.traits.traits) {
if (eq(pkg, t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true))) {
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(), true))) {
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<>(), true))) {
outName.setVal(obj);
outNs.setVal(pkg);
outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true));
@@ -2284,7 +2284,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
continue;
}
Multiname clsName = ii.getName(abc.constants);
if (obj.equals(clsName.getName(abc.constants, new ArrayList<String>(), true))) {
if (obj.equals(clsName.getName(abc.constants, new ArrayList<>(), true))) {
if (eq(pkg, clsName.getNamespace(abc.constants).getName(abc.constants, true))) {
//class found
@@ -2292,7 +2292,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (t.getName(abc) == null) { //in traits phase 2
continue;
}
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(), true))) {
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<>(), true))) {
outName.setVal(obj);
outNs.setVal(pkg);
outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true));
@@ -2312,7 +2312,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (t.getName(abc) == null) { //in traits phase 2
continue;
}
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(), true))) {
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<>(), true))) {
outName.setVal(obj);
outNs.setVal(pkg);
outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true));
@@ -2330,7 +2330,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
Multiname superName = abc.constants.constant_multiname.get(ii.super_index);
if (superName != null) {
return searchPrototypeChain(instanceOnly, abcs, superName.getNamespace(abc.constants).getName(abc.constants, true), superName.getName(abc.constants, new ArrayList<String>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue);
return searchPrototypeChain(instanceOnly, abcs, superName.getNamespace(abc.constants).getName(abc.constants, true), superName.getName(abc.constants, new ArrayList<>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue);
} else {
return false;
}
@@ -2343,7 +2343,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
public static void parentNames(ABC abc, List<ABC> allABCs, int name_index, List<Integer> indices, List<String> names, List<String> namespaces, List<ABC> outABCs) {
indices.add(name_index);
names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, new ArrayList<String>(), true));
names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, new ArrayList<>(), true));
namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants, true));
Multiname mname = abc.constants.constant_multiname.get(name_index);
@@ -2356,7 +2356,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
for (ABC a : abcs) {
for (int i = 0; i < a.instance_info.size(); i++) {
Multiname m = a.constants.constant_multiname.get(a.instance_info.get(i).name_index);
if (m.getName(a.constants, new ArrayList<String>(), true).equals(mname.getName(abc.constants, new ArrayList<String>(), true))) {
if (m.getName(a.constants, new ArrayList<>(), true).equals(mname.getName(abc.constants, new ArrayList<>(), true))) {
if (m.getNamespace(a.constants).hasName(mname.getNamespace(abc.constants).getName(abc.constants, true), a.constants)) {
//Multiname superName = a.constants.constant_multiname.get(a.instance_info.get(i).super_index);
@@ -2366,7 +2366,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
/*parentNames(abc,allABCs,abc.constants.getMultinameId(
new Multiname(superName.kind,
abc.constants.getStringId(superName.getName(a.constants, new ArrayList<String>()),true),
abc.constants.getStringId(superName.getName(a.constants, new ArrayList<>()),true),
abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants),true)),0,true), 0, 0, new ArrayList<Integer>()), true),indices,names,namespaces,outABCs);*/
return;
}
@@ -2390,7 +2390,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (ci != -1) {
Multiname tname = a.instance_info.get(ci).getName(a.constants);
return abc.constants.getMultinameId(new Multiname(tname.kind,
abc.constants.getStringId(tname.getName(a.constants, new ArrayList<String>()), true),
abc.constants.getStringId(tname.getName(a.constants, new ArrayList<>()), true),
abc.constants.getNamespaceId(new Namespace(tname.getNamespace(a.constants).kind, abc.constants.getStringId(tname.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList<Integer>()), true);
}
}
@@ -2424,7 +2424,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (item instanceof UnresolvedAVM2Item) {
String fullClass = localData.getFullClass();
item = ((UnresolvedAVM2Item) item).resolve(new TypeItem(fullClass), new ArrayList<GraphTargetItem>(), new ArrayList<String>(), abc, allABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>());
item = ((UnresolvedAVM2Item) item).resolve(new TypeItem(fullClass), new ArrayList<GraphTargetItem>(), new ArrayList<>(), abc, allABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>());
}
if (item instanceof TypeItem) {
typeItem = item;
@@ -2435,7 +2435,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
if (typeItem instanceof UnresolvedAVM2Item) {
String fullClass = localData.getFullClass();
typeItem = ((UnresolvedAVM2Item) typeItem).resolve(new TypeItem(fullClass), new ArrayList<GraphTargetItem>(), new ArrayList<String>(), abc, allABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>());
typeItem = ((UnresolvedAVM2Item) typeItem).resolve(new TypeItem(fullClass), new ArrayList<GraphTargetItem>(), new ArrayList<>(), abc, allABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>());
}
if (!(typeItem instanceof TypeItem)) {
@@ -2452,7 +2452,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
for (InstanceInfo ii : abc.instance_info) {
Multiname mname = abc.constants.constant_multiname.get(ii.name_index);
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<String>(), true))) {
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<>(), true))) {
if (mname.getNamespace(abc.constants).hasName(pkg, abc.constants)) {
name_index = ii.name_index;
break;
@@ -2461,7 +2461,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
for (int i = 1; i < abc.constants.constant_multiname.size(); i++) {
Multiname mname = abc.constants.constant_multiname.get(i);
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<String>(), true))) {
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<>(), true))) {
if (mname.getNamespace(abc.constants) != null && pkg.equals(mname.getNamespace(abc.constants).getName(abc.constants, true))) {
name_index = i;
break;
@@ -2471,7 +2471,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (name_index == 0) {
if (pkg.isEmpty() && localData.currentScript != null /*FIXME!*/) {
for (Trait t : localData.currentScript.traits.traits) {
if (t.getName(abc).getName(abc.constants, new ArrayList<String>(), true).equals(name)) {
if (t.getName(abc).getName(abc.constants, new ArrayList<>(), true).equals(name)) {
name_index = t.name_index;
break;
}

View File

@@ -931,7 +931,7 @@ public class ActionScriptParser {
List<String> names = new ArrayList<>();
List<String> namespaces = new ArrayList<>();
//FIXME for Private classes in script!!!
AVM2SourceGenerator.parentNamesAddNames(abc, otherABCs, AVM2SourceGenerator.resolveType(new SourceGeneratorLocalData(new HashMap<String, Integer>(), 0, false, 0), ((TypeItem) ((UnresolvedAVM2Item) extendsStr).resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<String>(), abc, otherABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>())), abc, otherABCs), indices, names, namespaces);
AVM2SourceGenerator.parentNamesAddNames(abc, otherABCs, AVM2SourceGenerator.resolveType(new SourceGeneratorLocalData(new HashMap<String, Integer>(), 0, false, 0), ((TypeItem) ((UnresolvedAVM2Item) extendsStr).resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<>(), abc, otherABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>())), abc, otherABCs), indices, names, namespaces);
for (int i = 0; i < names.size(); i++) {
if (namespaces.get(i).isEmpty()) {
continue;
@@ -1585,7 +1585,7 @@ public class ActionScriptParser {
UnresolvedAVM2Item ui = (UnresolvedAVM2Item) a;
if (ui.getVariableName().equals(e.getVariableName())) {
try {
ui.resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<String>(), abc, otherABCs, new ArrayList<MethodBody>(), variables);
ui.resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<>(), abc, otherABCs, new ArrayList<MethodBody>(), variables);
} catch (CompilationException ex) {
// ignore
}
@@ -1608,7 +1608,7 @@ public class ActionScriptParser {
for (NameAVM2Item e : catchExceptions) {
if (ui.getVariableName().equals(e.getVariableName())) {
try {
ui.resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<String>(), abc, otherABCs, new ArrayList<MethodBody>(), variables);
ui.resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<>(), abc, otherABCs, new ArrayList<MethodBody>(), variables);
} catch (CompilationException ex) {
// ignore
}
@@ -2348,7 +2348,7 @@ public class ActionScriptParser {
openedNamespaces.add(publicNs = abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, abc.constants.getStringId("", true)), 0, true));
List<GraphTargetItem> items = new ArrayList<>();
traits(fileName, true, new ArrayList<AssignableAVM2Item>(), new Reference<>(false), new ArrayList<GraphTargetItem>(), new ArrayList<String>(), scriptPrivateNs, 0, publicNs, 0, 0, openedNamespaces, null, null, false, items);
traits(fileName, true, new ArrayList<AssignableAVM2Item>(), new Reference<>(false), new ArrayList<GraphTargetItem>(), new ArrayList<>(), scriptPrivateNs, 0, publicNs, 0, 0, openedNamespaces, null, null, false, items);
return items;
}

View File

@@ -164,7 +164,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
for (int h = 0; h < a.instance_info.size(); h++) {
InstanceInfo ii = a.instance_info.get(h);
Multiname n = a.constants.constant_multiname.get(ii.name_index);
if (name.equals(n.getName(a.constants, new ArrayList<String>())) && n.getNamespace(a.constants).hasName(nsname,a.constants)) {
if (name.equals(n.getName(a.constants, new ArrayList<>())) && n.getNamespace(a.constants).hasName(nsname,a.constants)) {
Reference<String> outName = new Reference<>("");
Reference<String> outNs = new Reference<>("");
Reference<String> outPropNs = new Reference<>("");
@@ -225,7 +225,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
Reference<Integer> outPropNsIndex = new Reference<>(0);
Reference<GraphTargetItem> outPropType = new Reference<>(null);
Reference<ValueKind> outPropValue = new Reference<>(null);
if (AVM2SourceGenerator.searchPrototypeChain(false, abcs, m.getNamespace(a.constants).getName(a.constants, true), m.getName(a.constants, new ArrayList<String>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) {
if (AVM2SourceGenerator.searchPrototypeChain(false, abcs, m.getNamespace(a.constants).getName(a.constants, true), m.getName(a.constants, new ArrayList<>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) {
objType = new TypeItem("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal());
propType = outPropType.getVal();
propIndex = abc.constants.getMultinameId(new Multiname(Multiname.QNAME,
@@ -245,7 +245,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
for (MethodBody b : callStack) {
for (int i = 0; i < b.traits.traits.size(); i++) {
Trait t = b.traits.traits.get(i);
if (t.getName(abc).getName(abc.constants, new ArrayList<String>(), true).equals(propertyName)) {
if (t.getName(abc).getName(abc.constants, new ArrayList<>(), true).equals(propertyName)) {
if (t instanceof TraitSlotConst) {
TraitSlotConst tsc = (TraitSlotConst) t;
objType = new TypeItem("Function");
@@ -268,7 +268,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
int name_index = 0;
for (int m = 1; m < abc.constants.constant_multiname.size(); m++) {
Multiname mname = abc.constants.constant_multiname.get(m);
if (mname.kind == Multiname.QNAME && mname.getName(abc.constants, new ArrayList<String>(), true).equals(propertyName) && mname.namespace_index == nsindex) {
if (mname.kind == Multiname.QNAME && mname.getName(abc.constants, new ArrayList<>(), true).equals(propertyName) && mname.namespace_index == nsindex) {
name_index = m;
break;
}
@@ -343,7 +343,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
Reference<GraphTargetItem> outPropType = new Reference<>(null);
Reference<ValueKind> outPropValue = new Reference<>(null);
if (propertyName != null && AVM2SourceGenerator.searchPrototypeChain(false, abcs, nsname, n.getName(a.constants, new ArrayList<String>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) {
if (propertyName != null && AVM2SourceGenerator.searchPrototypeChain(false, abcs, nsname, n.getName(a.constants, new ArrayList<>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) {
objType = new TypeItem("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal());
propType = outPropType.getVal();
propIndex = abc.constants.getMultinameId(new Multiname(Multiname.QNAME,
@@ -405,7 +405,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
int name_index = 0;
for (int m = 1; m < abc.constants.constant_multiname.size(); m++) {
Multiname mname = abc.constants.constant_multiname.get(m);
if (mname.kind == Multiname.QNAME && mname.getName(abc.constants, new ArrayList<String>()).equals(propertyName) && mname.namespace_index == nsindex) {
if (mname.kind == Multiname.QNAME && mname.getName(abc.constants, new ArrayList<>()).equals(propertyName) && mname.namespace_index == nsindex) {
name_index = m;
break;
}
@@ -445,7 +445,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
Reference<String> outNs = new Reference<>("");
Reference<String> outPropNs = new Reference<>("");
Reference<Integer> outPropNsKind = new Reference<>(1);
if (AVM2SourceGenerator.searchPrototypeChain(abcs, nsname, n.getName(a.constants, new ArrayList<String>()), propertyName, outName, outNs, outPropNs, outPropNsKind)) {
if (AVM2SourceGenerator.searchPrototypeChain(abcs, nsname, n.getName(a.constants, new ArrayList<>()), propertyName, outName, outNs, outPropNs, outPropNsKind)) {
return "".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal();
}
}
@@ -471,7 +471,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
int ci = a.findClassByName(objType);
if (ci != -1) {
for (Trait t : a.instance_info.get(ci).instance_traits.traits) {
String tnames = t.getName(a).getName(a.constants, new ArrayList<String>());
String tnames = t.getName(a).getName(a.constants, new ArrayList<>());
if (tnames.equals(propertyName)) {
if (t instanceof TraitSlotConst) {
TraitSlotConst tsc = (TraitSlotConst) t;
@@ -514,7 +514,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
if (ci != -1) {
for (Trait t : a.instance_info.get(ci).instance_traits.traits) {
Multiname tname = t.getName(a);
String tnames = t.getName(a).getName(a.constants, new ArrayList<String>());
String tnames = t.getName(a).getName(a.constants, new ArrayList<>());
if (tnames.equals(propertyName)) {
return abc.constants.getMultinameId(new Multiname(tname.kind,
abc.constants.getStringId(tnames, true),
@@ -523,7 +523,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
}
for (Trait t : a.class_info.get(ci).static_traits.traits) {
Multiname tname = t.getName(a);
String tnames = t.getName(a).getName(a.constants, new ArrayList<String>());
String tnames = t.getName(a).getName(a.constants, new ArrayList<>());
if (tnames.equals(propertyName)) {
return abc.constants.getMultinameId(new Multiname(tname.kind,
abc.constants.getStringId(tnames, true),
@@ -538,7 +538,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
for (ScriptInfo si : a.script_info) {
for (Trait t : si.traits.traits) {
Multiname tname = t.getName(a);
String tnames = t.getName(a).getName(a.constants, new ArrayList<String>());
String tnames = t.getName(a).getName(a.constants, new ArrayList<>());
if (tnames.equals(propertyName)) {
return abc.constants.getMultinameId(new Multiname(tname.kind,
abc.constants.getStringId(tnames, true),

View File

@@ -395,14 +395,14 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item {
}
if ((a.instance_info.get(c).getName(a.constants) != null && a == abc && a.instance_info.get(c).getName(a.constants).namespace_index == ni)
|| (ons.kind != Namespace.KIND_PRIVATE && a.instance_info.get(c).getName(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants).hasName(ons.getName(abc.constants, true), a.constants))) {
String cname = a.instance_info.get(c).getName(a.constants).getName(a.constants, new ArrayList<String>(), true);
String cname = a.instance_info.get(c).getName(a.constants).getName(a.constants, new ArrayList<>(), true);
if (parts.get(0).equals(cname)) {
if (!subtypes.isEmpty() && parts.size() > 1) {
continue;
}
TypeItem ret = new TypeItem(a.instance_info.get(c).getName(a.constants).getNameWithNamespace(a.constants, true));
/*for (String s : subtypes) {
UnresolvedAVM2Item su = new UnresolvedAVM2Item(new ArrayList<String>(), importedClasses, true, null, line, s, null, openedNamespaces);
UnresolvedAVM2Item su = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, true, null, line, s, null, openedNamespaces);
su.resolve(thisType, paramTypes, paramNames, abc, otherAbcs, callStack, variables);
if (!(su.resolved instanceof TypeItem)) {
throw new CompilationException("Not a type", line);
@@ -472,7 +472,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item {
if (/*!subtypes.isEmpty() && */parts.size() == 1 && parts.get(0).equals("Vector")) {
TypeItem ret = new TypeItem("__AS3__.vec.Vector");
/*for (String s : subtypes) {
UnresolvedAVM2Item su = new UnresolvedAVM2Item(new ArrayList<String>(), importedClasses, true, null, line, s, null, openedNamespaces);
UnresolvedAVM2Item su = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, true, null, line, s, null, openedNamespaces);
su.resolve(thisType, paramTypes, paramNames, abc, otherAbcs, callStack, variables);
if (!(su.resolved instanceof TypeItem)) {
throw new CompilationException("Not a type", line);

View File

@@ -97,7 +97,7 @@ public class InstanceInfo {
}
writer.appendNoHilight(modifiers + objType);
writer.hilightSpecial(abc.constants.getMultiname(name_index).getName(abc.constants, new ArrayList<String>()/* 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, true);

View File

@@ -194,7 +194,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<String>(), false);
String objectName = name.getName(abc.constants, new ArrayList<>(), false);
return new ClassPath(packageName, objectName); //assume not null name
}
}

View File

@@ -379,7 +379,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
//imports
List<String> imports = new ArrayList<>();
List<String> uses = new ArrayList<>();
getImportsUsages(abc, imports, uses, new ArrayList<String>());
getImportsUsages(abc, imports, uses, new ArrayList<>());
fullyQualifiedNames = new ArrayList<>();
@@ -398,7 +398,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
importnames.add(name);
}
}
/*List<String> imports2 = new ArrayList<String>();
/*List<String> imports2 = new ArrayList<>();
for (String path : imports) {
String name = path;
String pkg = "";
@@ -500,7 +500,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
writer.startMethod(abc.instance_info.get(class_info).iinit_index);
writer.appendNoHilight(modifier);
writer.appendNoHilight("function ");
writer.appendNoHilight(abc.constants.getMultiname(abc.instance_info.get(class_info).name_index).getName(abc.constants, new ArrayList<String>()/*do not want full names here*/, false));
writer.appendNoHilight(abc.constants.getMultiname(abc.instance_info.get(class_info).name_index).getName(abc.constants, new ArrayList<>()/*do not want full names here*/, false));
writer.appendNoHilight("(");
bodyIndex = abc.findBodyIndex(abc.instance_info.get(class_info).iinit_index);
if (bodyIndex != -1) {

View File

@@ -41,13 +41,13 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage {
NulWriter nulWriter = new NulWriter();
if (parentTraitIndex > -1) {
if (isStatic) {
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<>(), false);
} else {
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<>(), false);
}
}
try {
((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<>(), false);
} catch (InterruptedException ex) {
// ignore
}
@@ -56,13 +56,13 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage {
writer.appendNoHilight(super.toString() + " ");
if (parentTraitIndex > -1) {
if (isStatic) {
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<>(), false);
} else {
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<>(), false);
}
}
try {
((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<>(), false);
} catch (InterruptedException ex) {
// ignore
}

View File

@@ -48,12 +48,12 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage {
if (!isInitializer) {
if (parentTraitIndex > -1) {
if (isStatic) {
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<>(), false);
} else {
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<>(), false);
}
}
((TraitMethodGetterSetter) traits.traits.get(traitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
((TraitMethodGetterSetter) traits.traits.get(traitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<>(), false);
}
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
@@ -68,13 +68,13 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage {
} else {
if (parentTraitIndex > -1) {
if (isStatic) {
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<>(), false);
} else {
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<>(), false);
}
writer.appendNoHilight(" ");
}
((TraitMethodGetterSetter) traits.traits.get(traitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
((TraitMethodGetterSetter) traits.traits.get(traitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<>(), false);
}
return writer.toString();
}

View File

@@ -34,6 +34,6 @@ public class TypeNameMultinameUsage extends MultinameUsage {
@Override
public String toString() {
return "TypeName " + abc.constants.getMultiname(typename_index).toString(abc.constants, new ArrayList<String>());
return "TypeName " + abc.constants.getMultiname(typename_index).toString(abc.constants, new ArrayList<>());
}
}

View File

@@ -967,9 +967,9 @@ public abstract class Action implements GraphSourceItem {
List<GraphTargetItem> tryCommands = ActionGraph.translateViaGraph(registerNames, variables, functions, atry.tryBody, version);
ActionItem catchName;
if (atry.catchInRegisterFlag) {
catchName = new DirectValueActionItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList<String>());
catchName = new DirectValueActionItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList<>());
} else {
catchName = new DirectValueActionItem(atry, -1, atry.catchName, new ArrayList<String>());
catchName = new DirectValueActionItem(atry, -1, atry.catchName, new ArrayList<>());
}
List<GraphTargetItem> catchExceptions = new ArrayList<GraphTargetItem>();
catchExceptions.add(catchName);

View File

@@ -120,7 +120,7 @@ public class ActionGraph extends Graph {
break;
}
} else {
target = new DirectValueActionItem(null, 0, st.target, new ArrayList<String>());
target = new DirectValueActionItem(null, 0, st.target, new ArrayList<>());
targetStart = t;
targetStartItem = it;
}

View File

@@ -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<String>()));
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<String>()));
stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>()));
}
a.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, path);
}

View File

@@ -43,7 +43,7 @@ public class DirectValueActionItem extends ActionItem {
public GraphTargetItem computedRegValue;
public DirectValueActionItem(Object o) {
this(null, 0, o, new ArrayList<String>());
this(null, 0, o, new ArrayList<>());
}
public DirectValueActionItem(GraphSourceItem instruction, int instructionPos, Object value, List<String> constants) {

View File

@@ -632,7 +632,7 @@ public class ActionScriptParser {
}
} else {
lexer.pushback(s);
target = new DirectValueActionItem(null, 0, "", new ArrayList<String>());
target = new DirectValueActionItem(null, 0, "", new ArrayList<>());
}
expectedType(SymbolType.PARENT_CLOSE);
ret = new GetURL2ActionItem(null, url, target, getuMethod);
@@ -816,7 +816,7 @@ public class ActionScriptParser {
lockCenter = (expression(inFunction, inMethod, true, variables));
s = lex();
if (s.type == SymbolType.COMMA) {
constrain = new DirectValueActionItem(null, 0, 1L, new ArrayList<String>());
constrain = new DirectValueActionItem(null, 0, 1L, new ArrayList<>());
x1 = (expression(inFunction, inMethod, true, variables));
s = lex();
if (s.type == SymbolType.COMMA) {
@@ -829,28 +829,28 @@ public class ActionScriptParser {
y2 = (expression(inFunction, inMethod, true, variables));
} else {
lexer.pushback(s);
y2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
y2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
}
} else {
lexer.pushback(s);
x2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
y2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
x2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
y2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
}
} else {
lexer.pushback(s);
x2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
y2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
y1 = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
x2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
y2 = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
y1 = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
}
} else {
lexer.pushback(s);
constrain = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
constrain = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
//ret.add(new ActionPush(Boolean.FALSE));
}
} else {
lockCenter = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
constrain = new DirectValueActionItem(null, 0, 0L, new ArrayList<String>());
lockCenter = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
constrain = new DirectValueActionItem(null, 0, 0L, new ArrayList<>());
lexer.pushback(s);
}
expectedType(SymbolType.PARENT_CLOSE);
@@ -1142,7 +1142,7 @@ public class ActionScriptParser {
case RETURN:
GraphTargetItem retexpr = expression(inFunction, inMethod, true, variables);
if (retexpr == null) {
retexpr = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList<String>());
retexpr = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList<>());
}
ret = new ReturnActionItem(null, retexpr);
break;
@@ -1582,10 +1582,10 @@ public class ActionScriptParser {
case MINUS:
s = lex();
if (s.isType(SymbolType.DOUBLE)) {
ret = new DirectValueActionItem(null, 0, -(double) (Double) s.value, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, -(double) (Double) s.value, new ArrayList<>());
} else if (s.isType(SymbolType.INTEGER)) {
ret = new DirectValueActionItem(null, 0, -(long) (Long) s.value, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, -(long) (Long) s.value, new ArrayList<>());
} else {
lexer.pushback(s);
@@ -1608,7 +1608,7 @@ public class ActionScriptParser {
((DirectValueActionItem) num).value = -(Float) ((DirectValueActionItem) num).value;
ret = (num);
} else {;
ret = (new SubtractActionItem(null, new DirectValueActionItem(null, 0, (Long) 0L, new ArrayList<String>()), num));
ret = (new SubtractActionItem(null, new DirectValueActionItem(null, 0, (Long) 0L, new ArrayList<>()), num));
}
}
break;
@@ -1617,18 +1617,18 @@ public class ActionScriptParser {
allowMemberOrCall = true;
break;
case TRUE:
ret = new DirectValueActionItem(null, 0, Boolean.TRUE, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, Boolean.TRUE, new ArrayList<>());
break;
case NULL:
ret = new DirectValueActionItem(null, 0, new Null(), new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, new Null(), new ArrayList<>());
break;
case UNDEFINED:
ret = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, new Undefined(), new ArrayList<>());
break;
case FALSE:
ret = new DirectValueActionItem(null, 0, Boolean.FALSE, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, Boolean.FALSE, new ArrayList<>());
break;
case CURLY_OPEN: //Object literal
@@ -1675,20 +1675,20 @@ public class ActionScriptParser {
allowMemberOrCall = true;
break;
case NEWLINE:
ret = new DirectValueActionItem(null, 0, "\r", new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, "\r", new ArrayList<>());
allowMemberOrCall = true;
break;
case NAN:
ret = new DirectValueActionItem(null, 0, Double.NaN, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, Double.NaN, new ArrayList<>());
break;
case INFINITY:
ret = new DirectValueActionItem(null, 0, Double.POSITIVE_INFINITY, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, Double.POSITIVE_INFINITY, new ArrayList<>());
break;
case INTEGER:
case DOUBLE:
ret = new DirectValueActionItem(null, 0, s.value, new ArrayList<String>());
ret = new DirectValueActionItem(null, 0, s.value, new ArrayList<>());
break;
case DELETE:

View File

@@ -570,7 +570,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<String>())), v.name);
item = new GetMemberActionItem(null, new GetVariableActionItem(null, new DirectValueActionItem(null, 0, "_global", new ArrayList<>())), v.name);
if (mem != null) {
mem.object = item;
}
@@ -670,7 +670,7 @@ public class ActionSourceGenerator implements SourceGenerator {
if (constructor == null) {
List<Action> val = new ArrayList<>();
val.add(new ActionDefineFunction("", new ArrayList<String>(), 0, SWF.DEFAULT_VERSION));
val.add(new ActionDefineFunction("", new ArrayList<>(), 0, SWF.DEFAULT_VERSION));
if (!isInterface) {
val.add(new ActionStoreRegister(1));
}
@@ -722,7 +722,7 @@ public class ActionSourceGenerator implements SourceGenerator {
if (constr.isEmpty()) {
List<Action> val = new ArrayList<>();
val.add(new ActionDefineFunction("", new ArrayList<String>(), 0, SWF.DEFAULT_VERSION));
val.add(new ActionDefineFunction("", new ArrayList<>(), 0, SWF.DEFAULT_VERSION));
if (!isInterface) {
val.add(new ActionStoreRegister(1));
}

View File

@@ -96,7 +96,7 @@ public class ActionGetURL extends Action {
if (urlString.isEmpty()) {
output.add(new UnLoadMovieNumActionItem(this, new DirectValueActionItem((Long) (long) (int) num)));
} else {
DirectValueActionItem urlStringDi = new DirectValueActionItem(null, 0, urlString, new ArrayList<String>());
DirectValueActionItem urlStringDi = new DirectValueActionItem(null, 0, urlString, new ArrayList<>());
output.add(new LoadMovieNumActionItem(this, urlStringDi, new DirectValueActionItem((Long) (long) (int) num), 1/*GET*/));
}
return;
@@ -106,7 +106,7 @@ public class ActionGetURL extends Action {
}
if (urlString.isEmpty()) {
DirectValueActionItem targetStringDi = new DirectValueActionItem(null, 0, targetString, new ArrayList<String>());
DirectValueActionItem targetStringDi = new DirectValueActionItem(null, 0, targetString, new ArrayList<>());
output.add(new UnLoadMovieActionItem(this, targetStringDi));
} else {
output.add(new GetURLActionItem(this, urlString, targetString));

View File

@@ -86,7 +86,7 @@ public class ActionWaitForFrame extends Action implements ActionStore {
@Override
public void translate(TranslateStack stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) throws InterruptedException {
GraphTargetItem frameTi = new DirectValueActionItem(null, 0, new Long(frame), new ArrayList<String>());
GraphTargetItem frameTi = new DirectValueActionItem(null, 0, new Long(frame), new ArrayList<>());
List<GraphTargetItem> body = ActionGraph.translateViaGraph(regNames, variables, functions, skipped, SWF.DEFAULT_VERSION, staticOperation, path);
output.add(new IfFrameLoadedActionItem(frameTi, body, this));
}

View File

@@ -120,7 +120,7 @@ public class ActionGetURL2 extends Action {
}
if (loadVariablesFlag) {
if (num != null) {
output.add(new LoadVariablesNumActionItem(this, urlString, new DirectValueActionItem(null, 0, (Long) (long) (int) num, new ArrayList<String>()), sendVarsMethod));
output.add(new LoadVariablesNumActionItem(this, urlString, new DirectValueActionItem(null, 0, (Long) (long) (int) num, new ArrayList<>()), sendVarsMethod));
} else {
output.add(new LoadVariablesActionItem(this, urlString, targetString, sendVarsMethod));
}
@@ -140,14 +140,14 @@ public class ActionGetURL2 extends Action {
if (num != null) {
if ("".equals(urlStr)) {
output.add(new UnLoadMovieNumActionItem(this, new DirectValueActionItem(null, 0, (Long) (long) (int) num, new ArrayList<String>())));
output.add(new UnLoadMovieNumActionItem(this, new DirectValueActionItem(null, 0, (Long) (long) (int) num, new ArrayList<>())));
} else if (urlStr != null && urlStr.startsWith(printPrefix)) {
output.add(new PrintNumActionItem(this, new DirectValueActionItem((Long) (long) (int) num),
new DirectValueActionItem(urlStr.substring(printPrefix.length()))));
} else if (urlStr != null && urlStr.startsWith(printAsBitmapPrefix)) {
output.add(new PrintAsBitmapNumActionItem(this, new DirectValueActionItem((Long) (long) (int) num), new DirectValueActionItem(urlStr.substring(printAsBitmapPrefix.length()))));
} else {
output.add(new LoadMovieNumActionItem(this, urlString, new DirectValueActionItem(null, 0, (Long) (long) (int) num, new ArrayList<String>()), sendVarsMethod));
output.add(new LoadMovieNumActionItem(this, urlString, new DirectValueActionItem(null, 0, (Long) (long) (int) num, new ArrayList<>()), sendVarsMethod));
}
} else {
if (urlStr != null && urlStr.startsWith(printPrefix)) {

View File

@@ -39,7 +39,7 @@ public class ActionEnumerate extends Action {
@Override
public void translate(TranslateStack stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) {
GraphTargetItem object = stack.pop();
GraphTargetItem object = stack.pop();
stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList<>()));
stack.push(new EnumerateActionItem(this, object));
}

View File

@@ -256,9 +256,9 @@ public class ActionTry extends Action implements GraphSourceItemContainer {
List<GraphTargetItem> tryCommands = contents.get(0);
ActionItem catchName;
if (catchInRegisterFlag) {
catchName = new DirectValueActionItem(this, -1, new RegisterNumber(this.catchRegister), new ArrayList<String>());
catchName = new DirectValueActionItem(this, -1, new RegisterNumber(this.catchRegister), new ArrayList<>());
} else {
catchName = new DirectValueActionItem(this, -1, this.catchName, new ArrayList<String>());
catchName = new DirectValueActionItem(this, -1, this.catchName, new ArrayList<>());
}
List<GraphTargetItem> catchExceptions = new ArrayList<>();
if (catchBlockFlag) {