diff --git a/trunk/src/com/jpexs/asdec/Main.java b/trunk/src/com/jpexs/asdec/Main.java index 4de61e9e0..5576d7eba 100644 --- a/trunk/src/com/jpexs/asdec/Main.java +++ b/trunk/src/com/jpexs/asdec/Main.java @@ -17,8 +17,6 @@ package com.jpexs.asdec; import com.jpexs.asdec.abc.avm2.AVM2Code; -import com.jpexs.asdec.abc.avm2.parser.ASM3Parser; -import com.jpexs.asdec.abc.avm2.parser.ParseException; import com.jpexs.asdec.abc.types.MethodBody; import com.jpexs.asdec.gui.AboutDialog; import com.jpexs.asdec.gui.LoadingDialog; @@ -144,7 +142,7 @@ public class Main { public static void startWork(String name) { startWork(name, -1); } - + public static void startWork(String name, int percent) { working = true; if (mainFrame != null) { @@ -482,13 +480,14 @@ public class Main { } } - public static final void printASM(AVM2Code code){ - String s=Highlighting.stripHilights(code.toASMSource(null, new MethodBody())); - String ss[]=s.split("\n"); - for(int i=0;i 0) { if (args[0].equals("-debug")) { diff --git a/trunk/src/com/jpexs/asdec/ReReadableInputStream.java b/trunk/src/com/jpexs/asdec/ReReadableInputStream.java index bdfc7de45..c8b438a10 100644 --- a/trunk/src/com/jpexs/asdec/ReReadableInputStream.java +++ b/trunk/src/com/jpexs/asdec/ReReadableInputStream.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec; import java.io.ByteArrayOutputStream; @@ -11,53 +27,50 @@ import java.io.InputStream; public class ReReadableInputStream extends InputStream { InputStream is; - ByteArrayOutputStream baos=new ByteArrayOutputStream(); - byte []converted; - int pos=0; - int count=0; - - public byte[] getAllRead(){ + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] converted; + int pos = 0; + int count = 0; + + public byte[] getAllRead() { return baos.toByteArray(); } public int getPos() { return pos; } - - - - public ReReadableInputStream(InputStream is) { - this.is=is; - } - - public void setPos(int pos) throws IOException{ - if(pos>count){ - skip(pos-count); - } - this.pos=pos; + public ReReadableInputStream(InputStream is) { + this.is = is; } - + + public void setPos(int pos) throws IOException { + if (pos > count) { + skip(pos - count); + } + this.pos = pos; + } + @Override public int read() throws IOException { - if(pos stack, ConstantPool cpool, SWFInputStream sis, ReReadableInputStream rri, int ip, List ret) throws IOException { boolean debugMode = false; - boolean displayCompiletime=false; + boolean displayCompiletime = false; rri.setPos(ip); Action a; List output = new ArrayList(); @@ -575,27 +573,25 @@ public class SWFInputStream extends InputStream { } a = new ActionNop(); } - if(displayCompiletime){ + if (displayCompiletime) { beforeInsert = new ActionPop(); - } - else{ - List needed=top.getNeededActions(); - for(IgnoredPair ig:needed){ - if(ig.action instanceof ActionPush){ - if(!((ActionPush)ig.action).ignoredParts.contains(ig.pos)){ - ((ActionPush)ig.action).ignoredParts.add(ig.pos); + } else { + List needed = top.getNeededActions(); + for (IgnoredPair ig : needed) { + if (ig.action instanceof ActionPush) { + if (!((ActionPush) ig.action).ignoredParts.contains(ig.pos)) { + ((ActionPush) ig.action).ignoredParts.add(ig.pos); - if(((ActionPush)ig.action).ignoredParts.size()==((ActionPush)ig.action).values.size()) - { - ig.action.ignored=true; + if (((ActionPush) ig.action).ignoredParts.size() == ((ActionPush) ig.action).values.size()) { + ig.action.ignored = true; + } } + } else { + ig.action.ignored = true; } - }else{ - ig.action.ignored=true; } } - } - + } else { goaif = true; } diff --git a/trunk/src/com/jpexs/asdec/abc/ABC.java b/trunk/src/com/jpexs/asdec/abc/ABC.java index 7510d441a..a030f39e0 100644 --- a/trunk/src/com/jpexs/asdec/abc/ABC.java +++ b/trunk/src/com/jpexs/asdec/abc/ABC.java @@ -21,18 +21,12 @@ import com.jpexs.asdec.abc.avm2.AVM2Code; import com.jpexs.asdec.abc.avm2.ConstantPool; import com.jpexs.asdec.abc.avm2.UnknownInstructionCode; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.asdec.abc.avm2.parser.ASM3Parser; -import com.jpexs.asdec.abc.avm2.parser.ParseException; -import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.types.*; import com.jpexs.asdec.abc.types.traits.Trait; -import com.jpexs.asdec.abc.types.traits.TraitClass; import com.jpexs.asdec.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.asdec.abc.types.traits.TraitSlotConst; import com.jpexs.asdec.abc.types.traits.Traits; import com.jpexs.asdec.abc.usages.*; -import com.jpexs.asdec.helpers.Helper; -import com.jpexs.asdec.helpers.Highlighting; import com.jpexs.asdec.tags.DoABCTag; import java.io.*; import java.util.ArrayList; @@ -40,7 +34,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Random; -import java.util.Stack; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; @@ -118,7 +111,7 @@ public class ABC { ret++; } } - for (int i = 1; i < constants.constant_namespace.length; i++) { + for (int i = 1; i < constants.constant_namespace.length; i++) { if (deobfuscateNameSpace(namesMap, constants.constant_namespace[i].name_index)) { ret++; } @@ -677,12 +670,12 @@ public class ABC { return false; } - private boolean isValidNSPart(String s){ + private boolean isValidNSPart(String s) { boolean isValid = true; if (isReserved(s)) { isValid = false; } - + if (isValid) { for (int i = 0; i < s.length(); i++) { if (s.charAt(i) > 127) { @@ -699,32 +692,32 @@ public class ABC { } return isValid; } - + public boolean deobfuscateNameSpace(HashMap namesMap, int strIndex) { if (strIndex <= 0) { return false; } String s = constants.constant_string[strIndex]; - boolean isValid = isValidNSPart(s); + boolean isValid = isValidNSPart(s); if (!isValid) { if (namesMap.containsKey(s)) { constants.constant_string[strIndex] = namesMap.get(s); } else { - String parts[]=null; - if(s.contains(".")){ - parts=s.split("\\."); - }else{ - parts=new String[]{s}; + String parts[] = null; + if (s.contains(".")) { + parts = s.split("\\."); + } else { + parts = new String[]{s}; } - String ret=""; - for(int p=0;p0){ - ret+="."; + String ret = ""; + for (int p = 0; p < parts.length; p++) { + if (p > 0) { + ret += "."; } - if(!isValidNSPart(parts[p])){ - ret+=fooString(constants.constant_string[strIndex], false, DEFAULT_FOO_SIZE); - }else{ - ret+=parts[p]; + if (!isValidNSPart(parts[p])) { + ret += fooString(constants.constant_string[strIndex], false, DEFAULT_FOO_SIZE); + } else { + ret += parts[p]; } } constants.constant_string[strIndex] = ret; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java index cdd385731..b288e6a13 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.avm2; -import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.abc.ABCInputStream; import com.jpexs.asdec.abc.CopyOutputStream; @@ -44,7 +43,6 @@ import com.jpexs.asdec.abc.avm2.treemodel.*; import com.jpexs.asdec.abc.avm2.treemodel.clauses.*; import com.jpexs.asdec.abc.avm2.treemodel.operations.AndTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.operations.OrTreeItem; -import com.jpexs.asdec.abc.gui.DialogMissingSymbolHandler; import com.jpexs.asdec.abc.types.ABCException; import com.jpexs.asdec.abc.types.MethodBody; import com.jpexs.asdec.abc.types.MethodInfo; @@ -60,8 +58,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.swing.text.Highlighter; -import com.jpexs.asdec.abc.avm2.instructions.TagInstruction; public class AVM2Code implements Serializable { @@ -729,7 +725,7 @@ public class AVM2Code implements Serializable { long ofs = 0; int ip = 0; int largeLimit = 20000; - boolean markOffsets=code.size()<=largeLimit; + boolean markOffsets = code.size() <= largeLimit; for (AVM2Instruction ins : code) { if (ins.labelname != null) { ret.append(ins.labelname + ":"); @@ -754,7 +750,7 @@ public class AVM2Code implements Serializable { if (ins2.isIgnored()) { continue; } - t = Highlighting.hilighOffset("", ins2.mappedOffset>-1?ins2.mappedOffset:ofs) + ins2.toStringNoAddress(constants, new ArrayList()) + " ;copy from " + Helper.formatAddress(pos2adr((Integer) o)) + "\n"; + t = Highlighting.hilighOffset("", ins2.mappedOffset > -1 ? ins2.mappedOffset : ofs) + ins2.toStringNoAddress(constants, new ArrayList()) + " ;copy from " + Helper.formatAddress(pos2adr((Integer) o)) + "\n"; ret.append(t); outputMap.add((Integer) o); } else if (o instanceof ControlFlowTag) { @@ -775,11 +771,11 @@ public class AVM2Code implements Serializable { if (ins.changeJumpTo > -1) { t = ins.definition.instructionName + " ofs" + Helper.formatAddress(pos2adr(ins.changeJumpTo)); } - if(markOffsets){ - t = Highlighting.hilighOffset("", ins.mappedOffset>-1?ins.mappedOffset:ofs) + t + "\n"; - }else{ + if (markOffsets) { + t = Highlighting.hilighOffset("", ins.mappedOffset > -1 ? ins.mappedOffset : ofs) + t + "\n"; + } else { t = t + "\n"; - } + } ret.append(t); outputMap.add(ip); } @@ -787,7 +783,7 @@ public class AVM2Code implements Serializable { ofs += ins.getBytes().length; ip++; } - String r=ret.toString(); + String r = ret.toString(); return r; } private boolean cacheActual = false; @@ -1038,7 +1034,7 @@ public class AVM2Code implements Serializable { return pos2adr(fixIPAfterDebugLine(adr2pos(addr))); } - public ConvertOutput toSourceOutput(boolean processJumps,boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean visited[]) throws ConvertException { + public ConvertOutput toSourceOutput(boolean processJumps, boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean visited[]) throws ConvertException { boolean debugMode = DEBUG_MODE; if (debugMode) { System.out.println("OPEN SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); @@ -1126,7 +1122,7 @@ public class AVM2Code implements Serializable { if (swins.operands.length >= 3) { if (swins.operands[0] == swins.getBytes().length) { if (adr2pos(pos2adr(f) + swins.operands[2]) < finStart) { - finallyCommands = toSourceOutput(processJumps,isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, finStart, f - 1, localRegNames, fullyQualifiedNames, visited).output; + finallyCommands = toSourceOutput(processJumps, isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, finStart, f - 1, localRegNames, fullyQualifiedNames, visited).output; returnPos = f + 1; break; } @@ -1151,10 +1147,10 @@ public class AVM2Code implements Serializable { } Stack substack = new Stack(); substack.add(new ExceptionTreeItem(catchedExceptions.get(e))); - catchedCommands.add(toSourceOutput(processJumps,isStatic, classIndex, localRegs, substack, new Stack(), abc, constants, method_info, body, adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e).target)), eendpos, localRegNames, fullyQualifiedNames, visited).output); + catchedCommands.add(toSourceOutput(processJumps, isStatic, classIndex, localRegs, substack, new Stack(), abc, constants, method_info, body, adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e).target)), eendpos, localRegNames, fullyQualifiedNames, visited).output); } - List tryCommands = toSourceOutput(processJumps,isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, ip, endpos - 1, localRegNames, fullyQualifiedNames, visited).output; + List tryCommands = toSourceOutput(processJumps, isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, ip, endpos - 1, localRegNames, fullyQualifiedNames, visited).output; output.add(new TryTreeItem(tryCommands, catchedExceptions, catchedCommands, finallyCommands)); @@ -1328,7 +1324,7 @@ public class AVM2Code implements Serializable { throw new ConvertException("Unknown pattern: no setlocal before lookupswitch", switchPos); } loopList.add(new Loop(ip, switchPos + 1)); - Stack substack = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, jumpPos, evalTo - 1, localRegNames, fullyQualifiedNames, visited).stack; + Stack substack = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, jumpPos, evalTo - 1, localRegNames, fullyQualifiedNames, visited).stack; TreeItem switchedValue = substack.pop(); //output.add("loop" + (switchPos + 1) + ":"); int switchBreak = switchPos + 1; @@ -1363,7 +1359,7 @@ public class AVM2Code implements Serializable { if (evalTo > -1) { - substack = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, curPos, evalTo - 1, localRegNames, fullyQualifiedNames, visited).stack; + substack = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, curPos, evalTo - 1, localRegNames, fullyQualifiedNames, visited).stack; casesList.add(substack.pop()); } int substart = adr2pos(code.get(switchPos).operands[2 + casePos] + pos2adr(switchPos)); @@ -1375,7 +1371,7 @@ public class AVM2Code implements Serializable { if (evalTo == -1) { subend--; } - List commands = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, substart, subend, localRegNames, fullyQualifiedNames, visited).output; + List commands = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, substart, subend, localRegNames, fullyQualifiedNames, visited).output; if ((evalTo == -1) && (casePos + 1 < code.get(switchPos).operands.length - 2)) { if (commands.size() == 1) { commands.remove(0); @@ -1397,12 +1393,12 @@ public class AVM2Code implements Serializable { break; } } while (true); - if(processJumps){ - List valMapping=new ArrayList(); - for(int i=0;i valMapping = new ArrayList(); + for (int i = 0; i < casesList.size(); i++) { valMapping.add(i); } - output.add(new SwitchTreeItem(code.get(switchPos), switchBreak, switchedValue, casesList, caseCommands, defaultCommands,valMapping)); + output.add(new SwitchTreeItem(code.get(switchPos), switchBreak, switchedValue, casesList, caseCommands, defaultCommands, valMapping)); } ip = switchPos + 1; continue; @@ -1427,7 +1423,7 @@ public class AVM2Code implements Serializable { if (debugMode) { System.out.println("expression branch"); } - ConvertOutput co = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, jumpPos, adr2pos(afterBackJumpAddr) - 2, localRegNames, fullyQualifiedNames, visited); + ConvertOutput co = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, jumpPos, adr2pos(afterBackJumpAddr) - 2, localRegNames, fullyQualifiedNames, visited); Stack substack = co.stack; backJumpIns.definition.translate(isStatic, classIndex, localRegs, substack, scopeStack, constants, backJumpIns, method_info, output, body, abc, localRegNames, fullyQualifiedNames); @@ -1439,7 +1435,7 @@ public class AVM2Code implements Serializable { if (debugMode) { System.out.println("subins branch"); } - subins = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, adr2pos(secondAddr) + 1/*label*/, jumpPos - 1, localRegNames, fullyQualifiedNames, visited).output; + subins = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, adr2pos(secondAddr) + 1/*label*/, jumpPos - 1, localRegNames, fullyQualifiedNames, visited).output; } catch (UnknownJumpException uje) { if ((uje.ip >= start) && (uje.ip <= end)) { currentLoop.loopContinue = uje.ip; @@ -1467,7 +1463,7 @@ public class AVM2Code implements Serializable { if (debugMode) { System.out.println("final expression branch"); } - finalExpression = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, uje.ip, jumpPos - 1, localRegNames, fullyQualifiedNames, visited).output; + finalExpression = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, uje.ip, jumpPos - 1, localRegNames, fullyQualifiedNames, visited).output; isFor = true; } else { throw new ConvertException("Unknown pattern: jump to nowhere", ip); @@ -1600,7 +1596,7 @@ public class AVM2Code implements Serializable { addr = pos2adr(ip); insAfter = code.get(ip + 1); } - + boolean isAnd; if (processJumps && (insAfter.definition instanceof IfFalseIns)) { //stack.add("(" + stack.pop() + ")&&"); @@ -1621,7 +1617,7 @@ public class AVM2Code implements Serializable { if (((GetLocalTypeIns) code.get(t).definition).getRegisterId(code.get(t)) == reg) { if (code.get(t + 1).definition instanceof KillIns) { if (code.get(t + 1).operands[0] == reg) { - ConvertOutput assignment = toSourceOutput(processJumps,isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, ip + 2, t - 1, localRegNames, fullyQualifiedNames, visited); + ConvertOutput assignment = toSourceOutput(processJumps, isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, ip + 2, t - 1, localRegNames, fullyQualifiedNames, visited); stack.push(assignment.output.remove(assignment.output.size() - 1)); ip = t + 2; continue iploop; @@ -1652,18 +1648,18 @@ public class AVM2Code implements Serializable { ip++; break; //throw new ConvertException("Unknown pattern after DUP:" + insComparsion.toString()); - } - if(processJumps){ + } + if (processJumps) { addr = addr + ins.getBytes().length + insAfter.getBytes().length + insAfter.operands[0]; nextPos = adr2pos(addr) - 1; if (isAnd) { - stack.add(new AndTreeItem(insAfter, stack.pop(), toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 3, nextPos, localRegNames, fullyQualifiedNames, visited).stack.pop())); + stack.add(new AndTreeItem(insAfter, stack.pop(), toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 3, nextPos, localRegNames, fullyQualifiedNames, visited).stack.pop())); } else { - stack.add(new OrTreeItem(insAfter, stack.pop(), toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 3, nextPos, localRegNames, fullyQualifiedNames, visited).stack.pop())); + stack.add(new OrTreeItem(insAfter, stack.pop(), toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 3, nextPos, localRegNames, fullyQualifiedNames, visited).stack.pop())); } ins = code.get(nextPos + 1); ip = nextPos + 1; - } + } } while (ins.definition instanceof DupIns); } else if (ins.definition instanceof IfTypeIns) { int targetAddr = pos2adr(ip) + ins.getBytes().length + ins.operands[0]; @@ -1720,7 +1716,7 @@ public class AVM2Code implements Serializable { if (debugMode) { System.out.println("true branch"); } - ConvertOutput onTrue = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 1, targetIns - 1 - ((hasElse || hasReturn) ? 1 : 0), localRegNames, fullyQualifiedNames, visited); + ConvertOutput onTrue = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 1, targetIns - 1 - ((hasElse || hasReturn) ? 1 : 0), localRegNames, fullyQualifiedNames, visited); ip = targetIns; ConvertOutput onFalse = new ConvertOutput(new Stack(), new ArrayList()); if (hasElse) { @@ -1729,7 +1725,7 @@ public class AVM2Code implements Serializable { if (debugMode) { System.out.println("false branch"); } - onFalse = toSourceOutput(processJumps,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, targetIns, finalIns - 1, localRegNames, fullyQualifiedNames, visited); + onFalse = toSourceOutput(processJumps, isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, targetIns, finalIns - 1, localRegNames, fullyQualifiedNames, visited); ip = finalIns; } if ((onTrue.stack.size() > 0) && (onFalse != null) && (onFalse.stack.size() > 0)) { @@ -1791,12 +1787,12 @@ public class AVM2Code implements Serializable { System.out.println("CLOSE SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); } /*if (hideTemporaryRegisters) { - clearTemporaryRegisters(output); - }*/ + clearTemporaryRegisters(output); + }*/ return new ConvertOutput(stack, output); } catch (ConvertException cex) { throw cex; - } + } } public String tabString(int len) { @@ -1807,11 +1803,10 @@ public class AVM2Code implements Serializable { return ret; } - public String toSource(String path,boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) { - return toSource(path,isStatic, classIndex, abc, constants, method_info, body, false, localRegNames, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits); + public String toSource(String path, boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) { + return toSource(path, isStatic, classIndex, abc, constants, method_info, body, false, localRegNames, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits); } - public int getRegisterCount() { int maxRegister = -1; for (AVM2Instruction ins : code) { @@ -1882,7 +1877,7 @@ public class AVM2Code implements Serializable { ignoredIns = new ArrayList(); } - public String toSource(String path,boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, boolean hilighted, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) { + public String toSource(String path, boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, boolean hilighted, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) { initToSource(); List list; String s; @@ -1900,104 +1895,104 @@ public class AVM2Code implements Serializable { //try { - try{ - list = AVM2Graph.translateViaGraph(path,this, abc, body); - }catch(Exception ex2){ - Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, "Decompilation error in "+path,ex2); - return "/*\r\n * Decompilation error\r\n * Code may be obfuscated\r\n * Error Message: " + ex2.getMessage() + "\r\n */"; - } - /*try{ - list=toSourceOutput(true,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, 0, code.size() - 1, localRegNames, fullyQualifiedNames, null).output; - }catch(Exception ex){ + try { + list = AVM2Graph.translateViaGraph(path, this, abc, body); + } catch (Exception ex2) { + Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, "Decompilation error in " + path, ex2); + return "/*\r\n * Decompilation error\r\n * Code may be obfuscated\r\n * Error Message: " + ex2.getMessage() + "\r\n */"; + } + /*try{ + list=toSourceOutput(true,isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, 0, code.size() - 1, localRegNames, fullyQualifiedNames, null).output; + }catch(Exception ex){ - }*/ - if (initTraits != null) { - for (int i = 0; i < list.size(); i++) { - TreeItem ti = list.get(i); - if ((ti instanceof InitPropertyTreeItem) || (ti instanceof SetPropertyTreeItem)) { - int multinameIndex = 0; - TreeItem value = null; - if (ti instanceof InitPropertyTreeItem) { - multinameIndex = ((InitPropertyTreeItem) ti).propertyName.multinameIndex; - value = ((InitPropertyTreeItem) ti).value; - } - if (ti instanceof SetPropertyTreeItem) { - multinameIndex = ((SetPropertyTreeItem) ti).propertyName.multinameIndex; - value = ((SetPropertyTreeItem) ti).value; - } - for (Trait t : initTraits.traits) { - if (t.name_index == multinameIndex) { - if ((t instanceof TraitSlotConst)) { - if (((TraitSlotConst) t).isConst() || isStaticInitializer) { - ((TraitSlotConst) t).assignedValue = value; - list.remove(i); - i--; - continue; - } - break; - } - } - } - } else { - break; - } - } - } - if (isStaticInitializer) { - List newList = new ArrayList(); - for (TreeItem ti : list) { - if (!(ti instanceof ReturnVoidTreeItem)) { - if (!(ti instanceof InitPropertyTreeItem)) { - if (!(ti instanceof SetPropertyTreeItem)) { - newList.add(ti); - } - } - } - } - list = newList; - if (list.isEmpty()) { - return ""; - } - } - //Declarations - boolean declaredRegisters[] = new boolean[regCount]; - for (int b = 0; b < declaredRegisters.length; b++) { - declaredRegisters[b] = false; - } - List declaredSlots = new ArrayList(); + }*/ + if (initTraits != null) { for (int i = 0; i < list.size(); i++) { TreeItem ti = list.get(i); - if (ti instanceof SetLocalTreeItem) { - int reg = ((SetLocalTreeItem) ti).regIndex; - if (!declaredRegisters[reg]) { - list.set(i, new DeclarationTreeItem(ti)); - declaredRegisters[reg] = true; + if ((ti instanceof InitPropertyTreeItem) || (ti instanceof SetPropertyTreeItem)) { + int multinameIndex = 0; + TreeItem value = null; + if (ti instanceof InitPropertyTreeItem) { + multinameIndex = ((InitPropertyTreeItem) ti).propertyName.multinameIndex; + value = ((InitPropertyTreeItem) ti).value; } - } - if (ti instanceof SetSlotTreeItem) { - SetSlotTreeItem ssti = (SetSlotTreeItem) ti; - Slot sl = new Slot(ssti.scope, ssti.slotName); - if (!declaredSlots.contains(sl)) { - String type = "*"; - for (int t = 0; t < body.traits.traits.length; t++) { - if (body.traits.traits[t].getName(abc) == sl.multiname) { - if (body.traits.traits[t] instanceof TraitSlotConst) { - type = ((TraitSlotConst) body.traits.traits[t]).getType(constants, fullyQualifiedNames); + if (ti instanceof SetPropertyTreeItem) { + multinameIndex = ((SetPropertyTreeItem) ti).propertyName.multinameIndex; + value = ((SetPropertyTreeItem) ti).value; + } + for (Trait t : initTraits.traits) { + if (t.name_index == multinameIndex) { + if ((t instanceof TraitSlotConst)) { + if (((TraitSlotConst) t).isConst() || isStaticInitializer) { + ((TraitSlotConst) t).assignedValue = value; + list.remove(i); + i--; + continue; } + break; } } - list.set(i, new DeclarationTreeItem(ti, type)); - declaredSlots.add(sl); + } + } else { + break; + } + } + } + if (isStaticInitializer) { + List newList = new ArrayList(); + for (TreeItem ti : list) { + if (!(ti instanceof ReturnVoidTreeItem)) { + if (!(ti instanceof InitPropertyTreeItem)) { + if (!(ti instanceof SetPropertyTreeItem)) { + newList.add(ti); + } } } } + list = newList; + if (list.isEmpty()) { + return ""; + } + } + //Declarations + boolean declaredRegisters[] = new boolean[regCount]; + for (int b = 0; b < declaredRegisters.length; b++) { + declaredRegisters[b] = false; + } + List declaredSlots = new ArrayList(); + for (int i = 0; i < list.size(); i++) { + TreeItem ti = list.get(i); + if (ti instanceof SetLocalTreeItem) { + int reg = ((SetLocalTreeItem) ti).regIndex; + if (!declaredRegisters[reg]) { + list.set(i, new DeclarationTreeItem(ti)); + declaredRegisters[reg] = true; + } + } + if (ti instanceof SetSlotTreeItem) { + SetSlotTreeItem ssti = (SetSlotTreeItem) ti; + Slot sl = new Slot(ssti.scope, ssti.slotName); + if (!declaredSlots.contains(sl)) { + String type = "*"; + for (int t = 0; t < body.traits.traits.length; t++) { + if (body.traits.traits[t].getName(abc) == sl.multiname) { + if (body.traits.traits[t] instanceof TraitSlotConst) { + type = ((TraitSlotConst) body.traits.traits[t]).getType(constants, fullyQualifiedNames); + } + } + } + list.set(i, new DeclarationTreeItem(ti, type)); + declaredSlots.add(sl); + } + } + } - s = listToString(list, constants, localRegNames, fullyQualifiedNames); + s = listToString(list, constants, localRegNames, fullyQualifiedNames); /*} catch (Exception ex) { - Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, "Error in method "+path, ex); - s = "/ *\r\n * Decompilation error\r\n * Code may be obfuscated\r\n * Error Message: " + ex.getMessage() + "\r\n * /"; - return s; - }*/ + Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, "Error in method "+path, ex); + s = "/ *\r\n * Decompilation error\r\n * Code may be obfuscated\r\n * Error Message: " + ex.getMessage() + "\r\n * /"; + return s; + }*/ StringBuffer sub = new StringBuffer(); @@ -2006,7 +2001,7 @@ public class AVM2Code implements Serializable { String parts[] = s.split("\r\n"); boolean processLoops = true; - + if (processLoops) { try { Stack loopStack = new Stack(); @@ -2086,8 +2081,8 @@ public class AVM2Code implements Serializable { if (!hilighted) { return Highlighting.stripHilights(sub.toString()); } - String ret=sub.toString(); - + String ret = sub.toString(); + return ret; } @@ -2243,8 +2238,8 @@ public class AVM2Code implements Serializable { code.add(pos, instruction); } - public int removeTraps(ConstantPool constants, MethodBody body) { - + public int removeTraps(ConstantPool constants, MethodBody body) { + removeDeadCode(constants, body); boolean isSecure = true; try { @@ -2386,7 +2381,7 @@ public class AVM2Code implements Serializable { } } } while (found); - removeIgnored(constants,body); + removeIgnored(constants, body); removeDeadCode(constants, body); } else { //isSecure = false; @@ -2400,7 +2395,7 @@ public class AVM2Code implements Serializable { } int ret = isSecure ? 1 : 0; ret += visitCodeTrap(body, new int[code.size()]); - removeIgnored(constants,body); + removeIgnored(constants, body); removeDeadCode(constants, body); return ret; @@ -2743,7 +2738,9 @@ public class AVM2Code implements Serializable { boolean allJumpsOrIfs = true; for (int ref : refs.get(ip)) { - if(ref<0) continue; + if (ref < 0) { + continue; + } if (!(code.get(ref).definition instanceof JumpIns)) { if (!(code.get(ref).definition instanceof IfTypeIns)) { allJumpsOrIfs = false; @@ -2758,7 +2755,9 @@ public class AVM2Code implements Serializable { } if (allJumpsOrIfs) { for (int ref : refs.get(ip)) { - if(ref<0) continue; + if (ref < 0) { + continue; + } code.get(ref).changeJumpTo = newip; } } @@ -2856,18 +2855,17 @@ public class AVM2Code implements Serializable { } /*private void removeIgnored(MethodBody body) { - for (int rem = code.size() - 1; rem >= 0; rem--) { - if (code.get(rem).ignored) { - removeInstruction(rem, body); - } - } - }*/ - - public void removeIgnored(ConstantPool constants,MethodBody body){ + for (int rem = code.size() - 1; rem >= 0; rem--) { + if (code.get(rem).ignored) { + removeInstruction(rem, body); + } + } + }*/ + public void removeIgnored(ConstantPool constants, MethodBody body) { try { - List outputMap=new ArrayList(); - String src=toASMSource(constants, body,outputMap); - AVM2Code acode=ASM3Parser.parse(new ByteArrayInputStream(src.getBytes()), constants, body); + List outputMap = new ArrayList(); + String src = toASMSource(constants, body, outputMap); + AVM2Code acode = ASM3Parser.parse(new ByteArrayInputStream(src.getBytes()), constants, body); for (int i = 0; i < acode.code.size(); i++) { if (outputMap.size() > i) { int tpos = outputMap.get(i); @@ -2879,9 +2877,9 @@ public class AVM2Code implements Serializable { } } } - this.code=acode.code; - } catch (Exception ex){ - } + this.code = acode.code; + } catch (Exception ex) { + } invalidateCache(); } @@ -2891,18 +2889,18 @@ public class AVM2Code implements Serializable { int cnt = 0; for (int i = code.size() - 1; i >= 0; i--) { if (refs.get(i).isEmpty()) { - code.get(i).ignored=true; + code.get(i).ignored = true; //removeInstruction(i, body); cnt++; } } - + removeIgnored(constants, body); for (int i = code.size() - 1; i >= 0; i--) { AVM2Instruction ins = code.get(i); if (ins.definition instanceof JumpIns) { if (ins.operands[0] == 0) { - code.get(i).ignored=true; + code.get(i).ignored = true; //removeInstruction(i, body); cnt++; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/ConvertOutput.java b/trunk/src/com/jpexs/asdec/abc/avm2/ConvertOutput.java index db4945943..1f26d098b 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/ConvertOutput.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/ConvertOutput.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; @@ -10,11 +26,11 @@ import java.util.Stack; */ public class ConvertOutput { - public Stack stack; - public List output; + public Stack stack; + public List output; - public ConvertOutput(Stack stack, List output) { - this.stack = stack; - this.output = output; - } + public ConvertOutput(Stack stack, List output) { + this.stack = stack; + this.output = output; } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/graph/AVM2Graph.java b/trunk/src/com/jpexs/asdec/abc/avm2/graph/AVM2Graph.java index 4026c87fa..c28511f36 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/graph/AVM2Graph.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/graph/AVM2Graph.java @@ -16,10 +16,6 @@ */ package com.jpexs.asdec.abc.avm2.graph; -import com.jpexs.asdec.graph.Graph; -import com.jpexs.asdec.graph.GraphPart; -import com.jpexs.asdec.graph.Loop; -import com.jpexs.asdec.graph.GraphPartMulti; import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.abc.avm2.AVM2Code; import com.jpexs.asdec.abc.avm2.ConvertException; @@ -33,10 +29,7 @@ import com.jpexs.asdec.abc.avm2.instructions.jumps.JumpIns; import com.jpexs.asdec.abc.avm2.instructions.jumps.LookupSwitchIns; import com.jpexs.asdec.abc.avm2.instructions.localregs.GetLocalTypeIns; import com.jpexs.asdec.abc.avm2.instructions.localregs.KillIns; -import com.jpexs.asdec.abc.avm2.instructions.localregs.SetLocalTypeIns; import com.jpexs.asdec.abc.avm2.instructions.other.LabelIns; -import com.jpexs.asdec.abc.avm2.instructions.other.NextNameIns; -import com.jpexs.asdec.abc.avm2.instructions.other.NextValueIns; import com.jpexs.asdec.abc.avm2.instructions.other.ReturnValueIns; import com.jpexs.asdec.abc.avm2.instructions.other.ReturnVoidIns; import com.jpexs.asdec.abc.avm2.instructions.other.ThrowIns; @@ -75,7 +68,10 @@ import com.jpexs.asdec.abc.avm2.treemodel.operations.LogicalOp; import com.jpexs.asdec.abc.avm2.treemodel.operations.OrTreeItem; import com.jpexs.asdec.abc.types.ABCException; import com.jpexs.asdec.abc.types.MethodBody; -import com.jpexs.asdec.helpers.Highlighting; +import com.jpexs.asdec.graph.Graph; +import com.jpexs.asdec.graph.GraphPart; +import com.jpexs.asdec.graph.GraphPartMulti; +import com.jpexs.asdec.graph.Loop; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -89,7 +85,7 @@ import java.util.logging.Logger; * * @author JPEXS */ -public class AVM2Graph extends Graph{ +public class AVM2Graph extends Graph { private AVM2Code code; private ABC abc; @@ -101,12 +97,10 @@ public class AVM2Graph extends Graph{ this.abc = abc; this.body = body; for (GraphPart head : heads) { - fixGraph(head); + fixGraph(head); } } - - public static List translateViaGraph(String path, AVM2Code code, ABC abc, MethodBody body) { AVM2Graph g = new AVM2Graph(code, abc, body); List allParts = new ArrayList(); @@ -116,8 +110,6 @@ public class AVM2Graph extends Graph{ return g.printGraph(path, new Stack(), new Stack(), allParts, new ArrayList(), new ArrayList(), 0, null, g.heads.get(0), null, new ArrayList(), new HashMap(), body, new ArrayList()); } - - private TreeItem checkLoop(GraphPart part, GraphPart stopPart, List loops) { if (part == stopPart) { return null; @@ -486,12 +478,12 @@ public class AVM2Graph extends Graph{ } } boolean loop = false; - boolean reversed=false; + boolean reversed = false; if ((!part.nextParts.isEmpty()) && part.nextParts.get(0).leadsTo(part, loopContinues)) { loop = true; - }else if ((part.nextParts.size()>1) && part.nextParts.get(1).leadsTo(part, loopContinues)) { + } else if ((part.nextParts.size() > 1) && part.nextParts.get(1).leadsTo(part, loopContinues)) { loop = true; - reversed=true; + reversed = true; } if (((part.nextParts.size() == 2) || ((part.nextParts.size() == 1) && loop)) && (!isSwitch)) { @@ -512,7 +504,7 @@ public class AVM2Graph extends Graph{ } if (part.nextParts.size() > 1) { - currentLoop.loopBreak = part.nextParts.get(reversed?0:1); + currentLoop.loopBreak = part.nextParts.get(reversed ? 0 : 1); } int breakIp = -1; @@ -541,7 +533,7 @@ public class AVM2Graph extends Graph{ GraphPart finalPart = null; boolean isFor = false; try { - loopBody = printGraph(methodPath, stack, scopeStack, allParts, parsedExceptions, finallyJumps, level + 1, part, part.nextParts.get(reversed?1:0), stopPart, loops, localRegs, body, ignoredSwitches); + loopBody = printGraph(methodPath, stack, scopeStack, allParts, parsedExceptions, finallyJumps, level + 1, part, part.nextParts.get(reversed ? 1 : 0), stopPart, loops, localRegs, body, ignoredSwitches); } catch (ForException fex) { loopBody = fex.output; finalCommands = fex.finalOutput; @@ -551,9 +543,8 @@ public class AVM2Graph extends Graph{ finalPart = fex.continuePart; isFor = true; for (Object o : finalPart.forContinues) { - if(o instanceof ContinueTreeItem) - { - ((ContinueTreeItem)o).loopPos = breakIp; + if (o instanceof ContinueTreeItem) { + ((ContinueTreeItem) o).loopPos = breakIp; } } } @@ -632,16 +623,16 @@ public class AVM2Graph extends Graph{ if (onTrue.isEmpty() && onFalse.isEmpty() && (trueStack.size() > stackSizeBefore) && (falseStack.size() > stackSizeBefore)) { stack.push(new TernarOpTreeItem(null, expr, trueStack.pop(), falseStack.pop())); - } else { + } else { ret.add(new IfTreeItem(null, expr, onTrue, onFalse)); - + //Same continues in onTrue and onFalse gets continue on parent level - if((!onTrue.isEmpty())&&(!onFalse.isEmpty())){ - if(onTrue.get(onTrue.size()-1) instanceof ContinueTreeItem){ - if(onFalse.get(onFalse.size()-1) instanceof ContinueTreeItem){ - if(((ContinueTreeItem)onTrue.get(onTrue.size()-1)).loopPos==((ContinueTreeItem)onFalse.get(onFalse.size()-1)).loopPos){ - onTrue.remove(onTrue.size()-1); - ret.add(onFalse.remove(onFalse.size()-1)); + if ((!onTrue.isEmpty()) && (!onFalse.isEmpty())) { + if (onTrue.get(onTrue.size() - 1) instanceof ContinueTreeItem) { + if (onFalse.get(onFalse.size() - 1) instanceof ContinueTreeItem) { + if (((ContinueTreeItem) onTrue.get(onTrue.size() - 1)).loopPos == ((ContinueTreeItem) onFalse.get(onFalse.size() - 1)).loopPos) { + onTrue.remove(onTrue.size() - 1); + ret.add(onFalse.remove(onFalse.size() - 1)); } } } @@ -650,7 +641,7 @@ public class AVM2Graph extends Graph{ } if (loop && (part.nextParts.size() > 1)) { loops.remove(currentLoop); //remove loop so no break shows up - ret.addAll(printGraph(methodPath, stack, scopeStack, allParts, parsedExceptions, finallyJumps, level, part, part.nextParts.get(reversed?0:1), stopPart, loops, localRegs, body, ignoredSwitches)); + ret.addAll(printGraph(methodPath, stack, scopeStack, allParts, parsedExceptions, finallyJumps, level, part, part.nextParts.get(reversed ? 0 : 1), stopPart, loops, localRegs, body, ignoredSwitches)); } if (next != null) { @@ -805,8 +796,6 @@ public class AVM2Graph extends Graph{ return ret; } - - private List makeGraph(AVM2Code code, List allBlocks, MethodBody body) { HashMap> refs = code.visitCode(body); List ret = new ArrayList(); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/graph/ForException.java b/trunk/src/com/jpexs/asdec/abc/avm2/graph/ForException.java index 2059ca970..7b046ea06 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/graph/ForException.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/graph/ForException.java @@ -1,22 +1,38 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2.graph; -import com.jpexs.asdec.graph.GraphPart; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.graph.GraphPart; import java.util.List; /** * * @author JPEXS */ -public class ForException extends RuntimeException{ +public class ForException extends RuntimeException { + public List output; public List finalOutput; public GraphPart continuePart; - - public ForException(List output,List finalOutput, GraphPart continuePart) { - this.output=output; - this.finalOutput=finalOutput; - this.continuePart=continuePart; + + public ForException(List output, List finalOutput, GraphPart continuePart) { + this.output = output; + this.finalOutput = finalOutput; + this.continuePart = continuePart; } - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java index d340f820c..91c85216f 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java @@ -26,7 +26,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; -public class AVM2Instruction implements Serializable{ +public class AVM2Instruction implements Serializable { public InstructionDefinition definition; public int operands[]; @@ -35,8 +35,8 @@ public class AVM2Instruction implements Serializable{ public String comment; public boolean ignored = false; public String labelname; - public long mappedOffset=-1; - public int changeJumpTo=-1; + public long mappedOffset = -1; + public int changeJumpTo = -1; public AVM2Instruction(long offset, InstructionDefinition definition, int[] operands, byte bytes[]) { this.definition = definition; @@ -214,8 +214,6 @@ public class AVM2Instruction implements Serializable{ public boolean isIgnored() { return ignored; } - - public String toString(ConstantPool constants, List fullyQualifiedNames) { String s = Helper.formatAddress(offset) + " " + Helper.padSpaceRight(Helper.byteArrToString(getBytes()), 30) + definition.instructionName; @@ -228,6 +226,5 @@ public class AVM2Instruction implements Serializable{ s += getParams(constants, fullyQualifiedNames) + getComment(); return s; } - public List replaceWith; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java index 8d43a3895..6654b33c8 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -public class InstructionDefinition implements Serializable{ +public class InstructionDefinition implements Serializable { protected String hilighOffset(String text, long offset) { return Highlighting.hilighOffset(text, offset); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/TagInstruction.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/TagInstruction.java index 07ffe0b0f..71db40d07 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/TagInstruction.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/TagInstruction.java @@ -25,7 +25,4 @@ public class TagInstruction extends InstructionDefinition { public TagInstruction(String tagName) { super(-1, tagName, new int[0]); } - - - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java index 4397551f6..f9b6d264d 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java @@ -23,7 +23,6 @@ import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; import com.jpexs.asdec.abc.avm2.treemodel.ConstructPropTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.ConstructTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.avm2.treemodel.XMLTreeItem; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java index e84da667e..744cf8b06 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java @@ -43,7 +43,7 @@ public class NewFunctionIns extends InstructionDefinition { String bodyStr = ""; String paramStr = ""; if (mybody != null) { - bodyStr = Highlighting.hilighMethodEnd() + mybody.toString("",false, isStatic, classIndex, abc, constants, method_info, new Stack()/*scopeStack*/, false, true, fullyQualifiedNames, null) + Highlighting.hilighMethodBegin(body.method_info); + bodyStr = Highlighting.hilighMethodEnd() + mybody.toString("", false, isStatic, classIndex, abc, constants, method_info, new Stack()/*scopeStack*/, false, true, fullyQualifiedNames, null) + Highlighting.hilighMethodBegin(body.method_info); paramStr = method_info[methodIndex].getParamStr(constants, mybody, abc, fullyQualifiedNames); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java index 5524bf911..6affb2a4a 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java @@ -36,7 +36,7 @@ public class GetScopeObjectIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int index = ins.operands[0]; - if(scopeStack.size()<=index){ + if (scopeStack.size() <= index) { System.out.println("uuu"); } stack.push(scopeStack.get(index)); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java index 3b079bde7..61811b69f 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.abc.avm2.ConstantPool; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; import com.jpexs.asdec.abc.avm2.treemodel.HasNextTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.InTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.types.MethodInfo; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java index d0458dc98..9ee5c0709 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.abc.avm2.ConstantPool; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; import com.jpexs.asdec.abc.avm2.treemodel.HasNextTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.InTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.types.MethodInfo; import java.util.HashMap; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java index 0703a87ac..d07380b21 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java @@ -36,7 +36,7 @@ public class NextValueIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { TreeItem index = stack.pop(); - TreeItem obj = stack.pop(); + TreeItem obj = stack.pop(); stack.push(new NextValueTreeItem(ins, index, obj)); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java index 2f654635a..59cf23022 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java @@ -24,10 +24,8 @@ import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.avm2.treemodel.WithEndTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.WithObjectTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.WithTreeItem; import com.jpexs.asdec.abc.types.MethodBody; import com.jpexs.asdec.abc.types.MethodInfo; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Stack; @@ -48,8 +46,8 @@ public class PopScopeIns extends InstructionDefinition { TreeItem scope = (TreeItem) scopeStack.pop(); if (scope instanceof WithObjectTreeItem) { scope = ((WithObjectTreeItem) scope).scope; - output.add(new WithEndTreeItem(ins,scope)); - } + output.add(new WithEndTreeItem(ins, scope)); + } } @Override diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java index 67af92de8..dd61bd3df 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2.treemodel; import com.jpexs.asdec.abc.avm2.ConstantPool; @@ -10,22 +26,21 @@ import java.util.List; * @author JPEXS */ public class CommentTreeItem extends TreeItem { + public String comment; - public CommentTreeItem(AVM2Instruction instruction,String comment) { + + public CommentTreeItem(AVM2Instruction instruction, String comment) { super(instruction, NOPRECEDENCE); - this.comment=comment; + this.comment = comment; } @Override public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return "//"+comment; + return "//" + comment; } @Override public boolean needsSemicolon() { return false; } - - - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java index c73571261..e15591bcf 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java @@ -46,7 +46,7 @@ public class ConstructPropTreeItem extends TreeItem { String objstr = object.toString(constants, localRegNames, fullyQualifiedNames); if (!objstr.equals("")) { objstr += "."; - } + } return hilight("new ") + objstr + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + hilight("(") + argStr + hilight(")"); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/HasNextTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/HasNextTreeItem.java index bb1f28db2..3b8b0ef48 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/HasNextTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/HasNextTreeItem.java @@ -1,4 +1,19 @@ - +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2.treemodel; import com.jpexs.asdec.abc.avm2.ConstantPool; @@ -11,17 +26,18 @@ import java.util.List; * @author JPEXS */ public class HasNextTreeItem extends TreeItem { + public TreeItem object; public TreeItem collection; + public HasNextTreeItem(AVM2Instruction instruction, TreeItem object, TreeItem collection) { super(instruction, NOPRECEDENCE); - this.object=object; - this.collection=collection; + this.object = object; + this.collection = collection; } @Override public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return collection.toString(constants, localRegNames, fullyQualifiedNames)+" hasNext "+object.toString(constants, localRegNames, fullyQualifiedNames); + return collection.toString(constants, localRegNames, fullyQualifiedNames) + " hasNext " + object.toString(constants, localRegNames, fullyQualifiedNames); } - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextNameTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextNameTreeItem.java index 91ea427c9..72598c551 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextNameTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextNameTreeItem.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2.treemodel; import com.jpexs.asdec.abc.avm2.ConstantPool; @@ -13,15 +29,15 @@ public class NextNameTreeItem extends TreeItem { TreeItem index; TreeItem obj; - public NextNameTreeItem(AVM2Instruction instruction,TreeItem index,TreeItem obj) { + + public NextNameTreeItem(AVM2Instruction instruction, TreeItem index, TreeItem obj) { super(instruction, NOPRECEDENCE); - this.index=index; - this.obj=obj; + this.index = index; + this.obj = obj; } @Override public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return "nextName("+index.toString(constants, localRegNames, fullyQualifiedNames) +","+obj.toString(constants, localRegNames, fullyQualifiedNames)+")"; + return "nextName(" + index.toString(constants, localRegNames, fullyQualifiedNames) + "," + obj.toString(constants, localRegNames, fullyQualifiedNames) + ")"; } - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextValueTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextValueTreeItem.java index bcdf8ecde..0c0d61ca8 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextValueTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NextValueTreeItem.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2.treemodel; import com.jpexs.asdec.abc.avm2.ConstantPool; @@ -13,15 +29,15 @@ public class NextValueTreeItem extends TreeItem { TreeItem index; TreeItem obj; - public NextValueTreeItem(AVM2Instruction instruction,TreeItem index,TreeItem obj) { + + public NextValueTreeItem(AVM2Instruction instruction, TreeItem index, TreeItem obj) { super(instruction, NOPRECEDENCE); - this.index=index; - this.obj=obj; + this.index = index; + this.obj = obj; } @Override public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - return "nextValue("+index.toString(constants, localRegNames, fullyQualifiedNames) +","+obj.toString(constants, localRegNames, fullyQualifiedNames)+")"; + return "nextValue(" + index.toString(constants, localRegNames, fullyQualifiedNames) + "," + obj.toString(constants, localRegNames, fullyQualifiedNames) + ")"; } - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java index 9ab785323..7186564af 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java @@ -56,8 +56,8 @@ public class SetSlotTreeItem extends TreeItem implements SetTypeTreeItem, Assign } } }*/ - if(slotName==null){ - return ret+"/*UnknownSlot*/"; + if (slotName == null) { + return ret + "/*UnknownSlot*/"; } return ret + hilight(slotName.getName(constants, fullyQualifiedNames)); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java index 4adcc7c8f..415aa6fb5 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.helpers.Highlighting; import java.util.HashMap; import java.util.List; -import java.util.Stack; public abstract class TreeItem { @@ -69,9 +68,9 @@ public abstract class TreeItem { if (instruction == null) { return str; } - if(instruction.mappedOffset>=0){ + if (instruction.mappedOffset >= 0) { return Highlighting.hilighOffset(str, instruction.mappedOffset); - }else{ + } else { return Highlighting.hilighOffset(str, instruction.offset); } } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithEndTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithEndTreeItem.java index e800db082..936495850 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithEndTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithEndTreeItem.java @@ -34,7 +34,7 @@ public class WithEndTreeItem extends TreeItem { public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return hilight("}"); } - + public boolean needsSemicolon() { return false; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java index e38d18e98..9dcc861d3 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java @@ -44,12 +44,12 @@ public class WithTreeItem extends TreeItem { String ret; ret = hilight("with(") + scope.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")\r\n{\r\n"); /*for (TreeItem ti : items) { - ret += ti.toString(constants, localRegNames, fullyQualifiedNames) + "\r\n"; - } - ret += hilight("}");*/ + ret += ti.toString(constants, localRegNames, fullyQualifiedNames) + "\r\n"; + } + ret += hilight("}");*/ return ret; } - + public boolean needsSemicolon() { return false; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java index 9a68a4f5e..ca425057a 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java @@ -47,7 +47,7 @@ public class ForInTreeItem extends LoopTreeItem implements Block { } this.expression = expression; this.commands = commands; - + if ((!commands.isEmpty()) && (commands.get(commands.size() - 1) instanceof ContinueTreeItem)) { if (((ContinueTreeItem) commands.get(commands.size() - 1)).loopPos == loopBreak) { commands.remove(commands.size() - 1); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java index d8c4bf1c9..053e458c0 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java @@ -37,7 +37,7 @@ public class ForTreeItem extends LoopTreeItem implements Block { this.expression = expression; this.finalCommands = finalCommands; this.commands = commands; - + if ((!commands.isEmpty()) && (commands.get(commands.size() - 1) instanceof ContinueTreeItem)) { if (((ContinueTreeItem) commands.get(commands.size() - 1)).loopPos == loopBreak) { commands.remove(commands.size() - 1); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java index a51c75fe7..efb22eca2 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java @@ -34,13 +34,13 @@ public class SwitchTreeItem extends LoopTreeItem implements Block { public List defaultCommands; public List valuesMapping; - public SwitchTreeItem(AVM2Instruction instruction, int switchBreak, TreeItem switchedObject, List caseValues, List> caseCommands, List defaultCommands,List valuesMapping) { + public SwitchTreeItem(AVM2Instruction instruction, int switchBreak, TreeItem switchedObject, List caseValues, List> caseCommands, List defaultCommands, List valuesMapping) { super(instruction, switchBreak, -1); this.switchedObject = switchedObject; this.caseValues = caseValues; this.caseCommands = caseCommands; this.defaultCommands = defaultCommands; - this.valuesMapping=valuesMapping; + this.valuesMapping = valuesMapping; } @Override @@ -49,9 +49,9 @@ public class SwitchTreeItem extends LoopTreeItem implements Block { ret += "loop" + loopBreak + ":\r\n"; ret += hilight("switch(") + switchedObject.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")") + "\r\n{\r\n"; for (int i = 0; i < caseCommands.size(); i++) { - for(int k=0;k 0) { - if(!((defaultCommands.size()==1)&&(defaultCommands.get(0) instanceof BreakTreeItem)&&(((BreakTreeItem)defaultCommands.get(0)).loopPos==loopBreak))){ + if (!((defaultCommands.size() == 1) && (defaultCommands.get(0) instanceof BreakTreeItem) && (((BreakTreeItem) defaultCommands.get(0)).loopPos == loopBreak))) { ret += hilight("default") + ":\r\n"; ret += AVM2Code.IDENTOPEN + "\r\n"; for (int j = 0; j < defaultCommands.size(); j++) { @@ -69,7 +69,7 @@ public class SwitchTreeItem extends LoopTreeItem implements Block { } ret += AVM2Code.IDENTCLOSE + "\r\n"; } - + } ret += hilight("}") + "\r\n"; ret += ":loop" + loopBreak; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java index b0773589e..b3432e933 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java @@ -33,7 +33,7 @@ public class WhileTreeItem extends LoopTreeItem implements Block { super(instruction, loopBreak, loopContinue); this.expression = expression; this.commands = commands; - + if ((!commands.isEmpty()) && (commands.get(commands.size() - 1) instanceof ContinueTreeItem)) { if (((ContinueTreeItem) commands.get(commands.size() - 1)).loopPos == loopBreak) { commands.remove(commands.size() - 1); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java index 8f9dba433..15ed43a52 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java @@ -24,7 +24,7 @@ public class EqTreeItem extends BinaryOpTreeItem implements LogicalOp { public EqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "=="); } - + @Override public TreeItem invert() { return new NeqTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java index f573c6417..f47b28a48 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java @@ -19,12 +19,12 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class GeTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class GeTreeItem extends BinaryOpTreeItem implements LogicalOp { public GeTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">="); } - + @Override public TreeItem invert() { return new LtTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java index 1e7076dde..3d776ebd8 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java @@ -19,12 +19,12 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class GtTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class GtTreeItem extends BinaryOpTreeItem implements LogicalOp { public GtTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">"); } - + @Override public TreeItem invert() { return new LeTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java index b816137b3..66392d868 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java @@ -19,12 +19,12 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class LeTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class LeTreeItem extends BinaryOpTreeItem implements LogicalOp { public LeTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<="); } - + @Override public TreeItem invert() { return new GtTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LogicalOp.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LogicalOp.java index af4322cdd..a947ba4fa 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LogicalOp.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LogicalOp.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; @@ -7,5 +23,6 @@ import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; * @author JPEXS */ public interface LogicalOp { + public TreeItem invert(); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java index 3cafea7df..c6d2ba741 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java @@ -19,12 +19,12 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class LtTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class LtTreeItem extends BinaryOpTreeItem implements LogicalOp { public LtTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<"); } - + @Override public TreeItem invert() { return new GeTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java index 2003e3d22..0dea304fa 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java @@ -19,7 +19,7 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class NotTreeItem extends UnaryOpTreeItem implements LogicalOp{ +public class NotTreeItem extends UnaryOpTreeItem implements LogicalOp { public NotTreeItem(AVM2Instruction instruction, TreeItem value) { super(instruction, PRECEDENCE_UNARY, value, "!"); @@ -34,7 +34,7 @@ public class NotTreeItem extends UnaryOpTreeItem implements LogicalOp{ public boolean isFalse() { return !value.isFalse(); } - + @Override public TreeItem invert() { return value; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java index accf18073..d3dfc99c2 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java @@ -19,12 +19,12 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class StrictEqTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class StrictEqTreeItem extends BinaryOpTreeItem implements LogicalOp { public StrictEqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "==="); } - + @Override public TreeItem invert() { return new StrictNeqTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java index 28b4bd4fc..06877b94c 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java @@ -19,12 +19,12 @@ package com.jpexs.asdec.abc.avm2.treemodel.operations; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -public class StrictNeqTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class StrictNeqTreeItem extends BinaryOpTreeItem implements LogicalOp { public StrictNeqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=="); } - + @Override public TreeItem invert() { return new StrictEqTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ABCPanel.java b/trunk/src/com/jpexs/asdec/abc/gui/ABCPanel.java index fdb1303d1..d09b30b0d 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/ABCPanel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/ABCPanel.java @@ -147,7 +147,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { oneList.add(list.get(index)); this.abc = list.get(index).abc; classTree.setDoABCTags(oneList); - } + } updateConstList(); } @@ -183,9 +183,9 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { - + decompiledTextArea = new DecompiledEditorPane(this); - decompiledScrollPane = new JScrollPane(decompiledTextArea); + decompiledScrollPane = new JScrollPane(decompiledTextArea); detailPanel = new DetailPanel(this); JPanel panB = new JPanel(); panB.setLayout(new BorderLayout()); @@ -243,7 +243,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { JPanel treePanel = new JPanel(); treePanel.setLayout(new BorderLayout()); - treePanel.add(new JScrollPane(classTree = new ClassesListTree(list,this)), BorderLayout.CENTER); + treePanel.add(new JScrollPane(classTree = new ClassesListTree(list, this)), BorderLayout.CENTER); JPanel searchPanel = new JPanel(); searchPanel.setLayout(new BorderLayout()); searchPanel.add(filterField, BorderLayout.CENTER); @@ -289,7 +289,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { constantTable.setAutoCreateRowSorter(true); final List inlist = list; - final ABCPanel t=this; + final ABCPanel t = this; constantTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { @@ -301,7 +301,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { } int multinameIndex = constantTable.convertRowIndexToModel(rowIndex); if (multinameIndex > 0) { - UsageFrame usageFrame = new UsageFrame(inlist, abc, multinameIndex,t); + UsageFrame usageFrame = new UsageFrame(inlist, abc, multinameIndex, t); usageFrame.setVisible(true); } } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java index 278e8a547..83ff6a39a 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java @@ -43,8 +43,6 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi public void setIgnoreCarret(boolean ignoreCarret) { this.ignoreCarret = ignoreCarret; } - - public ASMSourceEditorPane(DecompiledEditorPane decompiledEditor) { this.decompiledEditor = decompiledEditor; @@ -52,7 +50,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi } public void hilighOffset(long offset) { - if(isEditable()){ + if (isEditable()) { return; } for (Highlighting h2 : disassembledHilights) { @@ -73,7 +71,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi } public void graph() { - AVM2Graph gr = new AVM2Graph(abc.bodies[bodyIndex].code,abc,abc.bodies[bodyIndex]); + AVM2Graph gr = new AVM2Graph(abc.bodies[bodyIndex].code, abc, abc.bodies[bodyIndex]); (new GraphFrame(gr, "")).setVisible(true); } @@ -102,7 +100,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi @Override public void setText(String t) { disassembledHilights = Highlighting.getInstrHighlights(t); - t=Highlighting.stripHilights(t); + t = Highlighting.stripHilights(t); super.setText(t); } @@ -180,7 +178,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi @Override public void caretUpdate(CaretEvent e) { - if(isEditable()){ + if (isEditable()) { return; } if (ignoreCarret) { diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java b/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java index 83e45774c..b4edd3ab1 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java @@ -45,10 +45,10 @@ public class ClassesListTree extends JTree implements TreeSelectionListener { scrollPathToVisible(treePath); } - public ClassesListTree(List list,ABCPanel abcPanel) { + public ClassesListTree(List list, ABCPanel abcPanel) { this.abcList = list; this.treeList = getTreeList(list); - this.abcPanel=abcPanel; + this.abcPanel = abcPanel; setModel(new ClassesListTreeModel(this.treeList)); addTreeSelectionListener(this); DefaultTreeCellRenderer treeRenderer = new DefaultTreeCellRenderer(); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java index c42662730..3439439ac 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java @@ -16,28 +16,19 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.abc.avm2.ConvertException; import com.jpexs.asdec.abc.types.ScriptInfo; import com.jpexs.asdec.abc.types.traits.Trait; import com.jpexs.asdec.abc.types.traits.TraitSlotConst; import com.jpexs.asdec.helpers.Highlighting; import com.jpexs.asdec.tags.DoABCTag; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Timer; import java.util.TimerTask; -import javax.swing.JScrollPane; -import javax.swing.JViewport; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; -import javax.swing.text.Caret; public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretListener { @@ -82,7 +73,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL } private boolean displayMethod(int pos, int methodIndex) { - if(abc==null){ + if (abc == null) { return false; } int bi = abc.findBodyIndex(methodIndex); @@ -121,7 +112,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL } public void caretUpdate(CaretEvent e) { - if(abc==null){ + if (abc == null) { return; } if (ignoreCarret) { @@ -140,7 +131,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL break; } } - + for (Highlighting tm : methodHighlights) { if ((pos >= tm.startPos) && (pos < tm.startPos + tm.len)) { displayMethod(pos, (int) tm.offset); @@ -154,7 +145,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL return; } } - + if (classIndex == -1) { setNoTrait(); return; @@ -216,20 +207,20 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL if ((th.startPos > tc.startPos) && (th.startPos + th.len < tc.startPos + tc.len)) { if (th.offset == traitId) { try { - ignoreCarret=true; + ignoreCarret = true; setCaretPosition(th.startPos + th.len - 1); - ignoreCarret=false; + ignoreCarret = false; } catch (IllegalArgumentException iae) { } final int pos = th.startPos; new Timer().schedule(new TimerTask() { public void run() { try { - setCaretPosition(pos); + setCaretPosition(pos); } catch (IllegalArgumentException iae) { } } - }, 100); + }, 100); return; } } @@ -242,7 +233,6 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL setCaretPosition(0); } - public DecompiledEditorPane(ABCPanel abcPanel) { setEditable(false); @@ -252,12 +242,11 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL } private List abcList; - public void clearScriptCache() - { + public void clearScriptCache() { bufferedClasses.clear(); } - - public void setScript(ScriptInfo script, ABC abc, List abcList) { + + public void setScript(ScriptInfo script, ABC abc, List abcList) { if (script == null) { highlights = new ArrayList(); traitHighlights = new ArrayList(); @@ -269,7 +258,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL String hilightedCode; if (!bufferedClasses.containsKey(script)) { - hilightedCode = script.convert(abcList, abc, false, true); + hilightedCode = script.convert(abcList, abc, false, true); highlights = Highlighting.getInstrHighlights(hilightedCode); traitHighlights = Highlighting.getTraitHighlights(hilightedCode); methodHighlights = Highlighting.getMethodHighlights(hilightedCode); @@ -287,11 +276,11 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL this.abc = abc; this.abcList = abcList; this.script = script; - setText(hilightedCode); + setText(hilightedCode); } public void reloadClass() { - int ci=classIndex; + int ci = classIndex; if (bufferedClasses.containsKey(script)) { bufferedClasses.remove(script); } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DeobfuscationDialog.java b/trunk/src/com/jpexs/asdec/abc/gui/DeobfuscationDialog.java index c3ad3ccbd..668800641 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/DeobfuscationDialog.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/DeobfuscationDialog.java @@ -17,22 +17,16 @@ package com.jpexs.asdec.abc.gui; import com.jpexs.asdec.gui.View; -import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Hashtable; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.JSlider; /** diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DetailPanel.java b/trunk/src/com/jpexs/asdec/abc/gui/DetailPanel.java index 243ceccae..702a2125b 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/DetailPanel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/DetailPanel.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.Main; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.FlowLayout; @@ -50,7 +49,7 @@ public class DetailPanel extends JPanel implements ActionListener { private ABCPanel abcPanel; public DetailPanel(ABCPanel abcPanel) { - this.abcPanel=abcPanel; + this.abcPanel = abcPanel; innerPanel = new JPanel(); CardLayout layout = new CardLayout(); innerPanel.setLayout(layout); @@ -111,7 +110,7 @@ public class DetailPanel extends JPanel implements ActionListener { boolean b = cardMap.get(name) instanceof TraitDetail; buttonsPanel.setVisible(b); selectedCard = name; - selectedLabel.setText(selectedCard); + selectedLabel.setText(selectedCard); } public void actionPerformed(ActionEvent e) { @@ -127,7 +126,7 @@ public class DetailPanel extends JPanel implements ActionListener { if (cardMap.get(selectedCard) instanceof TraitDetail) { if (((TraitDetail) cardMap.get(selectedCard)).save()) { int lasttrait = abcPanel.decompiledTextArea.lastTraitIndex; - abcPanel.decompiledTextArea.reloadClass(); + abcPanel.decompiledTextArea.reloadClass(); abcPanel.decompiledTextArea.gotoTrait(lasttrait); JOptionPane.showMessageDialog(this, "Trait Successfully saved"); } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java index 5169e91e8..cde7e15e2 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.abc.avm2.graph.AVM2Graph; import com.jpexs.asdec.graph.Graph; import com.jpexs.asdec.graph.GraphPart; import com.jpexs.asdec.gui.View; @@ -25,7 +24,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Set; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -53,27 +51,27 @@ public class GraphFrame extends JFrame { protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.black); - paintPart(g, graph.heads.get(0), 0, getPartWidth(graph.heads.get(0), new HashSet()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2, new HashMap()); + paintPart(g, graph.heads.get(0), 0, getPartWidth(graph.heads.get(0), new HashSet()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2, new HashMap()); } - private void paintPart(Graphics g, GraphPart part, int y, int x, HashMap used) { - HashMap l = new HashMap(); + private void paintPart(Graphics g, GraphPart part, int y, int x, HashMap used) { + HashMap l = new HashMap(); l.putAll(used); - HashSet hs=new HashSet(); + HashSet hs = new HashSet(); hs.addAll(l.keySet()); int totalWidthParts = getPartWidth(part, hs); int totalWidth = totalWidthParts * (BLOCK_WIDTH + SPACE_HORIZONTAL); - + if (used.containsKey(part)) { g.setColor(Color.black); - Point p=used.get(part); + Point p = used.get(part); g.drawLine(x, y, p.x, p.y); return; } g.drawRect(x - BLOCK_WIDTH / 2 - SPACE_HORIZONTAL / 2, y, BLOCK_WIDTH, BLOCK_HEIGHT); g.drawString(part.toString(), x - BLOCK_WIDTH / 2, y + BLOCK_HEIGHT); - - used.put(part,new Point(x,y)); + + used.put(part, new Point(x, y)); if (part.nextParts.size() > 0) { int cx = x - totalWidth / 2; for (int p = 0; p < part.nextParts.size(); p++) { diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MethodBodyParamsPanel.java b/trunk/src/com/jpexs/asdec/abc/gui/MethodBodyParamsPanel.java index 003be4825..d2f6b0616 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/MethodBodyParamsPanel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/MethodBodyParamsPanel.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.types.MethodBody; import java.awt.Color; import java.awt.Dimension; @@ -43,9 +42,10 @@ public class MethodBodyParamsPanel extends JPanel implements ChangeListener { public JCheckBox autoFillCheckBox = new JCheckBox("Auto fill on code save (GLOBAL SETTING)"); public JLabel experimentalLabel = new JLabel("...EXPERIMENTAL"); private ABCPanel abcPanel; + public MethodBodyParamsPanel(ABCPanel abcPanel) { setLayout(null); - this.abcPanel=abcPanel; + this.abcPanel = abcPanel; maxStackLabel.setBounds(10, 10, 150, 25); maxStackField.setBounds(10 + 150 + 10, 10, 75, 25); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MethodCodePanel.java b/trunk/src/com/jpexs/asdec/abc/gui/MethodCodePanel.java index 62b02bd35..956554008 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/MethodCodePanel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/MethodCodePanel.java @@ -35,11 +35,11 @@ public class MethodCodePanel extends JPanel implements ActionListener { private ASMSourceEditorPane sourceTextArea; public JPanel buttonsPanel; - - public void focusEditor(){ + + public void focusEditor() { sourceTextArea.requestFocusInWindow(); } - + public void setIgnoreCarret(boolean ignoreCarret) { sourceTextArea.setIgnoreCarret(ignoreCarret); } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MethodTraitDetailPanel.java b/trunk/src/com/jpexs/asdec/abc/gui/MethodTraitDetailPanel.java index b21827b1f..5d24d7c7b 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/MethodTraitDetailPanel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/MethodTraitDetailPanel.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.Main; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; @@ -32,7 +31,7 @@ public class MethodTraitDetailPanel extends JTabbedPane implements TraitDetail { public ABCPanel abcPanel; public MethodTraitDetailPanel(ABCPanel abcPanel) { - this.abcPanel=abcPanel; + this.abcPanel = abcPanel; methodCodePanel = new MethodCodePanel(abcPanel.decompiledTextArea); methodBodyParamsPanel = new MethodBodyParamsPanel(abcPanel); methodInfoPanel = new MethodInfoPanel(); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java b/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java index 47dcc3e3b..5dc4cdb07 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.tags.DoABCTag; import java.util.List; @@ -31,13 +30,14 @@ public class TraitsList extends JList implements ListSelectionListener { List abcTags; int classIndex = -1; private ABCPanel abcPanel; + public int getClassIndex() { return classIndex; } public TraitsList(ABCPanel abcPanel) { addListSelectionListener(this); - this.abcPanel=abcPanel; + this.abcPanel = abcPanel; setCellRenderer(new IconListRenderer()); } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java b/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java index 96f35490a..1257301b8 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java @@ -46,9 +46,9 @@ public class TraitsListModel implements ListModel { public Object getElementAt(int index) { if (index < abc.class_info[classIndex].static_traits.traits.length) { - return abc.class_info[classIndex].static_traits.traits[index].convertHeader("",abcTags, abc, true, false, classIndex, false, new ArrayList()); + return abc.class_info[classIndex].static_traits.traits[index].convertHeader("", abcTags, abc, true, false, classIndex, false, new ArrayList()); } else if (index < abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length) { - return abc.instance_info[classIndex].instance_traits.traits[index - abc.class_info[classIndex].static_traits.traits.length].convertHeader("",abcTags, abc, false, false, classIndex, false, new ArrayList()); + return abc.instance_info[classIndex].instance_traits.traits[index - abc.class_info[classIndex].static_traits.traits.length].convertHeader("", abcTags, abc, false, false, classIndex, false, new ArrayList()); } else if (index == abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length) { return STR_INSTANCE_INITIALIZER; } else { diff --git a/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java index 22762a328..350e7693b 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.abc.gui; -import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.abc.usages.InsideClassMultinameUsage; import com.jpexs.asdec.abc.usages.MethodMultinameUsage; @@ -47,8 +46,8 @@ public class UsageFrame extends JFrame implements ActionListener, MouseListener private ABC abc; private ABCPanel abcPanel; - public UsageFrame(List abcTags, ABC abc, int multinameIndex,ABCPanel abcPanel) { - this.abcPanel=abcPanel; + public UsageFrame(List abcTags, ABC abc, int multinameIndex, ABCPanel abcPanel) { + this.abcPanel = abcPanel; List usages = abc.findMultinameUsage(multinameIndex); this.abc = abc; usageListModel = new UsageListModel(abcTags, abc); diff --git a/trunk/src/com/jpexs/asdec/abc/types/ABCException.java b/trunk/src/com/jpexs/asdec/abc/types/ABCException.java index 21ee182a1..a6bce46c9 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/ABCException.java +++ b/trunk/src/com/jpexs/asdec/abc/types/ABCException.java @@ -23,7 +23,7 @@ import com.jpexs.asdec.helpers.Helper; import java.io.Serializable; import java.util.List; -public class ABCException implements Serializable{ +public class ABCException implements Serializable { public int start; public int end; diff --git a/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java b/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java index 3f720135b..3c0e25b10 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java @@ -21,20 +21,14 @@ import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.abc.avm2.AVM2Code; import com.jpexs.asdec.abc.avm2.CodeStats; import com.jpexs.asdec.abc.avm2.ConstantPool; -import com.jpexs.asdec.abc.avm2.parser.ASM3Parser; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.types.traits.Traits; import com.jpexs.asdec.helpers.Helper; import com.jpexs.asdec.helpers.Highlighting; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Stack; -import java.util.logging.Level; -import java.util.logging.Logger; public class MethodBody implements Cloneable, Serializable { diff --git a/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java b/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java index a67dd6a3f..a1cb1f4b7 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java +++ b/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java @@ -42,28 +42,28 @@ public class ScriptInfo { } public String getPath(ABC abc) { - String packageName=""; - String scriptName=""; - int classCount=0; + String packageName = ""; + String scriptName = ""; + int classCount = 0; for (Trait t : traits.traits) { Multiname name = t.getName(abc); 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()); - if(t instanceof TraitClass){ + packageName = ns.getName(abc.constants); + scriptName = name.getName(abc.constants, new ArrayList()); + if (t instanceof TraitClass) { classCount++; } } } - if(classCount>1){ + if (classCount > 1) { scriptName = "[script]"; } - return packageName+"."+scriptName; + return packageName + "." + scriptName; } public String convert(List abcTags, ABC abc, boolean pcode, boolean highlighting) { - return traits.convert("",abcTags, abc, false, pcode, true, -1, highlighting, new ArrayList()); + return traits.convert("", abcTags, abc, false, pcode, true, -1, highlighting, new ArrayList()); } public void export(ABC abc, List abcList, String directory, boolean pcode) throws IOException { diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java b/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java index fcc122a12..67a664cbb 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java @@ -24,7 +24,7 @@ import com.jpexs.asdec.tags.DoABCTag; import java.io.Serializable; import java.util.List; -public abstract class Trait implements Serializable{ +public abstract class Trait implements Serializable { public int name_index; public int kindType; @@ -82,7 +82,7 @@ public abstract class Trait implements Serializable{ } } - if ((!nsname.contains(":"))&&(!nsname.equals(""))) { + if ((!nsname.contains(":")) && (!nsname.equals(""))) { ret += " " + nsname; } if (ns != null) { @@ -114,11 +114,11 @@ public abstract class Trait implements Serializable{ } public String convertPackaged(String path, List abcTags, ABC abc, boolean isStatic, boolean pcod, int classIndex, boolean highlight, List fullyQualifiedNames) { - return makePackageFromIndex(abc, name_index, convert(path,abcTags, abc, isStatic, pcod, classIndex, highlight, fullyQualifiedNames)); + return makePackageFromIndex(abc, name_index, convert(path, abcTags, abc, isStatic, pcod, classIndex, highlight, fullyQualifiedNames)); } - public String convertHeader(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { - return convert(path,abcTags, abc, isStatic, pcode, classIndex, highlight, fullyQualifiedNames).trim(); + public String convertHeader(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + return convert(path, abcTags, abc, isStatic, pcode, classIndex, highlight, fullyQualifiedNames).trim(); } protected String makePackageFromIndex(ABC abc, int name_index, String value) { diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java index 7a258914b..ea1fcf71a 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java @@ -284,14 +284,12 @@ public class TraitClass extends Trait { @Override public String convertHeader(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { - String classHeader = abc.instance_info[class_info].getClassHeaderStr(abc, fullyQualifiedNames); - return classHeader; + String classHeader = abc.instance_info[class_info].getClassHeaderStr(abc, fullyQualifiedNames); + return classHeader; } - - @Override - public String convert(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + public String convert(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { if (!highlight) { Highlighting.doHighlight = false; } @@ -379,7 +377,7 @@ public class TraitClass extends Trait { String bodyStr = ""; bodyIndex = abc.findBodyIndex(abc.class_info[class_info].cinit_index); if (bodyIndex != -1) { - bodyStr = abc.bodies[bodyIndex].toString(packageName+"."+abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames)+".staticinitializer",pcode, true, class_info, abc, abc.constants, abc.method_info, new Stack(), true, highlight, fullyQualifiedNames, abc.class_info[class_info].static_traits); + bodyStr = abc.bodies[bodyIndex].toString(packageName + "." + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", pcode, true, class_info, abc, abc.constants, abc.method_info, new Stack(), true, highlight, fullyQualifiedNames, abc.class_info[class_info].static_traits); } if (Highlighting.stripHilights(bodyStr).equals("")) { toPrint = ABC.addTabs(bodyStr, 3); @@ -413,7 +411,7 @@ public class TraitClass extends Trait { bodyStr = ""; bodyIndex = abc.findBodyIndex(abc.instance_info[class_info].iinit_index); if (bodyIndex != -1) { - bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(packageName+"."+abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) +".initializer",pcode, false, class_info, abc, abc.constants, abc.method_info, new Stack(), false, highlight, fullyQualifiedNames, abc.instance_info[class_info].instance_traits), 3); + bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(packageName + "." + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", pcode, false, class_info, abc, abc.constants, abc.method_info, new Stack(), false, highlight, fullyQualifiedNames, abc.instance_info[class_info].instance_traits), 3); constructorParams = abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants, abc.bodies[bodyIndex], abc, fullyQualifiedNames); } else { constructorParams = abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants, null, abc, fullyQualifiedNames); @@ -427,9 +425,9 @@ public class TraitClass extends Trait { //} //static variables,constants & methods - outTraits.add(abc.class_info[class_info].static_traits.convert(packageName+"."+abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames),abcTags, abc, true, pcode, false, class_info, highlight, fullyQualifiedNames)); + outTraits.add(abc.class_info[class_info].static_traits.convert(packageName + "." + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, true, pcode, false, class_info, highlight, fullyQualifiedNames)); - outTraits.add(abc.instance_info[class_info].instance_traits.convert(packageName+"."+abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames),abcTags, abc, false, pcode, false, class_info, highlight, fullyQualifiedNames)); + outTraits.add(abc.instance_info[class_info].instance_traits.convert(packageName + "." + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames), abcTags, abc, false, pcode, false, class_info, highlight, fullyQualifiedNames)); out.println(Helper.joinStrings(outTraits, "\r\n\r\n")); out.println(ABC.IDENT_STRING + "}");//class diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java index 4d161eb69..fc8adbcd8 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java @@ -35,7 +35,7 @@ public class TraitFunction extends Trait { } @Override - public String convertHeader(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + public String convertHeader(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { String modifier = getModifiers(abcTags, abc, isStatic) + " "; if (modifier.equals(" ")) { modifier = ""; @@ -45,12 +45,12 @@ public class TraitFunction extends Trait { } @Override - public String convert(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { - String header = convertHeader(path,abcTags, abc, isStatic, pcode, classIndex, highlight, fullyQualifiedNames); + public String convert(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + String header = convertHeader(path, abcTags, abc, isStatic, pcode, classIndex, highlight, fullyQualifiedNames); String bodyStr = ""; int bodyIndex = abc.findBodyIndex(method_info); if (bodyIndex != -1) { - bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(path+"."+abc.constants.constant_multiname[name_index].getName(abc.constants, fullyQualifiedNames),pcode, isStatic, classIndex, abc, abc.constants, abc.method_info, new Stack(), false, highlight, fullyQualifiedNames, null), 3); + bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(path + "." + abc.constants.constant_multiname[name_index].getName(abc.constants, fullyQualifiedNames), pcode, isStatic, classIndex, abc, abc.constants, abc.method_info, new Stack(), false, highlight, fullyQualifiedNames, null), 3); } return ABC.IDENT_STRING + ABC.IDENT_STRING + header + (abc.instance_info[classIndex].isInterface() ? ";" : " {\r\n" + bodyStr + "\r\n" + ABC.IDENT_STRING + ABC.IDENT_STRING + "}"); diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java index e378119d6..ab0625e2a 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.abc.types.traits; import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.abc.avm2.graph.AVM2Graph; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.types.MethodBody; import com.jpexs.asdec.helpers.Helper; @@ -36,7 +35,7 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public String convertHeader(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + public String convertHeader(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { String modifier = getModifiers(abcTags, abc, isStatic) + " "; if (modifier.equals(" ")) { modifier = ""; @@ -54,14 +53,14 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public String convert(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { - String header = convertHeader(path,abcTags, abc, isStatic, pcode, classIndex, highlight, fullyQualifiedNames); + public String convert(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + String header = convertHeader(path, abcTags, abc, isStatic, pcode, classIndex, highlight, fullyQualifiedNames); String bodyStr = ""; int bodyIndex = abc.findBodyIndex(method_info); if (bodyIndex != -1) { - bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(path+"."+getName(abc).getName(abc.constants, fullyQualifiedNames),pcode, isStatic, classIndex, abc, abc.constants, abc.method_info, new Stack(), false, highlight, fullyQualifiedNames, null), 3); + bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames), pcode, isStatic, classIndex, abc, abc.constants, abc.method_info, new Stack(), false, highlight, fullyQualifiedNames, null), 3); } - return ABC.IDENT_STRING + ABC.IDENT_STRING + header + ((classIndex!=-1 && abc.instance_info[classIndex].isInterface()) ? ";" : " {\r\n" + bodyStr + "\r\n" + ABC.IDENT_STRING + ABC.IDENT_STRING + "}"); + return ABC.IDENT_STRING + ABC.IDENT_STRING + header + ((classIndex != -1 && abc.instance_info[classIndex].isInterface()) ? ";" : " {\r\n" + bodyStr + "\r\n" + ABC.IDENT_STRING + ABC.IDENT_STRING + "}"); } } diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java index a85207b59..bb9d12d82 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java @@ -90,7 +90,7 @@ public class TraitSlotConst extends Trait { } @Override - public String convert(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { + public String convert(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, int classIndex, boolean highlight, List fullyQualifiedNames) { String modifier = getModifiers(abcTags, abc, isStatic) + " "; if (modifier.equals(" ")) { modifier = ""; diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java b/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java index a401f7413..686dc7d29 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java @@ -22,7 +22,7 @@ import com.jpexs.asdec.tags.DoABCTag; import java.io.Serializable; import java.util.List; -public class Traits implements Serializable{ +public class Traits implements Serializable { public Trait traits[] = new Trait[0]; @@ -49,7 +49,7 @@ public class Traits implements Serializable{ return s; } - public String convert(String path,List abcTags, ABC abc, boolean isStatic, boolean pcode, boolean makePackages, int classIndex, boolean highlighting, List fullyQualifiedNames) { + public String convert(String path, List abcTags, ABC abc, boolean isStatic, boolean pcode, boolean makePackages, int classIndex, boolean highlighting, List fullyQualifiedNames) { String s = ""; for (int t = 0; t < traits.length; t++) { if (t > 0) { @@ -58,9 +58,9 @@ public class Traits implements Serializable{ String plus; //System.out.println(path+":"+traits[t].convertHeader(path, abcTags, abc, isStatic, pcode, classIndex, highlighting, fullyQualifiedNames)); if (makePackages) { - plus = traits[t].convertPackaged(path,abcTags, abc, isStatic, pcode, classIndex, highlighting, fullyQualifiedNames); + plus = traits[t].convertPackaged(path, abcTags, abc, isStatic, pcode, classIndex, highlighting, fullyQualifiedNames); } else { - plus = traits[t].convert(path,abcTags, abc, isStatic, pcode, classIndex, highlighting, fullyQualifiedNames); + plus = traits[t].convert(path, abcTags, abc, isStatic, pcode, classIndex, highlighting, fullyQualifiedNames); } if (highlighting) { int h = t; diff --git a/trunk/src/com/jpexs/asdec/abc/usages/ConstVarMultinameUsage.java b/trunk/src/com/jpexs/asdec/abc/usages/ConstVarMultinameUsage.java index 4483dae7f..65d9c3a1e 100644 --- a/trunk/src/com/jpexs/asdec/abc/usages/ConstVarMultinameUsage.java +++ b/trunk/src/com/jpexs/asdec/abc/usages/ConstVarMultinameUsage.java @@ -39,10 +39,10 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { return super.toString(abcTags, abc) + " " + (parentTraitIndex > -1 ? (isStatic - ? (((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).convertHeader("",abcTags, abc, isStatic, false, classIndex, false, new ArrayList())) - : (((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).convertHeader("",abcTags, abc, isStatic, false, classIndex, false, new ArrayList()))) + ? (((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).convertHeader("", abcTags, abc, isStatic, false, classIndex, false, new ArrayList())) + : (((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).convertHeader("", abcTags, abc, isStatic, false, classIndex, false, new ArrayList()))) : "") - + ((TraitSlotConst) traits.traits[traitIndex]).convertHeader("",abcTags, abc, isStatic, false, classIndex, false, new ArrayList()); + + ((TraitSlotConst) traits.traits[traitIndex]).convertHeader("", abcTags, abc, isStatic, false, classIndex, false, new ArrayList()); } public int getTraitIndex() { diff --git a/trunk/src/com/jpexs/asdec/abc/usages/MethodMultinameUsage.java b/trunk/src/com/jpexs/asdec/abc/usages/MethodMultinameUsage.java index 6db654db1..effd24bc5 100644 --- a/trunk/src/com/jpexs/asdec/abc/usages/MethodMultinameUsage.java +++ b/trunk/src/com/jpexs/asdec/abc/usages/MethodMultinameUsage.java @@ -48,10 +48,10 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage { : "instance initializer") : ((parentTraitIndex > -1 ? (isStatic - ? (((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).convertHeader("",abcTags, abc, isStatic, false, classIndex, false, new ArrayList())) - : (((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).convertHeader("",abcTags, abc, isStatic, false, classIndex, false, new ArrayList()))) + " " + ? (((TraitMethodGetterSetter) abc.class_info[classIndex].static_traits.traits[parentTraitIndex]).convertHeader("", abcTags, abc, isStatic, false, classIndex, false, new ArrayList())) + : (((TraitMethodGetterSetter) abc.instance_info[classIndex].instance_traits.traits[parentTraitIndex]).convertHeader("", abcTags, abc, isStatic, false, classIndex, false, new ArrayList()))) + " " : "") - + (((TraitMethodGetterSetter) traits.traits[traitIndex]).convertHeader("",abcTags, abc, isStatic, false, classIndex, false, new ArrayList())))); + + (((TraitMethodGetterSetter) traits.traits[traitIndex]).convertHeader("", abcTags, abc, isStatic, false, classIndex, false, new ArrayList())))); } public int getTraitIndex() { diff --git a/trunk/src/com/jpexs/asdec/action/Action.java b/trunk/src/com/jpexs/asdec/action/Action.java index 86028e779..e896620bb 100644 --- a/trunk/src/com/jpexs/asdec/action/Action.java +++ b/trunk/src/com/jpexs/asdec/action/Action.java @@ -16,7 +16,6 @@ */ package com.jpexs.asdec.action; -import com.jpexs.asdec.Main; import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; @@ -25,15 +24,11 @@ import com.jpexs.asdec.action.special.ActionNop; import com.jpexs.asdec.action.swf4.*; import com.jpexs.asdec.action.swf5.*; import com.jpexs.asdec.action.swf6.ActionEnumerate2; -import com.jpexs.asdec.action.swf6.ActionStrictEquals; import com.jpexs.asdec.action.swf7.ActionDefineFunction2; import com.jpexs.asdec.action.swf7.ActionTry; import com.jpexs.asdec.action.treemodel.*; import com.jpexs.asdec.action.treemodel.clauses.*; -import com.jpexs.asdec.action.treemodel.operations.AndTreeItem; -import com.jpexs.asdec.action.treemodel.operations.EqTreeItem; import com.jpexs.asdec.action.treemodel.operations.NotTreeItem; -import com.jpexs.asdec.action.treemodel.operations.OrTreeItem; import com.jpexs.asdec.helpers.Helper; import com.jpexs.asdec.helpers.Highlighting; import java.io.ByteArrayOutputStream; @@ -48,7 +43,7 @@ import java.util.logging.Logger; public class Action { public Action beforeInsert; - public boolean ignored=false; + public boolean ignored = false; /** * Action type identifier */ @@ -125,7 +120,7 @@ public class Action { List ret = new ArrayList(); return ret; } - + /** * Gets all ActionIf or ActionJump actions from subactions * @@ -369,20 +364,20 @@ public class Action { if (importantOffsets.contains(offset)) { ret += "loc" + Helper.formatAddress(offset) + ":"; } - - if(a.ignored){ - int len=a.getBytes(version).length; - for(int i=0;i tryCommands = ActionGraph.translateViaGraph(registerNames, atry.tryBody, version); TreeItem catchName; if (atry.catchInRegisterFlag) { - catchName = new DirectValueTreeItem(atry,-1, new RegisterNumber(atry.catchRegister), new ArrayList()); + catchName = new DirectValueTreeItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList()); } else { - catchName = new DirectValueTreeItem(atry,-1, atry.catchName, new ArrayList()); + catchName = new DirectValueTreeItem(atry, -1, atry.catchName, new ArrayList()); } List catchExceptions = new ArrayList(); catchExceptions.add(catchName); diff --git a/trunk/src/com/jpexs/asdec/action/ActionGraph.java b/trunk/src/com/jpexs/asdec/action/ActionGraph.java index 0d0859fe5..eb7345b06 100644 --- a/trunk/src/com/jpexs/asdec/action/ActionGraph.java +++ b/trunk/src/com/jpexs/asdec/action/ActionGraph.java @@ -16,22 +16,16 @@ */ package com.jpexs.asdec.action; -import com.jpexs.asdec.graph.Graph; -import com.jpexs.asdec.graph.GraphPart; -import com.jpexs.asdec.graph.Loop; -import com.jpexs.asdec.graph.GraphPartMulti; import com.jpexs.asdec.action.swf4.ActionIf; import com.jpexs.asdec.action.swf4.ActionJump; import com.jpexs.asdec.action.swf4.Null; import com.jpexs.asdec.action.swf5.ActionReturn; -import com.jpexs.asdec.action.swf6.ActionStrictEquals; import com.jpexs.asdec.action.swf7.ActionThrow; import com.jpexs.asdec.action.treemodel.BreakTreeItem; import com.jpexs.asdec.action.treemodel.ContinueTreeItem; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.StoreRegisterTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; -import com.jpexs.asdec.action.treemodel.UnsupportedTreeItem; import com.jpexs.asdec.action.treemodel.clauses.DoWhileTreeItem; import com.jpexs.asdec.action.treemodel.clauses.ForTreeItem; import com.jpexs.asdec.action.treemodel.clauses.IfTreeItem; @@ -43,15 +37,16 @@ import com.jpexs.asdec.action.treemodel.operations.LogicalOp; import com.jpexs.asdec.action.treemodel.operations.NotTreeItem; import com.jpexs.asdec.action.treemodel.operations.OrTreeItem; import com.jpexs.asdec.action.treemodel.operations.StrictEqTreeItem; -import com.jpexs.asdec.helpers.Highlighting; +import com.jpexs.asdec.graph.Graph; +import com.jpexs.asdec.graph.GraphPart; +import com.jpexs.asdec.graph.GraphPartMulti; +import com.jpexs.asdec.graph.Loop; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Stack; -import java.util.logging.Level; -import java.util.logging.Logger; /** * @@ -205,7 +200,7 @@ public class ActionGraph extends Graph { } } if (switchedObject == null) { - switchedObject = new DirectValueTreeItem(null,-1, new Null(), null); + switchedObject = new DirectValueTreeItem(null, -1, new Null(), null); } HashMap caseValuesMap = new HashMap(); @@ -289,7 +284,7 @@ public class ActionGraph extends Graph { if ((defaultPart2 != breakPart) && (defaultCommands.isEmpty())) { defaultPart = defaultPart2; } - + List caseValues = new ArrayList(); for (int i = 0; i < caseBodyParts.size(); i++) { @@ -430,7 +425,7 @@ public class ActionGraph extends Graph { } TreeItem expr = null; if ((code.get(part.end) instanceof ActionJump) || (!(code.get(part.end) instanceof ActionIf))) { - expr = new DirectValueTreeItem(null,-1, (Boolean) true, new ArrayList()); + expr = new DirectValueTreeItem(null, -1, (Boolean) true, new ArrayList()); } else { if (stack.isEmpty()) { } @@ -584,7 +579,7 @@ public class ActionGraph extends Graph { } else { ret.add(lop); } - } + } return ret; } private List posCache; diff --git a/trunk/src/com/jpexs/asdec/action/IgnoredPair.java b/trunk/src/com/jpexs/asdec/action/IgnoredPair.java index 03b7b3632..3fc3e1dfc 100644 --- a/trunk/src/com/jpexs/asdec/action/IgnoredPair.java +++ b/trunk/src/com/jpexs/asdec/action/IgnoredPair.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.action; /** @@ -5,6 +21,7 @@ package com.jpexs.asdec.action; * @author JPEXS */ public class IgnoredPair { + public Action action; public int pos; @@ -12,5 +29,4 @@ public class IgnoredPair { this.action = action; this.pos = pos; } - } diff --git a/trunk/src/com/jpexs/asdec/action/flashlite/ActionFSCommand2.java b/trunk/src/com/jpexs/asdec/action/flashlite/ActionFSCommand2.java index 7afd2b673..3a7a9f0a3 100644 --- a/trunk/src/com/jpexs/asdec/action/flashlite/ActionFSCommand2.java +++ b/trunk/src/com/jpexs/asdec/action/flashlite/ActionFSCommand2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.flashlite; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.FSCommand2TreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java b/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java index a29ec1f0c..887ea6007 100644 --- a/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java +++ b/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.StrictModeTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/special/ActionNop.java b/trunk/src/com/jpexs/asdec/action/special/ActionNop.java index 870e8c63e..644377467 100644 --- a/trunk/src/com/jpexs/asdec/action/special/ActionNop.java +++ b/trunk/src/com/jpexs/asdec/action/special/ActionNop.java @@ -17,8 +17,6 @@ package com.jpexs.asdec.action.special; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; -import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java index 1a85f04f9..4c4430841 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GetURLTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; @@ -71,5 +70,5 @@ public class ActionGetURL extends Action { @Override public void translate(Stack stack, List output, java.util.HashMap regNames) { output.add(new GetURLTreeItem(this, urlString, targetString)); - } + } } diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java index c0a7cf607..22ab9f174 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GotoLabelTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java index 6e38db7b2..8683bd29e 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GotoFrameTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionNextFrame.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionNextFrame.java index 896d3377b..2308de8de 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionNextFrame.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionNextFrame.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf3; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionPlay.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionPlay.java index 18fbfbe9a..c503d68b2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionPlay.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionPlay.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf3; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionPrevFrame.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionPrevFrame.java index c6d59ef0c..7cb517bc6 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionPrevFrame.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionPrevFrame.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf3; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java index f72739d4e..7ae897f71 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SetTargetTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionStop.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionStop.java index 64b8e55b1..324b67ca2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionStop.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionStop.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf3; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionStopSounds.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionStopSounds.java index c1bd950ec..3ab7ec7e2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionStopSounds.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionStopSounds.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf3; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionToggleQuality.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionToggleQuality.java index deac40131..60cb261c7 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionToggleQuality.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionToggleQuality.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf3; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java index 547b8f474..0c11a00ef 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.WaitForFrameTreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionAdd.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionAdd.java index 6a329f28a..90d952d44 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionAdd.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionAdd.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.AddTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionAnd.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionAnd.java index 0d97db802..05064098a 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionAnd.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionAnd.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.AndTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionAsciiToChar.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionAsciiToChar.java index 42d811689..802271254 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionAsciiToChar.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionAsciiToChar.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.AsciiToCharTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionCall.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionCall.java index 628493d19..a15f40129 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionCall.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionCall.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CallTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionCharToAscii.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionCharToAscii.java index 5561d3b7a..74f9f0f7e 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionCharToAscii.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionCharToAscii.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CharToAsciiTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionCloneSprite.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionCloneSprite.java index 77ea00cdc..ff79bf0d9 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionCloneSprite.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionCloneSprite.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CloneSpriteTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionDivide.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionDivide.java index ff75a9362..dcdf6587c 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionDivide.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionDivide.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.DivideTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionEndDrag.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionEndDrag.java index 8af8fbcf3..6760fc951 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionEndDrag.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionEndDrag.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionEquals.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionEquals.java index d7916a3f4..f26f46151 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionEquals.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionEquals.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.EqTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetProperty.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetProperty.java index 48fdc0ccf..a5d9df25a 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetProperty.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetProperty.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.GetPropertyTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetTime.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetTime.java index f296f42e5..baf7af0a4 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetTime.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetTime.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SimpleActionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java index 63795670c..ec6b7fe57 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GetURL2TreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetVariable.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetVariable.java index cbb0522f6..834f7ffb8 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetVariable.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetVariable.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GetVariableTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java index 4f6cb4b54..738b703b8 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GotoFrame2TreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java index cd9e735d2..8dd91f11d 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java @@ -32,12 +32,11 @@ public class ActionJump extends Action { public int offset; public String identifier; - public ActionJump(int offset){ - super(0x99,2); - this.offset=offset; + public ActionJump(int offset) { + super(0x99, 2); + this.offset = offset; } - - + public ActionJump(SWFInputStream sis) throws IOException { super(0x99, 2); offset = sis.readSI16(); @@ -87,6 +86,4 @@ public class ActionJump extends Action { public String toString() { return "Jump"; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionLess.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionLess.java index 227716525..4320f4f33 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionLess.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionLess.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.LtTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBAsciiToChar.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBAsciiToChar.java index b2cd7d4ea..648646880 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBAsciiToChar.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBAsciiToChar.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.MBAsciiToCharTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBCharToAscii.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBCharToAscii.java index 4216068c2..2cc397bc6 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBCharToAscii.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBCharToAscii.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.MBCharToAsciiTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringExtract.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringExtract.java index 2ea1a24a1..64f8a4b0e 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringExtract.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringExtract.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.MBStringExtractTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringLength.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringLength.java index 76a47bdbd..b1050e188 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringLength.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionMBStringLength.java @@ -17,9 +17,8 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; -import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.MBStringLengthTreeItem; +import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionMultiply.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionMultiply.java index 32b4cf2ae..1c21272c3 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionMultiply.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionMultiply.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.MultiplyTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionNot.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionNot.java index 4f6861cfe..3b6732302 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionNot.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionNot.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.NotTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionOr.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionOr.java index 7b2b8a2bd..7314505bb 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionOr.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionOr.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.OrTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionPop.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionPop.java index a5a53b520..24fba1d6a 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionPop.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionPop.java @@ -19,10 +19,7 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CallFunctionTreeItem; import com.jpexs.asdec.action.treemodel.CallMethodTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; -import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; -import com.jpexs.asdec.action.treemodel.VoidTreeItem; import java.util.List; import java.util.Stack; @@ -43,11 +40,11 @@ public class ActionPop extends Action { return; } TreeItem val = stack.pop(); - if((val instanceof CallFunctionTreeItem)||(val instanceof CallMethodTreeItem)){ + if ((val instanceof CallFunctionTreeItem) || (val instanceof CallMethodTreeItem)) { output.add(val); } /*if (!(val instanceof DirectValueTreeItem)) { - output.add(new VoidTreeItem(this, val)); - }*/ + output.add(new VoidTreeItem(this, val)); + }*/ } } diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java index 58a9cbd08..dbc51de5f 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java @@ -22,7 +22,6 @@ import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; import com.jpexs.asdec.action.parser.ParsedSymbol; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; @@ -37,7 +36,7 @@ public class ActionPush extends Action { public List values; public List constantPool; - public List ignoredParts=new ArrayList(); + public List ignoredParts = new ArrayList(); public ActionPush(int actionLength, SWFInputStream sis, int version) throws IOException { super(0x96, actionLength); @@ -178,9 +177,9 @@ public class ActionPush extends Action { @Override public String toString() { String ret = "Push "; - int pos=0; + int pos = 0; for (int i = 0; i < values.size(); i++) { - if(ignoredParts.contains(i)){ + if (ignoredParts.contains(i)) { continue; } if (pos > 0) { @@ -205,12 +204,12 @@ public class ActionPush extends Action { @Override public void translate(Stack stack, List output, java.util.HashMap regNames) { - int pos=0; + int pos = 0; for (Object o : values) { if (o instanceof ConstantIndex) { - if((constantPool==null)||(((ConstantIndex) o).index>=constantPool.size())){ - o="CONSTNOTFOUND"; - }else{ + if ((constantPool == null) || (((ConstantIndex) o).index >= constantPool.size())) { + o = "CONSTNOTFOUND"; + } else { o = constantPool.get(((ConstantIndex) o).index); } } @@ -219,7 +218,7 @@ public class ActionPush extends Action { ((RegisterNumber) o).name = regNames.get(((RegisterNumber) o).number); } } - stack.push(new DirectValueTreeItem(this, pos,o, constantPool)); + stack.push(new DirectValueTreeItem(this, pos, o, constantPool)); pos++; } } diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionRandomNumber.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionRandomNumber.java index 75805c1b2..afb8b201b 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionRandomNumber.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionRandomNumber.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.RandomNumberTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionRemoveSprite.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionRemoveSprite.java index c577965b3..6976f6049 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionRemoveSprite.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionRemoveSprite.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.RemoveSpriteTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionSetProperty.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionSetProperty.java index a34feeae0..5470ae2d6 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionSetProperty.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionSetProperty.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.SetPropertyTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionSetTarget2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionSetTarget2.java index 3a8226c99..5cc4798c3 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionSetTarget2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionSetTarget2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SetTarget2TreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionSetVariable.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionSetVariable.java index a9ff5bb33..7fa631dc4 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionSetVariable.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionSetVariable.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SetVariableTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionStartDrag.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionStartDrag.java index ca74885ef..5c664c685 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionStartDrag.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionStartDrag.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.StartDragTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringAdd.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringAdd.java index 8ddbc7b27..b257ffcdc 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringAdd.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringAdd.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.StringAddTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringEquals.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringEquals.java index 5dc5c0297..a456b8f57 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringEquals.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringEquals.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.StringEqTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringExtract.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringExtract.java index 619051b91..deed5c3d7 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringExtract.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringExtract.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.StringExtractTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLength.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLength.java index d03c75d43..22d32ceb9 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLength.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLength.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.StringLengthTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLess.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLess.java index db2a8d228..93c443943 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLess.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionStringLess.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.StringLtTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionSubtract.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionSubtract.java index d9fa1e6d8..39b531348 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionSubtract.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionSubtract.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.SubtractTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionToInteger.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionToInteger.java index cbf83b57d..b440bb04b 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionToInteger.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionToInteger.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ToIntegerTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionTrace.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionTrace.java index 8c1bf060e..cf8b5d727 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionTrace.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionTrace.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf4; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TraceTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java index 8ffa8682f..172997ab6 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.SWFOutputStream; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.WaitForFrame2TreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ConstantIndex.java b/trunk/src/com/jpexs/asdec/action/swf4/ConstantIndex.java index d171b9687..25cf79126 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ConstantIndex.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ConstantIndex.java @@ -28,7 +28,7 @@ public class ConstantIndex { public ConstantIndex(int index) { this.index = index; - this.constantPool = new ArrayList(); + this.constantPool = new ArrayList(); } public ConstantIndex(int index, List constantPool) { diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionAdd2.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionAdd2.java index 6c810fcac..34ef5cde8 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionAdd2.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionAdd2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.AddTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitAnd.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitAnd.java index 5f4a6c1b4..3a1018a07 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitAnd.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitAnd.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.BitAndTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitLShift.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitLShift.java index 55504c426..c59d93b11 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitLShift.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitLShift.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.LShiftTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitOr.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitOr.java index 27c3d4989..edd2ca4e9 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitOr.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitOr.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.BitOrTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitRShift.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitRShift.java index 3c66ba539..23a12c0ec 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitRShift.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitRShift.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.RShiftTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitURShift.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitURShift.java index 99550b2b4..2520a1803 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitURShift.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitURShift.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.URShiftTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitXor.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitXor.java index 31d6ffd27..89513eece 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionBitXor.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionBitXor.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.BitXorTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionCallFunction.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionCallFunction.java index 0b70b9312..2acf37903 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionCallFunction.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionCallFunction.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CallFunctionTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionCallMethod.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionCallMethod.java index d28935aee..6f1c8f5b1 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionCallMethod.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionCallMethod.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CallMethodTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java index 50668666c..d469d3029 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java @@ -22,7 +22,6 @@ import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; import com.jpexs.asdec.action.parser.ParsedSymbol; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; import java.io.ByteArrayInputStream; @@ -87,6 +86,5 @@ public class ActionConstantPool extends Action { @Override public void translate(Stack stack, List output, java.util.HashMap regNames) { - } } diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDecrement.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDecrement.java index c42e91183..78e566cce 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDecrement.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDecrement.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DecrementTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java index 813d30de9..d47d931b2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java @@ -25,7 +25,6 @@ import com.jpexs.asdec.action.parser.Label; import com.jpexs.asdec.action.parser.ParseException; import com.jpexs.asdec.action.swf4.ActionPush; import com.jpexs.asdec.action.swf7.ActionDefineFunction2; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.FunctionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; @@ -46,23 +45,24 @@ public class ActionDefineFunction extends Action { private int version; public List constantPool; - public void setConstantPool(List constantPool){ - this.constantPool=constantPool; - for(Action a:code){ - if(a instanceof ActionPush){ - ((ActionPush)a).constantPool=constantPool; + public void setConstantPool(List constantPool) { + this.constantPool = constantPool; + for (Action a : code) { + if (a instanceof ActionPush) { + ((ActionPush) a).constantPool = constantPool; } - if(a instanceof ActionDefineFunction2){ - ((ActionDefineFunction2)a).setConstantPool(constantPool); + if (a instanceof ActionDefineFunction2) { + ((ActionDefineFunction2) a).setConstantPool(constantPool); } - if(a instanceof ActionDefineFunction){ - ((ActionDefineFunction)a).setConstantPool(constantPool); + if (a instanceof ActionDefineFunction) { + ((ActionDefineFunction) a).setConstantPool(constantPool); } } } + public ActionDefineFunction(int actionLength, SWFInputStream sis, int version) throws IOException { super(0x9B, actionLength); - this.version=version; + this.version = version; //byte data[]=sis.readBytes(actionLength); //sis=new SWFInputStream(new ByteArrayInputStream(data),version); functionName = sis.readString(); @@ -151,17 +151,14 @@ public class ActionDefineFunction extends Action { public List getAllIfsOrJumps() { return Action.getActionsAllIfsOrJumps(code); } - - + @Override public void translate(Stack stack, List output, HashMap regNames) { - stack.push(new FunctionTreeItem(this, functionName, paramNames, Action.actionsToTree(regNames, code,version ), constantPool,1)); + stack.push(new FunctionTreeItem(this, functionName, paramNames, Action.actionsToTree(regNames, code, version), constantPool, 1)); } @Override public String toString() { return "DefineFunction"; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal.java index ebdf63734..f6bd28519 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DefineLocalTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal2.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal2.java index 7b4fa7ae6..95b36aec2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal2.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineLocal2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DefineLocalTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete.java index 7df130f2a..93b17635b 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DeleteTreeItem; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; @@ -42,6 +41,6 @@ public class ActionDelete extends Action { TreeItem object = stack.pop(); output.add(new DeleteTreeItem(this, object, propertyName)); - stack.push(new DirectValueTreeItem(this,-1, Boolean.TRUE, new ArrayList())); + stack.push(new DirectValueTreeItem(this, -1, Boolean.TRUE, new ArrayList())); } } diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete2.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete2.java index c3cdb1b46..79ee7149d 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete2.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDelete2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.DeleteTreeItem; import com.jpexs.asdec.action.treemodel.DirectValueTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; @@ -41,6 +40,6 @@ public class ActionDelete2 extends Action { TreeItem propertyName = stack.pop(); output.add(new DeleteTreeItem(this, null, propertyName)); - stack.push(new DirectValueTreeItem(this,-1, Boolean.TRUE, new ArrayList())); + stack.push(new DirectValueTreeItem(this, -1, Boolean.TRUE, new ArrayList())); } } diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionEnumerate.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionEnumerate.java index dd982be27..1ace01202 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionEnumerate.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionEnumerate.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.EnumerateTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionEquals2.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionEquals2.java index f0b37edbb..b4743e887 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionEquals2.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionEquals2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.EqTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionGetMember.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionGetMember.java index ff2cdf765..3747e2555 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionGetMember.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionGetMember.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.GetMemberTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionIncrement.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionIncrement.java index 13b894a00..eb5f75aa0 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionIncrement.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionIncrement.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.IncrementTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionInitArray.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionInitArray.java index cfe39490c..1575c91ba 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionInitArray.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionInitArray.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.InitArrayTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionInitObject.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionInitObject.java index 1904561c5..3448e4cfb 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionInitObject.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionInitObject.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.InitObjectTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionLess2.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionLess2.java index ee7f60a8c..54b4a511d 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionLess2.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionLess2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.LtTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionModulo.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionModulo.java index e6e9f4557..7ff352d9c 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionModulo.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionModulo.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.ModuloTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionNewMethod.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionNewMethod.java index 5b5b1549f..bc45ed8fd 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionNewMethod.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionNewMethod.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.NewMethodTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionNewObject.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionNewObject.java index ca0c18059..4f84bca93 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionNewObject.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionNewObject.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.NewObjectTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionPushDuplicate.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionPushDuplicate.java index 16f31e0ef..76d69d2f7 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionPushDuplicate.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionPushDuplicate.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.IgnoredPair; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; @@ -39,6 +38,6 @@ public class ActionPushDuplicate extends Action { TreeItem value = stack.pop(); stack.push(value); stack.push(value); - value.moreInstructions.add(new IgnoredPair(this,0)); + value.moreInstructions.add(new IgnoredPair(this, 0)); } } diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionReturn.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionReturn.java index 4f15527a5..8df94456b 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionReturn.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionReturn.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ReturnTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionSetMember.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionSetMember.java index 1e00bfae9..3088a42db 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionSetMember.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionSetMember.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.SetMemberTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionStackSwap.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionStackSwap.java index 0a407576e..63dcf4e13 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionStackSwap.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionStackSwap.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java index e61dcf783..39eea444f 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java @@ -22,7 +22,6 @@ import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.parser.FlasmLexer; import com.jpexs.asdec.action.parser.ParseException; import com.jpexs.asdec.action.swf4.RegisterNumber; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.StoreRegisterTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionTargetPath.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionTargetPath.java index ac9a9b4cc..2304ccf5e 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionTargetPath.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionTargetPath.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TargetPathTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionToNumber.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionToNumber.java index 240a4a31d..671d3575b 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionToNumber.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionToNumber.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ToNumberTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionToString.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionToString.java index 625e31966..1c1caf74e 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionToString.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionToString.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ToStringTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionTypeOf.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionTypeOf.java index f8ad5d90a..51a1b258c 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionTypeOf.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionTypeOf.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf5; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.TypeOfTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf6/ActionEnumerate2.java b/trunk/src/com/jpexs/asdec/action/swf6/ActionEnumerate2.java index d9d2d9427..f290ea0ef 100644 --- a/trunk/src/com/jpexs/asdec/action/swf6/ActionEnumerate2.java +++ b/trunk/src/com/jpexs/asdec/action/swf6/ActionEnumerate2.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf6; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.EnumerateTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf6/ActionGreater.java b/trunk/src/com/jpexs/asdec/action/swf6/ActionGreater.java index 348d929b7..87957ac7c 100644 --- a/trunk/src/com/jpexs/asdec/action/swf6/ActionGreater.java +++ b/trunk/src/com/jpexs/asdec/action/swf6/ActionGreater.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf6; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.GtTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf6/ActionInstanceOf.java b/trunk/src/com/jpexs/asdec/action/swf6/ActionInstanceOf.java index 6f15092ba..3744a1ee7 100644 --- a/trunk/src/com/jpexs/asdec/action/swf6/ActionInstanceOf.java +++ b/trunk/src/com/jpexs/asdec/action/swf6/ActionInstanceOf.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf6; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.InstanceOfTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf6/ActionStrictEquals.java b/trunk/src/com/jpexs/asdec/action/swf6/ActionStrictEquals.java index 623b37a2d..1d29aabd0 100644 --- a/trunk/src/com/jpexs/asdec/action/swf6/ActionStrictEquals.java +++ b/trunk/src/com/jpexs/asdec/action/swf6/ActionStrictEquals.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf6; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.StrictEqTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf6/ActionStringGreater.java b/trunk/src/com/jpexs/asdec/action/swf6/ActionStringGreater.java index 08a3aed9e..b6576f741 100644 --- a/trunk/src/com/jpexs/asdec/action/swf6/ActionStringGreater.java +++ b/trunk/src/com/jpexs/asdec/action/swf6/ActionStringGreater.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf6; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.action.treemodel.operations.GtTreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf7/ActionCastOp.java b/trunk/src/com/jpexs/asdec/action/swf7/ActionCastOp.java index 9bedb95c2..819504b69 100644 --- a/trunk/src/com/jpexs/asdec/action/swf7/ActionCastOp.java +++ b/trunk/src/com/jpexs/asdec/action/swf7/ActionCastOp.java @@ -18,7 +18,6 @@ package com.jpexs.asdec.action.swf7; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.CastOpTreeItem; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; import java.util.Stack; diff --git a/trunk/src/com/jpexs/asdec/action/swf7/ActionDefineFunction2.java b/trunk/src/com/jpexs/asdec/action/swf7/ActionDefineFunction2.java index 3ac281e63..2ed5ceee6 100644 --- a/trunk/src/com/jpexs/asdec/action/swf7/ActionDefineFunction2.java +++ b/trunk/src/com/jpexs/asdec/action/swf7/ActionDefineFunction2.java @@ -25,7 +25,6 @@ import com.jpexs.asdec.action.parser.Label; import com.jpexs.asdec.action.parser.ParseException; import com.jpexs.asdec.action.swf4.ActionPush; import com.jpexs.asdec.action.swf5.ActionDefineFunction; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.FunctionTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import com.jpexs.asdec.helpers.Helper; @@ -240,7 +239,7 @@ public class ActionDefineFunction2 extends Action { @Override public void translate(Stack stack, List output, HashMap regNames) { - stack.push(new FunctionTreeItem(this, functionName, paramNames, Action.actionsToTree(regNames, code, version), constantPool,getFirstRegister())); + stack.push(new FunctionTreeItem(this, functionName, paramNames, Action.actionsToTree(regNames, code, version), constantPool, getFirstRegister())); } @Override diff --git a/trunk/src/com/jpexs/asdec/action/swf7/ActionExtends.java b/trunk/src/com/jpexs/asdec/action/swf7/ActionExtends.java index ce432d283..36d3fc666 100644 --- a/trunk/src/com/jpexs/asdec/action/swf7/ActionExtends.java +++ b/trunk/src/com/jpexs/asdec/action/swf7/ActionExtends.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf7; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ExtendsTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/swf7/ActionImplementsOp.java b/trunk/src/com/jpexs/asdec/action/swf7/ActionImplementsOp.java index b3b888256..33f87ba45 100644 --- a/trunk/src/com/jpexs/asdec/action/swf7/ActionImplementsOp.java +++ b/trunk/src/com/jpexs/asdec/action/swf7/ActionImplementsOp.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf7; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ImplementsOpTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/asdec/action/swf7/ActionThrow.java b/trunk/src/com/jpexs/asdec/action/swf7/ActionThrow.java index a1e4fb736..dde9c93e0 100644 --- a/trunk/src/com/jpexs/asdec/action/swf7/ActionThrow.java +++ b/trunk/src/com/jpexs/asdec/action/swf7/ActionThrow.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.action.swf7; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.ThrowTreeItem; import com.jpexs.asdec.action.treemodel.TreeItem; import java.util.List; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/AsciiToCharTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/AsciiToCharTreeItem.java index 0e73fe1a3..16c7dfadb 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/AsciiToCharTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/AsciiToCharTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class AsciiToCharTreeItem extends TreeItem { @@ -34,11 +34,9 @@ public class AsciiToCharTreeItem extends TreeItem { } @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/CallFunctionTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/CallFunctionTreeItem.java index 5c8e31081..3843fb4ef 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/CallFunctionTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/CallFunctionTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class CallFunctionTreeItem extends TreeItem { @@ -41,12 +41,12 @@ public class CallFunctionTreeItem extends TreeItem { } return stripQuotes(functionName) + hilight("(") + paramStr + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(functionName.getNeededActions()); - for(TreeItem ti:arguments){ + for (TreeItem ti : arguments) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/CallMethodTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/CallMethodTreeItem.java index 073e25478..b63ef8d7a 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/CallMethodTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/CallMethodTreeItem.java @@ -18,7 +18,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.swf4.Undefined; -import java.util.HashMap; import java.util.List; +import java.util.List; public class CallMethodTreeItem extends TreeItem { @@ -58,13 +58,13 @@ public class CallMethodTreeItem extends TreeItem { } return scriptObject.toString(constants) + hilight(".") + stripQuotes(methodName) + hilight("(") + paramStr + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(methodName.getNeededActions()); ret.addAll(scriptObject.getNeededActions()); - for(TreeItem ti:arguments){ + for (TreeItem ti : arguments) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/CallTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/CallTreeItem.java index 5d4f993e4..62738d5d0 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/CallTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/CallTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class CallTreeItem extends TreeItem { @@ -32,11 +32,11 @@ public class CallTreeItem extends TreeItem { public String toString(ConstantPool constants) { return stripQuotes(value) + hilight("()"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); - ret.addAll(value.getNeededActions()); + public List getNeededActions() { + List ret = super.getNeededActions(); + ret.addAll(value.getNeededActions()); return ret; } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/CastOpTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/CastOpTreeItem.java index f67171588..c60ab1cb3 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/CastOpTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/CastOpTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class CastOpTreeItem extends TreeItem { @@ -34,10 +34,10 @@ public class CastOpTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("(") + stripQuotes(constructor) + hilight(")") + object.toString(constants); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(constructor.getNeededActions()); ret.addAll(object.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/CharToAsciiTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/CharToAsciiTreeItem.java index 5b1e5ff43..87b04357b 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/CharToAsciiTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/CharToAsciiTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class CharToAsciiTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class CharToAsciiTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("chr(") + value.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/CloneSpriteTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/CloneSpriteTreeItem.java index b969123a9..08eed00ff 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/CloneSpriteTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/CloneSpriteTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class CloneSpriteTreeItem extends TreeItem { @@ -36,10 +36,10 @@ public class CloneSpriteTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("duplicateMovieClip(") + target.toString(constants) + hilight(",") + source.toString(constants) + hilight(",") + depth.toString(constants) + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(source.getNeededActions()); ret.addAll(target.getNeededActions()); ret.addAll(depth.getNeededActions()); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ConstantPool.java b/trunk/src/com/jpexs/asdec/action/treemodel/ConstantPool.java index 35041a788..5a82f43d0 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ConstantPool.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ConstantPool.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ConstantPool { diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/DecrementTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/DecrementTreeItem.java index b3fbb4451..079ec140d 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/DecrementTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/DecrementTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class DecrementTreeItem extends TreeItem { @@ -32,20 +32,20 @@ public class DecrementTreeItem extends TreeItem { public String toString(ConstantPool constants) { return object.toString(constants) + hilight("-1"); } - + @Override - public boolean isCompileTime(){ + public boolean isCompileTime() { return object.isCompileTime(); } @Override public double toNumber() { - return object.toNumber()-1; + return object.toNumber() - 1; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/DefineLocalTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/DefineLocalTreeItem.java index e815af2e5..2ab7685a7 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/DefineLocalTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/DefineLocalTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class DefineLocalTreeItem extends TreeItem { @@ -37,10 +37,10 @@ public class DefineLocalTreeItem extends TreeItem { } return hilight("var ") + stripQuotes(name) + hilight("=") + value.toString(constants); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); ret.addAll(name.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/DeleteTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/DeleteTreeItem.java index 30eae5d9a..84d7ebae3 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/DeleteTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/DeleteTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class DeleteTreeItem extends TreeItem { @@ -37,10 +37,10 @@ public class DeleteTreeItem extends TreeItem { } return hilight("delete ") + object.toString(constants) + "." + stripQuotes(propertyName); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); ret.addAll(propertyName.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/DirectValueTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/DirectValueTreeItem.java index c9a4cff1c..54d86a50f 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/DirectValueTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/DirectValueTreeItem.java @@ -19,53 +19,50 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.swf4.ConstantIndex; import com.jpexs.asdec.helpers.Helper; -import java.util.HashMap; import java.util.List; +import java.util.List; public class DirectValueTreeItem extends TreeItem { public Object value; public List constants; - public DirectValueTreeItem(Action instruction,int instructionPos, Object value, List constants) { + public DirectValueTreeItem(Action instruction, int instructionPos, Object value, List constants) { super(instruction, PRECEDENCE_PRIMARY); this.constants = constants; this.value = value; - this.instructionPos=instructionPos; + this.instructionPos = instructionPos; } @Override public double toNumber() { - if(value instanceof Double){ - return (Double)value; + if (value instanceof Double) { + return (Double) value; } - if(value instanceof Float){ - return (Float)value; + if (value instanceof Float) { + return (Float) value; } - if(value instanceof Long){ - return (Long)value; + if (value instanceof Long) { + return (Long) value; } return super.toNumber(); } @Override public boolean toBoolean() { - if(value instanceof Boolean){ - return (Boolean)value; + if (value instanceof Boolean) { + return (Boolean) value; } - if(value instanceof Double){ - return Double.compare((Double)value,0.0)!=0; + if (value instanceof Double) { + return Double.compare((Double) value, 0.0) != 0; } - if(value instanceof Float){ - return Float.compare((Float)value,0.0f)!=0; + if (value instanceof Float) { + return Float.compare((Float) value, 0.0f) != 0; } - if(value instanceof Long){ - return ((Long)value)!=0; + if (value instanceof Long) { + return ((Long) value) != 0; } return false; } - - - @Override public String toStringNoQuotes(ConstantPool constants) { @@ -108,9 +105,9 @@ public class DirectValueTreeItem extends TreeItem { } return hilight(value.toString()); } - + @Override - public boolean isCompileTime(){ - return (value instanceof Double)||(value instanceof Float)||(value instanceof Boolean)||(value instanceof Long); + public boolean isCompileTime() { + return (value instanceof Double) || (value instanceof Float) || (value instanceof Boolean) || (value instanceof Long); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/EachTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/EachTreeItem.java index 544f2eac9..e3520d03a 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/EachTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/EachTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class EachTreeItem extends TreeItem { @@ -34,10 +34,10 @@ public class EachTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("each (") + object.toString(constants) + hilight(" in ") + collection.toString(constants) + ")"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); ret.addAll(collection.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/EnumerateTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/EnumerateTreeItem.java index d6db7b7b9..132f386a0 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/EnumerateTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/EnumerateTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class EnumerateTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class EnumerateTreeItem extends TreeItem { public String toString(ConstantPool constants) { return "enumerate " + object.toString(constants); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ExtendsTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ExtendsTreeItem.java index 38cab682f..26e3a1f7e 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ExtendsTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ExtendsTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ExtendsTreeItem extends TreeItem { @@ -34,10 +34,10 @@ public class ExtendsTreeItem extends TreeItem { public String toString(ConstantPool constants) { return subclass.toString(constants) + hilight(" extends ") + stripQuotes(superclass); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(subclass.getNeededActions()); ret.addAll(superclass.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/FSCommand2TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/FSCommand2TreeItem.java index 6c7df9c2f..431519a1f 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/FSCommand2TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/FSCommand2TreeItem.java @@ -17,8 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; -import java.util.HashMap; import java.util.List; +import java.util.List; public class FSCommand2TreeItem extends TreeItem { @@ -41,12 +40,12 @@ public class FSCommand2TreeItem extends TreeItem { } return hilight("FSCommand2(") + command.toString(constants) + paramStr + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(command.getNeededActions()); - for(TreeItem ti:arguments){ + for (TreeItem ti : arguments) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/FunctionTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/FunctionTreeItem.java index 029ded679..af982d747 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/FunctionTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/FunctionTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class FunctionTreeItem extends TreeItem { @@ -28,7 +28,7 @@ public class FunctionTreeItem extends TreeItem { public TreeItem calculatedFunctionName; private int regStart; - public FunctionTreeItem(Action instruction, String functionName, List paramNames, List actions, List constants,int regStart) { + public FunctionTreeItem(Action instruction, String functionName, List paramNames, List actions, List constants, int regStart) { super(instruction, PRECEDENCE_PRIMARY); this.actions = actions; this.constants = constants; @@ -50,21 +50,20 @@ public class FunctionTreeItem extends TreeItem { if (p > 0) { ret += hilight(", "); } - String pname=paramNames.get(p); - if(pname==null || pname.equals("")){ - pname="register"+(regStart+p); + String pname = paramNames.get(p); + if (pname == null || pname.equals("")) { + pname = "register" + (regStart + p); } ret += hilight(pname); } ret += hilight(")") + "\r\n{\r\n" + Action.treeToString(actions) + "}"; return ret; } - - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); - for(TreeItem ti:actions){ + public List getNeededActions() { + List ret = super.getNeededActions(); + for (TreeItem ti : actions) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/GetMemberTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/GetMemberTreeItem.java index 0725ea06c..eb2db46e4 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/GetMemberTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/GetMemberTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class GetMemberTreeItem extends TreeItem { @@ -38,10 +38,10 @@ public class GetMemberTreeItem extends TreeItem { } return object.toString(constants) + "." + stripQuotes(memberName); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); ret.addAll(memberName.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/GetPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/GetPropertyTreeItem.java index d1ffcacba..615d6ff6f 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/GetPropertyTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/GetPropertyTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class GetPropertyTreeItem extends TreeItem { @@ -37,11 +37,11 @@ public class GetPropertyTreeItem extends TreeItem { } return target.toString(constants) + hilight("." + Action.propertyNames[propertyIndex]); } - - @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + + @Override + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(target.getNeededActions()); return ret; - } + } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/GetURL2TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/GetURL2TreeItem.java index 4a054c13b..b032f6f64 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/GetURL2TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/GetURL2TreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class GetURL2TreeItem extends TreeItem { @@ -54,10 +54,10 @@ public class GetURL2TreeItem extends TreeItem { this.loadTargetFlag = loadTargetFlag; this.loadVariablesFlag = loadVariablesFlag; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(urlString.getNeededActions()); ret.addAll(targetString.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/GetVariableTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/GetVariableTreeItem.java index ce4fab145..504b5cfcf 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/GetVariableTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/GetVariableTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class GetVariableTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class GetVariableTreeItem extends TreeItem { public String toString(ConstantPool constants) { return stripQuotes(value); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/GotoFrame2TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/GotoFrame2TreeItem.java index 3b92364c3..1bdbc510c 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/GotoFrame2TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/GotoFrame2TreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class GotoFrame2TreeItem extends TreeItem { @@ -42,10 +42,10 @@ public class GotoFrame2TreeItem extends TreeItem { } return hilight(prefix + "(") + frame.toString(constants) + (sceneBiasFlag ? "," + sceneBias : "") + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(frame.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ImplementsOpTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ImplementsOpTreeItem.java index 683c1ac1d..99ca2217d 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ImplementsOpTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ImplementsOpTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ImplementsOpTreeItem extends TreeItem { @@ -41,12 +41,12 @@ public class ImplementsOpTreeItem extends TreeItem { } return subclass.toString(constants) + hilight(" implements ") + impStr; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(subclass.getNeededActions()); - for(TreeItem ti:superclasses){ + for (TreeItem ti : superclasses) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/IncrementTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/IncrementTreeItem.java index ace9d2fa5..841c72b70 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/IncrementTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/IncrementTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class IncrementTreeItem extends TreeItem { @@ -32,23 +32,21 @@ public class IncrementTreeItem extends TreeItem { public String toString(ConstantPool constants) { return object.toString(constants) + hilight("+1"); } - + @Override - public boolean isCompileTime(){ + public boolean isCompileTime() { return object.isCompileTime(); } @Override public double toNumber() { - return object.toNumber()+1; + return object.toNumber() + 1; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); return ret; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/InitArrayTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/InitArrayTreeItem.java index ecf7197c1..54002213f 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/InitArrayTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/InitArrayTreeItem.java @@ -18,8 +18,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.IgnoredPair; -import com.sun.org.apache.xml.internal.security.utils.IgnoreAllErrorHandler; -import java.util.HashMap; import java.util.List; +import java.util.List; public class InitArrayTreeItem extends TreeItem { @@ -43,7 +42,7 @@ public class InitArrayTreeItem extends TreeItem { } @Override - public List getNeededActions() { + public List getNeededActions() { List ret = super.getNeededActions(); for (TreeItem value : values) { ret.addAll(value.getNeededActions()); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/InitObjectTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/InitObjectTreeItem.java index 0e2727108..88358f4ff 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/InitObjectTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/InitObjectTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class InitObjectTreeItem extends TreeItem { @@ -41,14 +41,14 @@ public class InitObjectTreeItem extends TreeItem { } return hilight("{") + objStr + hilight("}"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); - for(TreeItem name:names){ + public List getNeededActions() { + List ret = super.getNeededActions(); + for (TreeItem name : names) { ret.addAll(name.getNeededActions()); } - for(TreeItem value:values){ + for (TreeItem value : values) { ret.addAll(value.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/MBAsciiToCharTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/MBAsciiToCharTreeItem.java index e4a31e467..78ae8353b 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/MBAsciiToCharTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/MBAsciiToCharTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class MBAsciiToCharTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class MBAsciiToCharTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("mbord(") + value.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/MBCharToAsciiTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/MBCharToAsciiTreeItem.java index c4d361c58..1251e6959 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/MBCharToAsciiTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/MBCharToAsciiTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class MBCharToAsciiTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class MBCharToAsciiTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("mbchr(") + value.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/MBStringExtractTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/MBStringExtractTreeItem.java index 4939d0ea8..95df84d2a 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/MBStringExtractTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/MBStringExtractTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class MBStringExtractTreeItem extends TreeItem { @@ -36,10 +36,10 @@ public class MBStringExtractTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("mbsubstring(") + value.toString(constants) + hilight(",") + index.toString(constants) + hilight(",") + count.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); ret.addAll(index.getNeededActions()); ret.addAll(count.getNeededActions()); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/MBStringLengthTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/MBStringLengthTreeItem.java index 363149326..38bb60ef4 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/MBStringLengthTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/MBStringLengthTreeItem.java @@ -17,9 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import com.jpexs.asdec.action.treemodel.ConstantPool; -import com.jpexs.asdec.action.treemodel.TreeItem; -import java.util.HashMap; import java.util.List; +import java.util.List; public class MBStringLengthTreeItem extends TreeItem { @@ -38,10 +36,10 @@ public class MBStringLengthTreeItem extends TreeItem { } return hilight("mblength(") + s + ")"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/NewMethodTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/NewMethodTreeItem.java index cbdfca359..68b7fdc6d 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/NewMethodTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/NewMethodTreeItem.java @@ -18,7 +18,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.swf4.Undefined; -import java.util.HashMap; import java.util.List; +import java.util.List; public class NewMethodTreeItem extends TreeItem { @@ -63,13 +63,13 @@ public class NewMethodTreeItem extends TreeItem { } return hilight("new ") + scriptObject.toString(constants) + hilight(".") + methodNameStr + hilight("(") + paramStr + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(methodName.getNeededActions()); ret.addAll(scriptObject.getNeededActions()); - for(TreeItem ti:arguments){ + for (TreeItem ti : arguments) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/NewObjectTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/NewObjectTreeItem.java index 3218f665f..250657209 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/NewObjectTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/NewObjectTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class NewObjectTreeItem extends TreeItem { @@ -41,12 +41,12 @@ public class NewObjectTreeItem extends TreeItem { } return hilight("new ") + stripQuotes(objectName) + hilight("(") + paramStr + hilight(")"); } - - @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + + @Override + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(objectName.getNeededActions()); - for(TreeItem ti:arguments){ + for (TreeItem ti : arguments) { ret.addAll(ti.getNeededActions()); } return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/RandomNumberTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/RandomNumberTreeItem.java index e22977ae6..3ebb1af9e 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/RandomNumberTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/RandomNumberTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class RandomNumberTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class RandomNumberTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("random(") + maximum.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(maximum.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/RemoveSpriteTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/RemoveSpriteTreeItem.java index 3426a7a73..44f47859a 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/RemoveSpriteTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/RemoveSpriteTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class RemoveSpriteTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class RemoveSpriteTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("removeMovieClip(") + target.toString(constants) + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(target.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ReturnTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ReturnTreeItem.java index a5ad27ebf..ae1791ebf 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ReturnTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ReturnTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ReturnTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class ReturnTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("return ") + value.toString(constants) + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/SetMemberTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/SetMemberTreeItem.java index db2e1dbb7..eaf6565f8 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/SetMemberTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/SetMemberTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class SetMemberTreeItem extends TreeItem implements SetTypeTreeItem { @@ -41,10 +41,10 @@ public class SetMemberTreeItem extends TreeItem implements SetTypeTreeItem { public TreeItem getObject() { return new GetMemberTreeItem(instruction, object, objectName); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); ret.addAll(objectName.getNeededActions()); ret.addAll(value.getNeededActions()); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/SetPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/SetPropertyTreeItem.java index 89a0c8b3e..193edc15f 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/SetPropertyTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/SetPropertyTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class SetPropertyTreeItem extends TreeItem implements SetTypeTreeItem { @@ -44,10 +44,10 @@ public class SetPropertyTreeItem extends TreeItem implements SetTypeTreeItem { public TreeItem getObject() { return new GetPropertyTreeItem(instruction, target, propertyIndex); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(target.getNeededActions()); ret.addAll(value.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/SetTarget2TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/SetTarget2TreeItem.java index 267303aa7..be2e779a2 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/SetTarget2TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/SetTarget2TreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class SetTarget2TreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class SetTarget2TreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("tellTarget(") + target.toString(constants) + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(target.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/SetVariableTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/SetVariableTreeItem.java index 570f55484..96bc4e66c 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/SetVariableTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/SetVariableTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class SetVariableTreeItem extends TreeItem implements SetTypeTreeItem { @@ -39,10 +39,10 @@ public class SetVariableTreeItem extends TreeItem implements SetTypeTreeItem { public TreeItem getObject() { return new GetVariableTreeItem(instruction, value); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(name.getNeededActions()); ret.addAll(value.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/StartDragTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/StartDragTreeItem.java index 9d12ecaed..74c87cbfa 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/StartDragTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/StartDragTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class StartDragTreeItem extends TreeItem { @@ -57,10 +57,10 @@ public class StartDragTreeItem extends TreeItem { } return hilight("startDrag(") + target.toString(constants) + hilight(",") + lockCenter.toString(constants) + (hasConstrains ? hilight(",") + x1.toString(constants) + hilight(",") + y1.toString(constants) + hilight(",") + x2.toString(constants) + hilight(",") + y2.toString(constants) : "") + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(target.getNeededActions()); ret.addAll(constrain.getNeededActions()); ret.addAll(x1.getNeededActions()); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/StoreRegisterTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/StoreRegisterTreeItem.java index 2e5475d7f..27da2396e 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/StoreRegisterTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/StoreRegisterTreeItem.java @@ -18,7 +18,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.swf4.RegisterNumber; -import java.util.HashMap; import java.util.List; +import java.util.List; public class StoreRegisterTreeItem extends TreeItem implements SetTypeTreeItem { @@ -38,12 +38,12 @@ public class StoreRegisterTreeItem extends TreeItem implements SetTypeTreeItem { @Override public TreeItem getObject() { - return new DirectValueTreeItem(instruction,-1, register, null); + return new DirectValueTreeItem(instruction, -1, register, null); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/StringExtractTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/StringExtractTreeItem.java index 6d2bde82b..da573d4b5 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/StringExtractTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/StringExtractTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class StringExtractTreeItem extends TreeItem { @@ -36,10 +36,10 @@ public class StringExtractTreeItem extends TreeItem { public String toString(ConstantPool constants) { return value.toString(constants) + ".substr(" + index.toString(constants) + "," + count.toString(constants) + ")"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); ret.addAll(index.getNeededActions()); ret.addAll(count.getNeededActions()); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/TargetPathTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/TargetPathTreeItem.java index a65c71d95..22f9cb8bb 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/TargetPathTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/TargetPathTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class TargetPathTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class TargetPathTreeItem extends TreeItem { public String toString(ConstantPool constants) { return "targetPath(" + object.toString(constants) + ");"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ThrowTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ThrowTreeItem.java index 63a61305b..289ad4d70 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ThrowTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ThrowTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ThrowTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class ThrowTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("throw ") + object.toString(constants) + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(object.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ToIntegerTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ToIntegerTreeItem.java index 8c22b2f75..591e57372 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ToIntegerTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ToIntegerTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ToIntegerTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class ToIntegerTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("int(") + value.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ToNumberTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ToNumberTreeItem.java index c31f598b8..534bab8a4 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ToNumberTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ToNumberTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ToNumberTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class ToNumberTreeItem extends TreeItem { public String toString(ConstantPool constants) { return value.toString(constants) + hilight(".valueOf()"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/ToStringTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/ToStringTreeItem.java index d16cf0dd6..10e901fbf 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/ToStringTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/ToStringTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class ToStringTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class ToStringTreeItem extends TreeItem { public String toString(ConstantPool constants) { return value.toString(constants) + hilight(".toString()"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/TraceTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/TraceTreeItem.java index f220f0f8f..d454a6d0d 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/TraceTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/TraceTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class TraceTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class TraceTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("trace(") + value.toString(constants) + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java index 048b518e8..3c7434308 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java @@ -20,8 +20,7 @@ import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.IgnoredPair; import com.jpexs.asdec.helpers.Highlighting; import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashMap; import java.util.List; +import java.util.List; public abstract class TreeItem { @@ -44,8 +43,8 @@ public abstract class TreeItem { public static final int NOPRECEDENCE = 16; public int precedence = NOPRECEDENCE; public Action instruction; - public int instructionPos=0; - public List moreInstructions=new ArrayList(); + public int instructionPos = 0; + public List moreInstructions = new ArrayList(); public TreeItem(Action instruction, int precedence) { this.instruction = instruction; @@ -102,24 +101,23 @@ public abstract class TreeItem { return target.toString(); } } - - public boolean isCompileTime(){ + + public boolean isCompileTime() { return false; } - - - public double toNumber(){ + + public double toNumber() { return 0; } - - public boolean toBoolean(){ - return Double.compare(toNumber(),0.0)!=0; + + public boolean toBoolean() { + return Double.compare(toNumber(), 0.0) != 0; } - - public List getNeededActions(){ - List ret=new ArrayList(); - if(instruction!=null){ - ret.add(new IgnoredPair(instruction,instructionPos)); + + public List getNeededActions() { + List ret = new ArrayList(); + if (instruction != null) { + ret.add(new IgnoredPair(instruction, instructionPos)); } ret.addAll(moreInstructions); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/TypeOfTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/TypeOfTreeItem.java index 4aeb433b9..ad4548f37 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/TypeOfTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/TypeOfTreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class TypeOfTreeItem extends TreeItem { @@ -32,10 +32,10 @@ public class TypeOfTreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("typeof(") + value.toString(constants) + hilight(")"); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/WaitForFrame2TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/WaitForFrame2TreeItem.java index 1343072ce..9d3a0a410 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/WaitForFrame2TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/WaitForFrame2TreeItem.java @@ -17,7 +17,7 @@ package com.jpexs.asdec.action.treemodel; import com.jpexs.asdec.action.Action; -import java.util.HashMap; import java.util.List; +import java.util.List; public class WaitForFrame2TreeItem extends TreeItem { @@ -34,10 +34,10 @@ public class WaitForFrame2TreeItem extends TreeItem { public String toString(ConstantPool constants) { return hilight("waitForFrame2(") + frame.toString(constants) + "," + skipCount + hilight(")") + ";"; } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(frame.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/ForTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/ForTreeItem.java index f09f8b688..d933e50d6 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/ForTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/ForTreeItem.java @@ -36,7 +36,7 @@ public class ForTreeItem extends LoopTreeItem implements Block { this.expression = expression; this.finalCommands = finalCommands; this.commands = commands; - + if ((!commands.isEmpty()) && (commands.get(commands.size() - 1) instanceof ContinueTreeItem)) { if (((ContinueTreeItem) commands.get(commands.size() - 1)).loopPos == loopBreak) { commands.remove(commands.size() - 1); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/SwitchTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/SwitchTreeItem.java index ab949af83..5363399ec 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/SwitchTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/SwitchTreeItem.java @@ -31,13 +31,13 @@ public class SwitchTreeItem extends LoopTreeItem implements Block { public List defaultCommands; public List valuesMapping; - public SwitchTreeItem(Action instruction, long switchBreak, TreeItem switchedObject, List caseValues, List> caseCommands, List defaultCommands,List valuesMapping) { + public SwitchTreeItem(Action instruction, long switchBreak, TreeItem switchedObject, List caseValues, List> caseCommands, List defaultCommands, List valuesMapping) { super(instruction, switchBreak, -1); this.switchedObject = switchedObject; this.caseValues = caseValues; this.caseCommands = caseCommands; this.defaultCommands = defaultCommands; - this.valuesMapping=valuesMapping; + this.valuesMapping = valuesMapping; } @Override @@ -46,9 +46,9 @@ public class SwitchTreeItem extends LoopTreeItem implements Block { ret += "loopswitch" + loopBreak + ":\r\n"; ret += hilight("switch(") + switchedObject.toString(constants) + hilight(")") + "\r\n{\r\n"; for (int i = 0; i < caseCommands.size(); i++) { - for(int k=0;k getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(leftSide.getNeededActions()); ret.addAll(rightSide.getNeededActions()); return ret; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitAndTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitAndTreeItem.java index d95436a44..fa5287560 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitAndTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitAndTreeItem.java @@ -24,9 +24,9 @@ public class BitAndTreeItem extends BinaryOpTreeItem { public BitAndTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_BITWISEAND, leftSide, rightSide, "&"); } - + @Override public double toNumber() { - return ((int)leftSide.toNumber())&((int)rightSide.toNumber()); + return ((int) leftSide.toNumber()) & ((int) rightSide.toNumber()); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitNotTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitNotTreeItem.java index 3969616c9..8d80aa2b0 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitNotTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitNotTreeItem.java @@ -27,8 +27,6 @@ public class BitNotTreeItem extends UnaryOpTreeItem { @Override public double toNumber() { - return ~((int)value.toNumber()); + return ~((int) value.toNumber()); } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitOrTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitOrTreeItem.java index 002ad6bd6..8b02faab0 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitOrTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitOrTreeItem.java @@ -24,9 +24,9 @@ public class BitOrTreeItem extends BinaryOpTreeItem { public BitOrTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_BITWISEOR, leftSide, rightSide, "|"); } - + @Override public double toNumber() { - return ((int)leftSide.toNumber())|((int)rightSide.toNumber()); + return ((int) leftSide.toNumber()) | ((int) rightSide.toNumber()); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitXorTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitXorTreeItem.java index 0e39aef9a..dbe259146 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitXorTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/BitXorTreeItem.java @@ -24,9 +24,9 @@ public class BitXorTreeItem extends BinaryOpTreeItem { public BitXorTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_BITWISEXOR, leftSide, rightSide, "^"); } - + @Override public double toNumber() { - return ((int)leftSide.toNumber())^((int)rightSide.toNumber()); + return ((int) leftSide.toNumber()) ^ ((int) rightSide.toNumber()); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/DivideTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/DivideTreeItem.java index 5aa3a0526..8b6eb71ca 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/DivideTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/DivideTreeItem.java @@ -24,9 +24,9 @@ public class DivideTreeItem extends BinaryOpTreeItem { public DivideTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/"); } - + @Override public double toNumber() { - return leftSide.toNumber()/rightSide.toNumber(); + return leftSide.toNumber() / rightSide.toNumber(); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/EqTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/EqTreeItem.java index 88f142d2b..6bd05e457 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/EqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/EqTreeItem.java @@ -19,7 +19,7 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class EqTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class EqTreeItem extends BinaryOpTreeItem implements LogicalOp { public EqTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "=="); @@ -27,13 +27,11 @@ public class EqTreeItem extends BinaryOpTreeItem implements LogicalOp{ @Override public boolean toBoolean() { - return (leftSide.toBoolean()==rightSide.toBoolean())&&(leftSide.toNumber()==rightSide.toNumber()); + return (leftSide.toBoolean() == rightSide.toBoolean()) && (leftSide.toNumber() == rightSide.toNumber()); } @Override public TreeItem invert() { return new NeqTreeItem(instruction, leftSide, rightSide); } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/GeTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/GeTreeItem.java index 99f940091..b67eb6a48 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/GeTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/GeTreeItem.java @@ -19,7 +19,7 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class GeTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class GeTreeItem extends BinaryOpTreeItem implements LogicalOp { public GeTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">="); @@ -27,9 +27,9 @@ public class GeTreeItem extends BinaryOpTreeItem implements LogicalOp{ @Override public boolean toBoolean() { - return leftSide.toNumber()>=rightSide.toNumber(); + return leftSide.toNumber() >= rightSide.toNumber(); } - + @Override public TreeItem invert() { return new LtTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/GtTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/GtTreeItem.java index ed7603db2..5adb98bb6 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/GtTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/GtTreeItem.java @@ -19,17 +19,17 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class GtTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class GtTreeItem extends BinaryOpTreeItem implements LogicalOp { public GtTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">"); } - + @Override public boolean toBoolean() { - return leftSide.toNumber()>rightSide.toNumber(); + return leftSide.toNumber() > rightSide.toNumber(); } - + @Override public TreeItem invert() { return new LeTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/InTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/InTreeItem.java index 320cb8c84..b4917e133 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/InTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/InTreeItem.java @@ -29,6 +29,4 @@ public class InTreeItem extends BinaryOpTreeItem { public boolean isCompileTime() { return false; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/InstanceOfTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/InstanceOfTreeItem.java index bdc0a1076..65d7704f4 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/InstanceOfTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/InstanceOfTreeItem.java @@ -29,6 +29,4 @@ public class InstanceOfTreeItem extends BinaryOpTreeItem { public boolean isCompileTime() { return false; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/IsTypeTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/IsTypeTreeItem.java index 8035b8842..a871b0a18 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/IsTypeTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/IsTypeTreeItem.java @@ -29,6 +29,4 @@ public class IsTypeTreeItem extends BinaryOpTreeItem { public boolean isCompileTime() { return false; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LShiftTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LShiftTreeItem.java index 9c262ab6b..df4b95ebc 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LShiftTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LShiftTreeItem.java @@ -24,9 +24,9 @@ public class LShiftTreeItem extends BinaryOpTreeItem { public LShiftTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<"); } - + @Override public double toNumber() { - return ((int)leftSide.toNumber())<<((int)rightSide.toNumber()); + return ((int) leftSide.toNumber()) << ((int) rightSide.toNumber()); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LeTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LeTreeItem.java index c1c5393cb..0ac85d924 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LeTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LeTreeItem.java @@ -19,17 +19,17 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class LeTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class LeTreeItem extends BinaryOpTreeItem implements LogicalOp { public LeTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<="); } - + @Override public boolean toBoolean() { - return leftSide.toNumber()<=rightSide.toNumber(); + return leftSide.toNumber() <= rightSide.toNumber(); } - + @Override public TreeItem invert() { return new GtTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LogicalOp.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LogicalOp.java index b87d68f3b..fe4fffa15 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LogicalOp.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LogicalOp.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.treemodel.TreeItem; @@ -7,5 +23,6 @@ import com.jpexs.asdec.action.treemodel.TreeItem; * @author JPEXS */ public interface LogicalOp { + public TreeItem invert(); } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LtTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LtTreeItem.java index fe22b5511..1368b5599 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/LtTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/LtTreeItem.java @@ -19,17 +19,17 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class LtTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class LtTreeItem extends BinaryOpTreeItem implements LogicalOp { public LtTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<"); } - + @Override public boolean toBoolean() { - return leftSide.toNumber()>"); } - + @Override public double toNumber() { - return ((int)leftSide.toNumber())>>((int)rightSide.toNumber()); + return ((int) leftSide.toNumber()) >> ((int) rightSide.toNumber()); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictEqTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictEqTreeItem.java index 17c39d2ac..c075a80ac 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictEqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictEqTreeItem.java @@ -19,17 +19,17 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class StrictEqTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class StrictEqTreeItem extends BinaryOpTreeItem implements LogicalOp { public StrictEqTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "==="); } - + @Override public boolean toBoolean() { - return (leftSide.toBoolean()==rightSide.toBoolean())&&(leftSide.toNumber()==rightSide.toNumber()); + return (leftSide.toBoolean() == rightSide.toBoolean()) && (leftSide.toNumber() == rightSide.toNumber()); } - + @Override public TreeItem invert() { return new StrictNeqTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictNeqTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictNeqTreeItem.java index 31c84b89d..fe7ea64f0 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictNeqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StrictNeqTreeItem.java @@ -19,17 +19,17 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.TreeItem; -public class StrictNeqTreeItem extends BinaryOpTreeItem implements LogicalOp{ +public class StrictNeqTreeItem extends BinaryOpTreeItem implements LogicalOp { public StrictNeqTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=="); } - + @Override public boolean toBoolean() { - return (leftSide.toBoolean()!=rightSide.toBoolean())&&(leftSide.toNumber()!=rightSide.toNumber()); + return (leftSide.toBoolean() != rightSide.toBoolean()) && (leftSide.toNumber() != rightSide.toNumber()); } - + @Override public TreeItem invert() { return new StrictEqTreeItem(instruction, leftSide, rightSide); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringAddTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringAddTreeItem.java index 89762a1c2..dedba1092 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringAddTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringAddTreeItem.java @@ -24,7 +24,7 @@ public class StringAddTreeItem extends BinaryOpTreeItem { public StringAddTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+"); } - + @Override public boolean isCompileTime() { return false; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringEqTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringEqTreeItem.java index 141ea8e1d..492718797 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringEqTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringEqTreeItem.java @@ -29,6 +29,4 @@ public class StringEqTreeItem extends BinaryOpTreeItem { public boolean isCompileTime() { return false; } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLengthTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLengthTreeItem.java index 8665a5361..53240f07c 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLengthTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLengthTreeItem.java @@ -37,7 +37,7 @@ public class StringLengthTreeItem extends TreeItem { } return s + hilight(".length"); } - + @Override public boolean isCompileTime() { return false; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLtTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLtTreeItem.java index d15ca53df..312b70e9c 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLtTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/StringLtTreeItem.java @@ -24,7 +24,7 @@ public class StringLtTreeItem extends BinaryOpTreeItem { public StringLtTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<"); } - + @Override public boolean isCompileTime() { return false; diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/SubtractTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/SubtractTreeItem.java index ee621ff49..e512d6273 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/SubtractTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/SubtractTreeItem.java @@ -27,8 +27,6 @@ public class SubtractTreeItem extends BinaryOpTreeItem { @Override public double toNumber() { - return leftSide.toNumber()-rightSide.toNumber(); + return leftSide.toNumber() - rightSide.toNumber(); } - - } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/URShiftTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/URShiftTreeItem.java index 0abcf56b2..a6f904223 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/URShiftTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/URShiftTreeItem.java @@ -24,9 +24,9 @@ public class URShiftTreeItem extends BinaryOpTreeItem { public URShiftTreeItem(Action instruction, TreeItem leftSide, TreeItem rightSide) { super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>"); } - + @Override public double toNumber() { - return ((int)leftSide.toNumber())>>>((int)rightSide.toNumber()); + return ((int) leftSide.toNumber()) >>> ((int) rightSide.toNumber()); } } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/operations/UnaryOpTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/operations/UnaryOpTreeItem.java index 44efcc6d9..0363ae45f 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/operations/UnaryOpTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/operations/UnaryOpTreeItem.java @@ -19,7 +19,6 @@ package com.jpexs.asdec.action.treemodel.operations; import com.jpexs.asdec.action.Action; import com.jpexs.asdec.action.treemodel.ConstantPool; import com.jpexs.asdec.action.treemodel.TreeItem; -import java.util.HashMap; import java.util.List; public abstract class UnaryOpTreeItem extends TreeItem { @@ -41,15 +40,15 @@ public abstract class UnaryOpTreeItem extends TreeItem { } return hilight(operator) + s; } - + @Override - public boolean isCompileTime(){ + public boolean isCompileTime() { return value.isCompileTime(); } - + @Override - public List getNeededActions() { - List ret=super.getNeededActions(); + public List getNeededActions() { + List ret = super.getNeededActions(); ret.addAll(value.getNeededActions()); return ret; } diff --git a/trunk/src/com/jpexs/asdec/graph/Graph.java b/trunk/src/com/jpexs/asdec/graph/Graph.java index 70d692bd0..5cacfa6cc 100644 --- a/trunk/src/com/jpexs/asdec/graph/Graph.java +++ b/trunk/src/com/jpexs/asdec/graph/Graph.java @@ -1,7 +1,21 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.graph; -import com.jpexs.asdec.abc.gui.GraphFrame; -import com.jpexs.asdec.helpers.Helper; import java.util.ArrayList; import java.util.List; @@ -10,8 +24,9 @@ import java.util.List; * @author JPEXS */ public class Graph { + public List heads; - + protected static void populateParts(GraphPart part, List allParts) { if (allParts.contains(part)) { return; @@ -21,7 +36,7 @@ public class Graph { populateParts(p, allParts); } } - + protected void fixGraph(GraphPart part) { while (fixGraphOnce(part, new ArrayList(), false)) { } @@ -126,8 +141,8 @@ public class Graph { } return fixed; } - - protected void makeMulti(GraphPart part, List visited) { + + protected void makeMulti(GraphPart part, List visited) { if (visited.contains(part)) { return; } @@ -169,78 +184,78 @@ public class Graph { makeMulti(part.nextParts.get(i), visited); } } - - public GraphPart deepCopy(GraphPart part,List visited,List copies){ - if(visited==null){ - visited=new ArrayList(); - } - if(copies==null){ - copies=new ArrayList(); - } - if(visited.contains(part)){ - return copies.get(visited.indexOf(part)); - } - visited.add(part); - GraphPart copy=new GraphPart(part.start,part.end); - copy.path=part.path; - copies.add(copy); - copy.nextParts=new ArrayList(); - for(int i=0;i visited){ - if(visited.contains(part)){ - return; - } - visited.add(part); - int pos=0; - for(GraphPart p:part.nextParts){ - if(!visited.contains(p)){ - p.path=part.path+pos; - } - resetGraph(p, visited); - pos++; - } - } - - public GraphPart getCommonPart(List parts){ - GraphPart head=new GraphPart(0, 0); - head.nextParts.addAll(parts); - List allVisited=new ArrayList(); - head=deepCopy(head,allVisited,null); - for(GraphPart g:head.nextParts){ - for(GraphPart r:g.refs){ - r.nextParts.remove(g); - } - g.refs.clear(); - g.refs.add(head); - } - head.path="0"; - resetGraph(head,new ArrayList()); - fixGraph(head); - - /*Graph gr=new Graph(); + + public GraphPart deepCopy(GraphPart part, List visited, List copies) { + if (visited == null) { + visited = new ArrayList(); + } + if (copies == null) { + copies = new ArrayList(); + } + if (visited.contains(part)) { + return copies.get(visited.indexOf(part)); + } + visited.add(part); + GraphPart copy = new GraphPart(part.start, part.end); + copy.path = part.path; + copies.add(copy); + copy.nextParts = new ArrayList(); + for (int i = 0; i < part.nextParts.size(); i++) { + copy.nextParts.add(deepCopy(part.nextParts.get(i), visited, copies)); + } + for (int i = 0; i < part.refs.size(); i++) { + copy.refs.add(deepCopy(part.refs.get(i), visited, copies)); + } + return copy; + } + + public void resetGraph(GraphPart part, List visited) { + if (visited.contains(part)) { + return; + } + visited.add(part); + int pos = 0; + for (GraphPart p : part.nextParts) { + if (!visited.contains(p)) { + p.path = part.path + pos; + } + resetGraph(p, visited); + pos++; + } + } + + public GraphPart getCommonPart(List parts) { + GraphPart head = new GraphPart(0, 0); + head.nextParts.addAll(parts); + List allVisited = new ArrayList(); + head = deepCopy(head, allVisited, null); + for (GraphPart g : head.nextParts) { + for (GraphPart r : g.refs) { + r.nextParts.remove(g); + } + g.refs.clear(); + g.refs.add(head); + } + head.path = "0"; + resetGraph(head, new ArrayList()); + fixGraph(head); + + /*Graph gr=new Graph(); gr.heads=new ArrayList(); gr.heads.add(head); GraphFrame gf=new GraphFrame(gr, ""); gf.setVisible(true); */ - - GraphPart next=head.getNextPartPath(new ArrayList()); - if(next==null){ - return null; - } - for(GraphPart g:allVisited){ - if(g.start==next.start){ - return g; - } - } - return null; - } + + GraphPart next = head.getNextPartPath(new ArrayList()); + if (next == null) { + return null; + } + for (GraphPart g : allVisited) { + if (g.start == next.start) { + return g; + } + } + return null; + } } diff --git a/trunk/src/com/jpexs/asdec/graph/GraphPart.java b/trunk/src/com/jpexs/asdec/graph/GraphPart.java index 9ee2b5743..d51b5331a 100644 --- a/trunk/src/com/jpexs/asdec/graph/GraphPart.java +++ b/trunk/src/com/jpexs/asdec/graph/GraphPart.java @@ -16,11 +16,8 @@ */ package com.jpexs.asdec.graph; -import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; /** * @@ -34,100 +31,101 @@ public class GraphPart { public List nextParts = new ArrayList(); public int posX = -1; public int posY = -1; - public String path=""; - public List refs=new ArrayList(); - public boolean ignored=false; - public List forContinues=new ArrayList(); + public String path = ""; + public List refs = new ArrayList(); + public boolean ignored = false; + public List forContinues = new ArrayList(); - private boolean leadsTo(GraphPart part,List visited,List ignored){ - if(visited.contains(this)){ + private boolean leadsTo(GraphPart part, List visited, List ignored) { + if (visited.contains(this)) { return false; } - if(ignored.contains(this)){ + if (ignored.contains(this)) { return false; } visited.add(this); - for(GraphPart p:nextParts){ - if(p==part){ + for (GraphPart p : nextParts) { + if (p == part) { return true; - }else{ - if(p.leadsTo(part,visited,ignored)){ + } else { + if (p.leadsTo(part, visited, ignored)) { return true; } } } return false; } - public boolean leadsTo(GraphPart part,List ignored){ - - return leadsTo(part,new ArrayList(),ignored); + + public boolean leadsTo(GraphPart part, List ignored) { + + return leadsTo(part, new ArrayList(), ignored); } - + public GraphPart(int start, int end) { this.start = start; this.end = end; } - - - private GraphPart getNextPartPath(GraphPart original,String path,List visited){ - if(visited.contains(this)){ + + private GraphPart getNextPartPath(GraphPart original, String path, List visited) { + if (visited.contains(this)) { return null; } visited.add(this); - for(GraphPart p:nextParts){ - if(p==original){ + for (GraphPart p : nextParts) { + if (p == original) { continue; } - if(p.path.equals(path)){ + if (p.path.equals(path)) { return p; - }else if(p.path.length()>=path.length()){ - GraphPart gp=p.getNextPartPath(original,path,visited); - if(gp!=null){ + } else if (p.path.length() >= path.length()) { + GraphPart gp = p.getNextPartPath(original, path, visited); + if (gp != null) { return gp; } } } return null; } - public GraphPart getNextPartPath(List ignored){ - List visited=new ArrayList(); - visited.addAll(ignored); - return getNextPartPath(this,path,visited); - } - - public GraphPart getNextSuperPartPath(List ignored){ - List visited=new ArrayList(); - visited.addAll(ignored); - return getNextSuperPartPath(this,path,visited); - } - private GraphPart getNextSuperPartPath(GraphPart original,String path,List visited){ - if(visited.contains(this)){ + public GraphPart getNextPartPath(List ignored) { + List visited = new ArrayList(); + visited.addAll(ignored); + return getNextPartPath(this, path, visited); + } + + public GraphPart getNextSuperPartPath(List ignored) { + List visited = new ArrayList(); + visited.addAll(ignored); + return getNextSuperPartPath(this, path, visited); + } + + private GraphPart getNextSuperPartPath(GraphPart original, String path, List visited) { + if (visited.contains(this)) { return null; } visited.add(this); - for(GraphPart p:nextParts){ - if(p==original){ + for (GraphPart p : nextParts) { + if (p == original) { continue; } - if(p.path.length() "+(start+1)+"-"+(end+1); + return "<-> " + (start + 1) + "-" + (end + 1); } - return "" + (start + 1) + "-" + (end + 1) + (instanceCount > 1 ? "(" + instanceCount + " links)" : "")+" p"+path; + return "" + (start + 1) + "-" + (end + 1) + (instanceCount > 1 ? "(" + instanceCount + " links)" : "") + " p" + path; } public boolean containsIP(int ip) { @@ -150,21 +148,21 @@ public class GraphPart { return false; } - public int getHeight(){ - return end-start+1; + public int getHeight() { + return end - start + 1; } - - public int getPosAt(int offset){ - return start+offset; + + public int getPosAt(int offset) { + return start + offset; } - + public boolean containsPart(GraphPart what) { return containsPart(this, what, new ArrayList()); } - - public List getSubParts(){ - List ret=new ArrayList(); + + public List getSubParts() { + List ret = new ArrayList(); ret.add(this); - return ret; + return ret; } } diff --git a/trunk/src/com/jpexs/asdec/graph/GraphPartMulti.java b/trunk/src/com/jpexs/asdec/graph/GraphPartMulti.java index 9c24a88fd..225ae7971 100644 --- a/trunk/src/com/jpexs/asdec/graph/GraphPartMulti.java +++ b/trunk/src/com/jpexs/asdec/graph/GraphPartMulti.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.graph; import java.util.Collections; @@ -14,54 +30,53 @@ public class GraphPartMulti extends GraphPart { public GraphPartMulti(List parts) { super(parts.get(0).start, parts.get(parts.size() - 1).end); this.parts = parts; - this.path=parts.get(0).path; + this.path = parts.get(0).path; } @Override public String toString() { - String ret=""; - ret+="[multi "; - boolean first=true; - for(GraphPart g:parts){ - if(first){ - first=false; - }else{ - ret+=", "; + String ret = ""; + ret += "[multi "; + boolean first = true; + for (GraphPart g : parts) { + if (first) { + first = false; + } else { + ret += ", "; } - ret+=g.toString(); + ret += g.toString(); } - ret+="]"; + ret += "]"; return ret; } - + @Override - public int getHeight(){ - int ret=0; - for(GraphPart p:parts){ - ret+=p.getHeight(); + public int getHeight() { + int ret = 0; + for (GraphPart p : parts) { + ret += p.getHeight(); } return ret; } @Override public int getPosAt(int offset) { - int ofs=0; - int pos=0; - for(GraphPart p:parts){ - for(int i=0;i getSubParts(){ + public List getSubParts() { return Collections.unmodifiableList(parts); } - } diff --git a/trunk/src/com/jpexs/asdec/graph/Loop.java b/trunk/src/com/jpexs/asdec/graph/Loop.java index 18a4a2e56..c30031298 100644 --- a/trunk/src/com/jpexs/asdec/graph/Loop.java +++ b/trunk/src/com/jpexs/asdec/graph/Loop.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.jpexs.asdec.graph; /** @@ -5,6 +21,7 @@ package com.jpexs.asdec.graph; * @author JPEXS */ public class Loop { + public GraphPart loopContinue; public GraphPart loopBreak; @@ -12,5 +29,4 @@ public class Loop { this.loopContinue = loopContinue; this.loopBreak = loopBreak; } - } diff --git a/trunk/src/com/jpexs/asdec/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/gui/MainFrame.java index 5abfd6dac..25f00f827 100644 --- a/trunk/src/com/jpexs/asdec/gui/MainFrame.java +++ b/trunk/src/com/jpexs/asdec/gui/MainFrame.java @@ -125,6 +125,7 @@ public class MainFrame extends JFrame implements ActionListener { public void setStatus(String s) { statusLabel.setText(s); } + public void setWorkStatus(String s) { if (s.equals("")) { loadingPanel.setVisible(false); @@ -271,14 +272,14 @@ public class MainFrame extends JFrame implements ActionListener { //menuDeobfuscation.add(miSubLimiter); menuDeobfuscation.add(miDeobfuscation); /*menuDeobfuscation.add(miDeobfuscate); - menuDeobfuscation.addSeparator();*/ + menuDeobfuscation.addSeparator();*/ /*menuDeobfuscation.add(miRemoveDeadCode); - menuDeobfuscation.add(miRemoveDeadCodeAll); - menuDeobfuscation.add(miTraps); - menuDeobfuscation.add(miTrapsAll); - menuDeobfuscation.add(miControlFlow); - menuDeobfuscation.add(miControlFlowAll); -*/ + menuDeobfuscation.add(miRemoveDeadCodeAll); + menuDeobfuscation.add(miTraps); + menuDeobfuscation.add(miTrapsAll); + menuDeobfuscation.add(miControlFlow); + menuDeobfuscation.add(miControlFlowAll); + */ JMenu menuTools = new JMenu("Tools"); JMenuItem miProxy = new JMenuItem("Proxy"); miProxy.setActionCommand("SHOWPROXY"); @@ -690,7 +691,7 @@ public class MainFrame extends JFrame implements ActionListener { chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { - final long timeBefore=System.currentTimeMillis(); + final long timeBefore = System.currentTimeMillis(); Main.startWork("Exporting..."); final String selFile = chooser.getSelectedFile().getAbsolutePath(); Configuration.setConfig("lastExportDir", chooser.getSelectedFile().getParentFile().getAbsolutePath()); @@ -753,21 +754,21 @@ public class MainFrame extends JFrame implements ActionListener { JOptionPane.showMessageDialog(null, "Cannot write to the file"); } Main.stopWork(); - long timeAfter=System.currentTimeMillis(); - long timeMs=timeAfter-timeBefore; - long timeS=timeMs/1000; - timeMs=timeMs%1000; - long timeM=timeS/60; - timeS=timeS%60; - long timeH=timeM/60; - timeM=timeM%60; - String timeStr=""; - if(timeH>0){ - timeStr+=Helper.padZeros(timeH, 2)+":"; + long timeAfter = System.currentTimeMillis(); + long timeMs = timeAfter - timeBefore; + long timeS = timeMs / 1000; + timeMs = timeMs % 1000; + long timeM = timeS / 60; + timeS = timeS % 60; + long timeH = timeM / 60; + timeM = timeM % 60; + String timeStr = ""; + if (timeH > 0) { + timeStr += Helper.padZeros(timeH, 2) + ":"; } - timeStr+=Helper.padZeros(timeM, 2)+":"; - timeStr+=Helper.padZeros(timeS, 2)+"."+Helper.padZeros(timeMs,3); - setStatus("Exported in "+timeStr); + timeStr += Helper.padZeros(timeM, 2) + ":"; + timeStr += Helper.padZeros(timeS, 2) + "." + Helper.padZeros(timeMs, 3); + setStatus("Exported in " + timeStr); } }).start(); @@ -873,7 +874,7 @@ public class MainFrame extends JFrame implements ActionListener { @Override protected Object doInBackground() throws Exception { int cnt = 0; - HashMap namesMap=new HashMap(); + HashMap namesMap = new HashMap(); for (DoABCTag tag : abcPanel.list) { cnt += tag.abc.deobfuscateIdentifiers(namesMap); } @@ -888,8 +889,8 @@ public class MainFrame extends JFrame implements ActionListener { } } - if (e.getActionCommand().startsWith("DEOBFUSCATE")) { - if(deobfuscationDialog==null){ + if (e.getActionCommand().startsWith("DEOBFUSCATE")) { + if (deobfuscationDialog == null) { deobfuscationDialog = new DeobfuscationDialog(); } deobfuscationDialog.setVisible(true); diff --git a/trunk/src/com/jpexs/asdec/helpers/Helper.java b/trunk/src/com/jpexs/asdec/helpers/Helper.java index 7051d64ec..e58409634 100644 --- a/trunk/src/com/jpexs/asdec/helpers/Helper.java +++ b/trunk/src/com/jpexs/asdec/helpers/Helper.java @@ -170,11 +170,11 @@ public class Helper { sb.append(ss); return sb.toString(); } - - public static String padZeros(long number,int length){ - String ret=""+number; - while(ret.length()