diff --git a/jode/src/net/sf/jode/bytecode/BasicBlockReader.java b/jode/src/net/sf/jode/bytecode/BasicBlockReader.java index 43878c8..0e690db 100644 --- a/jode/src/net/sf/jode/bytecode/BasicBlockReader.java +++ b/jode/src/net/sf/jode/bytecode/BasicBlockReader.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.Stack; import java.util.Vector; import java.util.Enumeration; -///#def COLLECTIONS java.util -import java.util.Arrays; -///#enddef /** * This is a helper class, that contains the method to read in basic @@ -546,8 +543,8 @@ class BasicBlockReader implements Opcodes { case opc_ldc: { int index = input.readUnsignedByte(); int tag = cp.getTag(index); - if (tag != cp.STRING && tag != cp.CLASS - && tag != cp.INTEGER && tag != cp.FLOAT) + if (tag != ConstantPool.STRING && tag != ConstantPool.CLASS + && tag != ConstantPool.INTEGER && tag != ConstantPool.FLOAT) throw new ClassFormatException ("wrong constant tag: "+tag); instr = new ConstantInstruction @@ -558,8 +555,8 @@ class BasicBlockReader implements Opcodes { case opc_ldc_w: { int index = input.readUnsignedShort(); int tag = cp.getTag(index); - if (tag != cp.STRING && tag != cp.CLASS - && tag != cp.INTEGER && tag != cp.FLOAT) + if (tag != ConstantPool.STRING && tag != ConstantPool.CLASS + && tag != ConstantPool.INTEGER && tag != ConstantPool.FLOAT) throw new ClassFormatException ("wrong constant tag: "+tag); instr = new ConstantInstruction @@ -570,7 +567,7 @@ class BasicBlockReader implements Opcodes { case opc_ldc2_w: { int index = input.readUnsignedShort(); int tag = cp.getTag(index); - if (tag != cp.LONG && tag != cp.DOUBLE) + if (tag != ConstantPool.LONG && tag != ConstantPool.DOUBLE) throw new ClassFormatException ("wrong constant tag: "+tag); instr = new ConstantInstruction @@ -680,11 +677,11 @@ class BasicBlockReader implements Opcodes { int index = input.readUnsignedShort(); int tag = cp.getTag(index); if (opcode < opc_invokevirtual) { - if (tag != cp.FIELDREF) + if (tag != ConstantPool.FIELDREF) throw new ClassFormatException ("field tag mismatch: "+tag); } else { - if (tag != cp.METHODREF) + if (tag != ConstantPool.METHODREF) throw new ClassFormatException ("method tag mismatch: "+tag); } @@ -704,7 +701,7 @@ class BasicBlockReader implements Opcodes { case opc_invokeinterface: { int index = input.readUnsignedShort(); int tag = cp.getTag(index); - if (tag != cp.INTERFACEMETHODREF) + if (tag != ConstantPool.INTERFACEMETHODREF) throw new ClassFormatException ("interface tag mismatch: "+tag); Reference ref = cp.getRef(index); @@ -966,8 +963,8 @@ class BasicBlockReader implements Opcodes { int nameIndex = input.readUnsignedShort(); int typeIndex = input.readUnsignedShort(); int slot = input.readUnsignedShort(); - if (nameIndex == 0 || cp.getTag(nameIndex) != cp.UTF8 - || typeIndex == 0 || cp.getTag(typeIndex) != cp.UTF8 + if (nameIndex == 0 || cp.getTag(nameIndex) != ConstantPool.UTF8 + || typeIndex == 0 || cp.getTag(typeIndex) != ConstantPool.UTF8 || slot >= maxLocals) { // This is probably an evil lvt as created by HashJava diff --git a/jode/src/net/sf/jode/bytecode/BasicBlockWriter.java b/jode/src/net/sf/jode/bytecode/BasicBlockWriter.java index 08de109..35751a7 100644 --- a/jode/src/net/sf/jode/bytecode/BasicBlockWriter.java +++ b/jode/src/net/sf/jode/bytecode/BasicBlockWriter.java @@ -25,8 +25,6 @@ import java.util.BitSet; import java.util.Stack; ///#def COLLECTIONS java.util import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; ///#enddef /** @@ -37,7 +35,6 @@ class BasicBlockWriter implements Opcodes { private class LVTEntry { int startAddr, endAddr; - Instruction start, end; LocalVariableInfo lvi; } @@ -382,17 +379,17 @@ class BasicBlockWriter implements Opcodes { case opc_getfield: case opc_putstatic: case opc_putfield: - gcp.putRef(gcp.FIELDREF, instr.getReference()); + gcp.putRef(ConstantPool.FIELDREF, instr.getReference()); length = 3; break; case opc_invokespecial: case opc_invokestatic: case opc_invokevirtual: - gcp.putRef(gcp.METHODREF, instr.getReference()); + gcp.putRef(ConstantPool.METHODREF, instr.getReference()); length = 3; break; case opc_invokeinterface: - gcp.putRef(gcp.INTERFACEMETHODREF, instr.getReference()); + gcp.putRef(ConstantPool.INTERFACEMETHODREF, instr.getReference()); length = 5; break; case opc_new: @@ -880,7 +877,7 @@ class BasicBlockWriter implements Opcodes { case opc_putstatic: case opc_putfield: output.writeByte(opcode); - output.writeShort(gcp.putRef(gcp.FIELDREF, + output.writeShort(gcp.putRef(ConstantPool.FIELDREF, instr.getReference())); break; @@ -892,13 +889,13 @@ class BasicBlockWriter implements Opcodes { output.writeByte(opcode); if (opcode == opc_invokeinterface) { output.writeShort - (gcp.putRef(gcp.INTERFACEMETHODREF, ref)); + (gcp.putRef(ConstantPool.INTERFACEMETHODREF, ref)); output.writeByte (TypeSignature .getParameterSize(ref.getType()) + 1); output.writeByte(0); } else - output.writeShort(gcp.putRef(gcp.METHODREF, ref)); + output.writeShort(gcp.putRef(ConstantPool.METHODREF, ref)); break; } case opc_new: diff --git a/jode/src/net/sf/jode/bytecode/BasicBlocks.java b/jode/src/net/sf/jode/bytecode/BasicBlocks.java index dddb1ae..9fb1dcc 100644 --- a/jode/src/net/sf/jode/bytecode/BasicBlocks.java +++ b/jode/src/net/sf/jode/bytecode/BasicBlocks.java @@ -32,10 +32,6 @@ import java.util.Stack; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; -import java.util.NoSuchElementException; -///#enddef -///#def COLLECTIONEXTRA java.lang -import java.lang.UnsupportedOperationException; ///#enddef /** @@ -187,7 +183,6 @@ public class BasicBlocks extends BinaryInfo implements Opcodes { BitSet visited = new BitSet(); Stack todo = new Stack(); - int[] poppush = new int[2]; startBlock.stackHeight = 0; todo.push(startBlock); diff --git a/jode/src/net/sf/jode/bytecode/Block.java b/jode/src/net/sf/jode/bytecode/Block.java index 8ad9426..dcf6aeb 100644 --- a/jode/src/net/sf/jode/bytecode/Block.java +++ b/jode/src/net/sf/jode/bytecode/Block.java @@ -20,12 +20,6 @@ package net.sf.jode.bytecode; import java.io.PrintWriter; -///#def COLLECTIONS java.util -import java.util.Collection; -import java.util.Arrays; -import java.util.List; -import java.util.Iterator; -///#enddef /** *

Represents a single basic block. It contains a list of diff --git a/jode/src/net/sf/jode/bytecode/ClassFormatException.java b/jode/src/net/sf/jode/bytecode/ClassFormatException.java index 8b1d5ef..151431f 100644 --- a/jode/src/net/sf/jode/bytecode/ClassFormatException.java +++ b/jode/src/net/sf/jode/bytecode/ClassFormatException.java @@ -24,7 +24,7 @@ package net.sf.jode.bytecode; * * @author Jochen Hoenicke */ -public class ClassFormatException extends java.io.IOException{ +public class ClassFormatException extends java.io.IOException { /** * Constructs a new class format exception with the given detail * message. diff --git a/jode/src/net/sf/jode/bytecode/ClassPath.java b/jode/src/net/sf/jode/bytecode/ClassPath.java index cd37b56..78ab323 100644 --- a/jode/src/net/sf/jode/bytecode/ClassPath.java +++ b/jode/src/net/sf/jode/bytecode/ClassPath.java @@ -25,7 +25,6 @@ import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; @@ -36,7 +35,6 @@ import java.net.URLConnection; import java.util.Enumeration; import java.util.NoSuchElementException; import java.util.Hashtable; -import java.util.StringTokenizer; import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -288,7 +286,6 @@ public class ClassPath { if (!directory.endsWith(File.separator)) directory += File.separator; - final String prefix = directory; return new Enumeration() { int i = 0; public boolean hasMoreElements() { diff --git a/jode/src/net/sf/jode/bytecode/SwitchInstruction.java b/jode/src/net/sf/jode/bytecode/SwitchInstruction.java index 66a29af..5219865 100644 --- a/jode/src/net/sf/jode/bytecode/SwitchInstruction.java +++ b/jode/src/net/sf/jode/bytecode/SwitchInstruction.java @@ -18,7 +18,6 @@ */ package net.sf.jode.bytecode; -import net.sf.jode.util.StringQuoter; /** * This class represents an instruction in the byte code. diff --git a/jode/src/net/sf/jode/bytecode/TypeSignature.java b/jode/src/net/sf/jode/bytecode/TypeSignature.java index 7af8a11..bcea8a0 100644 --- a/jode/src/net/sf/jode/bytecode/TypeSignature.java +++ b/jode/src/net/sf/jode/bytecode/TypeSignature.java @@ -18,7 +18,6 @@ */ package net.sf.jode.bytecode; -import net.sf.jode.util.UnifyHash; /** * This class contains some static methods to handle type signatures.
diff --git a/jode/src/net/sf/jode/decompiler/ClassAnalyzer.java b/jode/src/net/sf/jode/decompiler/ClassAnalyzer.java index 7651f6b..b63d3c0 100644 --- a/jode/src/net/sf/jode/decompiler/ClassAnalyzer.java +++ b/jode/src/net/sf/jode/decompiler/ClassAnalyzer.java @@ -33,9 +33,7 @@ import net.sf.jode.flow.StructuredBlock; import net.sf.jode.util.SimpleSet; import java.lang.reflect.Modifier; -import java.util.NoSuchElementException; import java.util.Vector; -import java.util.Enumeration; import java.io.IOException; ///#def COLLECTIONS java.util @@ -470,7 +468,7 @@ public class ClassAnalyzer return; } - writer.startOp(writer.NO_PAREN, 0); + writer.startOp(TabbedPrintWriter.NO_PAREN, 0); /* Clear the SUPER bit, which is also used as SYNCHRONIZED bit. */ int modifiedModifiers = modifiers & ~(Modifier.SYNCHRONIZED | STRICTFP); @@ -508,7 +506,7 @@ public class ClassAnalyzer if (interfaces.length > 0) { writer.breakOp(); writer.print(clazz.isInterface() ? " extends " : " implements "); - writer.startOp(writer.EXPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1); for (int i=0; i < interfaces.length; i++) { if (i > 0) { writer.print(", "); @@ -632,7 +630,7 @@ public class ClassAnalyzer needNewLine = true; } writer.popScope(); - clazz.drop(clazz.DECLARATIONS); + clazz.drop(ClassInfo.DECLARATIONS); } public void dumpSource(TabbedPrintWriter writer) @@ -707,9 +705,9 @@ public class ClassAnalyzer } if (usageType == CLASSNAME || usageType == AMBIGUOUSNAME) { try { - info.load(info.DECLARATIONS); + info.load(ClassInfo.DECLARATIONS); } catch (IOException ex) { - info.guess(info.DECLARATIONS); + info.guess(ClassInfo.DECLARATIONS); } ClassInfo[] iinfos = info.getClasses(); if (iinfos != null) { diff --git a/jode/src/net/sf/jode/decompiler/Decompiler.java b/jode/src/net/sf/jode/decompiler/Decompiler.java index 3608c73..def0661 100644 --- a/jode/src/net/sf/jode/decompiler/Decompiler.java +++ b/jode/src/net/sf/jode/decompiler/Decompiler.java @@ -24,7 +24,6 @@ import net.sf.jode.bytecode.ClassInfo; import java.io.File; import java.io.PrintWriter; import java.io.Writer; -import java.io.BufferedWriter; /** * This is the interface that other java classes may use to decompile diff --git a/jode/src/net/sf/jode/decompiler/FieldAnalyzer.java b/jode/src/net/sf/jode/decompiler/FieldAnalyzer.java index efeef64..6e594ba 100644 --- a/jode/src/net/sf/jode/decompiler/FieldAnalyzer.java +++ b/jode/src/net/sf/jode/decompiler/FieldAnalyzer.java @@ -21,8 +21,6 @@ package net.sf.jode.decompiler; import net.sf.jode.type.Type; import net.sf.jode.bytecode.FieldInfo; import net.sf.jode.expr.Expression; -import net.sf.jode.expr.ThisOperator; -import net.sf.jode.expr.LocalLoadOperator; import net.sf.jode.expr.ConstOperator; import net.sf.jode.expr.OuterLocalOperator; @@ -178,7 +176,7 @@ public class FieldAnalyzer implements Analyzer { | Modifier.STATIC | Modifier.FINAL); */ - writer.startOp(writer.NO_PAREN, 0); + writer.startOp(TabbedPrintWriter.NO_PAREN, 0); String modif = Modifier.toString(modifiedModifiers); if (modif.length() > 0) writer.print(modif+" "); @@ -188,7 +186,7 @@ public class FieldAnalyzer implements Analyzer { if (constant != null) { writer.breakOp(); writer.print(" = "); - constant.dumpExpression(writer.IMPL_PAREN, writer); + constant.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer); } writer.endOp(); writer.println(";"); diff --git a/jode/src/net/sf/jode/decompiler/ImportHandler.java b/jode/src/net/sf/jode/decompiler/ImportHandler.java index f1a2d4d..c676e69 100644 --- a/jode/src/net/sf/jode/decompiler/ImportHandler.java +++ b/jode/src/net/sf/jode/decompiler/ImportHandler.java @@ -372,7 +372,6 @@ public class ImportHandler { String pkgName = name.substring(0, pkgdelim); - Integer i; if (pkgName.equals(pkg) || (imports.get(pkgName+".*") != null && !conflictsImport(name))) { diff --git a/jode/src/net/sf/jode/decompiler/Main.java b/jode/src/net/sf/jode/decompiler/Main.java index 385476f..cc723a5 100644 --- a/jode/src/net/sf/jode/decompiler/Main.java +++ b/jode/src/net/sf/jode/decompiler/Main.java @@ -215,14 +215,8 @@ public class Main extends Options { } } - public static void main(String[] params) { - try { - decompile(params); - } catch (ExceptionInInitializerError ex) { - ex.getException().printStackTrace(); - } catch (Throwable ex) { - ex.printStackTrace(); - } + public static void main(String[] params) throws Throwable{ + decompile(params); /* When AWT applications are compiled with insufficient * classpath the type guessing by reflection code can * generate an awt thread that will prevent normal diff --git a/jode/src/net/sf/jode/decompiler/MethodAnalyzer.java b/jode/src/net/sf/jode/decompiler/MethodAnalyzer.java index e216693..adb251a 100644 --- a/jode/src/net/sf/jode/decompiler/MethodAnalyzer.java +++ b/jode/src/net/sf/jode/decompiler/MethodAnalyzer.java @@ -29,7 +29,6 @@ import net.sf.jode.bytecode.MethodInfo; import net.sf.jode.jvm.SyntheticAnalyzer; import net.sf.jode.type.*; import net.sf.jode.expr.Expression; -import net.sf.jode.expr.ConstOperator; import net.sf.jode.expr.CheckNullOperator; import net.sf.jode.expr.ThisOperator; import net.sf.jode.expr.LocalLoadOperator; @@ -38,22 +37,15 @@ import net.sf.jode.expr.InvokeOperator; import net.sf.jode.flow.StructuredBlock; import net.sf.jode.flow.FlowBlock; import net.sf.jode.flow.TransformExceptionHandlers; -import net.sf.jode.flow.Jump; import net.sf.jode.jvm.CodeVerifier; import net.sf.jode.jvm.VerifyException; -import net.sf.jode.util.SimpleMap; import java.lang.reflect.Modifier; -import java.util.BitSet; -import java.util.Stack; import java.util.Vector; import java.util.Enumeration; -import java.io.DataInputStream; -import java.io.ByteArrayInputStream; import java.io.IOException; ///#def COLLECTIONS java.util -import java.util.Map; import java.util.Collection; import java.util.ArrayList; import java.util.Iterator; @@ -461,7 +453,6 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { Block[] blocks = bb.getBlocks(); FlowBlock[] flows = new FlowBlock[blocks.length]; - int returnCount; TransformExceptionHandlers excHandlers; { for (int i=0; i < blocks.length; i++) @@ -618,7 +609,6 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { public void analyzeInnerClasses() throws ClassFormatError { - int serialnr = 0; Enumeration elts = anonConstructors.elements(); while (elts.hasMoreElements()) { InvokeOperator cop = (InvokeOperator) elts.nextElement(); @@ -694,10 +684,10 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { if (synth != null) { // We don't need this class anymore (hopefully?) - if (synth.getKind() == synth.GETCLASS) + if (synth.getKind() == SyntheticAnalyzer.GETCLASS) return true; - if (synth.getKind() >= synth.ACCESSGETFIELD - && synth.getKind() <= synth.ACCESSDUPPUTSTATIC + if (synth.getKind() >= SyntheticAnalyzer.ACCESSGETFIELD + && synth.getKind() <= SyntheticAnalyzer.ACCESSDUPPUTSTATIC && (Options.options & Options.OPTION_INNER) != 0 && (Options.options & Options.OPTION_ANON) != 0) return true; @@ -826,8 +816,8 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { | Modifier.PROTECTED | Modifier.PRIVATE); modifiedModifiers &= ~STRICTFP; - writer.startOp(writer.NO_PAREN, 0); - writer.startOp(writer.NO_PAREN, 5); + writer.startOp(TabbedPrintWriter.NO_PAREN, 0); + writer.startOp(TabbedPrintWriter.NO_PAREN, 5); String delim =""; if (minfo.isSynthetic()) { @@ -871,7 +861,7 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { writer.breakOp(); writer.printOptionalSpace(); writer.print("("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); int offset = skipParams + (isStatic() ? 0 : 1); for (int i = offset; i < param.length; i++) { if (i > offset) { @@ -887,7 +877,7 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { if (exceptions.length > 0) { writer.breakOp(); writer.print(" throws "); - writer.startOp(writer.NO_PAREN, 0); + writer.startOp(TabbedPrintWriter.NO_PAREN, 0); for (int i= 0; i< exceptions.length; i++) { if (i > 0) { writer.print(", "); diff --git a/jode/src/net/sf/jode/decompiler/Opcodes.java b/jode/src/net/sf/jode/decompiler/Opcodes.java index 6130dcc..4d1b81f 100644 --- a/jode/src/net/sf/jode/decompiler/Opcodes.java +++ b/jode/src/net/sf/jode/decompiler/Opcodes.java @@ -20,12 +20,9 @@ package net.sf.jode.decompiler; import net.sf.jode.type.Type; import net.sf.jode.type.IntegerType; -import net.sf.jode.type.MethodType; import net.sf.jode.expr.*; import net.sf.jode.flow.*; import net.sf.jode.bytecode.*; -import java.io.*; -import java.util.Vector; /** * This is an abstract class which creates flow blocks for the @@ -87,12 +84,6 @@ public abstract class Opcodes implements net.sf.jode.bytecode.Opcodes { return new SpecialBlock(type, stackcount, param); } - private static StructuredBlock createGoto(MethodAnalyzer ma, - Instruction instr) - { - return new EmptyBlock(); - } - private static StructuredBlock createJsr(MethodAnalyzer ma, Instruction instr) { diff --git a/jode/src/net/sf/jode/decompiler/Options.java b/jode/src/net/sf/jode/decompiler/Options.java index ac52057..361e24b 100644 --- a/jode/src/net/sf/jode/decompiler/Options.java +++ b/jode/src/net/sf/jode/decompiler/Options.java @@ -35,7 +35,7 @@ public class Options { public static int options = OPTION_LVT | OPTION_INNER | OPTION_ANON | OPTION_PRETTY | - OPTION_DECRYPT | OPTION_VERIFY | OPTION_CONTRAFO; + OPTION_DECRYPT | OPTION_VERIFY | OPTION_CONTRAFO | OPTION_PUSH; public final static boolean doAnonymous() { return (options & OPTION_ANON) != 0; diff --git a/jode/src/net/sf/jode/decompiler/OuterValues.java b/jode/src/net/sf/jode/decompiler/OuterValues.java index a51d113..808ed6f 100644 --- a/jode/src/net/sf/jode/decompiler/OuterValues.java +++ b/jode/src/net/sf/jode/decompiler/OuterValues.java @@ -23,7 +23,6 @@ import net.sf.jode.expr.Expression; import net.sf.jode.expr.ThisOperator; import net.sf.jode.expr.LocalLoadOperator; import net.sf.jode.expr.OuterLocalOperator; -import net.sf.jode.util.SimpleMap; import net.sf.jode.type.Type; import java.util.Vector; @@ -324,13 +323,6 @@ public class OuterValues implicitOuterClass = value; } - private static int countSlots(Expression[] exprs, int length) { - int slots = 0; - for (int i=0; i < length; i++) - slots += exprs[i].getType().stackSize(); - return slots; - } - public void setMinCount(int newMin) { if (headCount < newMin) { GlobalOptions.err.println diff --git a/jode/src/net/sf/jode/decompiler/TabbedPrintWriter.java b/jode/src/net/sf/jode/decompiler/TabbedPrintWriter.java index 00d6464..3a25024 100644 --- a/jode/src/net/sf/jode/decompiler/TabbedPrintWriter.java +++ b/jode/src/net/sf/jode/decompiler/TabbedPrintWriter.java @@ -22,7 +22,6 @@ import java.io.*; import java.util.Stack; import java.util.Vector; import java.util.Enumeration; -import net.sf.jode.GlobalOptions; import net.sf.jode.bytecode.ClassInfo; import net.sf.jode.type.*; diff --git a/jode/src/net/sf/jode/decompiler/Window.java b/jode/src/net/sf/jode/decompiler/Window.java index 0cd1037..b1290b3 100644 --- a/jode/src/net/sf/jode/decompiler/Window.java +++ b/jode/src/net/sf/jode/decompiler/Window.java @@ -18,7 +18,6 @@ */ package net.sf.jode.decompiler; -import java.applet.*; import java.awt.*; ///#ifndef AWT10 import java.awt.event.*; @@ -182,7 +181,7 @@ public class Window FileDialog.SAVE); fd.setFile(lastClassName.substring (lastClassName.lastIndexOf('.')+1).concat(".java")); - fd.show(); + fd.setVisible(true); String fileName = fd.getFile(); if (fileName == null) return; @@ -302,6 +301,6 @@ public class Window }); ///#endif frame.pack(); - frame.show(); + frame.setVisible(true); } } diff --git a/jode/src/net/sf/jode/expr/ArrayStoreOperator.java b/jode/src/net/sf/jode/expr/ArrayStoreOperator.java index bd05733..066a6f8 100644 --- a/jode/src/net/sf/jode/expr/ArrayStoreOperator.java +++ b/jode/src/net/sf/jode/expr/ArrayStoreOperator.java @@ -41,7 +41,7 @@ public class ArrayStoreOperator extends ArrayLoadOperator if (!elemType.isOfType(getType())) { /* We need an explicit widening cast */ writer.print("("); - writer.startOp(writer.EXPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1); writer.print("("); writer.printType(Type.tArray(getType().getHint())); writer.print(") "); diff --git a/jode/src/net/sf/jode/expr/ClassFieldOperator.java b/jode/src/net/sf/jode/expr/ClassFieldOperator.java index 8585175..5c96648 100644 --- a/jode/src/net/sf/jode/expr/ClassFieldOperator.java +++ b/jode/src/net/sf/jode/expr/ClassFieldOperator.java @@ -19,7 +19,6 @@ package net.sf.jode.expr; import net.sf.jode.type.Type; -import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.TabbedPrintWriter; public class ClassFieldOperator extends NoArgOperator { diff --git a/jode/src/net/sf/jode/expr/ConstantArrayOperator.java b/jode/src/net/sf/jode/expr/ConstantArrayOperator.java index fce087d..678e4db 100644 --- a/jode/src/net/sf/jode/expr/ConstantArrayOperator.java +++ b/jode/src/net/sf/jode/expr/ConstantArrayOperator.java @@ -33,7 +33,7 @@ public class ConstantArrayOperator extends Operator { ? Type.tSubType(((ArrayType)type).getElementType()) : Type.tError; Object emptyVal; - if (argType == type.tError || argType.isOfType(Type.tUObject)) + if (argType == Type.tError || argType.isOfType(Type.tUObject)) emptyVal = null; else if (argType.isOfType(Type.tBoolUInt)) emptyVal = new Integer(0); @@ -104,7 +104,7 @@ public class ConstantArrayOperator extends Operator { writer.print(" "); } writer.print("{ "); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); for (int i=0; i< subExpressions.length; i++) { if (i>0) { writer.print(", "); diff --git a/jode/src/net/sf/jode/expr/Expression.java b/jode/src/net/sf/jode/expr/Expression.java index 47557bf..2806cae 100644 --- a/jode/src/net/sf/jode/expr/Expression.java +++ b/jode/src/net/sf/jode/expr/Expression.java @@ -239,7 +239,6 @@ public abstract class Expression { public void dumpExpression(TabbedPrintWriter writer, int minPriority) throws java.io.IOException { - int options; boolean needParen1 = false, needParen2 = false; boolean needEndOp1 = false, needEndOp2 = false; @@ -256,10 +255,10 @@ public abstract class Expression { needParen1 = true; needEndOp1 = true; writer.print("("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); } else if (minPriority < 700) { needEndOp1 = true; - writer.startOp(writer.IMPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.IMPL_PAREN, 1); } writer.print(typecast); writer.breakOp(); @@ -272,13 +271,13 @@ public abstract class Expression { needParen2 = true; needEndOp2 = true; writer.print("("); - writer.startOp(writer.EXPL_PAREN, getBreakPenalty()); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, getBreakPenalty()); } else if (priority != minPriority) { needEndOp2 = true; if (getType() == Type.tVoid) - writer.startOp(writer.NO_PAREN, getBreakPenalty()); + writer.startOp(TabbedPrintWriter.NO_PAREN, getBreakPenalty()); else - writer.startOp(writer.IMPL_PAREN, 1 + getBreakPenalty()); + writer.startOp(TabbedPrintWriter.IMPL_PAREN, 1 + getBreakPenalty()); } try { diff --git a/jode/src/net/sf/jode/expr/FieldOperator.java b/jode/src/net/sf/jode/expr/FieldOperator.java index 7506544..d4726db 100644 --- a/jode/src/net/sf/jode/expr/FieldOperator.java +++ b/jode/src/net/sf/jode/expr/FieldOperator.java @@ -18,7 +18,6 @@ */ package net.sf.jode.expr; -import net.sf.jode.GlobalOptions; import net.sf.jode.type.Type; import net.sf.jode.type.NullType; import net.sf.jode.type.ClassInfoType; @@ -29,7 +28,6 @@ import net.sf.jode.bytecode.Reference; import net.sf.jode.bytecode.TypeSignature; import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.ClassAnalyzer; -import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.FieldAnalyzer; import net.sf.jode.decompiler.Options; import net.sf.jode.decompiler.TabbedPrintWriter; @@ -146,21 +144,6 @@ public abstract class FieldOperator extends Operator { return Type.tType(classPath, ref.getType()); } - private FieldInfo[] loadFields(ClassInfo clazz) { - int howMuch = (clazz.getName().startsWith(callerPackage) - && (clazz.getName().lastIndexOf('.') - < callerPackage.length())) - ? ClassInfo.DECLARATIONS : ClassInfo.PUBLICDECLARATIONS; - try { - clazz.load(howMuch); - } catch (IOException ex) { - GlobalOptions.err.println("Warning: Can't find fields of " - +clazz+" to detect hiding conflicts"); - clazz.guess(howMuch); - } - return clazz.getFields(); - } - private static FieldInfo getFieldInfo(ClassInfo clazz, String name, String type) { while (clazz != null) { @@ -278,7 +261,7 @@ public abstract class FieldOperator extends Operator { writer.print(fieldName); } else if (needsCast(subExpressions[0].getType().getCanonic())) { writer.print("("); - writer.startOp(writer.EXPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1); writer.print("("); writer.printType(classType); writer.print(") "); diff --git a/jode/src/net/sf/jode/expr/IIncOperator.java b/jode/src/net/sf/jode/expr/IIncOperator.java index ac8311a..0702aee 100644 --- a/jode/src/net/sf/jode/expr/IIncOperator.java +++ b/jode/src/net/sf/jode/expr/IIncOperator.java @@ -19,7 +19,6 @@ package net.sf.jode.expr; import net.sf.jode.type.Type; -import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.TabbedPrintWriter; public class IIncOperator extends Operator diff --git a/jode/src/net/sf/jode/expr/IfThenElseOperator.java b/jode/src/net/sf/jode/expr/IfThenElseOperator.java index 8218af6..9bbadc0 100644 --- a/jode/src/net/sf/jode/expr/IfThenElseOperator.java +++ b/jode/src/net/sf/jode/expr/IfThenElseOperator.java @@ -76,7 +76,6 @@ public class IfThenElseOperator extends Operator { = (GetFieldOperator) subExpressions[2 - cmpType]; StoreInstruction put = (StoreInstruction) subExpressions[1 + cmpType]; - int opIndex = cmp.getOperatorIndex(); FieldAnalyzer field; if (put.getLValue() instanceof PutFieldOperator && ((field = ((PutFieldOperator)put.getLValue()) @@ -120,7 +119,7 @@ public class IfThenElseOperator extends Operator { int subPriority = 0; if (!subExpressions[1].getType().getHint().isOfType (subExpressions[2].getType())) { - writer.startOp(writer.IMPL_PAREN, 2); + writer.startOp(TabbedPrintWriter.IMPL_PAREN, 2); /* We need a cast here */ writer.print("("); writer.printType(getType().getHint()); diff --git a/jode/src/net/sf/jode/expr/InstanceOfOperator.java b/jode/src/net/sf/jode/expr/InstanceOfOperator.java index e45d5d9..8e4662e 100644 --- a/jode/src/net/sf/jode/expr/InstanceOfOperator.java +++ b/jode/src/net/sf/jode/expr/InstanceOfOperator.java @@ -51,7 +51,7 @@ public class InstanceOfOperator extends Operator { Type superType = instanceType.getCastHelper(subExpressions[0].getType()); if (superType != null) { - writer.startOp(writer.IMPL_PAREN, 2); + writer.startOp(TabbedPrintWriter.IMPL_PAREN, 2); writer.print("("); writer.printType(superType); writer.print(") "); diff --git a/jode/src/net/sf/jode/expr/InvokeOperator.java b/jode/src/net/sf/jode/expr/InvokeOperator.java index b79f203..89f276e 100644 --- a/jode/src/net/sf/jode/expr/InvokeOperator.java +++ b/jode/src/net/sf/jode/expr/InvokeOperator.java @@ -20,7 +20,6 @@ package net.sf.jode.expr; import java.lang.reflect.Modifier; -import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.TabbedPrintWriter; @@ -40,7 +39,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.Set; ///#enddef @@ -218,9 +216,9 @@ public final class InvokeOperator extends Operator String name, String type) { while (clazz != null) { try { - clazz.load(clazz.DECLARATIONS); + clazz.load(ClassInfo.DECLARATIONS); } catch (IOException ex) { - clazz.guess(clazz.DECLARATIONS); + clazz.guess(ClassInfo.DECLARATIONS); } MethodInfo method = clazz.findMethod(name, type); if (method != null) @@ -642,7 +640,7 @@ public final class InvokeOperator extends Operator op = new StoreInstruction (new PutFieldOperator(methodAnalyzer, false, synth.getReference())); - if (synth.getKind() == synth.ACCESSDUPPUTFIELD) + if (synth.getKind() == SyntheticAnalyzer.ACCESSDUPPUTFIELD) ((StoreInstruction) op).makeNonVoid(); break; case SyntheticAnalyzer.ACCESSPUTSTATIC: @@ -650,7 +648,7 @@ public final class InvokeOperator extends Operator op = new StoreInstruction (new PutFieldOperator(methodAnalyzer, true, synth.getReference())); - if (synth.getKind() == synth.ACCESSDUPPUTSTATIC) + if (synth.getKind() == SyntheticAnalyzer.ACCESSDUPPUTSTATIC) ((StoreInstruction) op).makeNonVoid(); break; case SyntheticAnalyzer.ACCESSMETHOD: @@ -948,7 +946,7 @@ public final class InvokeOperator extends Operator * we have to differentiate all kinds of method calls: static, * virtual, constructor, anonymous constructors, super calls etc. */ - writer.startOp(writer.NO_PAREN, 0); + writer.startOp(TabbedPrintWriter.NO_PAREN, 0); switch (methodFlag) { case CONSTRUCTOR: { @@ -1040,7 +1038,7 @@ public final class InvokeOperator extends Operator if (outerExpr.getType().getCanonic() instanceof NullType) { writer.print("("); - writer.startOp(writer.EXPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1); writer.print("("); writer.printType(Type.tClass(clazz)); writer.print(") "); @@ -1078,7 +1076,7 @@ public final class InvokeOperator extends Operator } writer.print("("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); writer.print("(UNCONSTRUCTED)"); writer.breakOp(); subExpressions[0].dumpExpression(writer, 700); @@ -1111,7 +1109,7 @@ public final class InvokeOperator extends Operator /* XXX check if this is a private method. */ if (needsCast(0, paramTypes)){ writer.print("("); - writer.startOp(writer.EXPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1); writer.print("("); writer.printType(classType); writer.print(") "); @@ -1126,7 +1124,7 @@ public final class InvokeOperator extends Operator writer.print("."); } else { writer.print("("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); writer.print("(NON VIRTUAL "); writer.printType(classType); writer.print(") "); @@ -1148,7 +1146,7 @@ public final class InvokeOperator extends Operator subExpressions[0].dumpExpression(writer, 950); else { writer.print("("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); writer.print("("); writer.printType(classType); writer.print(") "); @@ -1199,7 +1197,7 @@ public final class InvokeOperator extends Operator } else { if (needsCast(0, paramTypes)){ writer.print("("); - writer.startOp(writer.EXPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1); writer.print("("); writer.printType(classType); writer.print(") "); @@ -1223,7 +1221,7 @@ public final class InvokeOperator extends Operator writer.breakOp(); writer.printOptionalSpace(); writer.print("("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); boolean first = true; int offset = skippedArgs; while (arg < length) { @@ -1235,7 +1233,7 @@ public final class InvokeOperator extends Operator int priority = 0; if (needsCast(arg, paramTypes)) { Type castType = methodType.getParameterTypes()[arg-offset]; - writer.startOp(writer.IMPL_PAREN, 1); + writer.startOp(TabbedPrintWriter.IMPL_PAREN, 1); writer.print("("); writer.printType(castType); writer.print(") "); diff --git a/jode/src/net/sf/jode/expr/LValueExpression.java b/jode/src/net/sf/jode/expr/LValueExpression.java index 4f9c130..1b5d6c8 100644 --- a/jode/src/net/sf/jode/expr/LValueExpression.java +++ b/jode/src/net/sf/jode/expr/LValueExpression.java @@ -18,9 +18,6 @@ */ package net.sf.jode.expr; -import net.sf.jode.type.Type; -import net.sf.jode.GlobalOptions; -import net.sf.jode.decompiler.TabbedPrintWriter; public interface LValueExpression extends MatchableOperator { } diff --git a/jode/src/net/sf/jode/expr/LocalLoadOperator.java b/jode/src/net/sf/jode/expr/LocalLoadOperator.java index ba6f9c8..ec95074 100644 --- a/jode/src/net/sf/jode/expr/LocalLoadOperator.java +++ b/jode/src/net/sf/jode/expr/LocalLoadOperator.java @@ -18,12 +18,9 @@ */ package net.sf.jode.expr; -import net.sf.jode.GlobalOptions; import net.sf.jode.type.Type; import net.sf.jode.decompiler.MethodAnalyzer; -import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.LocalInfo; -import net.sf.jode.decompiler.TabbedPrintWriter; public class LocalLoadOperator extends LocalVarOperator { diff --git a/jode/src/net/sf/jode/expr/LocalStoreOperator.java b/jode/src/net/sf/jode/expr/LocalStoreOperator.java index 2f15a00..aba09bb 100644 --- a/jode/src/net/sf/jode/expr/LocalStoreOperator.java +++ b/jode/src/net/sf/jode/expr/LocalStoreOperator.java @@ -18,10 +18,8 @@ */ package net.sf.jode.expr; -import net.sf.jode.GlobalOptions; import net.sf.jode.type.Type; import net.sf.jode.decompiler.LocalInfo; -import net.sf.jode.decompiler.TabbedPrintWriter; public class LocalStoreOperator extends LocalVarOperator implements LValueExpression { diff --git a/jode/src/net/sf/jode/expr/NoArgOperator.java b/jode/src/net/sf/jode/expr/NoArgOperator.java index dafd222..5ab4b60 100644 --- a/jode/src/net/sf/jode/expr/NoArgOperator.java +++ b/jode/src/net/sf/jode/expr/NoArgOperator.java @@ -19,7 +19,6 @@ package net.sf.jode.expr; import net.sf.jode.type.Type; -import net.sf.jode.decompiler.TabbedPrintWriter; public abstract class NoArgOperator extends Operator { diff --git a/jode/src/net/sf/jode/expr/Operator.java b/jode/src/net/sf/jode/expr/Operator.java index da39581..c4a067b 100644 --- a/jode/src/net/sf/jode/expr/Operator.java +++ b/jode/src/net/sf/jode/expr/Operator.java @@ -19,7 +19,6 @@ package net.sf.jode.expr; import net.sf.jode.type.Type; -import net.sf.jode.GlobalOptions; import net.sf.jode.decompiler.TabbedPrintWriter; ///#def COLLECTIONS java.util @@ -221,7 +220,6 @@ public abstract class Operator extends Expression { * is not a CombineableOperator. */ public boolean containsMatchingLoad(CombineableOperator comb) { - Operator combOp = (Operator) comb; if (comb.getLValue().matches(this)) { if (subsEquals((Operator) comb.getLValue())) return true; diff --git a/jode/src/net/sf/jode/expr/OuterLocalOperator.java b/jode/src/net/sf/jode/expr/OuterLocalOperator.java index 1d3b735..254d03f 100644 --- a/jode/src/net/sf/jode/expr/OuterLocalOperator.java +++ b/jode/src/net/sf/jode/expr/OuterLocalOperator.java @@ -19,9 +19,6 @@ package net.sf.jode.expr; import net.sf.jode.GlobalOptions; -import net.sf.jode.type.Type; -import net.sf.jode.decompiler.MethodAnalyzer; -import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.TabbedPrintWriter; diff --git a/jode/src/net/sf/jode/expr/PrePostFixOperator.java b/jode/src/net/sf/jode/expr/PrePostFixOperator.java index 440f14b..4e940cb 100644 --- a/jode/src/net/sf/jode/expr/PrePostFixOperator.java +++ b/jode/src/net/sf/jode/expr/PrePostFixOperator.java @@ -52,7 +52,6 @@ public class PrePostFixOperator extends Operator { public void dumpExpression(TabbedPrintWriter writer) throws java.io.IOException { - boolean needBrace = false; int priority = 700; if (!postfix) { writer.print(getOperatorString()); diff --git a/jode/src/net/sf/jode/expr/PutFieldOperator.java b/jode/src/net/sf/jode/expr/PutFieldOperator.java index 83d782b..a62b367 100644 --- a/jode/src/net/sf/jode/expr/PutFieldOperator.java +++ b/jode/src/net/sf/jode/expr/PutFieldOperator.java @@ -20,7 +20,6 @@ package net.sf.jode.expr; import net.sf.jode.bytecode.Reference; import net.sf.jode.decompiler.MethodAnalyzer; -import net.sf.jode.decompiler.FieldAnalyzer; public class PutFieldOperator extends FieldOperator implements LValueExpression { diff --git a/jode/src/net/sf/jode/expr/StoreInstruction.java b/jode/src/net/sf/jode/expr/StoreInstruction.java index 22207b7..c6f7922 100644 --- a/jode/src/net/sf/jode/expr/StoreInstruction.java +++ b/jode/src/net/sf/jode/expr/StoreInstruction.java @@ -19,7 +19,6 @@ package net.sf.jode.expr; import net.sf.jode.type.Type; -import net.sf.jode.GlobalOptions; import net.sf.jode.decompiler.TabbedPrintWriter; public class StoreInstruction extends Operator @@ -73,9 +72,6 @@ public class StoreInstruction extends Operator } public void updateType() { - - Type newType; - if (!opAssign) { /* An opassign (+=, -=, etc.) doesn't merge rvalue type. */ Type lvalueType = subExpressions[0].getType(); diff --git a/jode/src/net/sf/jode/flow/BreakableBlock.java b/jode/src/net/sf/jode/flow/BreakableBlock.java index a13824a..ee54ef0 100644 --- a/jode/src/net/sf/jode/flow/BreakableBlock.java +++ b/jode/src/net/sf/jode/flow/BreakableBlock.java @@ -18,7 +18,6 @@ */ package net.sf.jode.flow; -import net.sf.jode.decompiler.TabbedPrintWriter; /** * This is a structured block, that supports break. diff --git a/jode/src/net/sf/jode/flow/CatchBlock.java b/jode/src/net/sf/jode/flow/CatchBlock.java index 144f274..3eaf851 100644 --- a/jode/src/net/sf/jode/flow/CatchBlock.java +++ b/jode/src/net/sf/jode/flow/CatchBlock.java @@ -25,8 +25,8 @@ import net.sf.jode.expr.Expression; import net.sf.jode.expr.LocalLoadOperator; import net.sf.jode.expr.LocalStoreOperator; import net.sf.jode.expr.NopOperator; +import net.sf.jode.expr.Operator; import net.sf.jode.expr.StoreInstruction; -import net.sf.jode.util.SimpleSet; ///#def COLLECTIONS java.util import java.util.Collections; @@ -223,7 +223,7 @@ public class CatchBlock extends StructuredBlock { ((InstructionBlock) firstInstr).getInstruction(); if (instr instanceof StoreInstruction) { StoreInstruction store = (StoreInstruction) instr; - if (store.getOperatorIndex() == store.OPASSIGN_OP + if (store.getOperatorIndex() == Operator.OPASSIGN_OP && store.getSubExpressions()[1] instanceof NopOperator && store.getLValue() instanceof LocalStoreOperator) { /* The exception is stored in a local variable */ diff --git a/jode/src/net/sf/jode/flow/CombineIfGotoExpressions.java b/jode/src/net/sf/jode/flow/CombineIfGotoExpressions.java index 448909c..8d38569 100644 --- a/jode/src/net/sf/jode/flow/CombineIfGotoExpressions.java +++ b/jode/src/net/sf/jode/flow/CombineIfGotoExpressions.java @@ -18,7 +18,6 @@ */ package net.sf.jode.flow; -import java.util.Vector; import net.sf.jode.expr.*; import net.sf.jode.type.Type; diff --git a/jode/src/net/sf/jode/flow/ConditionalBlock.java b/jode/src/net/sf/jode/flow/ConditionalBlock.java index 839b9be..3d49d9f 100644 --- a/jode/src/net/sf/jode/flow/ConditionalBlock.java +++ b/jode/src/net/sf/jode/flow/ConditionalBlock.java @@ -20,7 +20,6 @@ package net.sf.jode.flow; import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.expr.Expression; -import net.sf.jode.expr.LocalVarOperator; /** * An ConditionalBlock is the structured block representing an if @@ -123,7 +122,7 @@ public class ConditionalBlock extends InstructionContainer { throws java.io.IOException { writer.print("IF ("); - instr.dumpExpression(writer.EXPL_PAREN, writer); + instr.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer); writer.println(")"); writer.tab(); trueBlock.dumpSource(writer); diff --git a/jode/src/net/sf/jode/flow/CreateAssignExpression.java b/jode/src/net/sf/jode/flow/CreateAssignExpression.java index 8dec5a4..1fef4c0 100644 --- a/jode/src/net/sf/jode/flow/CreateAssignExpression.java +++ b/jode/src/net/sf/jode/flow/CreateAssignExpression.java @@ -115,7 +115,7 @@ public class CreateAssignExpression { } if (expr instanceof BinaryOperator) { opIndex = expr.getOperatorIndex(); - if (opIndex < expr.ADD_OP || opIndex >= expr.ASSIGN_OP) + if (opIndex < Operator.ADD_OP || opIndex >= Operator.ASSIGN_OP) return false; if (!(expr.getSubExpressions()[0] instanceof Operator)) @@ -179,7 +179,7 @@ public class CreateAssignExpression { ib.setInstruction(rightHandSide); lvalue.setType(rvalueType); - store.makeOpAssign(store.OPASSIGN_OP + opIndex); + store.makeOpAssign(Operator.OPASSIGN_OP + opIndex); if (isAssignOp) store.makeNonVoid(); diff --git a/jode/src/net/sf/jode/flow/CreateClassField.java b/jode/src/net/sf/jode/flow/CreateClassField.java index 2ca597c..0818c6d 100644 --- a/jode/src/net/sf/jode/flow/CreateClassField.java +++ b/jode/src/net/sf/jode/flow/CreateClassField.java @@ -21,7 +21,6 @@ package net.sf.jode.flow; import net.sf.jode.expr.*; import net.sf.jode.bytecode.ClassPath; import net.sf.jode.type.Type; -import net.sf.jode.decompiler.LocalInfo; public class CreateClassField { diff --git a/jode/src/net/sf/jode/flow/CreateConstantArray.java b/jode/src/net/sf/jode/flow/CreateConstantArray.java index 82aa644..aa0be93 100644 --- a/jode/src/net/sf/jode/flow/CreateConstantArray.java +++ b/jode/src/net/sf/jode/flow/CreateConstantArray.java @@ -20,7 +20,6 @@ package net.sf.jode.flow; import net.sf.jode.GlobalOptions; import net.sf.jode.expr.*; -import net.sf.jode.type.Type; public class CreateConstantArray { diff --git a/jode/src/net/sf/jode/flow/CreateIfThenElseOperator.java b/jode/src/net/sf/jode/flow/CreateIfThenElseOperator.java index a2ca73b..daa0105 100644 --- a/jode/src/net/sf/jode/flow/CreateIfThenElseOperator.java +++ b/jode/src/net/sf/jode/flow/CreateIfThenElseOperator.java @@ -22,9 +22,6 @@ import net.sf.jode.GlobalOptions; import net.sf.jode.type.Type; import net.sf.jode.expr.*; -import java.util.Enumeration; -import java.util.Vector; - public class CreateIfThenElseOperator { /** @@ -55,7 +52,6 @@ public class CreateIfThenElseOperator { if (block instanceof IfThenElseBlock) { IfThenElseBlock ifBlock = (IfThenElseBlock) block; - Expression expr1, expr2; if (ifBlock.elseBlock == null) return false; @@ -156,18 +152,15 @@ public class CreateIfThenElseOperator { FlowBlock trueDestination; FlowBlock falseDestination; - if (compare.getOperatorIndex() == compare.EQUALS_OP) { + if (compare.getOperatorIndex() == Operator.EQUALS_OP) { trueDestination = cb.jump.destination; falseDestination = cb.trueBlock.jump.destination; - } else if (compare.getOperatorIndex() == compare.NOTEQUALS_OP) { + } else if (compare.getOperatorIndex() == Operator.NOTEQUALS_OP) { falseDestination = cb.jump.destination; trueDestination = cb.trueBlock.jump.destination; } else return false; - Expression[] e = new Expression[3]; - IfThenElseBlock ifBlock; - SequentialBlock sequBlock = (SequentialBlock) last.outer; return createFunnyHelper(trueDestination, falseDestination, sequBlock.subBlocks[0]); diff --git a/jode/src/net/sf/jode/flow/CreatePrePostIncExpression.java b/jode/src/net/sf/jode/flow/CreatePrePostIncExpression.java index 5d76c9c..0062802 100644 --- a/jode/src/net/sf/jode/flow/CreatePrePostIncExpression.java +++ b/jode/src/net/sf/jode/flow/CreatePrePostIncExpression.java @@ -65,9 +65,9 @@ public class CreatePrePostIncExpression { return false; int op; - if (iinc.getOperatorIndex() == iinc.ADD_OP + iinc.OPASSIGN_OP) + if (iinc.getOperatorIndex() == Operator.ADD_OP + Operator.OPASSIGN_OP) op = Operator.INC_OP; - else if (iinc.getOperatorIndex() == iinc.SUB_OP + iinc.OPASSIGN_OP) + else if (iinc.getOperatorIndex() == Operator.SUB_OP + Operator.OPASSIGN_OP) op = Operator.DEC_OP; else return false; @@ -128,9 +128,9 @@ public class CreatePrePostIncExpression { ConstOperator constOp = (ConstOperator) binOp.getSubExpressions()[1]; int op; - if (binOp.getOperatorIndex() == store.ADD_OP) + if (binOp.getOperatorIndex() == Operator.ADD_OP) op = Operator.INC_OP; - else if (binOp.getOperatorIndex() == store.SUB_OP) + else if (binOp.getOperatorIndex() == Operator.SUB_OP) op = Operator.DEC_OP; else return false; diff --git a/jode/src/net/sf/jode/flow/FlowBlock.java b/jode/src/net/sf/jode/flow/FlowBlock.java index 66bdee4..356bcf9 100644 --- a/jode/src/net/sf/jode/flow/FlowBlock.java +++ b/jode/src/net/sf/jode/flow/FlowBlock.java @@ -25,7 +25,6 @@ import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.expr.Expression; import net.sf.jode.expr.CombineableOperator; import net.sf.jode.util.SimpleMap; -import net.sf.jode.util.SimpleSet; ///#def COLLECTIONS java.util import java.util.Map; @@ -244,7 +243,6 @@ public class FlowBlock { cb.swapJump(prev); } } - next_jump: while (jumps != null) { Jump jump = jumps; jumps = jumps.next; @@ -581,7 +579,6 @@ public class FlowBlock { LoopBlock doWhileFalse = null; StructuredBlock outerMost = lastModified; boolean removeLast = false; - next_jump: for (; jumps != null; jumps = jumps.next) { StructuredBlock prevBlock = jumps.prev; @@ -962,10 +959,6 @@ public class FlowBlock { } public void setSuccessors(FlowBlock[] succs) { - SlotSet blockIn = new SlotSet(); - SlotSet blockKill = new SlotSet(); - VariableSet blockGen = new VariableSet(); - Jump[] jumps = new Jump[succs.length]; for (int i=0; i< succs.length; i++) { Jump jump = new Jump(succs[i]); @@ -1078,7 +1071,6 @@ public class FlowBlock { if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_FLOW) != 0) GlobalOptions.err.println("before remaining: "+this); - next_jump: for (; jumps != null; jumps = jumps.next) { StructuredBlock prevBlock = jumps.prev; @@ -1178,7 +1170,7 @@ public class FlowBlock { LoopBlock lb = (LoopBlock) lastModified.outer.getSubBlocks()[0]; - if (lb.cond == lb.FALSE && lb.type == lb.DOWHILE) { + if (lb.cond == LoopBlock.FALSE && lb.type == LoopBlock.DOWHILE) { /* The jump is directly following a * do-while(false) block @@ -1442,7 +1434,6 @@ public class FlowBlock { * block lie in range [start,end). Otherwise * we have no chance to combine these two blocks. */ - boolean predOutOfRange = false; for (Iterator i = succ.predecessors.iterator(); i.hasNext(); ) { FlowBlock pred = (FlowBlock)i.next(); diff --git a/jode/src/net/sf/jode/flow/IfThenElseBlock.java b/jode/src/net/sf/jode/flow/IfThenElseBlock.java index 771e0d3..67d9945 100644 --- a/jode/src/net/sf/jode/flow/IfThenElseBlock.java +++ b/jode/src/net/sf/jode/flow/IfThenElseBlock.java @@ -18,10 +18,8 @@ */ package net.sf.jode.flow; -import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.expr.Expression; -import net.sf.jode.type.Type; import net.sf.jode.util.SimpleSet; ///#def COLLECTIONS java.util @@ -174,7 +172,7 @@ public class IfThenElseBlock extends StructuredBlock { { boolean needBrace = thenBlock.needsBraces(); writer.print("if ("); - cond.dumpExpression(writer.EXPL_PAREN, writer); + cond.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer); writer.print(")"); if (needBrace) writer.openBrace(); diff --git a/jode/src/net/sf/jode/flow/InstructionBlock.java b/jode/src/net/sf/jode/flow/InstructionBlock.java index 41a24f3..3351845 100644 --- a/jode/src/net/sf/jode/flow/InstructionBlock.java +++ b/jode/src/net/sf/jode/flow/InstructionBlock.java @@ -24,7 +24,6 @@ import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.expr.Expression; import net.sf.jode.expr.StoreInstruction; import net.sf.jode.expr.LocalStoreOperator; -import net.sf.jode.util.SimpleSet; ///#def COLLECTIONS java.util import java.util.Set; @@ -137,12 +136,12 @@ public class InstructionBlock extends InstructionContainer { StoreInstruction store = (StoreInstruction) instr; LocalInfo local = ((LocalStoreOperator) store.getLValue()).getLocalInfo(); - writer.startOp(writer.NO_PAREN, 0); + writer.startOp(TabbedPrintWriter.NO_PAREN, 0); local.dumpDeclaration(writer); writer.breakOp(); writer.print(" = "); store.getSubExpressions()[1].makeInitializer(local.getType()); - store.getSubExpressions()[1].dumpExpression(writer.IMPL_PAREN, + store.getSubExpressions()[1].dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer); writer.endOp(); } else { @@ -150,9 +149,9 @@ public class InstructionBlock extends InstructionContainer { if (instr.getType() != Type.tVoid) { writer.print("PUSH "); - instr.dumpExpression(writer.IMPL_PAREN, writer); + instr.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer); } else - instr.dumpExpression(writer.NO_PAREN, writer); + instr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer); } catch (RuntimeException ex) { writer.print("(RUNTIME ERROR IN EXPRESSION)"); } diff --git a/jode/src/net/sf/jode/flow/InstructionContainer.java b/jode/src/net/sf/jode/flow/InstructionContainer.java index c7254a4..d527651 100644 --- a/jode/src/net/sf/jode/flow/InstructionContainer.java +++ b/jode/src/net/sf/jode/flow/InstructionContainer.java @@ -18,10 +18,8 @@ */ package net.sf.jode.flow; -import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.expr.Expression; import net.sf.jode.expr.InvokeOperator; -import net.sf.jode.expr.LocalVarOperator; import net.sf.jode.util.SimpleSet; ///#def COLLECTIONS java.util diff --git a/jode/src/net/sf/jode/flow/Jump.java b/jode/src/net/sf/jode/flow/Jump.java index 9a0c21e..e6c945c 100644 --- a/jode/src/net/sf/jode/flow/Jump.java +++ b/jode/src/net/sf/jode/flow/Jump.java @@ -18,7 +18,6 @@ */ package net.sf.jode.flow; -import net.sf.jode.GlobalOptions; /** * This class represents an unconditional jump. diff --git a/jode/src/net/sf/jode/flow/LoopBlock.java b/jode/src/net/sf/jode/flow/LoopBlock.java index 58295a8..2ac0afd 100644 --- a/jode/src/net/sf/jode/flow/LoopBlock.java +++ b/jode/src/net/sf/jode/flow/LoopBlock.java @@ -19,7 +19,6 @@ package net.sf.jode.flow; import net.sf.jode.decompiler.TabbedPrintWriter; -import net.sf.jode.type.Type; import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.expr.Expression; import net.sf.jode.expr.ConstOperator; @@ -316,7 +315,7 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { writer.print("for (;;)"); else { writer.print("while ("); - cond.dumpExpression(writer.EXPL_PAREN, writer); + cond.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer); writer.print(")"); } break; @@ -325,13 +324,13 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { break; case FOR: writer.print("for ("); - writer.startOp(writer.EXPL_PAREN, 0); + writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0); if (initInstr != null) { if (isDeclaration) { StoreInstruction store = (StoreInstruction) initInstr; LocalInfo local = ((LocalStoreOperator) store .getLValue()).getLocalInfo(); - writer.startOp(writer.NO_PAREN, 1); + writer.startOp(TabbedPrintWriter.NO_PAREN, 1); local.dumpDeclaration(writer); writer.breakOp(); writer.print(" = "); @@ -340,16 +339,16 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { store.getSubExpressions()[1].dumpExpression(writer, 100); writer.endOp(); } else - initInstr.dumpExpression(writer.NO_PAREN, writer); + initInstr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer); } else { writer.print("/**/"); } writer.print("; "); writer.breakOp(); - cond.dumpExpression(writer.IMPL_PAREN, writer); + cond.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer); writer.print("; "); writer.breakOp(); - incrInstr.dumpExpression(writer.NO_PAREN, writer); + incrInstr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer); writer.endOp(); writer.print(")"); break; @@ -365,7 +364,7 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { if (needBrace) writer.closeBraceContinue(); writer.print("while ("); - cond.dumpExpression(writer.EXPL_PAREN, writer); + cond.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer); writer.println(");"); } else if (needBrace) writer.closeBrace(); diff --git a/jode/src/net/sf/jode/flow/ReturnBlock.java b/jode/src/net/sf/jode/flow/ReturnBlock.java index 8e13c7e..6bff807 100644 --- a/jode/src/net/sf/jode/flow/ReturnBlock.java +++ b/jode/src/net/sf/jode/flow/ReturnBlock.java @@ -63,7 +63,7 @@ public class ReturnBlock extends InstructionContainer { newStack = stack.pop(params); } } - return null; + return newStack; } public void removePush() { @@ -85,7 +85,7 @@ public class ReturnBlock extends InstructionContainer { writer.print("return"); if (instr != null) { writer.print(" "); - instr.dumpExpression(writer.IMPL_PAREN, writer); + instr.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer); } writer.println(";"); } diff --git a/jode/src/net/sf/jode/flow/SequentialBlock.java b/jode/src/net/sf/jode/flow/SequentialBlock.java index 8ee7279..5cc67bf 100644 --- a/jode/src/net/sf/jode/flow/SequentialBlock.java +++ b/jode/src/net/sf/jode/flow/SequentialBlock.java @@ -19,7 +19,6 @@ package net.sf.jode.flow; import net.sf.jode.decompiler.TabbedPrintWriter; -import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.expr.LocalStoreOperator; import net.sf.jode.expr.StoreInstruction; import net.sf.jode.util.SimpleSet; diff --git a/jode/src/net/sf/jode/flow/SlotSet.java b/jode/src/net/sf/jode/flow/SlotSet.java index aef2e2a..c83519b 100644 --- a/jode/src/net/sf/jode/flow/SlotSet.java +++ b/jode/src/net/sf/jode/flow/SlotSet.java @@ -19,10 +19,8 @@ package net.sf.jode.flow; import net.sf.jode.decompiler.LocalInfo; -import net.sf.jode.util.ArrayEnum; ///#def COLLECTIONS java.util -import java.util.Collection; import java.util.AbstractSet; import java.util.Set; import java.util.Iterator; @@ -207,7 +205,6 @@ public final class SlotSet extends AbstractSet implements Cloneable { */ public void mergeKill(Set kill) { grow(kill.size()); - big_loop: for (Iterator i = kill.iterator(); i.hasNext(); ) { LocalInfo li2 = (LocalInfo) i.next(); if (!containsSlot(li2.getSlot())) diff --git a/jode/src/net/sf/jode/flow/SynchronizedBlock.java b/jode/src/net/sf/jode/flow/SynchronizedBlock.java index 04f7fd0..43b40b2 100644 --- a/jode/src/net/sf/jode/flow/SynchronizedBlock.java +++ b/jode/src/net/sf/jode/flow/SynchronizedBlock.java @@ -91,7 +91,7 @@ public class SynchronizedBlock extends StructuredBlock { writer.println("MISSING MONITORENTER"); writer.print("synchronized ("); if (object != null) - object.dumpExpression(writer.EXPL_PAREN, writer); + object.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer); else writer.print(local.getName()); writer.print(")"); diff --git a/jode/src/net/sf/jode/flow/ThrowBlock.java b/jode/src/net/sf/jode/flow/ThrowBlock.java index 018db20..3a37ba0 100644 --- a/jode/src/net/sf/jode/flow/ThrowBlock.java +++ b/jode/src/net/sf/jode/flow/ThrowBlock.java @@ -33,7 +33,7 @@ public class ThrowBlock extends ReturnBlock { throws java.io.IOException { writer.print("throw "); - instr.dumpExpression(writer.NO_PAREN, writer); + instr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer); writer.println(";"); } } diff --git a/jode/src/net/sf/jode/flow/TransformConstructors.java b/jode/src/net/sf/jode/flow/TransformConstructors.java index 95f2d3d..70a60d8 100644 --- a/jode/src/net/sf/jode/flow/TransformConstructors.java +++ b/jode/src/net/sf/jode/flow/TransformConstructors.java @@ -20,11 +20,9 @@ package net.sf.jode.flow; import java.lang.reflect.Modifier; import net.sf.jode.GlobalOptions; -import net.sf.jode.decompiler.Analyzer; import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.FieldAnalyzer; -import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.Options; import net.sf.jode.decompiler.OuterValues; import net.sf.jode.decompiler.OuterValueListener; @@ -36,8 +34,6 @@ import net.sf.jode.bytecode.ClassPath; import net.sf.jode.bytecode.MethodInfo; import java.io.IOException; -import java.util.Vector; -import java.util.Enumeration; /** * This class will transform the constructors. We differ three types of @@ -440,7 +436,6 @@ public class TransformConstructors { + cons[i].getMethodHeader()); MethodAnalyzer constr = cons[i]; - MethodType constrType = constr.getType(); /* * constructor(outerValues, params, opt. jikesAnonInner param) { @@ -462,7 +457,6 @@ public class TransformConstructors { * constructor$? as Jikes constructor. */ StructuredBlock sb = constr.getMethodHeader().block; - Vector localLoads = null; InstructionBlock superBlock = null; InvokeOperator superInvoke = null; if (i >= type0Count) { @@ -547,7 +541,6 @@ public class TransformConstructors { int firstParamSlot = slot; int firstOuterSlot = firstParam; - int slotDist = firstParamSlot - firstOuterSlot; /* check the remaining parameters. */ for (int j=firstParam; j < methodParams.length; j++) { @@ -857,8 +850,6 @@ public class TransformConstructors { } private void transformBlockInitializer(StructuredBlock block) { - StructuredBlock start = null; - StructuredBlock tail = null; int lastField = -1; while (block instanceof SequentialBlock) { StructuredBlock ib = block.getSubBlocks()[0]; diff --git a/jode/src/net/sf/jode/flow/TransformExceptionHandlers.java b/jode/src/net/sf/jode/flow/TransformExceptionHandlers.java index 836f9e3..186ec7a 100644 --- a/jode/src/net/sf/jode/flow/TransformExceptionHandlers.java +++ b/jode/src/net/sf/jode/flow/TransformExceptionHandlers.java @@ -27,7 +27,6 @@ import net.sf.jode.expr.*; import java.util.TreeSet; import java.util.SortedSet; import java.util.Set; -import java.util.Map; import java.util.Iterator; ///#enddef ///#def COLLECTIONEXTRA java.lang @@ -777,7 +776,6 @@ public class TransformExceptionHandlers { finallyBlock = subRoutine.block; DescriptionBlock msg = new DescriptionBlock ("ERROR: Missing return address handling"); - StructuredBlock subblock = subRoutine.block; msg.replace(finallyBlock); msg.appendBlock(finallyBlock); } @@ -935,7 +933,7 @@ public class TransformExceptionHandlers { GlobalOptions.err.println ("Warning: Can't completely analyze try."); } - TryBlock tryBlock = new TryBlock(tryFlow); + new TryBlock(tryFlow); } else if (!(tryFlow.block instanceof TryBlock)) throw new InternalError("no TryBlock"); diff --git a/jode/src/net/sf/jode/flow/VariableSet.java b/jode/src/net/sf/jode/flow/VariableSet.java index 22e10f6..39716de 100644 --- a/jode/src/net/sf/jode/flow/VariableSet.java +++ b/jode/src/net/sf/jode/flow/VariableSet.java @@ -19,7 +19,6 @@ package net.sf.jode.flow; import net.sf.jode.decompiler.LocalInfo; -import net.sf.jode.util.ArrayEnum; ///#def COLLECTIONS java.util import java.util.Collection; @@ -193,7 +192,6 @@ public final class VariableSet extends AbstractSet implements Cloneable { public VariableSet intersect(VariableSet vs) { VariableSet intersection = new VariableSet(); intersection.grow(Math.min(count, vs.count)); - big_loop: for (int i=0; i")) { Type clazz = info.pop(); - String typeSig = clazz.getTypeSig(); String refClazzSig = ref.getClazz(); Type refClazz = tType("N" + refClazzSig.substring(1)); if (opcode != opc_invokespecial diff --git a/jode/src/net/sf/jode/jvm/Interpreter.java b/jode/src/net/sf/jode/jvm/Interpreter.java index 80b9ed9..6d2d2f2 100644 --- a/jode/src/net/sf/jode/jvm/Interpreter.java +++ b/jode/src/net/sf/jode/jvm/Interpreter.java @@ -92,7 +92,6 @@ public class Interpreter implements Opcodes { for (int i=0; i < stack.length; i++) stack[i] = new Value(); - Block[] blocks = bb.getBlocks(); Block nextBlock = bb.getStartBlock(); int stacktop = 0; diff --git a/jode/src/net/sf/jode/jvm/SyntheticAnalyzer.java b/jode/src/net/sf/jode/jvm/SyntheticAnalyzer.java index 5ac72e4..0bce9b4 100644 --- a/jode/src/net/sf/jode/jvm/SyntheticAnalyzer.java +++ b/jode/src/net/sf/jode/jvm/SyntheticAnalyzer.java @@ -18,7 +18,6 @@ */ package net.sf.jode.jvm; -import net.sf.jode.GlobalOptions; import net.sf.jode.bytecode.BasicBlocks; import net.sf.jode.bytecode.Block; import net.sf.jode.bytecode.ClassInfo; @@ -107,7 +106,6 @@ public class SyntheticAnalyzer implements Opcodes { BasicBlocks bb = method.getBasicBlocks(); - Block[] blocks = bb.getBlocks(); Block startBlock = bb.getStartBlock(); Handler[] excHandlers = bb.getExceptionHandlers(); if (startBlock == null @@ -185,7 +183,6 @@ public class SyntheticAnalyzer implements Opcodes { Handler[] excHandlers = bb.getExceptionHandlers(); if (excHandlers != null && excHandlers.length != 0) return false; - Block[] blocks = bb.getBlocks(); Block startBlock = bb.getStartBlock(); if (startBlock == null) return false; diff --git a/jode/src/net/sf/jode/jvm/Value.java b/jode/src/net/sf/jode/jvm/Value.java index 5a1c851..2a52da0 100644 --- a/jode/src/net/sf/jode/jvm/Value.java +++ b/jode/src/net/sf/jode/jvm/Value.java @@ -18,7 +18,6 @@ */ package net.sf.jode.jvm; -import net.sf.jode.bytecode.*; /** * This class represents a stack value. diff --git a/jode/src/net/sf/jode/jvm/VerifyException.java b/jode/src/net/sf/jode/jvm/VerifyException.java index 5ed773d..294939d 100644 --- a/jode/src/net/sf/jode/jvm/VerifyException.java +++ b/jode/src/net/sf/jode/jvm/VerifyException.java @@ -18,7 +18,6 @@ */ package net.sf.jode.jvm; -import net.sf.jode.bytecode.*; /** * This exception is thrown by the CodeVerifier on various conditions. diff --git a/jode/src/net/sf/jode/obfuscator/ClassBundle.java b/jode/src/net/sf/jode/obfuscator/ClassBundle.java index af42c6e..2e04f36 100644 --- a/jode/src/net/sf/jode/obfuscator/ClassBundle.java +++ b/jode/src/net/sf/jode/obfuscator/ClassBundle.java @@ -20,7 +20,6 @@ package net.sf.jode.obfuscator; import net.sf.jode.GlobalOptions; import net.sf.jode.bytecode.ClassPath; -import net.sf.jode.bytecode.ClassInfo; import net.sf.jode.bytecode.Reference; import net.sf.jode.obfuscator.modules.WildCard; import net.sf.jode.obfuscator.modules.MultiIdentifierMatcher; @@ -36,10 +35,6 @@ import java.util.Set; import java.util.HashSet; import java.util.Map; import java.util.HashMap; -import java.util.TreeMap; -///#enddef -///#def COLLECTIONEXTRA java.lang -import java.lang.UnsupportedOperationException; ///#enddef ///#ifdef JDK12 diff --git a/jode/src/net/sf/jode/obfuscator/ClassIdentifier.java b/jode/src/net/sf/jode/obfuscator/ClassIdentifier.java index 541d4a7..09eaec4 100644 --- a/jode/src/net/sf/jode/obfuscator/ClassIdentifier.java +++ b/jode/src/net/sf/jode/obfuscator/ClassIdentifier.java @@ -30,7 +30,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.LinkedList; -import java.util.Map; import java.util.Random; ///#enddef ///#def COLLECTIONEXTRA java.lang @@ -394,7 +393,7 @@ public class ClassIdentifier extends Identifier { initialized = true; try { - info.load(info.ALL); + info.load(ClassInfo.ALL); } catch (IOException ex) { throw new RuntimeException("Can't read class " + info.getName() + ": " + ex.getMessage()); @@ -749,7 +748,6 @@ public class ClassIdentifier extends Identifier { * they must be there!). */ ClassInfo superInfo = info.getSuperclass(); - ClassIdentifier superIdent = this; while (superInfo != null) { ClassIdentifier superident = Main.getClassBundle() .getClassIdentifier(superInfo.getName()); diff --git a/jode/src/net/sf/jode/obfuscator/FieldIdentifier.java b/jode/src/net/sf/jode/obfuscator/FieldIdentifier.java index c56ffc0..04de1f5 100644 --- a/jode/src/net/sf/jode/obfuscator/FieldIdentifier.java +++ b/jode/src/net/sf/jode/obfuscator/FieldIdentifier.java @@ -18,14 +18,12 @@ */ package net.sf.jode.obfuscator; -import java.lang.reflect.Modifier; import net.sf.jode.bytecode.*; ///#def COLLECTIONS java.util import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.HashSet; -import java.util.Map; ///#enddef diff --git a/jode/src/net/sf/jode/obfuscator/Identifier.java b/jode/src/net/sf/jode/obfuscator/Identifier.java index 0e4cf14..9af7e90 100644 --- a/jode/src/net/sf/jode/obfuscator/Identifier.java +++ b/jode/src/net/sf/jode/obfuscator/Identifier.java @@ -19,7 +19,6 @@ package net.sf.jode.obfuscator; import net.sf.jode.GlobalOptions; -import java.io.*; ///#def COLLECTIONS java.util import java.util.Map; import java.util.Iterator; diff --git a/jode/src/net/sf/jode/obfuscator/Main.java b/jode/src/net/sf/jode/obfuscator/Main.java index 01bc7cd..9e8352f 100644 --- a/jode/src/net/sf/jode/obfuscator/Main.java +++ b/jode/src/net/sf/jode/obfuscator/Main.java @@ -23,7 +23,6 @@ import net.sf.jode.GlobalOptions; import gnu.getopt.LongOpt; import gnu.getopt.Getopt; -import java.lang.reflect.Modifier; import java.io.PrintWriter; import java.io.FileReader; import java.io.InputStreamReader; diff --git a/jode/src/net/sf/jode/obfuscator/MethodIdentifier.java b/jode/src/net/sf/jode/obfuscator/MethodIdentifier.java index bb7449e..9a58db7 100644 --- a/jode/src/net/sf/jode/obfuscator/MethodIdentifier.java +++ b/jode/src/net/sf/jode/obfuscator/MethodIdentifier.java @@ -24,10 +24,8 @@ import net.sf.jode.bytecode.*; ///#def COLLECTIONS java.util import java.util.Collections; import java.util.Iterator; -import java.util.Map; ///#enddef -import java.lang.reflect.Modifier; import java.util.BitSet; public class MethodIdentifier extends Identifier implements Opcodes { diff --git a/jode/src/net/sf/jode/obfuscator/PackageIdentifier.java b/jode/src/net/sf/jode/obfuscator/PackageIdentifier.java index b0c39a5..5302372 100644 --- a/jode/src/net/sf/jode/obfuscator/PackageIdentifier.java +++ b/jode/src/net/sf/jode/obfuscator/PackageIdentifier.java @@ -19,12 +19,7 @@ package net.sf.jode.obfuscator; import net.sf.jode.GlobalOptions; -import net.sf.jode.bytecode.ClassInfo; -import net.sf.jode.bytecode.FieldInfo; -import net.sf.jode.bytecode.MethodInfo; -import java.lang.reflect.Modifier; import java.io.*; -import java.util.Vector; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -183,7 +178,7 @@ public class PackageIdentifier extends Identifier { if (loadOnDemand || matcher.matches(ident)) ident.setLoadOnDemand(); if (initialized) - ((PackageIdentifier) ident).initialize(); + ident.initialize(); } else { ClassIdentifier ident = new ClassIdentifier (this, subFull, subclazz, @@ -197,7 +192,7 @@ public class PackageIdentifier extends Identifier { swappedClasses = null; bundle.addClassIdentifier(ident); if (initialized) - ((ClassIdentifier) ident).initClass(); + ident.initClass(); } } } diff --git a/jode/src/net/sf/jode/obfuscator/modules/ConstantAnalyzer.java b/jode/src/net/sf/jode/obfuscator/modules/ConstantAnalyzer.java index 98ad9c5..0502e1d 100644 --- a/jode/src/net/sf/jode/obfuscator/modules/ConstantAnalyzer.java +++ b/jode/src/net/sf/jode/obfuscator/modules/ConstantAnalyzer.java @@ -25,8 +25,6 @@ import net.sf.jode.jvm.InterpreterException; import net.sf.jode.obfuscator.*; import net.sf.jode.util.StringQuoter; -import java.lang.reflect.Array; -import java.lang.reflect.Modifier; import java.lang.reflect.InvocationTargetException; import java.io.PrintWriter; import java.util.BitSet; @@ -40,7 +38,6 @@ import java.util.Set; import java.util.HashMap; import java.util.Map; import java.util.Iterator; -import java.util.ListIterator; ///#enddef /** @@ -180,10 +177,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer { listeners.add(l); } - public void removeConstantListener(ConstantListener l) { - listeners.remove(l); - } - public void fireChanged() { value = VOLATILE; for (Iterator i = listeners.iterator(); i.hasNext(); ) { @@ -453,14 +446,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer { } private static class ConstantInfo implements ConstantListener { - ConstantInfo() { - this(0, null); - } - - ConstantInfo(int flags) { - this(flags, null); - } - ConstantInfo(int flags, Object constant) { this.flags = flags; this.constant = constant; @@ -482,8 +467,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer { new ConstValue(1), new ConstValue(2) }; - private static ConstantInfo unknownConstInfo = new ConstantInfo(); - /** * The block info contains the info needed for a single block. */ @@ -591,8 +574,7 @@ public class ConstantAnalyzer extends SimpleAnalyzer { for (int slot = 0; slot < newLocals.length; slot++) { if (retBlock.usedLocals.get(slot)) { newLocals[slot] = retBlock.after.locals[slot]; - if (nextUsed != null) - nextUsed.set(slot); + nextUsed.set(slot); } } StackLocalInfo nextInfo @@ -700,7 +682,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer { if (constantFlow >= 0) /* Nothing changed... */ return; - Instruction pc; int value = ((Integer) stacktop.value).intValue(); int[] values = instr.getValues(); constantFlow = Arrays.binarySearch(values, value); @@ -1361,7 +1342,7 @@ public class ConstantAnalyzer extends SimpleAnalyzer { || opcode == opc_invokeinterface); return info.pop(size); } - if (constant && !runtime.isWhite(retType)) { + if (constant && !ConstantRuntimeEnvironment.isWhite(retType)) { /* This is not a valid constant type */ constant = false; } @@ -1667,8 +1648,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer { case opc_invokevirtual: { Reference ref = instr.getReference(); String[] pt = TypeSignature.getParameterTypes(ref.getType()); - int arg = 0; - int i = pt.length; while (i > 0) newCode.add(Instruction.forOpcode(TypeSignature diff --git a/jode/src/net/sf/jode/obfuscator/modules/SimpleAnalyzer.java b/jode/src/net/sf/jode/obfuscator/modules/SimpleAnalyzer.java index fc9c2cb..9032c7e 100644 --- a/jode/src/net/sf/jode/obfuscator/modules/SimpleAnalyzer.java +++ b/jode/src/net/sf/jode/obfuscator/modules/SimpleAnalyzer.java @@ -34,8 +34,6 @@ import net.sf.jode.GlobalOptions; import java.io.IOException; ///#def COLLECTIONS java.util import java.util.ArrayList; -import java.util.Iterator; -import java.util.ListIterator; ///#enddef public class SimpleAnalyzer implements CodeAnalyzer, Opcodes { @@ -81,7 +79,7 @@ public class SimpleAnalyzer implements CodeAnalyzer, Opcodes { .replace('/','.')); } try { - clazz.load(clazz.DECLARATIONS); + clazz.load(ClassInfo.DECLARATIONS); } catch (IOException ex) { throw new RuntimeException("Can't get declarations of " + clazz); diff --git a/jode/src/net/sf/jode/swingui/ClassPathDialog.java b/jode/src/net/sf/jode/swingui/ClassPathDialog.java index e22216a..bdbfda7 100644 --- a/jode/src/net/sf/jode/swingui/ClassPathDialog.java +++ b/jode/src/net/sf/jode/swingui/ClassPathDialog.java @@ -18,10 +18,7 @@ */ package net.sf.jode.swingui; -import net.sf.jode.GlobalOptions; import net.sf.jode.bytecode.ClassPath; -import net.sf.jode.decompiler.Decompiler; -import net.sf.jode.decompiler.ProgressListener; ///#def JAVAX_SWING javax.swing import javax.swing.*; @@ -29,9 +26,7 @@ import javax.swing.filechooser.*; import javax.swing.event.*; ///#enddef -import java.awt.Container; import java.awt.Dimension; -import java.awt.GridLayout; import java.awt.BorderLayout; import java.awt.event.*; import java.awt.AWTEventMulticaster; diff --git a/jode/src/net/sf/jode/swingui/HierarchyTreeModel.java b/jode/src/net/sf/jode/swingui/HierarchyTreeModel.java index fdd2c1c..2ebad0e 100644 --- a/jode/src/net/sf/jode/swingui/HierarchyTreeModel.java +++ b/jode/src/net/sf/jode/swingui/HierarchyTreeModel.java @@ -43,7 +43,6 @@ import java.util.HashSet; import java.io.IOException; import java.util.Enumeration; -import java.util.NoSuchElementException; public class HierarchyTreeModel implements TreeModel, Runnable { static final int MAX_PACKAGE_LEVEL = 10; diff --git a/jode/src/net/sf/jode/swingui/Main.java b/jode/src/net/sf/jode/swingui/Main.java index 56ecd50..b7441e3 100644 --- a/jode/src/net/sf/jode/swingui/Main.java +++ b/jode/src/net/sf/jode/swingui/Main.java @@ -34,7 +34,6 @@ import java.awt.event.*; import java.io.*; import java.util.StringTokenizer; import java.util.ResourceBundle; -import java.util.*; public class Main implements ActionListener, Runnable, TreeSelectionListener { @@ -119,7 +118,7 @@ public class Main classTree = new JTree(packModel); classTree.setRootVisible(false); DefaultTreeSelectionModel selModel = new DefaultTreeSelectionModel(); - selModel.setSelectionMode(selModel.SINGLE_TREE_SELECTION); + selModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); classTree.setSelectionModel(selModel); classTree.addTreeSelectionListener(this); JScrollPane spClassTree = new JScrollPane(classTree); diff --git a/jode/src/net/sf/jode/swingui/PackagesTreeModel.java b/jode/src/net/sf/jode/swingui/PackagesTreeModel.java index 7fc96c5..2056b9d 100644 --- a/jode/src/net/sf/jode/swingui/PackagesTreeModel.java +++ b/jode/src/net/sf/jode/swingui/PackagesTreeModel.java @@ -19,7 +19,6 @@ package net.sf.jode.swingui; import net.sf.jode.decompiler.Options; -import net.sf.jode.bytecode.ClassInfo; import net.sf.jode.bytecode.ClassPath; ///#def JAVAX_SWING javax.swing diff --git a/jode/src/net/sf/jode/type/ArrayType.java b/jode/src/net/sf/jode/type/ArrayType.java index 9758ba2..62be44a 100644 --- a/jode/src/net/sf/jode/type/ArrayType.java +++ b/jode/src/net/sf/jode/type/ArrayType.java @@ -18,9 +18,6 @@ */ package net.sf.jode.type; -import net.sf.jode.bytecode.ClassInfo; -import java.util.Vector; -import java.io.IOException; /** * This type represents an array type. diff --git a/jode/src/net/sf/jode/type/ClassInfoType.java b/jode/src/net/sf/jode/type/ClassInfoType.java index 707b9db..a506d7f 100644 --- a/jode/src/net/sf/jode/type/ClassInfoType.java +++ b/jode/src/net/sf/jode/type/ClassInfoType.java @@ -23,9 +23,6 @@ import net.sf.jode.GlobalOptions; import java.lang.reflect.Modifier; import java.io.IOException; -import java.util.Vector; -import java.util.Stack; -import java.util.Hashtable; /** * This class is the type representing a class loaded from a ClassPath.

diff --git a/jode/src/net/sf/jode/type/ClassType.java b/jode/src/net/sf/jode/type/ClassType.java index 3660480..7095847 100644 --- a/jode/src/net/sf/jode/type/ClassType.java +++ b/jode/src/net/sf/jode/type/ClassType.java @@ -20,8 +20,6 @@ package net.sf.jode.type; import java.util.Stack; import java.util.Hashtable; -import java.util.Enumeration; -import java.io.IOException; /** * This class is the base class of all types representing a class type.

diff --git a/jode/src/net/sf/jode/type/MultiClassType.java b/jode/src/net/sf/jode/type/MultiClassType.java index 1953d05..ad127f7 100644 --- a/jode/src/net/sf/jode/type/MultiClassType.java +++ b/jode/src/net/sf/jode/type/MultiClassType.java @@ -18,10 +18,8 @@ */ package net.sf.jode.type; -import net.sf.jode.bytecode.ClassInfo; import java.util.Stack; import java.util.Vector; -import java.io.IOException; /** * This class represents a type aproximation, consisting of multiple @@ -177,7 +175,6 @@ public class MultiClassType extends ReferenceType { * class in the other list, we can omit it. */ Vector destClasses = new Vector(); - big_loop_this: for (int i=0; i< classes.length; i++) { ClassType clazz = classes[i]; if (!clazz.isSubTypeOf(type)) { @@ -187,7 +184,6 @@ public class MultiClassType extends ReferenceType { destClasses.addElement(clazz); } } - big_loop_other: for (int i=0; i< otherClasses.length; i++) { ClassType clazz = otherClasses[i]; if (!clazz.isSubTypeOf(this)) { diff --git a/jode/src/net/sf/jode/type/RangeType.java b/jode/src/net/sf/jode/type/RangeType.java index 2558c42..8992ca4 100644 --- a/jode/src/net/sf/jode/type/RangeType.java +++ b/jode/src/net/sf/jode/type/RangeType.java @@ -19,7 +19,6 @@ package net.sf.jode.type; import net.sf.jode.GlobalOptions; -import java.util.Hashtable; /** * This class represents a set of reference types. The set contains diff --git a/jode/src/net/sf/jode/type/SystemClassType.java b/jode/src/net/sf/jode/type/SystemClassType.java index d259adb..5f8a41c 100644 --- a/jode/src/net/sf/jode/type/SystemClassType.java +++ b/jode/src/net/sf/jode/type/SystemClassType.java @@ -18,11 +18,6 @@ */ package net.sf.jode.type; -import net.sf.jode.bytecode.ClassInfo; -import java.util.Vector; -import java.util.Stack; -import java.util.Hashtable; -import java.io.IOException; /** * This class represents the type of a system class, i.e. the classes