Fix Warnings

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1411 379699f6-c40d-0410-875b-85095c16579e
master
hoenicke 13 years ago
parent 977e4a6e8d
commit 5815ab3a08
  1. 23
      jode/src/net/sf/jode/bytecode/BasicBlockReader.java
  2. 15
      jode/src/net/sf/jode/bytecode/BasicBlockWriter.java
  3. 5
      jode/src/net/sf/jode/bytecode/BasicBlocks.java
  4. 6
      jode/src/net/sf/jode/bytecode/Block.java
  5. 2
      jode/src/net/sf/jode/bytecode/ClassFormatException.java
  6. 3
      jode/src/net/sf/jode/bytecode/ClassPath.java
  7. 1
      jode/src/net/sf/jode/bytecode/SwitchInstruction.java
  8. 1
      jode/src/net/sf/jode/bytecode/TypeSignature.java
  9. 12
      jode/src/net/sf/jode/decompiler/ClassAnalyzer.java
  10. 1
      jode/src/net/sf/jode/decompiler/Decompiler.java
  11. 6
      jode/src/net/sf/jode/decompiler/FieldAnalyzer.java
  12. 1
      jode/src/net/sf/jode/decompiler/ImportHandler.java
  13. 8
      jode/src/net/sf/jode/decompiler/Main.java
  14. 24
      jode/src/net/sf/jode/decompiler/MethodAnalyzer.java
  15. 9
      jode/src/net/sf/jode/decompiler/Opcodes.java
  16. 2
      jode/src/net/sf/jode/decompiler/Options.java
  17. 8
      jode/src/net/sf/jode/decompiler/OuterValues.java
  18. 1
      jode/src/net/sf/jode/decompiler/TabbedPrintWriter.java
  19. 5
      jode/src/net/sf/jode/decompiler/Window.java
  20. 2
      jode/src/net/sf/jode/expr/ArrayStoreOperator.java
  21. 1
      jode/src/net/sf/jode/expr/ClassFieldOperator.java
  22. 4
      jode/src/net/sf/jode/expr/ConstantArrayOperator.java
  23. 11
      jode/src/net/sf/jode/expr/Expression.java
  24. 19
      jode/src/net/sf/jode/expr/FieldOperator.java
  25. 1
      jode/src/net/sf/jode/expr/IIncOperator.java
  26. 3
      jode/src/net/sf/jode/expr/IfThenElseOperator.java
  27. 2
      jode/src/net/sf/jode/expr/InstanceOfOperator.java
  28. 28
      jode/src/net/sf/jode/expr/InvokeOperator.java
  29. 3
      jode/src/net/sf/jode/expr/LValueExpression.java
  30. 3
      jode/src/net/sf/jode/expr/LocalLoadOperator.java
  31. 2
      jode/src/net/sf/jode/expr/LocalStoreOperator.java
  32. 1
      jode/src/net/sf/jode/expr/NoArgOperator.java
  33. 2
      jode/src/net/sf/jode/expr/Operator.java
  34. 3
      jode/src/net/sf/jode/expr/OuterLocalOperator.java
  35. 1
      jode/src/net/sf/jode/expr/PrePostFixOperator.java
  36. 1
      jode/src/net/sf/jode/expr/PutFieldOperator.java
  37. 4
      jode/src/net/sf/jode/expr/StoreInstruction.java
  38. 1
      jode/src/net/sf/jode/flow/BreakableBlock.java
  39. 4
      jode/src/net/sf/jode/flow/CatchBlock.java
  40. 1
      jode/src/net/sf/jode/flow/CombineIfGotoExpressions.java
  41. 3
      jode/src/net/sf/jode/flow/ConditionalBlock.java
  42. 4
      jode/src/net/sf/jode/flow/CreateAssignExpression.java
  43. 1
      jode/src/net/sf/jode/flow/CreateClassField.java
  44. 1
      jode/src/net/sf/jode/flow/CreateConstantArray.java
  45. 11
      jode/src/net/sf/jode/flow/CreateIfThenElseOperator.java
  46. 8
      jode/src/net/sf/jode/flow/CreatePrePostIncExpression.java
  47. 11
      jode/src/net/sf/jode/flow/FlowBlock.java
  48. 4
      jode/src/net/sf/jode/flow/IfThenElseBlock.java
  49. 9
      jode/src/net/sf/jode/flow/InstructionBlock.java
  50. 2
      jode/src/net/sf/jode/flow/InstructionContainer.java
  51. 1
      jode/src/net/sf/jode/flow/Jump.java
  52. 15
      jode/src/net/sf/jode/flow/LoopBlock.java
  53. 4
      jode/src/net/sf/jode/flow/ReturnBlock.java
  54. 1
      jode/src/net/sf/jode/flow/SequentialBlock.java
  55. 3
      jode/src/net/sf/jode/flow/SlotSet.java
  56. 2
      jode/src/net/sf/jode/flow/SynchronizedBlock.java
  57. 2
      jode/src/net/sf/jode/flow/ThrowBlock.java
  58. 9
      jode/src/net/sf/jode/flow/TransformConstructors.java
  59. 4
      jode/src/net/sf/jode/flow/TransformExceptionHandlers.java
  60. 3
      jode/src/net/sf/jode/flow/VariableSet.java
  61. 7
      jode/src/net/sf/jode/flow/VariableStack.java
  62. 4
      jode/src/net/sf/jode/jvm/CodeVerifier.java
  63. 1
      jode/src/net/sf/jode/jvm/Interpreter.java
  64. 3
      jode/src/net/sf/jode/jvm/SyntheticAnalyzer.java
  65. 1
      jode/src/net/sf/jode/jvm/Value.java
  66. 1
      jode/src/net/sf/jode/jvm/VerifyException.java
  67. 5
      jode/src/net/sf/jode/obfuscator/ClassBundle.java
  68. 4
      jode/src/net/sf/jode/obfuscator/ClassIdentifier.java
  69. 2
      jode/src/net/sf/jode/obfuscator/FieldIdentifier.java
  70. 1
      jode/src/net/sf/jode/obfuscator/Identifier.java
  71. 1
      jode/src/net/sf/jode/obfuscator/Main.java
  72. 2
      jode/src/net/sf/jode/obfuscator/MethodIdentifier.java
  73. 9
      jode/src/net/sf/jode/obfuscator/PackageIdentifier.java
  74. 23
      jode/src/net/sf/jode/obfuscator/modules/ConstantAnalyzer.java
  75. 4
      jode/src/net/sf/jode/obfuscator/modules/SimpleAnalyzer.java
  76. 5
      jode/src/net/sf/jode/swingui/ClassPathDialog.java
  77. 1
      jode/src/net/sf/jode/swingui/HierarchyTreeModel.java
  78. 3
      jode/src/net/sf/jode/swingui/Main.java
  79. 1
      jode/src/net/sf/jode/swingui/PackagesTreeModel.java
  80. 3
      jode/src/net/sf/jode/type/ArrayType.java
  81. 3
      jode/src/net/sf/jode/type/ClassInfoType.java
  82. 2
      jode/src/net/sf/jode/type/ClassType.java
  83. 4
      jode/src/net/sf/jode/type/MultiClassType.java
  84. 1
      jode/src/net/sf/jode/type/RangeType.java
  85. 5
      jode/src/net/sf/jode/type/SystemClassType.java

@ -25,9 +25,6 @@ import java.io.IOException;
import java.util.Stack; import java.util.Stack;
import java.util.Vector; import java.util.Vector;
import java.util.Enumeration; 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 * This is a helper class, that contains the method to read in basic
@ -546,8 +543,8 @@ class BasicBlockReader implements Opcodes {
case opc_ldc: { case opc_ldc: {
int index = input.readUnsignedByte(); int index = input.readUnsignedByte();
int tag = cp.getTag(index); int tag = cp.getTag(index);
if (tag != cp.STRING && tag != cp.CLASS if (tag != ConstantPool.STRING && tag != ConstantPool.CLASS
&& tag != cp.INTEGER && tag != cp.FLOAT) && tag != ConstantPool.INTEGER && tag != ConstantPool.FLOAT)
throw new ClassFormatException throw new ClassFormatException
("wrong constant tag: "+tag); ("wrong constant tag: "+tag);
instr = new ConstantInstruction instr = new ConstantInstruction
@ -558,8 +555,8 @@ class BasicBlockReader implements Opcodes {
case opc_ldc_w: { case opc_ldc_w: {
int index = input.readUnsignedShort(); int index = input.readUnsignedShort();
int tag = cp.getTag(index); int tag = cp.getTag(index);
if (tag != cp.STRING && tag != cp.CLASS if (tag != ConstantPool.STRING && tag != ConstantPool.CLASS
&& tag != cp.INTEGER && tag != cp.FLOAT) && tag != ConstantPool.INTEGER && tag != ConstantPool.FLOAT)
throw new ClassFormatException throw new ClassFormatException
("wrong constant tag: "+tag); ("wrong constant tag: "+tag);
instr = new ConstantInstruction instr = new ConstantInstruction
@ -570,7 +567,7 @@ class BasicBlockReader implements Opcodes {
case opc_ldc2_w: { case opc_ldc2_w: {
int index = input.readUnsignedShort(); int index = input.readUnsignedShort();
int tag = cp.getTag(index); int tag = cp.getTag(index);
if (tag != cp.LONG && tag != cp.DOUBLE) if (tag != ConstantPool.LONG && tag != ConstantPool.DOUBLE)
throw new ClassFormatException throw new ClassFormatException
("wrong constant tag: "+tag); ("wrong constant tag: "+tag);
instr = new ConstantInstruction instr = new ConstantInstruction
@ -680,11 +677,11 @@ class BasicBlockReader implements Opcodes {
int index = input.readUnsignedShort(); int index = input.readUnsignedShort();
int tag = cp.getTag(index); int tag = cp.getTag(index);
if (opcode < opc_invokevirtual) { if (opcode < opc_invokevirtual) {
if (tag != cp.FIELDREF) if (tag != ConstantPool.FIELDREF)
throw new ClassFormatException throw new ClassFormatException
("field tag mismatch: "+tag); ("field tag mismatch: "+tag);
} else { } else {
if (tag != cp.METHODREF) if (tag != ConstantPool.METHODREF)
throw new ClassFormatException throw new ClassFormatException
("method tag mismatch: "+tag); ("method tag mismatch: "+tag);
} }
@ -704,7 +701,7 @@ class BasicBlockReader implements Opcodes {
case opc_invokeinterface: { case opc_invokeinterface: {
int index = input.readUnsignedShort(); int index = input.readUnsignedShort();
int tag = cp.getTag(index); int tag = cp.getTag(index);
if (tag != cp.INTERFACEMETHODREF) if (tag != ConstantPool.INTERFACEMETHODREF)
throw new ClassFormatException throw new ClassFormatException
("interface tag mismatch: "+tag); ("interface tag mismatch: "+tag);
Reference ref = cp.getRef(index); Reference ref = cp.getRef(index);
@ -966,8 +963,8 @@ class BasicBlockReader implements Opcodes {
int nameIndex = input.readUnsignedShort(); int nameIndex = input.readUnsignedShort();
int typeIndex = input.readUnsignedShort(); int typeIndex = input.readUnsignedShort();
int slot = input.readUnsignedShort(); int slot = input.readUnsignedShort();
if (nameIndex == 0 || cp.getTag(nameIndex) != cp.UTF8 if (nameIndex == 0 || cp.getTag(nameIndex) != ConstantPool.UTF8
|| typeIndex == 0 || cp.getTag(typeIndex) != cp.UTF8 || typeIndex == 0 || cp.getTag(typeIndex) != ConstantPool.UTF8
|| slot >= maxLocals) { || slot >= maxLocals) {
// This is probably an evil lvt as created by HashJava // This is probably an evil lvt as created by HashJava

@ -25,8 +25,6 @@ import java.util.BitSet;
import java.util.Stack; import java.util.Stack;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
///#enddef ///#enddef
/** /**
@ -37,7 +35,6 @@ class BasicBlockWriter implements Opcodes {
private class LVTEntry { private class LVTEntry {
int startAddr, endAddr; int startAddr, endAddr;
Instruction start, end;
LocalVariableInfo lvi; LocalVariableInfo lvi;
} }
@ -382,17 +379,17 @@ class BasicBlockWriter implements Opcodes {
case opc_getfield: case opc_getfield:
case opc_putstatic: case opc_putstatic:
case opc_putfield: case opc_putfield:
gcp.putRef(gcp.FIELDREF, instr.getReference()); gcp.putRef(ConstantPool.FIELDREF, instr.getReference());
length = 3; length = 3;
break; break;
case opc_invokespecial: case opc_invokespecial:
case opc_invokestatic: case opc_invokestatic:
case opc_invokevirtual: case opc_invokevirtual:
gcp.putRef(gcp.METHODREF, instr.getReference()); gcp.putRef(ConstantPool.METHODREF, instr.getReference());
length = 3; length = 3;
break; break;
case opc_invokeinterface: case opc_invokeinterface:
gcp.putRef(gcp.INTERFACEMETHODREF, instr.getReference()); gcp.putRef(ConstantPool.INTERFACEMETHODREF, instr.getReference());
length = 5; length = 5;
break; break;
case opc_new: case opc_new:
@ -880,7 +877,7 @@ class BasicBlockWriter implements Opcodes {
case opc_putstatic: case opc_putstatic:
case opc_putfield: case opc_putfield:
output.writeByte(opcode); output.writeByte(opcode);
output.writeShort(gcp.putRef(gcp.FIELDREF, output.writeShort(gcp.putRef(ConstantPool.FIELDREF,
instr.getReference())); instr.getReference()));
break; break;
@ -892,13 +889,13 @@ class BasicBlockWriter implements Opcodes {
output.writeByte(opcode); output.writeByte(opcode);
if (opcode == opc_invokeinterface) { if (opcode == opc_invokeinterface) {
output.writeShort output.writeShort
(gcp.putRef(gcp.INTERFACEMETHODREF, ref)); (gcp.putRef(ConstantPool.INTERFACEMETHODREF, ref));
output.writeByte output.writeByte
(TypeSignature (TypeSignature
.getParameterSize(ref.getType()) + 1); .getParameterSize(ref.getType()) + 1);
output.writeByte(0); output.writeByte(0);
} else } else
output.writeShort(gcp.putRef(gcp.METHODREF, ref)); output.writeShort(gcp.putRef(ConstantPool.METHODREF, ref));
break; break;
} }
case opc_new: case opc_new:

@ -32,10 +32,6 @@ import java.util.Stack;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.NoSuchElementException;
///#enddef
///#def COLLECTIONEXTRA java.lang
import java.lang.UnsupportedOperationException;
///#enddef ///#enddef
/** /**
@ -187,7 +183,6 @@ public class BasicBlocks extends BinaryInfo implements Opcodes {
BitSet visited = new BitSet(); BitSet visited = new BitSet();
Stack todo = new Stack(); Stack todo = new Stack();
int[] poppush = new int[2];
startBlock.stackHeight = 0; startBlock.stackHeight = 0;
todo.push(startBlock); todo.push(startBlock);

@ -20,12 +20,6 @@
package net.sf.jode.bytecode; package net.sf.jode.bytecode;
import java.io.PrintWriter; 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
/** /**
* <p>Represents a single basic block. It contains a list of * <p>Represents a single basic block. It contains a list of

@ -24,7 +24,7 @@ package net.sf.jode.bytecode;
* *
* @author Jochen Hoenicke * @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 * Constructs a new class format exception with the given detail
* message. * message.

@ -25,7 +25,6 @@ import java.io.DataInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FilterInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -36,7 +35,6 @@ import java.net.URLConnection;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Vector; import java.util.Vector;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
@ -288,7 +286,6 @@ public class ClassPath {
if (!directory.endsWith(File.separator)) if (!directory.endsWith(File.separator))
directory += File.separator; directory += File.separator;
final String prefix = directory;
return new Enumeration() { return new Enumeration() {
int i = 0; int i = 0;
public boolean hasMoreElements() { public boolean hasMoreElements() {

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.bytecode; package net.sf.jode.bytecode;
import net.sf.jode.util.StringQuoter;
/** /**
* This class represents an instruction in the byte code. * This class represents an instruction in the byte code.

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.bytecode; package net.sf.jode.bytecode;
import net.sf.jode.util.UnifyHash;
/** /**
* This class contains some static methods to handle type signatures. <br> * This class contains some static methods to handle type signatures. <br>

@ -33,9 +33,7 @@ import net.sf.jode.flow.StructuredBlock;
import net.sf.jode.util.SimpleSet; import net.sf.jode.util.SimpleSet;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.NoSuchElementException;
import java.util.Vector; import java.util.Vector;
import java.util.Enumeration;
import java.io.IOException; import java.io.IOException;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
@ -470,7 +468,7 @@ public class ClassAnalyzer
return; return;
} }
writer.startOp(writer.NO_PAREN, 0); writer.startOp(TabbedPrintWriter.NO_PAREN, 0);
/* Clear the SUPER bit, which is also used as SYNCHRONIZED bit. */ /* Clear the SUPER bit, which is also used as SYNCHRONIZED bit. */
int modifiedModifiers = modifiers & ~(Modifier.SYNCHRONIZED int modifiedModifiers = modifiers & ~(Modifier.SYNCHRONIZED
| STRICTFP); | STRICTFP);
@ -508,7 +506,7 @@ public class ClassAnalyzer
if (interfaces.length > 0) { if (interfaces.length > 0) {
writer.breakOp(); writer.breakOp();
writer.print(clazz.isInterface() ? " extends " : " implements "); 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++) { for (int i=0; i < interfaces.length; i++) {
if (i > 0) { if (i > 0) {
writer.print(", "); writer.print(", ");
@ -632,7 +630,7 @@ public class ClassAnalyzer
needNewLine = true; needNewLine = true;
} }
writer.popScope(); writer.popScope();
clazz.drop(clazz.DECLARATIONS); clazz.drop(ClassInfo.DECLARATIONS);
} }
public void dumpSource(TabbedPrintWriter writer) public void dumpSource(TabbedPrintWriter writer)
@ -707,9 +705,9 @@ public class ClassAnalyzer
} }
if (usageType == CLASSNAME || usageType == AMBIGUOUSNAME) { if (usageType == CLASSNAME || usageType == AMBIGUOUSNAME) {
try { try {
info.load(info.DECLARATIONS); info.load(ClassInfo.DECLARATIONS);
} catch (IOException ex) { } catch (IOException ex) {
info.guess(info.DECLARATIONS); info.guess(ClassInfo.DECLARATIONS);
} }
ClassInfo[] iinfos = info.getClasses(); ClassInfo[] iinfos = info.getClasses();
if (iinfos != null) { if (iinfos != null) {

@ -24,7 +24,6 @@ import net.sf.jode.bytecode.ClassInfo;
import java.io.File; import java.io.File;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Writer; import java.io.Writer;
import java.io.BufferedWriter;
/** /**
* This is the interface that other java classes may use to decompile * This is the interface that other java classes may use to decompile

@ -21,8 +21,6 @@ package net.sf.jode.decompiler;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.bytecode.FieldInfo; import net.sf.jode.bytecode.FieldInfo;
import net.sf.jode.expr.Expression; 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.ConstOperator;
import net.sf.jode.expr.OuterLocalOperator; import net.sf.jode.expr.OuterLocalOperator;
@ -178,7 +176,7 @@ public class FieldAnalyzer implements Analyzer {
| Modifier.STATIC | Modifier.STATIC
| Modifier.FINAL); | Modifier.FINAL);
*/ */
writer.startOp(writer.NO_PAREN, 0); writer.startOp(TabbedPrintWriter.NO_PAREN, 0);
String modif = Modifier.toString(modifiedModifiers); String modif = Modifier.toString(modifiedModifiers);
if (modif.length() > 0) if (modif.length() > 0)
writer.print(modif+" "); writer.print(modif+" ");
@ -188,7 +186,7 @@ public class FieldAnalyzer implements Analyzer {
if (constant != null) { if (constant != null) {
writer.breakOp(); writer.breakOp();
writer.print(" = "); writer.print(" = ");
constant.dumpExpression(writer.IMPL_PAREN, writer); constant.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer);
} }
writer.endOp(); writer.endOp();
writer.println(";"); writer.println(";");

@ -372,7 +372,6 @@ public class ImportHandler {
String pkgName = name.substring(0, pkgdelim); String pkgName = name.substring(0, pkgdelim);
Integer i;
if (pkgName.equals(pkg) if (pkgName.equals(pkg)
|| (imports.get(pkgName+".*") != null || (imports.get(pkgName+".*") != null
&& !conflictsImport(name))) { && !conflictsImport(name))) {

@ -215,14 +215,8 @@ public class Main extends Options {
} }
} }
public static void main(String[] params) { public static void main(String[] params) throws Throwable{
try {
decompile(params); decompile(params);
} catch (ExceptionInInitializerError ex) {
ex.getException().printStackTrace();
} catch (Throwable ex) {
ex.printStackTrace();
}
/* When AWT applications are compiled with insufficient /* When AWT applications are compiled with insufficient
* classpath the type guessing by reflection code can * classpath the type guessing by reflection code can
* generate an awt thread that will prevent normal * generate an awt thread that will prevent normal

@ -29,7 +29,6 @@ import net.sf.jode.bytecode.MethodInfo;
import net.sf.jode.jvm.SyntheticAnalyzer; import net.sf.jode.jvm.SyntheticAnalyzer;
import net.sf.jode.type.*; import net.sf.jode.type.*;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.ConstOperator;
import net.sf.jode.expr.CheckNullOperator; import net.sf.jode.expr.CheckNullOperator;
import net.sf.jode.expr.ThisOperator; import net.sf.jode.expr.ThisOperator;
import net.sf.jode.expr.LocalLoadOperator; 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.StructuredBlock;
import net.sf.jode.flow.FlowBlock; import net.sf.jode.flow.FlowBlock;
import net.sf.jode.flow.TransformExceptionHandlers; import net.sf.jode.flow.TransformExceptionHandlers;
import net.sf.jode.flow.Jump;
import net.sf.jode.jvm.CodeVerifier; import net.sf.jode.jvm.CodeVerifier;
import net.sf.jode.jvm.VerifyException; import net.sf.jode.jvm.VerifyException;
import net.sf.jode.util.SimpleMap;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.BitSet;
import java.util.Stack;
import java.util.Vector; import java.util.Vector;
import java.util.Enumeration; import java.util.Enumeration;
import java.io.DataInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Map;
import java.util.Collection; import java.util.Collection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -461,7 +453,6 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
Block[] blocks = bb.getBlocks(); Block[] blocks = bb.getBlocks();
FlowBlock[] flows = new FlowBlock[blocks.length]; FlowBlock[] flows = new FlowBlock[blocks.length];
int returnCount;
TransformExceptionHandlers excHandlers; TransformExceptionHandlers excHandlers;
{ {
for (int i=0; i < blocks.length; i++) for (int i=0; i < blocks.length; i++)
@ -618,7 +609,6 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
public void analyzeInnerClasses() public void analyzeInnerClasses()
throws ClassFormatError throws ClassFormatError
{ {
int serialnr = 0;
Enumeration elts = anonConstructors.elements(); Enumeration elts = anonConstructors.elements();
while (elts.hasMoreElements()) { while (elts.hasMoreElements()) {
InvokeOperator cop = (InvokeOperator) elts.nextElement(); InvokeOperator cop = (InvokeOperator) elts.nextElement();
@ -694,10 +684,10 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
if (synth != null) { if (synth != null) {
// We don't need this class anymore (hopefully?) // We don't need this class anymore (hopefully?)
if (synth.getKind() == synth.GETCLASS) if (synth.getKind() == SyntheticAnalyzer.GETCLASS)
return true; return true;
if (synth.getKind() >= synth.ACCESSGETFIELD if (synth.getKind() >= SyntheticAnalyzer.ACCESSGETFIELD
&& synth.getKind() <= synth.ACCESSDUPPUTSTATIC && synth.getKind() <= SyntheticAnalyzer.ACCESSDUPPUTSTATIC
&& (Options.options & Options.OPTION_INNER) != 0 && (Options.options & Options.OPTION_INNER) != 0
&& (Options.options & Options.OPTION_ANON) != 0) && (Options.options & Options.OPTION_ANON) != 0)
return true; return true;
@ -826,8 +816,8 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
| Modifier.PROTECTED | Modifier.PRIVATE); | Modifier.PROTECTED | Modifier.PRIVATE);
modifiedModifiers &= ~STRICTFP; modifiedModifiers &= ~STRICTFP;
writer.startOp(writer.NO_PAREN, 0); writer.startOp(TabbedPrintWriter.NO_PAREN, 0);
writer.startOp(writer.NO_PAREN, 5); writer.startOp(TabbedPrintWriter.NO_PAREN, 5);
String delim =""; String delim ="";
if (minfo.isSynthetic()) { if (minfo.isSynthetic()) {
@ -871,7 +861,7 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
writer.breakOp(); writer.breakOp();
writer.printOptionalSpace(); writer.printOptionalSpace();
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
int offset = skipParams + (isStatic() ? 0 : 1); int offset = skipParams + (isStatic() ? 0 : 1);
for (int i = offset; i < param.length; i++) { for (int i = offset; i < param.length; i++) {
if (i > offset) { if (i > offset) {
@ -887,7 +877,7 @@ public class MethodAnalyzer implements Scope, ClassDeclarer {
if (exceptions.length > 0) { if (exceptions.length > 0) {
writer.breakOp(); writer.breakOp();
writer.print(" throws "); writer.print(" throws ");
writer.startOp(writer.NO_PAREN, 0); writer.startOp(TabbedPrintWriter.NO_PAREN, 0);
for (int i= 0; i< exceptions.length; i++) { for (int i= 0; i< exceptions.length; i++) {
if (i > 0) { if (i > 0) {
writer.print(", "); writer.print(", ");

@ -20,12 +20,9 @@
package net.sf.jode.decompiler; package net.sf.jode.decompiler;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.type.IntegerType; import net.sf.jode.type.IntegerType;
import net.sf.jode.type.MethodType;
import net.sf.jode.expr.*; import net.sf.jode.expr.*;
import net.sf.jode.flow.*; import net.sf.jode.flow.*;
import net.sf.jode.bytecode.*; import net.sf.jode.bytecode.*;
import java.io.*;
import java.util.Vector;
/** /**
* This is an abstract class which creates flow blocks for the * 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); return new SpecialBlock(type, stackcount, param);
} }
private static StructuredBlock createGoto(MethodAnalyzer ma,
Instruction instr)
{
return new EmptyBlock();
}
private static StructuredBlock createJsr(MethodAnalyzer ma, private static StructuredBlock createJsr(MethodAnalyzer ma,
Instruction instr) Instruction instr)
{ {

@ -35,7 +35,7 @@ public class Options {
public static int options = public static int options =
OPTION_LVT | OPTION_INNER | OPTION_ANON | OPTION_PRETTY | 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() { public final static boolean doAnonymous() {
return (options & OPTION_ANON) != 0; return (options & OPTION_ANON) != 0;

@ -23,7 +23,6 @@ import net.sf.jode.expr.Expression;
import net.sf.jode.expr.ThisOperator; import net.sf.jode.expr.ThisOperator;
import net.sf.jode.expr.LocalLoadOperator; import net.sf.jode.expr.LocalLoadOperator;
import net.sf.jode.expr.OuterLocalOperator; import net.sf.jode.expr.OuterLocalOperator;
import net.sf.jode.util.SimpleMap;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import java.util.Vector; import java.util.Vector;
@ -324,13 +323,6 @@ public class OuterValues
implicitOuterClass = value; 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) { public void setMinCount(int newMin) {
if (headCount < newMin) { if (headCount < newMin) {
GlobalOptions.err.println GlobalOptions.err.println

@ -22,7 +22,6 @@ import java.io.*;
import java.util.Stack; import java.util.Stack;
import java.util.Vector; import java.util.Vector;
import java.util.Enumeration; import java.util.Enumeration;
import net.sf.jode.GlobalOptions;
import net.sf.jode.bytecode.ClassInfo; import net.sf.jode.bytecode.ClassInfo;
import net.sf.jode.type.*; import net.sf.jode.type.*;

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.decompiler; package net.sf.jode.decompiler;
import java.applet.*;
import java.awt.*; import java.awt.*;
///#ifndef AWT10 ///#ifndef AWT10
import java.awt.event.*; import java.awt.event.*;
@ -182,7 +181,7 @@ public class Window
FileDialog.SAVE); FileDialog.SAVE);
fd.setFile(lastClassName.substring fd.setFile(lastClassName.substring
(lastClassName.lastIndexOf('.')+1).concat(".java")); (lastClassName.lastIndexOf('.')+1).concat(".java"));
fd.show(); fd.setVisible(true);
String fileName = fd.getFile(); String fileName = fd.getFile();
if (fileName == null) if (fileName == null)
return; return;
@ -302,6 +301,6 @@ public class Window
}); });
///#endif ///#endif
frame.pack(); frame.pack();
frame.show(); frame.setVisible(true);
} }
} }

@ -41,7 +41,7 @@ public class ArrayStoreOperator extends ArrayLoadOperator
if (!elemType.isOfType(getType())) { if (!elemType.isOfType(getType())) {
/* We need an explicit widening cast */ /* We need an explicit widening cast */
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 1); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1);
writer.print("("); writer.print("(");
writer.printType(Type.tArray(getType().getHint())); writer.printType(Type.tArray(getType().getHint()));
writer.print(") "); writer.print(") ");

@ -19,7 +19,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
public class ClassFieldOperator extends NoArgOperator { public class ClassFieldOperator extends NoArgOperator {

@ -33,7 +33,7 @@ public class ConstantArrayOperator extends Operator {
? Type.tSubType(((ArrayType)type).getElementType()) : Type.tError; ? Type.tSubType(((ArrayType)type).getElementType()) : Type.tError;
Object emptyVal; Object emptyVal;
if (argType == type.tError || argType.isOfType(Type.tUObject)) if (argType == Type.tError || argType.isOfType(Type.tUObject))
emptyVal = null; emptyVal = null;
else if (argType.isOfType(Type.tBoolUInt)) else if (argType.isOfType(Type.tBoolUInt))
emptyVal = new Integer(0); emptyVal = new Integer(0);
@ -104,7 +104,7 @@ public class ConstantArrayOperator extends Operator {
writer.print(" "); writer.print(" ");
} }
writer.print("{ "); writer.print("{ ");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
for (int i=0; i< subExpressions.length; i++) { for (int i=0; i< subExpressions.length; i++) {
if (i>0) { if (i>0) {
writer.print(", "); writer.print(", ");

@ -239,7 +239,6 @@ public abstract class Expression {
public void dumpExpression(TabbedPrintWriter writer, int minPriority) public void dumpExpression(TabbedPrintWriter writer, int minPriority)
throws java.io.IOException { throws java.io.IOException {
int options;
boolean needParen1 = false, needParen2 = false; boolean needParen1 = false, needParen2 = false;
boolean needEndOp1 = false, needEndOp2 = false; boolean needEndOp1 = false, needEndOp2 = false;
@ -256,10 +255,10 @@ public abstract class Expression {
needParen1 = true; needParen1 = true;
needEndOp1 = true; needEndOp1 = true;
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
} else if (minPriority < 700) { } else if (minPriority < 700) {
needEndOp1 = true; needEndOp1 = true;
writer.startOp(writer.IMPL_PAREN, 1); writer.startOp(TabbedPrintWriter.IMPL_PAREN, 1);
} }
writer.print(typecast); writer.print(typecast);
writer.breakOp(); writer.breakOp();
@ -272,13 +271,13 @@ public abstract class Expression {
needParen2 = true; needParen2 = true;
needEndOp2 = true; needEndOp2 = true;
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, getBreakPenalty()); writer.startOp(TabbedPrintWriter.EXPL_PAREN, getBreakPenalty());
} else if (priority != minPriority) { } else if (priority != minPriority) {
needEndOp2 = true; needEndOp2 = true;
if (getType() == Type.tVoid) if (getType() == Type.tVoid)
writer.startOp(writer.NO_PAREN, getBreakPenalty()); writer.startOp(TabbedPrintWriter.NO_PAREN, getBreakPenalty());
else else
writer.startOp(writer.IMPL_PAREN, 1 + getBreakPenalty()); writer.startOp(TabbedPrintWriter.IMPL_PAREN, 1 + getBreakPenalty());
} }
try { try {

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.GlobalOptions;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.type.NullType; import net.sf.jode.type.NullType;
import net.sf.jode.type.ClassInfoType; 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.bytecode.TypeSignature;
import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.ClassAnalyzer;
import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.FieldAnalyzer; import net.sf.jode.decompiler.FieldAnalyzer;
import net.sf.jode.decompiler.Options; import net.sf.jode.decompiler.Options;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
@ -146,21 +144,6 @@ public abstract class FieldOperator extends Operator {
return Type.tType(classPath, ref.getType()); 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, private static FieldInfo getFieldInfo(ClassInfo clazz,
String name, String type) { String name, String type) {
while (clazz != null) { while (clazz != null) {
@ -278,7 +261,7 @@ public abstract class FieldOperator extends Operator {
writer.print(fieldName); writer.print(fieldName);
} else if (needsCast(subExpressions[0].getType().getCanonic())) { } else if (needsCast(subExpressions[0].getType().getCanonic())) {
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 1); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1);
writer.print("("); writer.print("(");
writer.printType(classType); writer.printType(classType);
writer.print(") "); writer.print(") ");

@ -19,7 +19,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
public class IIncOperator extends Operator public class IIncOperator extends Operator

@ -76,7 +76,6 @@ public class IfThenElseOperator extends Operator {
= (GetFieldOperator) subExpressions[2 - cmpType]; = (GetFieldOperator) subExpressions[2 - cmpType];
StoreInstruction put StoreInstruction put
= (StoreInstruction) subExpressions[1 + cmpType]; = (StoreInstruction) subExpressions[1 + cmpType];
int opIndex = cmp.getOperatorIndex();
FieldAnalyzer field; FieldAnalyzer field;
if (put.getLValue() instanceof PutFieldOperator if (put.getLValue() instanceof PutFieldOperator
&& ((field = ((PutFieldOperator)put.getLValue()) && ((field = ((PutFieldOperator)put.getLValue())
@ -120,7 +119,7 @@ public class IfThenElseOperator extends Operator {
int subPriority = 0; int subPriority = 0;
if (!subExpressions[1].getType().getHint().isOfType if (!subExpressions[1].getType().getHint().isOfType
(subExpressions[2].getType())) { (subExpressions[2].getType())) {
writer.startOp(writer.IMPL_PAREN, 2); writer.startOp(TabbedPrintWriter.IMPL_PAREN, 2);
/* We need a cast here */ /* We need a cast here */
writer.print("("); writer.print("(");
writer.printType(getType().getHint()); writer.printType(getType().getHint());

@ -51,7 +51,7 @@ public class InstanceOfOperator extends Operator {
Type superType Type superType
= instanceType.getCastHelper(subExpressions[0].getType()); = instanceType.getCastHelper(subExpressions[0].getType());
if (superType != null) { if (superType != null) {
writer.startOp(writer.IMPL_PAREN, 2); writer.startOp(TabbedPrintWriter.IMPL_PAREN, 2);
writer.print("("); writer.print("(");
writer.printType(superType); writer.printType(superType);
writer.print(") "); writer.print(") ");

@ -20,7 +20,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.ClassAnalyzer;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
@ -40,7 +39,6 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
///#enddef ///#enddef
@ -218,9 +216,9 @@ public final class InvokeOperator extends Operator
String name, String type) { String name, String type) {
while (clazz != null) { while (clazz != null) {
try { try {
clazz.load(clazz.DECLARATIONS); clazz.load(ClassInfo.DECLARATIONS);
} catch (IOException ex) { } catch (IOException ex) {
clazz.guess(clazz.DECLARATIONS); clazz.guess(ClassInfo.DECLARATIONS);
} }
MethodInfo method = clazz.findMethod(name, type); MethodInfo method = clazz.findMethod(name, type);
if (method != null) if (method != null)
@ -642,7 +640,7 @@ public final class InvokeOperator extends Operator
op = new StoreInstruction op = new StoreInstruction
(new PutFieldOperator(methodAnalyzer, false, (new PutFieldOperator(methodAnalyzer, false,
synth.getReference())); synth.getReference()));
if (synth.getKind() == synth.ACCESSDUPPUTFIELD) if (synth.getKind() == SyntheticAnalyzer.ACCESSDUPPUTFIELD)
((StoreInstruction) op).makeNonVoid(); ((StoreInstruction) op).makeNonVoid();
break; break;
case SyntheticAnalyzer.ACCESSPUTSTATIC: case SyntheticAnalyzer.ACCESSPUTSTATIC:
@ -650,7 +648,7 @@ public final class InvokeOperator extends Operator
op = new StoreInstruction op = new StoreInstruction
(new PutFieldOperator(methodAnalyzer, true, (new PutFieldOperator(methodAnalyzer, true,
synth.getReference())); synth.getReference()));
if (synth.getKind() == synth.ACCESSDUPPUTSTATIC) if (synth.getKind() == SyntheticAnalyzer.ACCESSDUPPUTSTATIC)
((StoreInstruction) op).makeNonVoid(); ((StoreInstruction) op).makeNonVoid();
break; break;
case SyntheticAnalyzer.ACCESSMETHOD: case SyntheticAnalyzer.ACCESSMETHOD:
@ -948,7 +946,7 @@ public final class InvokeOperator extends Operator
* we have to differentiate all kinds of method calls: static, * we have to differentiate all kinds of method calls: static,
* virtual, constructor, anonymous constructors, super calls etc. * virtual, constructor, anonymous constructors, super calls etc.
*/ */
writer.startOp(writer.NO_PAREN, 0); writer.startOp(TabbedPrintWriter.NO_PAREN, 0);
switch (methodFlag) { switch (methodFlag) {
case CONSTRUCTOR: { case CONSTRUCTOR: {
@ -1040,7 +1038,7 @@ public final class InvokeOperator extends Operator
if (outerExpr.getType().getCanonic() if (outerExpr.getType().getCanonic()
instanceof NullType) { instanceof NullType) {
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 1); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1);
writer.print("("); writer.print("(");
writer.printType(Type.tClass(clazz)); writer.printType(Type.tClass(clazz));
writer.print(") "); writer.print(") ");
@ -1078,7 +1076,7 @@ public final class InvokeOperator extends Operator
} }
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
writer.print("(UNCONSTRUCTED)"); writer.print("(UNCONSTRUCTED)");
writer.breakOp(); writer.breakOp();
subExpressions[0].dumpExpression(writer, 700); subExpressions[0].dumpExpression(writer, 700);
@ -1111,7 +1109,7 @@ public final class InvokeOperator extends Operator
/* XXX check if this is a private method. */ /* XXX check if this is a private method. */
if (needsCast(0, paramTypes)){ if (needsCast(0, paramTypes)){
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 1); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1);
writer.print("("); writer.print("(");
writer.printType(classType); writer.printType(classType);
writer.print(") "); writer.print(") ");
@ -1126,7 +1124,7 @@ public final class InvokeOperator extends Operator
writer.print("."); writer.print(".");
} else { } else {
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
writer.print("(NON VIRTUAL "); writer.print("(NON VIRTUAL ");
writer.printType(classType); writer.printType(classType);
writer.print(") "); writer.print(") ");
@ -1148,7 +1146,7 @@ public final class InvokeOperator extends Operator
subExpressions[0].dumpExpression(writer, 950); subExpressions[0].dumpExpression(writer, 950);
else { else {
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
writer.print("("); writer.print("(");
writer.printType(classType); writer.printType(classType);
writer.print(") "); writer.print(") ");
@ -1199,7 +1197,7 @@ public final class InvokeOperator extends Operator
} else { } else {
if (needsCast(0, paramTypes)){ if (needsCast(0, paramTypes)){
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 1); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 1);
writer.print("("); writer.print("(");
writer.printType(classType); writer.printType(classType);
writer.print(") "); writer.print(") ");
@ -1223,7 +1221,7 @@ public final class InvokeOperator extends Operator
writer.breakOp(); writer.breakOp();
writer.printOptionalSpace(); writer.printOptionalSpace();
writer.print("("); writer.print("(");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
boolean first = true; boolean first = true;
int offset = skippedArgs; int offset = skippedArgs;
while (arg < length) { while (arg < length) {
@ -1235,7 +1233,7 @@ public final class InvokeOperator extends Operator
int priority = 0; int priority = 0;
if (needsCast(arg, paramTypes)) { if (needsCast(arg, paramTypes)) {
Type castType = methodType.getParameterTypes()[arg-offset]; Type castType = methodType.getParameterTypes()[arg-offset];
writer.startOp(writer.IMPL_PAREN, 1); writer.startOp(TabbedPrintWriter.IMPL_PAREN, 1);
writer.print("("); writer.print("(");
writer.printType(castType); writer.printType(castType);
writer.print(") "); writer.print(") ");

@ -18,9 +18,6 @@
*/ */
package net.sf.jode.expr; 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 { public interface LValueExpression extends MatchableOperator {
} }

@ -18,12 +18,9 @@
*/ */
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.GlobalOptions;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.ClassAnalyzer;
import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.decompiler.TabbedPrintWriter;
public class LocalLoadOperator extends LocalVarOperator { public class LocalLoadOperator extends LocalVarOperator {

@ -18,10 +18,8 @@
*/ */
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.GlobalOptions;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.decompiler.TabbedPrintWriter;
public class LocalStoreOperator extends LocalVarOperator public class LocalStoreOperator extends LocalVarOperator
implements LValueExpression { implements LValueExpression {

@ -19,7 +19,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.decompiler.TabbedPrintWriter;
public abstract class NoArgOperator extends Operator { public abstract class NoArgOperator extends Operator {

@ -19,7 +19,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.GlobalOptions;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
@ -221,7 +220,6 @@ public abstract class Operator extends Expression {
* is not a CombineableOperator. * is not a CombineableOperator.
*/ */
public boolean containsMatchingLoad(CombineableOperator comb) { public boolean containsMatchingLoad(CombineableOperator comb) {
Operator combOp = (Operator) comb;
if (comb.getLValue().matches(this)) { if (comb.getLValue().matches(this)) {
if (subsEquals((Operator) comb.getLValue())) if (subsEquals((Operator) comb.getLValue()))
return true; return true;

@ -19,9 +19,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.GlobalOptions; 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.LocalInfo;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;

@ -52,7 +52,6 @@ public class PrePostFixOperator extends Operator {
public void dumpExpression(TabbedPrintWriter writer) public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException { throws java.io.IOException {
boolean needBrace = false;
int priority = 700; int priority = 700;
if (!postfix) { if (!postfix) {
writer.print(getOperatorString()); writer.print(getOperatorString());

@ -20,7 +20,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.bytecode.Reference; import net.sf.jode.bytecode.Reference;
import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.FieldAnalyzer;
public class PutFieldOperator extends FieldOperator public class PutFieldOperator extends FieldOperator
implements LValueExpression { implements LValueExpression {

@ -19,7 +19,6 @@
package net.sf.jode.expr; package net.sf.jode.expr;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.GlobalOptions;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
public class StoreInstruction extends Operator public class StoreInstruction extends Operator
@ -73,9 +72,6 @@ public class StoreInstruction extends Operator
} }
public void updateType() { public void updateType() {
Type newType;
if (!opAssign) { if (!opAssign) {
/* An opassign (+=, -=, etc.) doesn't merge rvalue type. */ /* An opassign (+=, -=, etc.) doesn't merge rvalue type. */
Type lvalueType = subExpressions[0].getType(); Type lvalueType = subExpressions[0].getType();

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.TabbedPrintWriter;
/** /**
* This is a structured block, that supports break. * This is a structured block, that supports break.

@ -25,8 +25,8 @@ import net.sf.jode.expr.Expression;
import net.sf.jode.expr.LocalLoadOperator; import net.sf.jode.expr.LocalLoadOperator;
import net.sf.jode.expr.LocalStoreOperator; import net.sf.jode.expr.LocalStoreOperator;
import net.sf.jode.expr.NopOperator; import net.sf.jode.expr.NopOperator;
import net.sf.jode.expr.Operator;
import net.sf.jode.expr.StoreInstruction; import net.sf.jode.expr.StoreInstruction;
import net.sf.jode.util.SimpleSet;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Collections; import java.util.Collections;
@ -223,7 +223,7 @@ public class CatchBlock extends StructuredBlock {
((InstructionBlock) firstInstr).getInstruction(); ((InstructionBlock) firstInstr).getInstruction();
if (instr instanceof StoreInstruction) { if (instr instanceof StoreInstruction) {
StoreInstruction store = (StoreInstruction) instr; StoreInstruction store = (StoreInstruction) instr;
if (store.getOperatorIndex() == store.OPASSIGN_OP if (store.getOperatorIndex() == Operator.OPASSIGN_OP
&& store.getSubExpressions()[1] instanceof NopOperator && store.getSubExpressions()[1] instanceof NopOperator
&& store.getLValue() instanceof LocalStoreOperator) { && store.getLValue() instanceof LocalStoreOperator) {
/* The exception is stored in a local variable */ /* The exception is stored in a local variable */

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.flow; package net.sf.jode.flow;
import java.util.Vector;
import net.sf.jode.expr.*; import net.sf.jode.expr.*;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;

@ -20,7 +20,6 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.LocalVarOperator;
/** /**
* An ConditionalBlock is the structured block representing an if * An ConditionalBlock is the structured block representing an if
@ -123,7 +122,7 @@ public class ConditionalBlock extends InstructionContainer {
throws java.io.IOException throws java.io.IOException
{ {
writer.print("IF ("); writer.print("IF (");
instr.dumpExpression(writer.EXPL_PAREN, writer); instr.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer);
writer.println(")"); writer.println(")");
writer.tab(); writer.tab();
trueBlock.dumpSource(writer); trueBlock.dumpSource(writer);

@ -115,7 +115,7 @@ public class CreateAssignExpression {
} }
if (expr instanceof BinaryOperator) { if (expr instanceof BinaryOperator) {
opIndex = expr.getOperatorIndex(); opIndex = expr.getOperatorIndex();
if (opIndex < expr.ADD_OP || opIndex >= expr.ASSIGN_OP) if (opIndex < Operator.ADD_OP || opIndex >= Operator.ASSIGN_OP)
return false; return false;
if (!(expr.getSubExpressions()[0] instanceof Operator)) if (!(expr.getSubExpressions()[0] instanceof Operator))
@ -179,7 +179,7 @@ public class CreateAssignExpression {
ib.setInstruction(rightHandSide); ib.setInstruction(rightHandSide);
lvalue.setType(rvalueType); lvalue.setType(rvalueType);
store.makeOpAssign(store.OPASSIGN_OP + opIndex); store.makeOpAssign(Operator.OPASSIGN_OP + opIndex);
if (isAssignOp) if (isAssignOp)
store.makeNonVoid(); store.makeNonVoid();

@ -21,7 +21,6 @@ package net.sf.jode.flow;
import net.sf.jode.expr.*; import net.sf.jode.expr.*;
import net.sf.jode.bytecode.ClassPath; import net.sf.jode.bytecode.ClassPath;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.decompiler.LocalInfo;
public class CreateClassField { public class CreateClassField {

@ -20,7 +20,6 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.GlobalOptions; import net.sf.jode.GlobalOptions;
import net.sf.jode.expr.*; import net.sf.jode.expr.*;
import net.sf.jode.type.Type;
public class CreateConstantArray { public class CreateConstantArray {

@ -22,9 +22,6 @@ import net.sf.jode.GlobalOptions;
import net.sf.jode.type.Type; import net.sf.jode.type.Type;
import net.sf.jode.expr.*; import net.sf.jode.expr.*;
import java.util.Enumeration;
import java.util.Vector;
public class CreateIfThenElseOperator { public class CreateIfThenElseOperator {
/** /**
@ -55,7 +52,6 @@ public class CreateIfThenElseOperator {
if (block instanceof IfThenElseBlock) { if (block instanceof IfThenElseBlock) {
IfThenElseBlock ifBlock = (IfThenElseBlock) block; IfThenElseBlock ifBlock = (IfThenElseBlock) block;
Expression expr1, expr2;
if (ifBlock.elseBlock == null) if (ifBlock.elseBlock == null)
return false; return false;
@ -156,18 +152,15 @@ public class CreateIfThenElseOperator {
FlowBlock trueDestination; FlowBlock trueDestination;
FlowBlock falseDestination; FlowBlock falseDestination;
if (compare.getOperatorIndex() == compare.EQUALS_OP) { if (compare.getOperatorIndex() == Operator.EQUALS_OP) {
trueDestination = cb.jump.destination; trueDestination = cb.jump.destination;
falseDestination = cb.trueBlock.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; falseDestination = cb.jump.destination;
trueDestination = cb.trueBlock.jump.destination; trueDestination = cb.trueBlock.jump.destination;
} else } else
return false; return false;
Expression[] e = new Expression[3];
IfThenElseBlock ifBlock;
SequentialBlock sequBlock = (SequentialBlock) last.outer; SequentialBlock sequBlock = (SequentialBlock) last.outer;
return createFunnyHelper(trueDestination, falseDestination, return createFunnyHelper(trueDestination, falseDestination,
sequBlock.subBlocks[0]); sequBlock.subBlocks[0]);

@ -65,9 +65,9 @@ public class CreatePrePostIncExpression {
return false; return false;
int op; int op;
if (iinc.getOperatorIndex() == iinc.ADD_OP + iinc.OPASSIGN_OP) if (iinc.getOperatorIndex() == Operator.ADD_OP + Operator.OPASSIGN_OP)
op = Operator.INC_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; op = Operator.DEC_OP;
else else
return false; return false;
@ -128,9 +128,9 @@ public class CreatePrePostIncExpression {
ConstOperator constOp = (ConstOperator) binOp.getSubExpressions()[1]; ConstOperator constOp = (ConstOperator) binOp.getSubExpressions()[1];
int op; int op;
if (binOp.getOperatorIndex() == store.ADD_OP) if (binOp.getOperatorIndex() == Operator.ADD_OP)
op = Operator.INC_OP; op = Operator.INC_OP;
else if (binOp.getOperatorIndex() == store.SUB_OP) else if (binOp.getOperatorIndex() == Operator.SUB_OP)
op = Operator.DEC_OP; op = Operator.DEC_OP;
else else
return false; return false;

@ -25,7 +25,6 @@ import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.CombineableOperator; import net.sf.jode.expr.CombineableOperator;
import net.sf.jode.util.SimpleMap; import net.sf.jode.util.SimpleMap;
import net.sf.jode.util.SimpleSet;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Map; import java.util.Map;
@ -244,7 +243,6 @@ public class FlowBlock {
cb.swapJump(prev); cb.swapJump(prev);
} }
} }
next_jump:
while (jumps != null) { while (jumps != null) {
Jump jump = jumps; Jump jump = jumps;
jumps = jumps.next; jumps = jumps.next;
@ -581,7 +579,6 @@ public class FlowBlock {
LoopBlock doWhileFalse = null; LoopBlock doWhileFalse = null;
StructuredBlock outerMost = lastModified; StructuredBlock outerMost = lastModified;
boolean removeLast = false; boolean removeLast = false;
next_jump:
for (; jumps != null; jumps = jumps.next) { for (; jumps != null; jumps = jumps.next) {
StructuredBlock prevBlock = jumps.prev; StructuredBlock prevBlock = jumps.prev;
@ -962,10 +959,6 @@ public class FlowBlock {
} }
public void setSuccessors(FlowBlock[] succs) { public void setSuccessors(FlowBlock[] succs) {
SlotSet blockIn = new SlotSet();
SlotSet blockKill = new SlotSet();
VariableSet blockGen = new VariableSet();
Jump[] jumps = new Jump[succs.length]; Jump[] jumps = new Jump[succs.length];
for (int i=0; i< succs.length; i++) { for (int i=0; i< succs.length; i++) {
Jump jump = new Jump(succs[i]); Jump jump = new Jump(succs[i]);
@ -1078,7 +1071,6 @@ public class FlowBlock {
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_FLOW) != 0) if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_FLOW) != 0)
GlobalOptions.err.println("before remaining: "+this); GlobalOptions.err.println("before remaining: "+this);
next_jump:
for (; jumps != null; jumps = jumps.next) { for (; jumps != null; jumps = jumps.next) {
StructuredBlock prevBlock = jumps.prev; StructuredBlock prevBlock = jumps.prev;
@ -1178,7 +1170,7 @@ public class FlowBlock {
LoopBlock lb = LoopBlock lb =
(LoopBlock) lastModified.outer.getSubBlocks()[0]; (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 /* The jump is directly following a
* do-while(false) block * do-while(false) block
@ -1442,7 +1434,6 @@ public class FlowBlock {
* block lie in range [start,end). Otherwise * block lie in range [start,end). Otherwise
* we have no chance to combine these two blocks. * we have no chance to combine these two blocks.
*/ */
boolean predOutOfRange = false;
for (Iterator i = succ.predecessors.iterator(); for (Iterator i = succ.predecessors.iterator();
i.hasNext(); ) { i.hasNext(); ) {
FlowBlock pred = (FlowBlock)i.next(); FlowBlock pred = (FlowBlock)i.next();

@ -18,10 +18,8 @@
*/ */
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.type.Type;
import net.sf.jode.util.SimpleSet; import net.sf.jode.util.SimpleSet;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
@ -174,7 +172,7 @@ public class IfThenElseBlock extends StructuredBlock {
{ {
boolean needBrace = thenBlock.needsBraces(); boolean needBrace = thenBlock.needsBraces();
writer.print("if ("); writer.print("if (");
cond.dumpExpression(writer.EXPL_PAREN, writer); cond.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer);
writer.print(")"); writer.print(")");
if (needBrace) if (needBrace)
writer.openBrace(); writer.openBrace();

@ -24,7 +24,6 @@ import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.StoreInstruction; import net.sf.jode.expr.StoreInstruction;
import net.sf.jode.expr.LocalStoreOperator; import net.sf.jode.expr.LocalStoreOperator;
import net.sf.jode.util.SimpleSet;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Set; import java.util.Set;
@ -137,12 +136,12 @@ public class InstructionBlock extends InstructionContainer {
StoreInstruction store = (StoreInstruction) instr; StoreInstruction store = (StoreInstruction) instr;
LocalInfo local = LocalInfo local =
((LocalStoreOperator) store.getLValue()).getLocalInfo(); ((LocalStoreOperator) store.getLValue()).getLocalInfo();
writer.startOp(writer.NO_PAREN, 0); writer.startOp(TabbedPrintWriter.NO_PAREN, 0);
local.dumpDeclaration(writer); local.dumpDeclaration(writer);
writer.breakOp(); writer.breakOp();
writer.print(" = "); writer.print(" = ");
store.getSubExpressions()[1].makeInitializer(local.getType()); store.getSubExpressions()[1].makeInitializer(local.getType());
store.getSubExpressions()[1].dumpExpression(writer.IMPL_PAREN, store.getSubExpressions()[1].dumpExpression(TabbedPrintWriter.IMPL_PAREN,
writer); writer);
writer.endOp(); writer.endOp();
} else { } else {
@ -150,9 +149,9 @@ public class InstructionBlock extends InstructionContainer {
if (instr.getType() != Type.tVoid) { if (instr.getType() != Type.tVoid) {
writer.print("PUSH "); writer.print("PUSH ");
instr.dumpExpression(writer.IMPL_PAREN, writer); instr.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer);
} else } else
instr.dumpExpression(writer.NO_PAREN, writer); instr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer);
} catch (RuntimeException ex) { } catch (RuntimeException ex) {
writer.print("(RUNTIME ERROR IN EXPRESSION)"); writer.print("(RUNTIME ERROR IN EXPRESSION)");
} }

@ -18,10 +18,8 @@
*/ */
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.InvokeOperator; import net.sf.jode.expr.InvokeOperator;
import net.sf.jode.expr.LocalVarOperator;
import net.sf.jode.util.SimpleSet; import net.sf.jode.util.SimpleSet;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.GlobalOptions;
/** /**
* This class represents an unconditional jump. * This class represents an unconditional jump.

@ -19,7 +19,6 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
import net.sf.jode.type.Type;
import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.ConstOperator; import net.sf.jode.expr.ConstOperator;
@ -316,7 +315,7 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock {
writer.print("for (;;)"); writer.print("for (;;)");
else { else {
writer.print("while ("); writer.print("while (");
cond.dumpExpression(writer.EXPL_PAREN, writer); cond.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer);
writer.print(")"); writer.print(")");
} }
break; break;
@ -325,13 +324,13 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock {
break; break;
case FOR: case FOR:
writer.print("for ("); writer.print("for (");
writer.startOp(writer.EXPL_PAREN, 0); writer.startOp(TabbedPrintWriter.EXPL_PAREN, 0);
if (initInstr != null) { if (initInstr != null) {
if (isDeclaration) { if (isDeclaration) {
StoreInstruction store = (StoreInstruction) initInstr; StoreInstruction store = (StoreInstruction) initInstr;
LocalInfo local = ((LocalStoreOperator) store LocalInfo local = ((LocalStoreOperator) store
.getLValue()).getLocalInfo(); .getLValue()).getLocalInfo();
writer.startOp(writer.NO_PAREN, 1); writer.startOp(TabbedPrintWriter.NO_PAREN, 1);
local.dumpDeclaration(writer); local.dumpDeclaration(writer);
writer.breakOp(); writer.breakOp();
writer.print(" = "); writer.print(" = ");
@ -340,16 +339,16 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock {
store.getSubExpressions()[1].dumpExpression(writer, 100); store.getSubExpressions()[1].dumpExpression(writer, 100);
writer.endOp(); writer.endOp();
} else } else
initInstr.dumpExpression(writer.NO_PAREN, writer); initInstr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer);
} else { } else {
writer.print("/**/"); writer.print("/**/");
} }
writer.print("; "); writer.print("; ");
writer.breakOp(); writer.breakOp();
cond.dumpExpression(writer.IMPL_PAREN, writer); cond.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer);
writer.print("; "); writer.print("; ");
writer.breakOp(); writer.breakOp();
incrInstr.dumpExpression(writer.NO_PAREN, writer); incrInstr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer);
writer.endOp(); writer.endOp();
writer.print(")"); writer.print(")");
break; break;
@ -365,7 +364,7 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock {
if (needBrace) if (needBrace)
writer.closeBraceContinue(); writer.closeBraceContinue();
writer.print("while ("); writer.print("while (");
cond.dumpExpression(writer.EXPL_PAREN, writer); cond.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer);
writer.println(");"); writer.println(");");
} else if (needBrace) } else if (needBrace)
writer.closeBrace(); writer.closeBrace();

@ -63,7 +63,7 @@ public class ReturnBlock extends InstructionContainer {
newStack = stack.pop(params); newStack = stack.pop(params);
} }
} }
return null; return newStack;
} }
public void removePush() { public void removePush() {
@ -85,7 +85,7 @@ public class ReturnBlock extends InstructionContainer {
writer.print("return"); writer.print("return");
if (instr != null) { if (instr != null) {
writer.print(" "); writer.print(" ");
instr.dumpExpression(writer.IMPL_PAREN, writer); instr.dumpExpression(TabbedPrintWriter.IMPL_PAREN, writer);
} }
writer.println(";"); writer.println(";");
} }

@ -19,7 +19,6 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.TabbedPrintWriter; import net.sf.jode.decompiler.TabbedPrintWriter;
import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.expr.LocalStoreOperator; import net.sf.jode.expr.LocalStoreOperator;
import net.sf.jode.expr.StoreInstruction; import net.sf.jode.expr.StoreInstruction;
import net.sf.jode.util.SimpleSet; import net.sf.jode.util.SimpleSet;

@ -19,10 +19,8 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.util.ArrayEnum;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Collection;
import java.util.AbstractSet; import java.util.AbstractSet;
import java.util.Set; import java.util.Set;
import java.util.Iterator; import java.util.Iterator;
@ -207,7 +205,6 @@ public final class SlotSet extends AbstractSet implements Cloneable {
*/ */
public void mergeKill(Set kill) { public void mergeKill(Set kill) {
grow(kill.size()); grow(kill.size());
big_loop:
for (Iterator i = kill.iterator(); i.hasNext(); ) { for (Iterator i = kill.iterator(); i.hasNext(); ) {
LocalInfo li2 = (LocalInfo) i.next(); LocalInfo li2 = (LocalInfo) i.next();
if (!containsSlot(li2.getSlot())) if (!containsSlot(li2.getSlot()))

@ -91,7 +91,7 @@ public class SynchronizedBlock extends StructuredBlock {
writer.println("MISSING MONITORENTER"); writer.println("MISSING MONITORENTER");
writer.print("synchronized ("); writer.print("synchronized (");
if (object != null) if (object != null)
object.dumpExpression(writer.EXPL_PAREN, writer); object.dumpExpression(TabbedPrintWriter.EXPL_PAREN, writer);
else else
writer.print(local.getName()); writer.print(local.getName());
writer.print(")"); writer.print(")");

@ -33,7 +33,7 @@ public class ThrowBlock extends ReturnBlock {
throws java.io.IOException throws java.io.IOException
{ {
writer.print("throw "); writer.print("throw ");
instr.dumpExpression(writer.NO_PAREN, writer); instr.dumpExpression(TabbedPrintWriter.NO_PAREN, writer);
writer.println(";"); writer.println(";");
} }
} }

@ -20,11 +20,9 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import net.sf.jode.GlobalOptions; import net.sf.jode.GlobalOptions;
import net.sf.jode.decompiler.Analyzer;
import net.sf.jode.decompiler.ClassAnalyzer; import net.sf.jode.decompiler.ClassAnalyzer;
import net.sf.jode.decompiler.MethodAnalyzer; import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.FieldAnalyzer; import net.sf.jode.decompiler.FieldAnalyzer;
import net.sf.jode.decompiler.MethodAnalyzer;
import net.sf.jode.decompiler.Options; import net.sf.jode.decompiler.Options;
import net.sf.jode.decompiler.OuterValues; import net.sf.jode.decompiler.OuterValues;
import net.sf.jode.decompiler.OuterValueListener; import net.sf.jode.decompiler.OuterValueListener;
@ -36,8 +34,6 @@ import net.sf.jode.bytecode.ClassPath;
import net.sf.jode.bytecode.MethodInfo; import net.sf.jode.bytecode.MethodInfo;
import java.io.IOException; import java.io.IOException;
import java.util.Vector;
import java.util.Enumeration;
/** /**
* This class will transform the constructors. We differ three types of * This class will transform the constructors. We differ three types of
@ -440,7 +436,6 @@ public class TransformConstructors {
+ cons[i].getMethodHeader()); + cons[i].getMethodHeader());
MethodAnalyzer constr = cons[i]; MethodAnalyzer constr = cons[i];
MethodType constrType = constr.getType();
/* /*
* constructor(outerValues, params, opt. jikesAnonInner param) { * constructor(outerValues, params, opt. jikesAnonInner param) {
@ -462,7 +457,6 @@ public class TransformConstructors {
* constructor$? as Jikes constructor. */ * constructor$? as Jikes constructor. */
StructuredBlock sb = constr.getMethodHeader().block; StructuredBlock sb = constr.getMethodHeader().block;
Vector localLoads = null;
InstructionBlock superBlock = null; InstructionBlock superBlock = null;
InvokeOperator superInvoke = null; InvokeOperator superInvoke = null;
if (i >= type0Count) { if (i >= type0Count) {
@ -547,7 +541,6 @@ public class TransformConstructors {
int firstParamSlot = slot; int firstParamSlot = slot;
int firstOuterSlot = firstParam; int firstOuterSlot = firstParam;
int slotDist = firstParamSlot - firstOuterSlot;
/* check the remaining parameters. /* check the remaining parameters.
*/ */
for (int j=firstParam; j < methodParams.length; j++) { for (int j=firstParam; j < methodParams.length; j++) {
@ -857,8 +850,6 @@ public class TransformConstructors {
} }
private void transformBlockInitializer(StructuredBlock block) { private void transformBlockInitializer(StructuredBlock block) {
StructuredBlock start = null;
StructuredBlock tail = null;
int lastField = -1; int lastField = -1;
while (block instanceof SequentialBlock) { while (block instanceof SequentialBlock) {
StructuredBlock ib = block.getSubBlocks()[0]; StructuredBlock ib = block.getSubBlocks()[0];

@ -27,7 +27,6 @@ import net.sf.jode.expr.*;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.Set; import java.util.Set;
import java.util.Map;
import java.util.Iterator; import java.util.Iterator;
///#enddef ///#enddef
///#def COLLECTIONEXTRA java.lang ///#def COLLECTIONEXTRA java.lang
@ -777,7 +776,6 @@ public class TransformExceptionHandlers {
finallyBlock = subRoutine.block; finallyBlock = subRoutine.block;
DescriptionBlock msg = new DescriptionBlock DescriptionBlock msg = new DescriptionBlock
("ERROR: Missing return address handling"); ("ERROR: Missing return address handling");
StructuredBlock subblock = subRoutine.block;
msg.replace(finallyBlock); msg.replace(finallyBlock);
msg.appendBlock(finallyBlock); msg.appendBlock(finallyBlock);
} }
@ -935,7 +933,7 @@ public class TransformExceptionHandlers {
GlobalOptions.err.println GlobalOptions.err.println
("Warning: Can't completely analyze try."); ("Warning: Can't completely analyze try.");
} }
TryBlock tryBlock = new TryBlock(tryFlow); new TryBlock(tryFlow);
} else if (!(tryFlow.block instanceof TryBlock)) } else if (!(tryFlow.block instanceof TryBlock))
throw new InternalError("no TryBlock"); throw new InternalError("no TryBlock");

@ -19,7 +19,6 @@
package net.sf.jode.flow; package net.sf.jode.flow;
import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.util.ArrayEnum;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Collection; import java.util.Collection;
@ -193,7 +192,6 @@ public final class VariableSet extends AbstractSet implements Cloneable {
public VariableSet intersect(VariableSet vs) { public VariableSet intersect(VariableSet vs) {
VariableSet intersection = new VariableSet(); VariableSet intersection = new VariableSet();
intersection.grow(Math.min(count, vs.count)); intersection.grow(Math.min(count, vs.count));
big_loop:
for (int i=0; i<count; i++) { for (int i=0; i<count; i++) {
LocalInfo li = locals[i]; LocalInfo li = locals[i];
int slot = li.getSlot(); int slot = li.getSlot();
@ -212,7 +210,6 @@ public final class VariableSet extends AbstractSet implements Cloneable {
*/ */
public void mergeGenKill(Collection gen, SlotSet kill) { public void mergeGenKill(Collection gen, SlotSet kill) {
grow(gen.size()); grow(gen.size());
big_loop:
for (Iterator i = gen.iterator(); i.hasNext(); ) { for (Iterator i = gen.iterator(); i.hasNext(); ) {
LocalInfo li2 = (LocalInfo) i.next(); LocalInfo li2 = (LocalInfo) i.next();
if (!kill.containsSlot(li2.getSlot())) if (!kill.containsSlot(li2.getSlot()))

@ -21,7 +21,6 @@ package net.sf.jode.flow;
import net.sf.jode.decompiler.LocalInfo; import net.sf.jode.decompiler.LocalInfo;
import net.sf.jode.expr.Expression; import net.sf.jode.expr.Expression;
import net.sf.jode.expr.LocalLoadOperator; import net.sf.jode.expr.LocalLoadOperator;
import net.sf.jode.expr.Operator;
/** /**
* This class represents the state of the stack at various points in * This class represents the state of the stack at various points in
@ -112,7 +111,7 @@ public class VariableStack {
} }
public VariableStack executeSpecial(SpecialBlock special) { public VariableStack executeSpecial(SpecialBlock special) {
if (special.type == special.POP) { if (special.type == SpecialBlock.POP) {
int popped = 0; int popped = 0;
int newLength = stackMap.length; int newLength = stackMap.length;
while (popped < special.count) { while (popped < special.count) {
@ -124,7 +123,7 @@ public class VariableStack {
LocalInfo[] newStack = new LocalInfo[newLength]; LocalInfo[] newStack = new LocalInfo[newLength];
System.arraycopy(stackMap, 0, newStack, 0, newLength); System.arraycopy(stackMap, 0, newStack, 0, newLength);
return new VariableStack(newStack); return new VariableStack(newStack);
} else if (special.type == special.DUP) { } else if (special.type == SpecialBlock.DUP) {
int popped = 0; int popped = 0;
int numDup = 0; int numDup = 0;
int startDup = stackMap.length; int startDup = stackMap.length;
@ -151,7 +150,7 @@ public class VariableStack {
System.arraycopy(stackMap, startDup, newStack, startDup + numDup, System.arraycopy(stackMap, startDup, newStack, startDup + numDup,
numDup); numDup);
return new VariableStack(newStack); return new VariableStack(newStack);
} else if (special.type == special.SWAP) { } else if (special.type == SpecialBlock.SWAP) {
LocalInfo[] newStack = new LocalInfo[stackMap.length]; LocalInfo[] newStack = new LocalInfo[stackMap.length];
System.arraycopy(stackMap, 0, newStack, 0, stackMap.length - 2); System.arraycopy(stackMap, 0, newStack, 0, stackMap.length - 2);
if (stackMap[stackMap.length-2].getType().stackSize() != 1 if (stackMap[stackMap.length-2].getType().stackSize() != 1

@ -33,12 +33,9 @@ import net.sf.jode.bytecode.TypeSignature;
import java.io.IOException; import java.io.IOException;
import java.util.BitSet; import java.util.BitSet;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
///#enddef ///#enddef
@ -1145,7 +1142,6 @@ public class CodeVerifier implements Opcodes {
} }
if (ref.getName().equals("<init>")) { if (ref.getName().equals("<init>")) {
Type clazz = info.pop(); Type clazz = info.pop();
String typeSig = clazz.getTypeSig();
String refClazzSig = ref.getClazz(); String refClazzSig = ref.getClazz();
Type refClazz = tType("N" + refClazzSig.substring(1)); Type refClazz = tType("N" + refClazzSig.substring(1));
if (opcode != opc_invokespecial if (opcode != opc_invokespecial

@ -92,7 +92,6 @@ public class Interpreter implements Opcodes {
for (int i=0; i < stack.length; i++) for (int i=0; i < stack.length; i++)
stack[i] = new Value(); stack[i] = new Value();
Block[] blocks = bb.getBlocks();
Block nextBlock = bb.getStartBlock(); Block nextBlock = bb.getStartBlock();
int stacktop = 0; int stacktop = 0;

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.jvm; package net.sf.jode.jvm;
import net.sf.jode.GlobalOptions;
import net.sf.jode.bytecode.BasicBlocks; import net.sf.jode.bytecode.BasicBlocks;
import net.sf.jode.bytecode.Block; import net.sf.jode.bytecode.Block;
import net.sf.jode.bytecode.ClassInfo; import net.sf.jode.bytecode.ClassInfo;
@ -107,7 +106,6 @@ public class SyntheticAnalyzer implements Opcodes {
BasicBlocks bb = method.getBasicBlocks(); BasicBlocks bb = method.getBasicBlocks();
Block[] blocks = bb.getBlocks();
Block startBlock = bb.getStartBlock(); Block startBlock = bb.getStartBlock();
Handler[] excHandlers = bb.getExceptionHandlers(); Handler[] excHandlers = bb.getExceptionHandlers();
if (startBlock == null if (startBlock == null
@ -185,7 +183,6 @@ public class SyntheticAnalyzer implements Opcodes {
Handler[] excHandlers = bb.getExceptionHandlers(); Handler[] excHandlers = bb.getExceptionHandlers();
if (excHandlers != null && excHandlers.length != 0) if (excHandlers != null && excHandlers.length != 0)
return false; return false;
Block[] blocks = bb.getBlocks();
Block startBlock = bb.getStartBlock(); Block startBlock = bb.getStartBlock();
if (startBlock == null) if (startBlock == null)
return false; return false;

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.jvm; package net.sf.jode.jvm;
import net.sf.jode.bytecode.*;
/** /**
* This class represents a stack value. * This class represents a stack value.

@ -18,7 +18,6 @@
*/ */
package net.sf.jode.jvm; package net.sf.jode.jvm;
import net.sf.jode.bytecode.*;
/** /**
* This exception is thrown by the CodeVerifier on various conditions. * This exception is thrown by the CodeVerifier on various conditions.

@ -20,7 +20,6 @@
package net.sf.jode.obfuscator; package net.sf.jode.obfuscator;
import net.sf.jode.GlobalOptions; import net.sf.jode.GlobalOptions;
import net.sf.jode.bytecode.ClassPath; import net.sf.jode.bytecode.ClassPath;
import net.sf.jode.bytecode.ClassInfo;
import net.sf.jode.bytecode.Reference; import net.sf.jode.bytecode.Reference;
import net.sf.jode.obfuscator.modules.WildCard; import net.sf.jode.obfuscator.modules.WildCard;
import net.sf.jode.obfuscator.modules.MultiIdentifierMatcher; import net.sf.jode.obfuscator.modules.MultiIdentifierMatcher;
@ -36,10 +35,6 @@ import java.util.Set;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.util.TreeMap;
///#enddef
///#def COLLECTIONEXTRA java.lang
import java.lang.UnsupportedOperationException;
///#enddef ///#enddef
///#ifdef JDK12 ///#ifdef JDK12

@ -30,7 +30,6 @@ import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Map;
import java.util.Random; import java.util.Random;
///#enddef ///#enddef
///#def COLLECTIONEXTRA java.lang ///#def COLLECTIONEXTRA java.lang
@ -394,7 +393,7 @@ public class ClassIdentifier extends Identifier {
initialized = true; initialized = true;
try { try {
info.load(info.ALL); info.load(ClassInfo.ALL);
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException("Can't read class " + info.getName() throw new RuntimeException("Can't read class " + info.getName()
+ ": " + ex.getMessage()); + ": " + ex.getMessage());
@ -749,7 +748,6 @@ public class ClassIdentifier extends Identifier {
* they must be there!). * they must be there!).
*/ */
ClassInfo superInfo = info.getSuperclass(); ClassInfo superInfo = info.getSuperclass();
ClassIdentifier superIdent = this;
while (superInfo != null) { while (superInfo != null) {
ClassIdentifier superident = Main.getClassBundle() ClassIdentifier superident = Main.getClassBundle()
.getClassIdentifier(superInfo.getName()); .getClassIdentifier(superInfo.getName());

@ -18,14 +18,12 @@
*/ */
package net.sf.jode.obfuscator; package net.sf.jode.obfuscator;
import java.lang.reflect.Modifier;
import net.sf.jode.bytecode.*; import net.sf.jode.bytecode.*;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
///#enddef ///#enddef

@ -19,7 +19,6 @@
package net.sf.jode.obfuscator; package net.sf.jode.obfuscator;
import net.sf.jode.GlobalOptions; import net.sf.jode.GlobalOptions;
import java.io.*;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Map; import java.util.Map;
import java.util.Iterator; import java.util.Iterator;

@ -23,7 +23,6 @@ import net.sf.jode.GlobalOptions;
import gnu.getopt.LongOpt; import gnu.getopt.LongOpt;
import gnu.getopt.Getopt; import gnu.getopt.Getopt;
import java.lang.reflect.Modifier;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.FileReader; import java.io.FileReader;
import java.io.InputStreamReader; import java.io.InputStreamReader;

@ -24,10 +24,8 @@ import net.sf.jode.bytecode.*;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map;
///#enddef ///#enddef
import java.lang.reflect.Modifier;
import java.util.BitSet; import java.util.BitSet;
public class MethodIdentifier extends Identifier implements Opcodes { public class MethodIdentifier extends Identifier implements Opcodes {

@ -19,12 +19,7 @@
package net.sf.jode.obfuscator; package net.sf.jode.obfuscator;
import net.sf.jode.GlobalOptions; 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.io.*;
import java.util.Vector;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
@ -183,7 +178,7 @@ public class PackageIdentifier extends Identifier {
if (loadOnDemand || matcher.matches(ident)) if (loadOnDemand || matcher.matches(ident))
ident.setLoadOnDemand(); ident.setLoadOnDemand();
if (initialized) if (initialized)
((PackageIdentifier) ident).initialize(); ident.initialize();
} else { } else {
ClassIdentifier ident = new ClassIdentifier ClassIdentifier ident = new ClassIdentifier
(this, subFull, subclazz, (this, subFull, subclazz,
@ -197,7 +192,7 @@ public class PackageIdentifier extends Identifier {
swappedClasses = null; swappedClasses = null;
bundle.addClassIdentifier(ident); bundle.addClassIdentifier(ident);
if (initialized) if (initialized)
((ClassIdentifier) ident).initClass(); ident.initClass();
} }
} }
} }

@ -25,8 +25,6 @@ import net.sf.jode.jvm.InterpreterException;
import net.sf.jode.obfuscator.*; import net.sf.jode.obfuscator.*;
import net.sf.jode.util.StringQuoter; import net.sf.jode.util.StringQuoter;
import java.lang.reflect.Array;
import java.lang.reflect.Modifier;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.BitSet; import java.util.BitSet;
@ -40,7 +38,6 @@ import java.util.Set;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Iterator; import java.util.Iterator;
import java.util.ListIterator;
///#enddef ///#enddef
/** /**
@ -180,10 +177,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
listeners.add(l); listeners.add(l);
} }
public void removeConstantListener(ConstantListener l) {
listeners.remove(l);
}
public void fireChanged() { public void fireChanged() {
value = VOLATILE; value = VOLATILE;
for (Iterator i = listeners.iterator(); i.hasNext(); ) { for (Iterator i = listeners.iterator(); i.hasNext(); ) {
@ -453,14 +446,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
} }
private static class ConstantInfo implements ConstantListener { private static class ConstantInfo implements ConstantListener {
ConstantInfo() {
this(0, null);
}
ConstantInfo(int flags) {
this(flags, null);
}
ConstantInfo(int flags, Object constant) { ConstantInfo(int flags, Object constant) {
this.flags = flags; this.flags = flags;
this.constant = constant; this.constant = constant;
@ -482,8 +467,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
new ConstValue(1), new ConstValue(2) new ConstValue(1), new ConstValue(2)
}; };
private static ConstantInfo unknownConstInfo = new ConstantInfo();
/** /**
* The block info contains the info needed for a single block. * The block info contains the info needed for a single block.
*/ */
@ -591,7 +574,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
for (int slot = 0; slot < newLocals.length; slot++) { for (int slot = 0; slot < newLocals.length; slot++) {
if (retBlock.usedLocals.get(slot)) { if (retBlock.usedLocals.get(slot)) {
newLocals[slot] = retBlock.after.locals[slot]; newLocals[slot] = retBlock.after.locals[slot];
if (nextUsed != null)
nextUsed.set(slot); nextUsed.set(slot);
} }
} }
@ -700,7 +682,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
if (constantFlow >= 0) if (constantFlow >= 0)
/* Nothing changed... */ /* Nothing changed... */
return; return;
Instruction pc;
int value = ((Integer) stacktop.value).intValue(); int value = ((Integer) stacktop.value).intValue();
int[] values = instr.getValues(); int[] values = instr.getValues();
constantFlow = Arrays.binarySearch(values, value); constantFlow = Arrays.binarySearch(values, value);
@ -1361,7 +1342,7 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
|| opcode == opc_invokeinterface); || opcode == opc_invokeinterface);
return info.pop(size); return info.pop(size);
} }
if (constant && !runtime.isWhite(retType)) { if (constant && !ConstantRuntimeEnvironment.isWhite(retType)) {
/* This is not a valid constant type */ /* This is not a valid constant type */
constant = false; constant = false;
} }
@ -1667,8 +1648,6 @@ public class ConstantAnalyzer extends SimpleAnalyzer {
case opc_invokevirtual: { case opc_invokevirtual: {
Reference ref = instr.getReference(); Reference ref = instr.getReference();
String[] pt = TypeSignature.getParameterTypes(ref.getType()); String[] pt = TypeSignature.getParameterTypes(ref.getType());
int arg = 0;
int i = pt.length; int i = pt.length;
while (i > 0) while (i > 0)
newCode.add(Instruction.forOpcode(TypeSignature newCode.add(Instruction.forOpcode(TypeSignature

@ -34,8 +34,6 @@ import net.sf.jode.GlobalOptions;
import java.io.IOException; import java.io.IOException;
///#def COLLECTIONS java.util ///#def COLLECTIONS java.util
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;
///#enddef ///#enddef
public class SimpleAnalyzer implements CodeAnalyzer, Opcodes { public class SimpleAnalyzer implements CodeAnalyzer, Opcodes {
@ -81,7 +79,7 @@ public class SimpleAnalyzer implements CodeAnalyzer, Opcodes {
.replace('/','.')); .replace('/','.'));
} }
try { try {
clazz.load(clazz.DECLARATIONS); clazz.load(ClassInfo.DECLARATIONS);
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException("Can't get declarations of " throw new RuntimeException("Can't get declarations of "
+ clazz); + clazz);

@ -18,10 +18,7 @@
*/ */
package net.sf.jode.swingui; package net.sf.jode.swingui;
import net.sf.jode.GlobalOptions;
import net.sf.jode.bytecode.ClassPath; import net.sf.jode.bytecode.ClassPath;
import net.sf.jode.decompiler.Decompiler;
import net.sf.jode.decompiler.ProgressListener;
///#def JAVAX_SWING javax.swing ///#def JAVAX_SWING javax.swing
import javax.swing.*; import javax.swing.*;
@ -29,9 +26,7 @@ import javax.swing.filechooser.*;
import javax.swing.event.*; import javax.swing.event.*;
///#enddef ///#enddef
import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.event.*; import java.awt.event.*;
import java.awt.AWTEventMulticaster; import java.awt.AWTEventMulticaster;

@ -43,7 +43,6 @@ import java.util.HashSet;
import java.io.IOException; import java.io.IOException;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.NoSuchElementException;
public class HierarchyTreeModel implements TreeModel, Runnable { public class HierarchyTreeModel implements TreeModel, Runnable {
static final int MAX_PACKAGE_LEVEL = 10; static final int MAX_PACKAGE_LEVEL = 10;

@ -34,7 +34,6 @@ import java.awt.event.*;
import java.io.*; import java.io.*;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.*;
public class Main public class Main
implements ActionListener, Runnable, TreeSelectionListener { implements ActionListener, Runnable, TreeSelectionListener {
@ -119,7 +118,7 @@ public class Main
classTree = new JTree(packModel); classTree = new JTree(packModel);
classTree.setRootVisible(false); classTree.setRootVisible(false);
DefaultTreeSelectionModel selModel = new DefaultTreeSelectionModel(); DefaultTreeSelectionModel selModel = new DefaultTreeSelectionModel();
selModel.setSelectionMode(selModel.SINGLE_TREE_SELECTION); selModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
classTree.setSelectionModel(selModel); classTree.setSelectionModel(selModel);
classTree.addTreeSelectionListener(this); classTree.addTreeSelectionListener(this);
JScrollPane spClassTree = new JScrollPane(classTree); JScrollPane spClassTree = new JScrollPane(classTree);

@ -19,7 +19,6 @@
package net.sf.jode.swingui; package net.sf.jode.swingui;
import net.sf.jode.decompiler.Options; import net.sf.jode.decompiler.Options;
import net.sf.jode.bytecode.ClassInfo;
import net.sf.jode.bytecode.ClassPath; import net.sf.jode.bytecode.ClassPath;
///#def JAVAX_SWING javax.swing ///#def JAVAX_SWING javax.swing

@ -18,9 +18,6 @@
*/ */
package net.sf.jode.type; 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. * This type represents an array type.

@ -23,9 +23,6 @@ import net.sf.jode.GlobalOptions;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.io.IOException; 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.<p> * This class is the type representing a class loaded from a ClassPath.<p>

@ -20,8 +20,6 @@
package net.sf.jode.type; package net.sf.jode.type;
import java.util.Stack; import java.util.Stack;
import java.util.Hashtable; 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.<p> * This class is the base class of all types representing a class type.<p>

@ -18,10 +18,8 @@
*/ */
package net.sf.jode.type; package net.sf.jode.type;
import net.sf.jode.bytecode.ClassInfo;
import java.util.Stack; import java.util.Stack;
import java.util.Vector; import java.util.Vector;
import java.io.IOException;
/** /**
* This class represents a type aproximation, consisting of multiple * 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. * class in the other list, we can omit it.
*/ */
Vector destClasses = new Vector(); Vector destClasses = new Vector();
big_loop_this:
for (int i=0; i< classes.length; i++) { for (int i=0; i< classes.length; i++) {
ClassType clazz = classes[i]; ClassType clazz = classes[i];
if (!clazz.isSubTypeOf(type)) { if (!clazz.isSubTypeOf(type)) {
@ -187,7 +184,6 @@ public class MultiClassType extends ReferenceType {
destClasses.addElement(clazz); destClasses.addElement(clazz);
} }
} }
big_loop_other:
for (int i=0; i< otherClasses.length; i++) { for (int i=0; i< otherClasses.length; i++) {
ClassType clazz = otherClasses[i]; ClassType clazz = otherClasses[i];
if (!clazz.isSubTypeOf(this)) { if (!clazz.isSubTypeOf(this)) {

@ -19,7 +19,6 @@
package net.sf.jode.type; package net.sf.jode.type;
import net.sf.jode.GlobalOptions; import net.sf.jode.GlobalOptions;
import java.util.Hashtable;
/** /**
* This class represents a set of reference types. The set contains * This class represents a set of reference types. The set contains

@ -18,11 +18,6 @@
*/ */
package net.sf.jode.type; 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 * This class represents the type of a system class, i.e. the classes

Loading…
Cancel
Save