From dbe3dc29050b3beb32f9db4e3e99cae2851fe2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Fri, 28 Dec 2012 12:17:33 +0100 Subject: [PATCH] ASDec: Small changes to eliminate notices --- trunk/src/com/jpexs/asdec/Configuration.java | 2 +- trunk/src/com/jpexs/asdec/Main.java | 16 ++++++------ trunk/src/com/jpexs/asdec/SWF.java | 8 +++--- trunk/src/com/jpexs/asdec/SWFInputStream.java | 4 +-- .../src/com/jpexs/asdec/SWFOutputStream.java | 20 +++++++------- trunk/src/com/jpexs/asdec/abc/ABC.java | 4 +-- .../com/jpexs/asdec/abc/ABCInputStream.java | 10 +++---- .../com/jpexs/asdec/abc/ABCOutputStream.java | 3 +-- .../com/jpexs/asdec/abc/avm2/AVM2Code.java | 26 ++++++------------- .../instructions/InstructionDefinition.java | 2 +- .../construction/ConstructIns.java | 4 +-- .../construction/ConstructPropIns.java | 4 +-- .../construction/ConstructSuperIns.java | 4 +-- .../avm2/instructions/executing/CallIns.java | 4 +-- .../instructions/executing/CallMethodIns.java | 4 +-- .../executing/CallPropVoidIns.java | 4 +-- .../executing/CallPropertyIns.java | 4 +-- .../instructions/executing/CallStaticIns.java | 4 +-- .../instructions/executing/CallSuperIns.java | 4 +-- .../executing/CallSuperVoidIns.java | 4 +-- .../avm2/instructions/types/ConvertBIns.java | 4 +-- .../avm2/instructions/types/ConvertDIns.java | 2 +- .../avm2/instructions/types/ConvertIIns.java | 2 +- .../asdec/abc/avm2/parser/ASM3Parser.java | 2 +- .../avm2/treemodel/FullMultinameTreeItem.java | 2 +- .../abc/avm2/treemodel/WithTreeItem.java | 2 +- .../avm2/treemodel/clauses/IfTreeItem.java | 2 +- .../asdec/abc/gui/ASMSourceEditorPane.java | 4 +-- .../asdec/abc/gui/DecompiledEditorPane.java | 2 +- .../com/jpexs/asdec/abc/gui/GraphFrame.java | 2 +- .../com/jpexs/asdec/abc/gui/MainFrame.java | 4 +-- .../abc/gui/SlotConstTraitDetailPanel.java | 4 +-- .../com/jpexs/asdec/abc/gui/UsageFrame.java | 2 +- .../jpexs/asdec/abc/types/InstanceInfo.java | 2 +- trunk/src/com/jpexs/asdec/action/Action.java | 7 +++-- trunk/src/com/jpexs/asdec/action/TagNode.java | 2 +- .../action/flashlite/ActionStrictMode.java | 1 + .../jpexs/asdec/action/swf3/ActionGetURL.java | 1 + .../asdec/action/swf3/ActionGoToLabel.java | 1 + .../asdec/action/swf3/ActionGotoFrame.java | 1 + .../asdec/action/swf3/ActionSetTarget.java | 1 + .../asdec/action/swf3/ActionWaitForFrame.java | 1 + .../asdec/action/swf4/ActionGetURL2.java | 1 + .../asdec/action/swf4/ActionGotoFrame2.java | 1 + .../com/jpexs/asdec/action/swf4/ActionIf.java | 1 + .../jpexs/asdec/action/swf4/ActionJump.java | 1 + .../jpexs/asdec/action/swf4/ActionPush.java | 5 ++-- .../action/swf4/ActionWaitForFrame2.java | 1 + .../asdec/action/swf5/ActionConstantPool.java | 1 + .../action/swf5/ActionDefineFunction.java | 1 + .../action/swf5/ActionStoreRegister.java | 1 + .../jpexs/asdec/action/swf5/ActionWith.java | 1 + .../jpexs/asdec/action/swf7/ActionTry.java | 1 + .../asdec/action/treemodel/TreeItem.java | 1 + .../action/treemodel/clauses/IfTreeItem.java | 4 +-- .../treemodel/clauses/WithTreeItem.java | 2 +- trunk/src/com/jpexs/asdec/gui/LinkLabel.java | 2 ++ .../com/jpexs/asdec/gui/proxy/ProxyFrame.java | 2 +- .../jpexs/asdec/tags/DefineButton2Tag.java | 3 ++- .../com/jpexs/asdec/tags/DefineButtonTag.java | 1 + .../com/jpexs/asdec/tags/DefineSpriteTag.java | 1 + .../com/jpexs/asdec/tags/DoInitActionTag.java | 1 + .../jpexs/asdec/types/CLIPACTIONRECORD.java | 2 +- 63 files changed, 116 insertions(+), 104 deletions(-) diff --git a/trunk/src/com/jpexs/asdec/Configuration.java b/trunk/src/com/jpexs/asdec/Configuration.java index debe0bbe4..3309c1b27 100644 --- a/trunk/src/com/jpexs/asdec/Configuration.java +++ b/trunk/src/com/jpexs/asdec/Configuration.java @@ -82,7 +82,7 @@ public class Configuration { replacements = new ArrayList(); try { BufferedReader br = new BufferedReader(new FileReader(getReplacementsFile())); - String s = ""; + String s; while ((s = br.readLine()) != null) { Replacement r = new Replacement(s, br.readLine()); replacements.add(r); diff --git a/trunk/src/com/jpexs/asdec/Main.java b/trunk/src/com/jpexs/asdec/Main.java index ac320b595..8fbe8397e 100644 --- a/trunk/src/com/jpexs/asdec/Main.java +++ b/trunk/src/com/jpexs/asdec/Main.java @@ -62,10 +62,10 @@ public class Main { public static String maskURL; public static SWF swf; public static final String version = "1.0.1"; - public static String applicationName = "JP ActionScript Decompiler v." + version; - public static String shortApplicationName = "ASDec"; - public static String shortApplicationVerName = shortApplicationName + " v." + version; - public static String projectPage = "http://code.google.com/p/asdec/"; + public static final String applicationName = "JP ActionScript Decompiler v." + version; + public static final String shortApplicationName = "ASDec"; + public static final String shortApplicationVerName = shortApplicationName + " v." + version; + public static final String projectPage = "http://code.google.com/p/asdec/"; public static LoadingDialog loadingDialog; public static ModeFrame modeFrame; private static boolean working = false; @@ -338,7 +338,7 @@ public class Main { } try { BufferedReader br = new BufferedReader(new FileReader(f)); - String s = ""; + String s; boolean packageFound = false; String author = defaultAuthor; String yearStr = defaultYearStr; @@ -472,7 +472,7 @@ public class Main { badArguments(); } commandLineMode = true; - boolean exportOK = true; + boolean exportOK; try { printHeader(); SWF exfile = new SWF(new FileInputStream(inFile)); @@ -505,7 +505,7 @@ public class Main { if (SWF.fws2cws(new FileInputStream(args[1]), new FileOutputStream(args[2]))) { System.out.println("OK"); } else { - System.err.println("FAIL");; + System.err.println("FAIL"); } } else if (args[0].equals("-decompress")) { if (args.length < 3) { @@ -658,7 +658,7 @@ public class Main { OutputStream os = sock.getOutputStream(); os.write("GET /feeds/p/asdec/downloads/basic HTTP/1.1\r\nHost: code.google.com\r\nConnection: close\r\n\r\n".getBytes()); BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream())); - String s = ""; + String s; String response = ""; boolean start = false; while ((s = br.readLine()) != null) { diff --git a/trunk/src/com/jpexs/asdec/SWF.java b/trunk/src/com/jpexs/asdec/SWF.java index 2bbf5a858..9d63712bf 100644 --- a/trunk/src/com/jpexs/asdec/SWF.java +++ b/trunk/src/com/jpexs/asdec/SWF.java @@ -237,7 +237,7 @@ public class SWF { swfHead[0] = 'C'; fos.write(swfHead); fos = new DeflaterOutputStream(fos); - int i = 0; + int i; while ((i = fis.read()) != -1) { fos.write(i); } @@ -269,7 +269,7 @@ public class SWF { } swfHead[0] = 'F'; fos.write(swfHead); - int i = 0; + int i; while ((i = iis.read()) != -1) { fos.write(i); } @@ -315,7 +315,7 @@ public class SWF { } List existingNames = new ArrayList(); for (TagNode node : nodeList) { - String name = ""; + String name; if (node.tag instanceof TagName) { name = ((TagName) node.tag).getName(); } else { @@ -333,7 +333,7 @@ public class SWF { try { String f = outdir + File.separatorChar + name + ".as"; informListeners("export", "Exporting " + f + " ..."); - String ret = ""; + String ret; if (isPcode) { ret = ((ASMSource) node.tag).getASMSource(10); //TODO:Ensure correct version here } else { diff --git a/trunk/src/com/jpexs/asdec/SWFInputStream.java b/trunk/src/com/jpexs/asdec/SWFInputStream.java index 1563a32a8..706c3e803 100644 --- a/trunk/src/com/jpexs/asdec/SWFInputStream.java +++ b/trunk/src/com/jpexs/asdec/SWFInputStream.java @@ -125,7 +125,7 @@ public class SWFInputStream extends InputStream { */ public String readString() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); - int r = 0; + int r; while (true) { r = read(); if (r <= 0) { @@ -233,7 +233,7 @@ public class SWFInputStream extends InputStream { + ((long) (readBuffer[7] & 255) << 24) + ((readBuffer[6] & 255) << 16) + ((readBuffer[5] & 255) << 8) - + ((readBuffer[4] & 255) << 0)); + + ((readBuffer[4] & 255))); } /** diff --git a/trunk/src/com/jpexs/asdec/SWFOutputStream.java b/trunk/src/com/jpexs/asdec/SWFOutputStream.java index 8f448451e..13ff36703 100644 --- a/trunk/src/com/jpexs/asdec/SWFOutputStream.java +++ b/trunk/src/com/jpexs/asdec/SWFOutputStream.java @@ -179,7 +179,7 @@ public class SWFOutputStream extends OutputStream { writeBuffer[7] = (byte) (value >>> 24); writeBuffer[6] = (byte) (value >>> 16); writeBuffer[5] = (byte) (value >>> 8); - writeBuffer[4] = (byte) (value >>> 0); + writeBuffer[4] = (byte) (value); write(writeBuffer); } @@ -473,9 +473,9 @@ public class SWFOutputStream extends OutputStream { public void writeMatrix(MATRIX value) throws IOException { writeUB(1, value.hasScale ? 1 : 0); if (value.hasScale) { - int nBits = 0; - nBits = enlargeBitCountF(nBits, value.scaleX); - nBits = enlargeBitCountF(nBits, value.scaleY); + int nBits; + //nBits = enlargeBitCountF(nBits, value.scaleX); + //nBits = enlargeBitCountF(nBits, value.scaleY); nBits = value.scaleNBits; //FFFUUU writeUB(5, nBits); writeFB(nBits, value.scaleX); @@ -483,17 +483,17 @@ public class SWFOutputStream extends OutputStream { } writeUB(1, value.hasRotate ? 1 : 0); if (value.hasRotate) { - int nBits = 0; - nBits = enlargeBitCountF(nBits, value.rotateSkew0); - nBits = enlargeBitCountF(nBits, value.rotateSkew1); + int nBits;// = 0; + //nBits = enlargeBitCountF(nBits, value.rotateSkew0); + //nBits = enlargeBitCountF(nBits, value.rotateSkew1); nBits = value.rotateNBits; //FFFUUU writeUB(5, nBits); writeFB(nBits, value.rotateSkew0); writeFB(nBits, value.rotateSkew1); } - int NTranslateBits = 0; - NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateX); - NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateY); + int NTranslateBits; + //NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateX); + ///NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateY); NTranslateBits = value.translateNBits; //FFFUUU writeUB(5, NTranslateBits); diff --git a/trunk/src/com/jpexs/asdec/abc/ABC.java b/trunk/src/com/jpexs/asdec/abc/ABC.java index 8c80a0a49..c7a893fd5 100644 --- a/trunk/src/com/jpexs/asdec/abc/ABC.java +++ b/trunk/src/com/jpexs/asdec/abc/ABC.java @@ -595,7 +595,7 @@ public class ABC { out.println(IDENT_STRING + classHeader); out.println(IDENT_STRING + "{"); - String toPrint = ""; + String toPrint; List outTraits = new LinkedList(); //if (class_info[i].cinit_index != 0) { @@ -654,7 +654,7 @@ public class ABC { } } } - String constructorParams = ""; + String constructorParams; bodyStr = ""; bodyIndex = findBodyIndex(instance_info[i].iinit_index); diff --git a/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java b/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java index b123e5a77..5bd2eb096 100644 --- a/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java +++ b/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java @@ -97,11 +97,11 @@ public class ABCInputStream extends InputStream { } public int readU32() throws IOException { - int i = 0; + int i; int ret = 0; int bytePos = 0; int byteCount = 0; - boolean nextByte = false; + boolean nextByte; do { i = read(); nextByte = (i >> 7) == 1; @@ -132,11 +132,11 @@ public class ABCInputStream extends InputStream { } public long readS32() throws IOException { - int i = 0; + int i; long ret = 0; int bytePos = 0; int byteCount = 0; - boolean nextByte = false; + boolean nextByte; do { i = read(); nextByte = (i >> 7) == 1; @@ -168,7 +168,7 @@ public class ABCInputStream extends InputStream { + ((long) (readBuffer[3] & 255) << 24) + ((readBuffer[2] & 255) << 16) + ((readBuffer[1] & 255) << 8) - + ((readBuffer[0] & 255) << 0)); + + ((readBuffer[0] & 255))); } public double readDouble() throws IOException { diff --git a/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java b/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java index e470e6d0f..b9dc5894e 100644 --- a/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java +++ b/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java @@ -83,7 +83,6 @@ public class ABCOutputStream extends OutputStream { value = value >> 8; ret = (int) (value & 0xff); write(ret); - value = value >> 8; } public void writeS32(long value) throws IOException { @@ -127,7 +126,7 @@ public class ABCOutputStream extends OutputStream { writeBuffer[3] = (byte) (value >>> 24); writeBuffer[2] = (byte) (value >>> 16); writeBuffer[1] = (byte) (value >>> 8); - writeBuffer[0] = (byte) (value >>> 0); + writeBuffer[0] = (byte) (value); write(writeBuffer); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java index b60562dbf..56e20864e 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java @@ -1073,7 +1073,7 @@ public class AVM2Code { } for (int e = 0; e < catchedExceptions.size(); e++) { - int eendpos = 0; + int eendpos; if (e < catchedExceptions.size() - 1) { eendpos = adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e + 1).target)) - 2; } else { @@ -1149,7 +1149,6 @@ public class AVM2Code { if (ins.definition instanceof JumpIns) { //Ifs with multiple conditions if (ins.operands[0] == 0) { ip++; - addr = pos2adr(ip); } else if (ins.operands[0] > 0) { int secondAddr = addr + ins.getBytes().length; int jumpAddr = secondAddr + ins.operands[0]; @@ -1181,14 +1180,12 @@ public class AVM2Code { for (Loop l : loopList) { if (l.loopBreak == jumpPos) { output.add(new BreakTreeItem(ins, l.loopBreak)); - addr = secondAddr; ip = ip + 1; continue iploop; } if (l.loopContinue == jumpPos) { l.continueCount++; output.add(new ContinueTreeItem(ins, l.loopBreak)); - addr = secondAddr; ip = ip + 1; continue iploop; } @@ -1323,18 +1320,15 @@ public class AVM2Code { } while (true); output.add(new SwitchTreeItem(code.get(switchPos), switchBreak, switchedValue, casesList, caseCommands, defaultCommands)); ip = switchPos + 1; - addr = pos2adr(ip); continue; } if (!backJumpFound) { if (jumpPos <= end + 1) { //probably skipping catch ip = jumpPos; - addr = pos2adr(ip); continue; } output.add(new ContinueTreeItem(ins, jumpPos, false)); - addr = secondAddr; ip = ip + 1; if (!unknownJumps.contains(jumpPos)) { unknownJumps.add(jumpPos); @@ -1451,7 +1445,7 @@ public class AVM2Code { throw new ConvertException("Unknown pattern: back jump ", ip); } } else if (ins.definition instanceof DupIns) { - int nextPos = 0; + int nextPos; do { AVM2Instruction insAfter = code.get(ip + 1); AVM2Instruction insBefore = ins; @@ -1464,7 +1458,7 @@ public class AVM2Code { insAfter = code.get(ip + 1); } - boolean isAnd = false; + boolean isAnd; if (insAfter.definition instanceof IfFalseIns) { //stack.add("(" + stack.pop() + ")&&"); isAnd = true; @@ -1496,14 +1490,12 @@ public class AVM2Code { ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc, localRegNames); } ip++; - addr = pos2adr(ip); - break; + break; //} } else { ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc, localRegNames); ip++; - addr = pos2adr(ip); break; //throw new ConvertException("Unknown pattern after DUP:" + insComparsion.toString()); } @@ -1566,14 +1558,12 @@ public class AVM2Code { } } ConvertOutput onTrue = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 1, targetIns - 1 - ((hasElse || hasReturn) ? 1 : 0), localRegNames); - addr = targetAddr; ip = targetIns; ConvertOutput onFalse = new ConvertOutput(new Stack(), new ArrayList()); if (hasElse) { int finalAddr = targetAddr + code.get(targetIns - 1).operands[0]; int finalIns = adr2pos(finalAddr); onFalse = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, targetIns, finalIns - 1, localRegNames); - addr = finalAddr; ip = finalIns; } if ((onTrue.stack.size() > 0) && (onFalse != null) && (onFalse.stack.size() > 0)) { @@ -1709,11 +1699,11 @@ public class AVM2Code { parsedExceptions = new ArrayList(); ignoredIns = new ArrayList(); List list; - String s = ""; + String s; HashMap localRegs = new HashMap(); int regCount = getRegisterCount(); - int paramCount = 0; + int paramCount; if (body.method_info != -1) { MethodInfo mi = method_info[body.method_info]; paramCount = mi.param_types.length; @@ -2120,7 +2110,7 @@ public class AVM2Code { } System.out.println("trueIndex:" + trueIndex); System.out.println("falseIndex:" + falseIndex); - boolean found = false; + boolean found; do { found = false; for (int ip = pos; ip < code.size(); ip++) { @@ -2196,7 +2186,7 @@ public class AVM2Code { } } while (found); } else { - isSecure = false; + //isSecure = false; } } 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 c32e48fbb..24a4ef173 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java @@ -99,7 +99,7 @@ public class InstructionDefinition { protected String resolveMultinameNoPop(int pos, Stack stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) { String ns = ""; - String name = ""; + String name; if (constants.constant_multiname[multinameIndex].needsNs()) { ns = "[" + stack.get(pos) + "]"; pos++; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java index 76e31c039..a79178e34 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java @@ -38,12 +38,12 @@ public class ConstructIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int argCount = (int) ((Long) arguments.get(0)).longValue(); + /*int argCount = (int) ((Long) arguments.get(0)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } - Object obj = lda.operandStack.pop(); + Object obj = lda.operandStack.pop();*/ throw new RuntimeException("Cannot call constructor"); //call construct property of obj //push new instance 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 9672d49d3..32ffa9324 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 @@ -39,12 +39,12 @@ public class ConstructPropIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + /*int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); - } + }*/ //if multiname[multinameIndex] is runtime //pop(name) pop(ns) throw new RuntimeException("Cannot construct property"); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java index 274213fc4..a58d0356c 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java @@ -38,12 +38,12 @@ public class ConstructSuperIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int argCount = (int) ((Long) arguments.get(0)).longValue(); + /*int argCount = (int) ((Long) arguments.get(0)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } - Object obj = lda.operandStack.pop(); + Object obj = lda.operandStack.pop();*/ throw new RuntimeException("Cannot call super constructor"); //call construct property of obj //do not push anything diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java index 7a6428e94..76c1981fe 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java @@ -38,13 +38,13 @@ public class CallIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int argCount = (int) ((Long) arguments.get(0)).longValue(); + /*int argCount = (int) ((Long) arguments.get(0)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } Object receiver = lda.operandStack.pop(); - Object function = lda.operandStack.pop(); + Object function = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown function"); //push(result) } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java index 8adffd36a..bf373cb2a 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java @@ -38,13 +38,13 @@ public class CallMethodIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int methodIndex = (int) ((Long) arguments.get(0)).longValue(); //index of object's method + /*int methodIndex = (int) ((Long) arguments.get(0)).longValue(); //index of object's method int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } - Object receiver = lda.operandStack.pop(); + Object receiver = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown method"); //push(result) } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java index a37808f86..92545ffa4 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -40,7 +40,7 @@ public class CallPropVoidIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { //same as callproperty - +/* int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); @@ -49,7 +49,7 @@ public class CallPropVoidIns extends InstructionDefinition { } //if multiname[multinameIndex] is runtime //pop(name) pop(ns) - Object obj = lda.operandStack.pop(); + Object obj = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown property"); //do not push anything } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java index a9d4f3073..786f25983 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java @@ -39,7 +39,7 @@ public class CallPropertyIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + /*int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { @@ -47,7 +47,7 @@ public class CallPropertyIns extends InstructionDefinition { } //if multiname[multinameIndex] is runtime //pop(name) pop(ns) - Object obj = lda.operandStack.pop(); + Object obj = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown property"); //push(result) } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java index 2ec6b64ab..6ef719fc6 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java @@ -38,13 +38,13 @@ public class CallStaticIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int methodIndex = (int) ((Long) arguments.get(0)).longValue(); //index of method_info + /*int methodIndex = (int) ((Long) arguments.get(0)).longValue(); //index of method_info int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } - Object receiver = lda.operandStack.pop(); + Object receiver = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown static method"); //push(result) } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java index 46f400c3a..5968fd671 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java @@ -39,7 +39,7 @@ public class CallSuperIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + /*int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { @@ -47,7 +47,7 @@ public class CallSuperIns extends InstructionDefinition { } //if multiname[multinameIndex] is runtime //pop(name) pop(ns) - Object receiver = lda.operandStack.pop(); + Object receiver = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown super method"); //push(result) } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java index beb5fa129..cdbfbbb5d 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java @@ -39,7 +39,7 @@ public class CallSuperVoidIns extends InstructionDefinition { @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { - int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + /*int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); int argCount = (int) ((Long) arguments.get(1)).longValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { @@ -47,7 +47,7 @@ public class CallSuperVoidIns extends InstructionDefinition { } //if multiname[multinameIndex] is runtime //pop(name) pop(ns) - Object receiver = lda.operandStack.pop(); + Object receiver = lda.operandStack.pop();*/ throw new RuntimeException("Call to unknown super method"); //do not push anything } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java index fcdbce42c..6bc8d07f6 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java @@ -37,7 +37,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { Object value = lda.operandStack.pop(); - boolean bval = false; + boolean bval; if (value instanceof Boolean) { bval = (Boolean) value; } else if (value instanceof Long) { @@ -47,7 +47,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver } else { bval = true; } - lda.operandStack.push(new Boolean(bval)); + lda.operandStack.push((Boolean)bval); } @Override diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java index 39d68aaf3..0dd510a77 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java @@ -37,7 +37,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { Object value = lda.operandStack.pop(); - double ret = 0; + double ret; if (value == null) { ret = 0; } else if (value instanceof Boolean) { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java index 7807cd334..25df936f3 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java @@ -37,7 +37,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver @Override public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { Object value = lda.operandStack.pop(); - long ret = 0; + long ret; if (value == null) { ret = 0; } else if (value instanceof Boolean) { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java index 0991eb39a..9af69fa23 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java @@ -294,7 +294,7 @@ public class ASM3Parser { for (LabelItem li : labelItems) { if (oi.label.equals(li.label)) { AVM2Instruction ins = code.code.get((int) oi.insPosition); - int relOffset = 0; + int relOffset; if (oi instanceof CaseOffsetItem) { relOffset = li.offset - (int) ins.offset; } else { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java index 89deb9da1..0b9d9bd7b 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java @@ -53,7 +53,7 @@ public class FullMultinameTreeItem extends TreeItem { @Override public String toString(ConstantPool constants, HashMap localRegNames) { - String ret = ""; + String ret; if (name != null) { ret = "[" + name.toString(constants, localRegNames) + "]"; } else { 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 1ea7c51ba..504e1fcd1 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java @@ -41,7 +41,7 @@ public class WithTreeItem extends TreeItem { @Override public String toString(ConstantPool constants, HashMap localRegNames) { - String ret = ""; + String ret; ret = hilight("with(") + scope.toString(constants, localRegNames) + hilight(")\r\n{\r\n"); for (TreeItem ti : items) { ret += ti.toString(constants, localRegNames) + "\r\n"; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java index f7976154c..563a20237 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java @@ -39,7 +39,7 @@ public class IfTreeItem extends TreeItem implements Block { @Override public String toString(ConstantPool constants, HashMap localRegNames) { - String ret = ""; + String ret; ret = hilight("if(") + expression.toString(constants, localRegNames) + hilight(")") + "\r\n{\r\n"; for (TreeItem ti : onTrue) { ret += ti.toStringSemicoloned(constants, localRegNames) + "\r\n"; diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java index 1013cbf63..64f769b79 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java @@ -90,7 +90,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane { String text = getText(); int lineCnt = 1; int lineStart = 0; - int lineEnd = -1; + int lineEnd; int instrCount = 0; int dot = -2; for (int i = 0; i < text.length(); i++) { @@ -111,7 +111,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane { } } if (lineCnt == -1) { - lineEnd = text.length() - 1; + //lineEnd = text.length() - 1; } //select(lineStart, lineEnd); setCaretPosition(lineStart); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java index b90d4430c..b9f3566fd 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java @@ -144,7 +144,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements MouseL public void setClassIndex(int index, ABC abc) { setText("//Please wait..."); - String hilightedCode = ""; + String hilightedCode; if (!bufferedClasses.containsKey(index)) { hilightedCode = abc.classToString(index, true, false); highlights = Highlighting.getInstrHighlights(hilightedCode); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java index f413c3af2..21d789be5 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/GraphFrame.java @@ -100,7 +100,7 @@ public class GraphFrame extends JFrame { return 1; } used.add(part); - if (part.nextParts.size() == 0) { + if (part.nextParts.isEmpty()) { return 1; } int w = 0; diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java index b4933a205..839d7378f 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java @@ -67,7 +67,7 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener { statusLabel.setText(s); } - public JTable autoResizeColWidth(JTable table, TableModel model) { + private JTable autoResizeColWidth(JTable table, TableModel model) { table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.setModel(model); @@ -77,7 +77,7 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener { int vColIndex = i; DefaultTableColumnModel colModel = (DefaultTableColumnModel) table.getColumnModel(); TableColumn col = colModel.getColumn(vColIndex); - int width = 0; + int width; // Get width of column header TableCellRenderer renderer = col.getHeaderRenderer(); diff --git a/trunk/src/com/jpexs/asdec/abc/gui/SlotConstTraitDetailPanel.java b/trunk/src/com/jpexs/asdec/abc/gui/SlotConstTraitDetailPanel.java index c3473c67a..746b36ca7 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/SlotConstTraitDetailPanel.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/SlotConstTraitDetailPanel.java @@ -49,8 +49,8 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail { public void load(TraitSlotConst trait, ABC abc) { this.abc = abc; this.trait = trait; - String s = ""; - String typeStr = "*"; + String s; + String typeStr; if (trait.type_index > 0) { typeStr = "m[" + trait.type_index + "]\"" + Helper.escapeString(abc.constants.constant_multiname[trait.type_index].toString(abc.constants)) + "\""; } else { diff --git a/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java index f0a48d131..9983e1d2c 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/UsageFrame.java @@ -85,7 +85,7 @@ public class UsageFrame extends JFrame implements ActionListener, MouseListener } if (usage instanceof TraitMultinameUsage) { TraitMultinameUsage tmu = (TraitMultinameUsage) usage; - int traitIndex = 0; + int traitIndex; if (tmu.parentTraitIndex > -1) { traitIndex = tmu.parentTraitIndex; } else { diff --git a/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java b/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java index 5b763a3ef..8c2ad5e18 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java +++ b/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java @@ -53,7 +53,7 @@ public class InstanceInfo { if (super_index > 0) { supIndexStr = " extends " + constants.constant_multiname[super_index].getName(constants);////+" flags="+flags+" protectedNS="+protectedNS+" interfaces="+Helper.intArrToString(interfaces)+" method_index="+iinit_index } - String modifiers = ""; + String modifiers; Namespace ns = constants.constant_multiname[name_index].getNamespace(constants); modifiers = ns.getPrefix(constants); if (!modifiers.equals("")) { diff --git a/trunk/src/com/jpexs/asdec/action/Action.java b/trunk/src/com/jpexs/asdec/action/Action.java index efb4b735e..a76d1b724 100644 --- a/trunk/src/com/jpexs/asdec/action/Action.java +++ b/trunk/src/com/jpexs/asdec/action/Action.java @@ -350,7 +350,7 @@ public class Action { */ public static String actionsToString(List list, List importantOffsets, List constantPool, int version) { String ret = ""; - long offset = 0; + long offset; if (importantOffsets == null) { setActionsAddresses(list, 0, version); importantOffsets = getActionsAllRefs(list, version); @@ -437,7 +437,7 @@ public class Action { */ public static long ip2adr(List actions, int ip, int version) { if (ip >= actions.size()) { - if (actions.size() == 0) { + if (actions.isEmpty()) { return 0; } return actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getBytes(version).length; @@ -715,7 +715,6 @@ public class Action { if (!unknownJumps.contains(((ActionJump) action).getRef(version))) { unknownJumps.add(((ActionJump) action).getRef(version)); } - ip = ip + 1; break; } else if (action instanceof ActionIf) { @@ -776,7 +775,7 @@ public class Action { try { onTrue = actionsToTree(registerNames, unknownJumps, loopList, jumpsOrIfs, trueStack, constants, actions, ip + 1, jumpIp - 1 - (hasElse || isWhile || isForIn ? 1 : 0), version); - if (onTrue.size() == 0 && trueStack.size() > 0) { + if (onTrue.isEmpty() && trueStack.size() > 0) { isTernar = true; } } catch (UnknownJumpException uje) { diff --git a/trunk/src/com/jpexs/asdec/action/TagNode.java b/trunk/src/com/jpexs/asdec/action/TagNode.java index 996b88799..228c45908 100644 --- a/trunk/src/com/jpexs/asdec/action/TagNode.java +++ b/trunk/src/com/jpexs/asdec/action/TagNode.java @@ -104,7 +104,7 @@ public class TagNode { continue; } } - if (ret.get(i).subItems.size() == 0) { + if (ret.get(i).subItems.isEmpty()) { ret.remove(i); } } diff --git a/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java b/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java index 16c7049c7..9a29baf97 100644 --- a/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java +++ b/trunk/src/com/jpexs/asdec/action/flashlite/ActionStrictMode.java @@ -43,6 +43,7 @@ public class ActionStrictMode extends Action { mode = (int) lexLong(lexer); } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java index f544294dc..f674f52c2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionGetURL.java @@ -50,6 +50,7 @@ public class ActionGetURL extends Action { targetString = lexString(lexer); } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java index 53e831e38..08ab56493 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionGoToLabel.java @@ -47,6 +47,7 @@ public class ActionGoToLabel extends Action { return "GoToLabel \"" + Helper.escapeString(label) + "\""; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java index 60e56a4f8..a30be651c 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionGotoFrame.java @@ -43,6 +43,7 @@ public class ActionGotoFrame extends Action { return "GotoFrame " + frame; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java index e0409a8b9..a29b5be63 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionSetTarget.java @@ -47,6 +47,7 @@ public class ActionSetTarget extends Action { return "SetTarget \"" + Helper.escapeString(targetName) + "\""; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java b/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java index be6be92af..e55066ac2 100644 --- a/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java +++ b/trunk/src/com/jpexs/asdec/action/swf3/ActionWaitForFrame.java @@ -45,6 +45,7 @@ public class ActionWaitForFrame extends Action { return "WaitForFrame " + frame + " " + skipCount; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java index fa2860dd8..6e9680d3e 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGetURL2.java @@ -50,6 +50,7 @@ public class ActionGetURL2 extends Action { return "GetURL2 " + sendVarsMethod + " " + loadTargetFlag + " " + loadVariablesFlag; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java index c28911cda..16d71cf3a 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionGotoFrame2.java @@ -45,6 +45,7 @@ public class ActionGotoFrame2 extends Action { } } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionIf.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionIf.java index d9ddac694..6b9132c49 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionIf.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionIf.java @@ -48,6 +48,7 @@ public class ActionIf extends Action { return getAddress() + getBytes(version).length + offset; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java index 3c485ce8c..6f52cc027 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionJump.java @@ -48,6 +48,7 @@ public class ActionJump extends Action { return getAddress() + getBytes(version).length + offset; } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java index c5253c53f..b560d75ab 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionPush.java @@ -61,7 +61,7 @@ public class ActionPush extends Action { values.add(new RegisterNumber(sis.readUI8())); break; case 5: - values.add(new Boolean(sis.readUI8() == 1)); + values.add((Boolean)(sis.readUI8() == 1)); break; case 6: values.add(sis.readDOUBLE()); @@ -79,6 +79,7 @@ public class ActionPush extends Action { } } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); @@ -142,7 +143,7 @@ public class ActionPush extends Action { switch (symb.type) { case ParsedSymbol.TYPE_STRING: count++; - if (constantPool.contains(symb.value)) { + if (constantPool.contains((String)symb.value)) { values.add(new ConstantIndex(constantPool.indexOf(symb.value), constantPool)); } else { values.add(symb.value); diff --git a/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java b/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java index 5f640553a..e08fff608 100644 --- a/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java +++ b/trunk/src/com/jpexs/asdec/action/swf4/ActionWaitForFrame2.java @@ -43,6 +43,7 @@ public class ActionWaitForFrame2 extends Action { skipCount = (int) lexLong(lexer); } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java index 4dba29d12..487bd4066 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionConstantPool.java @@ -58,6 +58,7 @@ public class ActionConstantPool extends Action { } } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java index 6b47dd9e9..32dcd3764 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionDefineFunction.java @@ -62,6 +62,7 @@ public class ActionDefineFunction extends Action { code = ASMParser.parse(labels, address + getPreLen(version), lexer, constantPool, version); } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java index f926984cf..819b38ebc 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionStoreRegister.java @@ -44,6 +44,7 @@ public class ActionStoreRegister extends Action { registerNumber = (int) lexLong(lexer); } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/swf5/ActionWith.java b/trunk/src/com/jpexs/asdec/action/swf5/ActionWith.java index c3e842cd7..20688a75d 100644 --- a/trunk/src/com/jpexs/asdec/action/swf5/ActionWith.java +++ b/trunk/src/com/jpexs/asdec/action/swf5/ActionWith.java @@ -52,6 +52,7 @@ public class ActionWith extends Action { Action.setActionsAddresses(actions, address + 5, version); } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/trunk/src/com/jpexs/asdec/action/swf7/ActionTry.java b/trunk/src/com/jpexs/asdec/action/swf7/ActionTry.java index fe610f7cd..f3d8ce838 100644 --- a/trunk/src/com/jpexs/asdec/action/swf7/ActionTry.java +++ b/trunk/src/com/jpexs/asdec/action/swf7/ActionTry.java @@ -92,6 +92,7 @@ public class ActionTry extends Action { } } + @Override public byte[] getBytes(int version) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos = new SWFOutputStream(baos, version); diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java index 25c9138a5..c2abfd68a 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/TreeItem.java @@ -48,6 +48,7 @@ public abstract class TreeItem { public abstract String toString(ConstantPool constants); + @Override public String toString() { return toString(null); } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/IfTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/IfTreeItem.java index 12465d984..df5bb219d 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/IfTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/IfTreeItem.java @@ -38,8 +38,8 @@ public class IfTreeItem extends TreeItem implements Block { @Override public String toString(ConstantPool constants) { - String ret = ""; - ret = hilight("if(") + expression.toString(constants) + hilight(")\r\n{\r\n"); + String ret; + ret = hilight("if(") + expression.toString(constants) + hilight(")")+"\r\n{\r\n"; for (TreeItem ti : onTrue) { ret += ti.toString(constants) + "\r\n"; } diff --git a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/WithTreeItem.java b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/WithTreeItem.java index 32bd63a80..5e7ad1456 100644 --- a/trunk/src/com/jpexs/asdec/action/treemodel/clauses/WithTreeItem.java +++ b/trunk/src/com/jpexs/asdec/action/treemodel/clauses/WithTreeItem.java @@ -41,7 +41,7 @@ public class WithTreeItem extends TreeItem { @Override public String toString(ConstantPool constants) { - String ret = ""; + String ret; ret = hilight("with(") + scope.toString(constants) + hilight(")\r\n{\r\n"); for (TreeItem ti : items) { ret += ti.toString(constants) + "\r\n"; diff --git a/trunk/src/com/jpexs/asdec/gui/LinkLabel.java b/trunk/src/com/jpexs/asdec/gui/LinkLabel.java index 8a73f4e4c..785a17626 100644 --- a/trunk/src/com/jpexs/asdec/gui/LinkLabel.java +++ b/trunk/src/com/jpexs/asdec/gui/LinkLabel.java @@ -48,6 +48,7 @@ public class LinkLabel extends JLabel { /** * Sets the text of the label. */ + @Override public void setText(String text) { super.setText("" + text + ""); this.text = text; @@ -63,6 +64,7 @@ public class LinkLabel extends JLabel { /** * Processes mouse events and responds to clicks. */ + @Override protected void processMouseEvent(MouseEvent evt) { super.processMouseEvent(evt); if (evt.getID() == MouseEvent.MOUSE_CLICKED) { diff --git a/trunk/src/com/jpexs/asdec/gui/proxy/ProxyFrame.java b/trunk/src/com/jpexs/asdec/gui/proxy/ProxyFrame.java index 50b520e77..f960cd8fb 100644 --- a/trunk/src/com/jpexs/asdec/gui/proxy/ProxyFrame.java +++ b/trunk/src/com/jpexs/asdec/gui/proxy/ProxyFrame.java @@ -342,7 +342,7 @@ public class ProxyFrame extends JFrame implements ActionListener, CatchedListene FileOutputStream fos = new FileOutputStream(f); fos.write(hdr); byte buf[] = new byte[2048]; - int count = 0; + int count; while ((count = data.read(buf)) > 0) { fos.write(buf, 0, count); } diff --git a/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java index feb381fd3..aa7e852f3 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java @@ -128,7 +128,7 @@ public class DefineButton2Tag extends Tag implements Container, TagName { if (Main.DEBUG_COPY) { sos = new SWFOutputStream(baos, version); } - if ((actions == null) || (actions.size() == 0)) { + if ((actions == null) || (actions.isEmpty())) { sos.writeUI16(0); } else { sos.writeUI16(2 + brdata.length); @@ -169,6 +169,7 @@ public class DefineButton2Tag extends Tag implements Container, TagName { return "DefineButton2Tag" + buttonId; } + @Override public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java b/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java index 85db26a86..b0c18ccb3 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java @@ -102,6 +102,7 @@ public class DefineButtonTag extends Tag implements ASMSource, TagName { return "DefineButtonTag" + buttonId; } + @Override public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java index 0fa90cd04..ceb66340b 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java @@ -99,6 +99,7 @@ public class DefineSpriteTag extends Tag implements Container, TagName { return "DefineSpriteTag" + spriteId; } + @Override public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java b/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java index a1c3416d6..4a16d7331 100644 --- a/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java @@ -76,6 +76,7 @@ public class DoInitActionTag extends Tag implements ASMSource, TagName { return baos.toByteArray(); } + @Override public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java index bbe65368d..bee0ced9e 100644 --- a/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/asdec/types/CLIPACTIONRECORD.java @@ -61,7 +61,7 @@ public class CLIPACTIONRECORD implements ASMSource { * @return String representation of events */ public String getHeader() { - String ret = ""; + String ret; ret = eventFlags.toString(); if (eventFlags.clipEventKeyPress) { ret = ret.replace("keyPress", "keyPress<" + keyCode + ">");