From 86e9b3608a22c6f083f7a9ec43a4716fec80b009 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 6 Dec 2009 00:19:52 +0000 Subject: [PATCH] More unused code removal. Still not complete. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@887613 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/bcel/Constants.java | 468 +-------------------- java/org/apache/tomcat/util/bcel/Repository.java | 125 ------ .../util/bcel/classfile/AnnotationDefault.java | 13 - .../util/bcel/classfile/AnnotationEntry.java | 2 +- .../tomcat/util/bcel/classfile/Annotations.java | 14 - .../tomcat/util/bcel/classfile/Attribute.java | 12 +- .../apache/tomcat/util/bcel/classfile/Code.java | 12 - .../tomcat/util/bcel/classfile/CodeException.java | 2 +- .../tomcat/util/bcel/classfile/Constant.java | 12 +- .../tomcat/util/bcel/classfile/ConstantClass.java | 12 - .../tomcat/util/bcel/classfile/ConstantDouble.java | 12 - .../util/bcel/classfile/ConstantFieldref.java | 20 +- .../tomcat/util/bcel/classfile/ConstantFloat.java | 14 +- .../util/bcel/classfile/ConstantInteger.java | 12 - .../bcel/classfile/ConstantInterfaceMethodref.java | 20 +- .../tomcat/util/bcel/classfile/ConstantLong.java | 12 - .../util/bcel/classfile/ConstantMethodref.java | 20 +- .../util/bcel/classfile/ConstantNameAndType.java | 12 - .../tomcat/util/bcel/classfile/ConstantPool.java | 2 +- .../tomcat/util/bcel/classfile/ConstantString.java | 12 - .../tomcat/util/bcel/classfile/ConstantUtf8.java | 12 - .../tomcat/util/bcel/classfile/ConstantValue.java | 12 - .../tomcat/util/bcel/classfile/Deprecated.java | 12 - .../util/bcel/classfile/EnclosingMethod.java | 4 - .../tomcat/util/bcel/classfile/ExceptionTable.java | 12 - .../tomcat/util/bcel/classfile/FieldOrMethod.java | 45 +- .../tomcat/util/bcel/classfile/InnerClass.java | 2 +- .../tomcat/util/bcel/classfile/InnerClasses.java | 12 - .../tomcat/util/bcel/classfile/JavaClass.java | 42 +- .../tomcat/util/bcel/classfile/LineNumber.java | 2 +- .../util/bcel/classfile/LineNumberTable.java | 12 - .../tomcat/util/bcel/classfile/LocalVariable.java | 2 +- .../util/bcel/classfile/LocalVariableTable.java | 12 - .../bcel/classfile/LocalVariableTypeTable.java | 4 - .../apache/tomcat/util/bcel/classfile/Node.java | 28 -- .../tomcat/util/bcel/classfile/PMGClass.java | 12 - .../bcel/classfile/ParameterAnnotationEntry.java | 2 +- .../util/bcel/classfile/ParameterAnnotations.java | 12 - .../tomcat/util/bcel/classfile/Signature.java | 25 -- .../tomcat/util/bcel/classfile/SourceFile.java | 12 - .../tomcat/util/bcel/classfile/StackMap.java | 17 +- .../tomcat/util/bcel/classfile/StackMapEntry.java | 2 - .../tomcat/util/bcel/classfile/StackMapTable.java | 17 +- .../util/bcel/classfile/StackMapTableEntry.java | 2 - .../tomcat/util/bcel/classfile/Synthetic.java | 12 - .../apache/tomcat/util/bcel/classfile/Unknown.java | 12 - .../apache/tomcat/util/bcel/classfile/Utility.java | 92 ---- .../apache/tomcat/util/bcel/classfile/Visitor.java | 108 ----- .../org/apache/tomcat/util/bcel/generic/ALOAD.java | 43 -- .../apache/tomcat/util/bcel/generic/ANEWARRAY.java | 44 -- .../apache/tomcat/util/bcel/generic/ASTORE.java | 43 -- .../apache/tomcat/util/bcel/generic/BIPUSH.java | 83 ---- .../tomcat/util/bcel/generic/BREAKPOINT.java | 30 -- .../tomcat/util/bcel/generic/BranchHandle.java | 10 +- .../util/bcel/generic/BranchInstruction.java | 7 +- .../apache/tomcat/util/bcel/generic/CHECKCAST.java | 44 -- .../tomcat/util/bcel/generic/CPInstruction.java | 8 +- .../apache/tomcat/util/bcel/generic/ClassGen.java | 96 +---- .../tomcat/util/bcel/generic/CodeExceptionGen.java | 124 ------ .../tomcat/util/bcel/generic/ConstantPoolGen.java | 258 ------------ .../org/apache/tomcat/util/bcel/generic/DLOAD.java | 43 -- .../apache/tomcat/util/bcel/generic/DSTORE.java | 43 -- .../org/apache/tomcat/util/bcel/generic/FLOAD.java | 43 -- .../apache/tomcat/util/bcel/generic/FSTORE.java | 43 -- .../apache/tomcat/util/bcel/generic/FieldGen.java | 13 - .../util/bcel/generic/FieldGenOrMethodGen.java | 30 +- .../tomcat/util/bcel/generic/FieldOrMethod.java | 21 +- .../apache/tomcat/util/bcel/generic/GETFIELD.java | 48 --- .../apache/tomcat/util/bcel/generic/GETSTATIC.java | 47 --- java/org/apache/tomcat/util/bcel/generic/GOTO.java | 70 --- .../apache/tomcat/util/bcel/generic/GOTO_W.java | 60 --- java/org/apache/tomcat/util/bcel/generic/IINC.java | 123 ------ .../org/apache/tomcat/util/bcel/generic/ILOAD.java | 43 -- .../apache/tomcat/util/bcel/generic/IMPDEP1.java | 30 -- .../apache/tomcat/util/bcel/generic/IMPDEP2.java | 30 -- .../tomcat/util/bcel/generic/INSTANCEOF.java | 44 -- .../tomcat/util/bcel/generic/INVOKEINTERFACE.java | 87 ---- .../tomcat/util/bcel/generic/INVOKESPECIAL.java | 42 -- .../tomcat/util/bcel/generic/INVOKESTATIC.java | 41 -- .../tomcat/util/bcel/generic/INVOKEVIRTUAL.java | 41 -- .../apache/tomcat/util/bcel/generic/ISTORE.java | 43 -- .../tomcat/util/bcel/generic/Instruction.java | 330 +-------------- .../util/bcel/generic/InstructionConstants.java | 165 -------- .../util/bcel/generic/InstructionHandle.java | 15 +- .../tomcat/util/bcel/generic/InstructionList.java | 339 --------------- java/org/apache/tomcat/util/bcel/generic/JSR.java | 67 --- .../org/apache/tomcat/util/bcel/generic/JSR_W.java | 60 --- .../tomcat/util/bcel/generic/JsrInstruction.java | 38 +- .../apache/tomcat/util/bcel/generic/LDC2_W.java | 53 --- .../org/apache/tomcat/util/bcel/generic/LDC_W.java | 52 --- .../org/apache/tomcat/util/bcel/generic/LLOAD.java | 40 -- .../tomcat/util/bcel/generic/LOOKUPSWITCH.java | 73 ---- .../apache/tomcat/util/bcel/generic/LSTORE.java | 40 -- .../tomcat/util/bcel/generic/LineNumberGen.java | 89 ---- .../tomcat/util/bcel/generic/LocalVariableGen.java | 8 +- .../tomcat/util/bcel/generic/MULTIANEWARRAY.java | 102 ----- .../apache/tomcat/util/bcel/generic/MethodGen.java | 172 -------- java/org/apache/tomcat/util/bcel/generic/NEW.java | 44 -- .../tomcat/util/bcel/generic/NamedAndTyped.java | 4 +- .../tomcat/util/bcel/generic/ObjectType.java | 6 +- .../apache/tomcat/util/bcel/generic/PUTFIELD.java | 47 --- .../apache/tomcat/util/bcel/generic/PUTSTATIC.java | 47 --- java/org/apache/tomcat/util/bcel/generic/RET.java | 123 ------ .../util/bcel/generic/ReturnaddressType.java | 77 ---- .../apache/tomcat/util/bcel/generic/SIPUSH.java | 79 ---- .../apache/tomcat/util/bcel/generic/Select.java | 7 +- .../tomcat/util/bcel/generic/TABLESWITCH.java | 79 ---- java/org/apache/tomcat/util/bcel/generic/Type.java | 1 - 108 files changed, 50 insertions(+), 5228 deletions(-) delete mode 100644 java/org/apache/tomcat/util/bcel/Repository.java delete mode 100644 java/org/apache/tomcat/util/bcel/classfile/Node.java delete mode 100644 java/org/apache/tomcat/util/bcel/classfile/Visitor.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ALOAD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ANEWARRAY.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ASTORE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/BIPUSH.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/BREAKPOINT.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/CHECKCAST.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/CodeExceptionGen.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/DLOAD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/DSTORE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/FLOAD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/FSTORE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/GETFIELD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/GETSTATIC.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/GOTO.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/GOTO_W.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IINC.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ILOAD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IMPDEP1.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IMPDEP2.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/INSTANCEOF.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/INVOKEINTERFACE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/INVOKESPECIAL.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/INVOKESTATIC.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/INVOKEVIRTUAL.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ISTORE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/InstructionConstants.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/JSR.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/JSR_W.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/LDC2_W.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/LDC_W.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/LLOAD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/LOOKUPSWITCH.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/LSTORE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/LineNumberGen.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/MULTIANEWARRAY.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/NEW.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/RET.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/SIPUSH.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java diff --git a/java/org/apache/tomcat/util/bcel/Constants.java b/java/org/apache/tomcat/util/bcel/Constants.java index 6a94ee35c..6bc505138 100644 --- a/java/org/apache/tomcat/util/bcel/Constants.java +++ b/java/org/apache/tomcat/util/bcel/Constants.java @@ -24,40 +24,6 @@ package org.apache.tomcat.util.bcel; */ public interface Constants { - /** Major version number of class files for Java 1.1. - * @see #MINOR_1_1 - * */ - public final static short MAJOR_1_1 = 45; - - /** Minor version number of class files for Java 1.1. - * @see #MAJOR_1_1 - * */ - public final static short MINOR_1_1 = 3; - - - - - - - - - - - - - - - - - - - - - - - - - /** Maximum value for an unsigned short. */ public final static int MAX_SHORT = 65535; // 2^16 - 1 @@ -66,39 +32,11 @@ public interface Constants { */ public final static int MAX_BYTE = 255; // 2^8 - 1 - - - - - - - /** One of the access flags for fields, methods, or classes. - * @see #ACC_PUBLIC - */ - public final static short ACC_STATIC = 0x0008; - /** One of the access flags for fields, methods, or classes. * @see #ACC_PUBLIC */ public final static short ACC_FINAL = 0x0010; - - - - - - - - - - - - - /** One of the access flags for fields, methods, or classes. - * @see #ACC_PUBLIC - */ - public final static short ACC_NATIVE = 0x0100; - /** One of the access flags for fields, methods, or classes. * @see #ACC_PUBLIC */ @@ -109,12 +47,6 @@ public interface Constants { */ public final static short ACC_ABSTRACT = 0x0400; - - - - - - /** One of the access flags for fields, methods, or classes. * @see #ACC_PUBLIC */ @@ -178,41 +110,7 @@ public interface Constants { "CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref", "CONSTANT_Methodref", "CONSTANT_InterfaceMethodref", "CONSTANT_NameAndType" }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short BIPUSH = 16; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short SIPUSH = 17; /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short LDC = 18; @@ -240,87 +138,27 @@ public interface Constants { /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ILOAD_0 = 26; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ILOAD_1 = 27; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ILOAD_2 = 28; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ILOAD_3 = 29; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short LLOAD_0 = 30; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LLOAD_1 = 31; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LLOAD_2 = 32; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LLOAD_3 = 33; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short FLOAD_0 = 34; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FLOAD_1 = 35; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FLOAD_2 = 36; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FLOAD_3 = 37; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short DLOAD_0 = 38; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DLOAD_1 = 39; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DLOAD_2 = 40; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DLOAD_3 = 41; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ALOAD_0 = 42; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ALOAD_1 = 43; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ALOAD_2 = 44; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ALOAD_3 = 45; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IALOAD = 46; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LALOAD = 47; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FALOAD = 48; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DALOAD = 49; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short AALOAD = 50; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short BALOAD = 51; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short CALOAD = 52; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short SALOAD = 53; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ISTORE = 54; @@ -339,259 +177,30 @@ public interface Constants { /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ISTORE_0 = 59; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ISTORE_1 = 60; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ISTORE_2 = 61; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ISTORE_3 = 62; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short LSTORE_0 = 63; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LSTORE_1 = 64; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LSTORE_2 = 65; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LSTORE_3 = 66; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short FSTORE_0 = 67; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FSTORE_1 = 68; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FSTORE_2 = 69; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FSTORE_3 = 70; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short DSTORE_0 = 71; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DSTORE_1 = 72; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DSTORE_2 = 73; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DSTORE_3 = 74; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ASTORE_0 = 75; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ASTORE_1 = 76; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ASTORE_2 = 77; + /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ASTORE_3 = 78; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IASTORE = 79; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LASTORE = 80; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FASTORE = 81; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DASTORE = 82; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short AASTORE = 83; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short BASTORE = 84; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short CASTORE = 85; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short SASTORE = 86; - - - - - - - - - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IADD = 96; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LADD = 97; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FADD = 98; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DADD = 99; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ISUB = 100; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LSUB = 101; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FSUB = 102; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DSUB = 103; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IMUL = 104; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LMUL = 105; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FMUL = 106; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DMUL = 107; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IDIV = 108; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LDIV = 109; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FDIV = 110; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DDIV = 111; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IREM = 112; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LREM = 113; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FREM = 114; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DREM = 115; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short INEG = 116; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LNEG = 117; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FNEG = 118; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DNEG = 119; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ISHL = 120; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LSHL = 121; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ISHR = 122; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LSHR = 123; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IUSHR = 124; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LUSHR = 125; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IAND = 126; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LAND = 127; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IOR = 128; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LOR = 129; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IXOR = 130; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LXOR = 131; /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short IINC = 132; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short I2L = 133; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short I2F = 134; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short I2D = 135; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short L2I = 136; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short L2F = 137; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short L2D = 138; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short F2I = 139; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short F2L = 140; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short F2D = 141; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short D2I = 142; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short D2L = 143; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short D2F = 144; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short I2B = 145; - - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short I2C = 146; - - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short I2S = 147; - - - - - /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ @@ -652,24 +261,6 @@ public interface Constants { public static final short LOOKUPSWITCH = 171; /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short IRETURN = 172; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short LRETURN = 173; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short FRETURN = 174; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short DRETURN = 175; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short ARETURN = 176; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ - public static final short RETURN = 177; - /** Java VM opcode. - * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short GETSTATIC = 178; /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ @@ -704,7 +295,6 @@ public interface Constants { * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short ANEWARRAY = 189; - /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short CHECKCAST = 192; @@ -712,7 +302,6 @@ public interface Constants { * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short INSTANCEOF = 193; - /** Java VM opcode. * @see Opcode definitions in The Java Virtual Machine Specification */ public static final short WIDE = 196; @@ -736,30 +325,6 @@ public interface Constants { * @see Reserved opcodes in the Java Virtual Machine Specification */ public static final short BREAKPOINT = 202; - - - - - - - - - - - - - - - - - - - - - - - - /** JVM internal opcode. * @see Reserved opcodes in the Java Virtual Machine Specification */ public static final short IMPDEP1 = 254; @@ -767,9 +332,6 @@ public interface Constants { * @see Reserved opcodes in the Java Virtual Machine Specification */ public static final short IMPDEP2 = 255; - - - /** Illegal opcode. */ public static final short UNDEFINED = -1; /** Illegal opcode. */ @@ -820,8 +382,6 @@ public interface Constants { "void", "array", "object", "unknown", "address" }; - - /** The signature characters corresponding to primitive types, * e.g., SHORT_TYPE_NAMES[T_INT] = "I" */ @@ -1170,12 +730,6 @@ public interface Constants { /** Constants used in the StackMap attribute. */ public static final byte ITEM_Bogus = 0; - - - - - - public static final byte ITEM_Object = 7; public static final byte ITEM_NewObject = 8; diff --git a/java/org/apache/tomcat/util/bcel/Repository.java b/java/org/apache/tomcat/util/bcel/Repository.java deleted file mode 100644 index ce809c256..000000000 --- a/java/org/apache/tomcat/util/bcel/Repository.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel; - -import org.apache.tomcat.util.bcel.classfile.JavaClass; -import org.apache.tomcat.util.bcel.util.SyntheticRepository; - -/** - * The repository maintains informations about class interdependencies, e.g., - * whether a class is a sub-class of another. Delegates actual class loading - * to SyntheticRepository with current class path by default. - * - * @see org.apache.tomcat.util.bcel.util.Repository - * @see org.apache.tomcat.util.bcel.util.SyntheticRepository - * - * @version $Id$ - * @author M. Dahm - */ -public abstract class Repository { - - private static org.apache.tomcat.util.bcel.util.Repository _repository = SyntheticRepository.getInstance(); - - - - - - - - - /** Lookup class somewhere found on your CLASSPATH, or whereever the - * repository instance looks for it. - * - * @return class object for given fully qualified class name - * @throws ClassNotFoundException if the class could not be found or - * parsed correctly - */ - public static JavaClass lookupClass( String class_name ) throws ClassNotFoundException { - return _repository.loadClass(class_name); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * Equivalent to runtime "instanceof" operator. - * @return true, if clazz is an instance of super_class - * @throws ClassNotFoundException if any superclasses or superinterfaces - * of clazz can't be found - */ - public static boolean instanceOf( JavaClass clazz, JavaClass super_class ) - throws ClassNotFoundException { - return clazz.instanceOf(super_class); - } - - - - - - - - - - - - /** - * @return true, if clazz is an implementation of interface inter - * @throws ClassNotFoundException if any superclasses or superinterfaces - * of clazz can't be found - */ - public static boolean implementationOf( JavaClass clazz, JavaClass inter ) - throws ClassNotFoundException { - return clazz.implementationOf(inter); - } - - - - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java b/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java index 2020e18ae..a6b1b4b02 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java +++ b/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java @@ -73,19 +73,6 @@ public class AnnotationDefault extends Attribute } /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v - * Visitor object - */ - public void accept(Visitor v) - { - // v.visitAnnotationDefault(this); - } - - /** * @param defaultValue * the default value of this methodinfo's annotation */ diff --git a/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java b/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java index 870526bf9..fc97b00cb 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java +++ b/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java @@ -32,7 +32,7 @@ import org.apache.tomcat.util.bcel.Constants; * @author D. Brosius * @since 5.3 */ -public class AnnotationEntry implements Node, Constants, Serializable { +public class AnnotationEntry implements Constants, Serializable { private int type_index; private int num_element_value_pairs; diff --git a/java/org/apache/tomcat/util/bcel/classfile/Annotations.java b/java/org/apache/tomcat/util/bcel/classfile/Annotations.java index cf3609a12..a9947a02d 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Annotations.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Annotations.java @@ -31,7 +31,6 @@ public abstract class Annotations extends Attribute { private int annotation_table_length; private AnnotationEntry[] annotation_table; // Table of annotations - private boolean isRuntimeVisible; /** @@ -63,19 +62,6 @@ public abstract class Annotations extends Attribute { AnnotationEntry[] annotation_table, ConstantPool constant_pool , boolean isRuntimeVisible) { super(annotation_type, name_index, length, constant_pool); setAnnotationTable(annotation_table); - this.isRuntimeVisible = isRuntimeVisible; - } - - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitAnnotation(this); } diff --git a/java/org/apache/tomcat/util/bcel/classfile/Attribute.java b/java/org/apache/tomcat/util/bcel/classfile/Attribute.java index 85523ace0..0c281b5e2 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Attribute.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Attribute.java @@ -47,7 +47,7 @@ import org.apache.tomcat.util.bcel.classfile.ConstantUtf8; * @see Deprecated * @see Signature */ -public abstract class Attribute implements Cloneable, Node, Serializable +public abstract class Attribute implements Cloneable, Serializable { protected int name_index; // Points to attribute name in constant pool @@ -67,16 +67,6 @@ public abstract class Attribute implements Cloneable, Node, Serializable } /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v - * Visitor object - */ - public abstract void accept(Visitor v); - - /** * Dump attribute to file stream in binary format. * * @param file diff --git a/java/org/apache/tomcat/util/bcel/classfile/Code.java b/java/org/apache/tomcat/util/bcel/classfile/Code.java index d05babcc6..ae9bfe603 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Code.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Code.java @@ -115,18 +115,6 @@ public final class Code extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitCode(this); - } - - - /** * Dump code attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/CodeException.java b/java/org/apache/tomcat/util/bcel/classfile/CodeException.java index 9d072859d..b8110ad5f 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/CodeException.java +++ b/java/org/apache/tomcat/util/bcel/classfile/CodeException.java @@ -32,7 +32,7 @@ import org.apache.tomcat.util.bcel.Constants; * @author M. Dahm * @see Code */ -public final class CodeException implements Cloneable, Constants, Node, Serializable { +public final class CodeException implements Cloneable, Constants, Serializable { private int start_pc; // Range in the code the exception handler is private int end_pc; // active. start_pc is inclusive, end_pc exclusive diff --git a/java/org/apache/tomcat/util/bcel/classfile/Constant.java b/java/org/apache/tomcat/util/bcel/classfile/Constant.java index 81d9b75aa..83025d195 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Constant.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Constant.java @@ -31,7 +31,7 @@ import org.apache.tomcat.util.bcel.util.BCELComparator; * @version $Id$ * @author M. Dahm */ -public abstract class Constant implements Cloneable, Node, Serializable { +public abstract class Constant implements Cloneable, Serializable { private static BCELComparator _cmp = new BCELComparator() { @@ -63,16 +63,6 @@ public abstract class Constant implements Cloneable, Node, Serializable { } - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public abstract void accept( Visitor v ); - - public abstract void dump( DataOutputStream file ) throws IOException; diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java index 94d945a68..d1aad296d 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java @@ -60,18 +60,6 @@ public final class ConstantClass extends Constant implements ConstantObject { } - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantClass(this); - } - - /** * Dump constant class to file stream in binary format. * diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java index 7a8b86b2d..56553a0f9 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java @@ -60,18 +60,6 @@ public final class ConstantDouble extends Constant implements ConstantObject { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantDouble(this); - } - - - /** * Dump constant double to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantFieldref.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantFieldref.java index 14807e0f4..37c529306 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantFieldref.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantFieldref.java @@ -42,23 +42,5 @@ public final class ConstantFieldref extends ConstantCP { } - /** - * @param class_index Reference to the class containing the Field - * @param name_and_type_index and the Field signature - */ - public ConstantFieldref(int class_index, int name_and_type_index) { - super(Constants.CONSTANT_Fieldref, class_index, name_and_type_index); - } - - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of Fields, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantFieldref(this); - } + } diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java index 53b8cf401..c8c5bb16d 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java @@ -58,19 +58,7 @@ public final class ConstantFloat extends Constant implements ConstantObject { this(file.readFloat()); } - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantFloat(this); - } - - + /** * Dump constant float to file stream in binary format. * diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java index 30bf1aa27..47cc68b77 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java @@ -60,18 +60,6 @@ public final class ConstantInteger extends Constant implements ConstantObject { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantInteger(this); - } - - - /** * Dump constant integer to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantInterfaceMethodref.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantInterfaceMethodref.java index 611b0194b..4aee89f0e 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantInterfaceMethodref.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantInterfaceMethodref.java @@ -42,23 +42,5 @@ public final class ConstantInterfaceMethodref extends ConstantCP { } - /** - * @param class_index Reference to the class containing the method - * @param name_and_type_index and the method signature - */ - public ConstantInterfaceMethodref(int class_index, int name_and_type_index) { - super(Constants.CONSTANT_InterfaceMethodref, class_index, name_and_type_index); - } - - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantInterfaceMethodref(this); - } + } diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java index b648f32e4..6f917521a 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java @@ -60,18 +60,6 @@ public final class ConstantLong extends Constant implements ConstantObject { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantLong(this); - } - - - /** * Dump constant long to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodref.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodref.java index a75ee00ce..7b82f17df 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodref.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodref.java @@ -42,23 +42,5 @@ public final class ConstantMethodref extends ConstantCP { } - /** - * @param class_index Reference to the class containing the method - * @param name_and_type_index and the method signature - */ - public ConstantMethodref(int class_index, int name_and_type_index) { - super(Constants.CONSTANT_Methodref, class_index, name_and_type_index); - } - - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantMethodref(this); - } + } diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantNameAndType.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantNameAndType.java index 98b8e266f..952254275 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantNameAndType.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantNameAndType.java @@ -64,18 +64,6 @@ public final class ConstantNameAndType extends Constant { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantNameAndType(this); - } - - - /** * Dump name and signature index to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java index 6f008890c..42173bf0f 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java @@ -34,7 +34,7 @@ import org.apache.tomcat.util.bcel.Constants; * @see org.apache.tomcat.util.bcel.generic.ConstantPoolGen * @author M. Dahm */ -public class ConstantPool implements Cloneable, Node, Serializable { +public class ConstantPool implements Cloneable, Serializable { private int constant_pool_count; private Constant[] constant_pool; diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantString.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantString.java index d1ca00e83..6630052e4 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantString.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantString.java @@ -60,18 +60,6 @@ public final class ConstantString extends Constant implements ConstantObject { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantString(this); - } - - - /** * Dump constant field reference to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java index 6b81d29cc..a1e1f99a8 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java @@ -64,18 +64,6 @@ public final class ConstantUtf8 extends Constant { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantUtf8(this); - } - - - /** * Dump String in Utf8 format to file stream. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java b/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java index 9e1e8f243..0eefac2d0 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java @@ -67,18 +67,6 @@ public final class ConstantValue extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitConstantValue(this); - } - - - /** * Dump constant value attribute to file stream on binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java b/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java index 87c573a95..c69bb261d 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java @@ -70,18 +70,6 @@ public final class Deprecated extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitDeprecated(this); - } - - - /** * Dump source file attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java b/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java index acbc4d1f7..5ee135a2f 100755 --- a/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java +++ b/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java @@ -49,10 +49,6 @@ public class EnclosingMethod extends Attribute { methodIndex = methodIdx; } - public void accept(Visitor v) { - v.visitEnclosingMethod(this); - } - public Attribute copy(ConstantPool constant_pool) { throw new RuntimeException("Not implemented yet!"); // is this next line sufficient? diff --git a/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java b/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java index 8cef8bade..2c3475f5b 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java @@ -75,18 +75,6 @@ public final class ExceptionTable extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitExceptionTable(this); - } - - - /** * Dump exceptions attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/FieldOrMethod.java b/java/org/apache/tomcat/util/bcel/classfile/FieldOrMethod.java index 32d48e96e..ac01a60e1 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/FieldOrMethod.java +++ b/java/org/apache/tomcat/util/bcel/classfile/FieldOrMethod.java @@ -27,7 +27,7 @@ import org.apache.tomcat.util.bcel.classfile.Attribute; * @version $Id$ * @author M. Dahm */ -public abstract class FieldOrMethod extends AccessFlags implements Cloneable, Node { +public abstract class FieldOrMethod extends AccessFlags implements Cloneable { protected int name_index; // Points to field name in constant pool protected int signature_index; // Points to encoded signature @@ -36,20 +36,10 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No protected ConstantPool constant_pool; - private String signatureAttributeString = null; - private boolean searchedForSignatureAttribute = false; - - - // Annotations are collected from certain attributes, don't do it more than necessary! - private boolean annotationsOutOfDate = true; - FieldOrMethod() { } - - - /** * Construct object from file stream. * @param file Input stream @@ -85,12 +75,6 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No } - - - - - - /** * @param attributes Collection of object attributes. */ @@ -99,25 +83,7 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No attributes_count = (attributes == null) ? 0 : attributes.length; } - - - - - - - - - - - - - - - - - - /** * @return Name of object, i.e., method name or field name */ @@ -136,13 +102,4 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No c = (ConstantUtf8) constant_pool.getConstant(signature_index, Constants.CONSTANT_Utf8); return c.getBytes(); } - - - - - - - - - } diff --git a/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java b/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java index 82c25424f..516fbad52 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java +++ b/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java @@ -32,7 +32,7 @@ import org.apache.tomcat.util.bcel.Constants; * @author M. Dahm * @see InnerClasses */ -public final class InnerClass implements Cloneable, Node, Serializable { +public final class InnerClass implements Cloneable, Serializable { private int inner_class_index; private int outer_class_index; diff --git a/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java b/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java index e41854a64..6e71d02af 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java +++ b/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java @@ -74,18 +74,6 @@ public final class InnerClasses extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitInnerClasses(this); - } - - - /** * Dump source file attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java b/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java index 6a5d196be..f5a24dac8 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java +++ b/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java @@ -38,13 +38,10 @@ import org.apache.tomcat.util.bcel.util.SyntheticRepository; * @see org.apache.tomcat.util.bcel.generic.ClassGen * @author M. Dahm */ -public class JavaClass extends AccessFlags implements Cloneable, Node, Comparable { +public class JavaClass extends AccessFlags implements Cloneable, Comparable { private String file_name; - private String package_name; private String source_file_name = ""; - private int class_name_index; - private int superclass_name_index; private String class_name; private String superclass_name; private int major, minor; // Compiler version @@ -55,11 +52,7 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl private Method[] methods; // methods defined in the class private Attribute[] attributes; // attributes defined in the class private AnnotationEntry[] annotations; // annotations defined on the class - private byte source = HEAP; // Generated in memory - private boolean isAnonymous = false; - private boolean isNested = false; - private boolean computedNestedTypeStatus = false; - public static final byte HEAP = 1; + public static final byte FILE = 2; public static final byte ZIP = 3; @@ -124,8 +117,6 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl if (methods == null) { methods = new Method[0]; } - this.class_name_index = class_name_index; - this.superclass_name_index = superclass_name_index; this.file_name = file_name; this.major = major; this.minor = minor; @@ -136,7 +127,6 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl this.methods = methods; this.attributes = attributes; annotationsOutOfDate = true; - this.source = source; // Get source file name if available for (int i = 0; i < attributes.length; i++) { if (attributes[i] instanceof SourceFile) { @@ -150,12 +140,6 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl */ class_name = constant_pool.getConstantString(class_name_index, Constants.CONSTANT_Class); class_name = Utility.compactClassName(class_name, false); - int index = class_name.lastIndexOf('.'); - if (index < 0) { - package_name = ""; - } else { - package_name = class_name.substring(0, index); - } if (superclass_name_index > 0) { // May be zero -> class is java.lang.Object superclass_name = constant_pool.getConstantString(superclass_name_index, @@ -366,27 +350,7 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl } - /** Equivalent to runtime "instanceof" operator. - * - * @return true if this JavaClass is derived from the super class - * @throws ClassNotFoundException if superclasses or superinterfaces - * of this object can't be found - */ - public final boolean instanceOf( JavaClass super_class ) throws ClassNotFoundException { - if (this.equals(super_class)) { - return true; - } - JavaClass[] super_classes = getSuperClasses(); - for (int i = 0; i < super_classes.length; i++) { - if (super_classes[i].equals(super_class)) { - return true; - } - } - if (super_class.isInterface()) { - return implementationOf(super_class); - } - return false; - } + /** diff --git a/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java b/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java index 8ac6b98d9..0df78a5b7 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java +++ b/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java @@ -30,7 +30,7 @@ import java.io.Serializable; * @author M. Dahm * @see LineNumberTable */ -public final class LineNumber implements Cloneable, Node, Serializable { +public final class LineNumber implements Cloneable, Serializable { private int start_pc; // Program Counter (PC) corresponds to line private int line_number; // number in source file diff --git a/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java b/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java index f1b145e26..e241879eb 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java +++ b/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java @@ -73,18 +73,6 @@ public final class LineNumberTable extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitLineNumberTable(this); - } - - - /** * Dump line number table attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java b/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java index 13c78a32a..5c6734c66 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java +++ b/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java @@ -31,7 +31,7 @@ import org.apache.tomcat.util.bcel.Constants; * @author M. Dahm * @see LocalVariableTable */ -public final class LocalVariable implements Constants, Cloneable, Node, Serializable { +public final class LocalVariable implements Constants, Cloneable, Serializable { private int start_pc; // Range in which the variable is valid private int length; diff --git a/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java b/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java index e13ca9299..9a6e9e03f 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java +++ b/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java @@ -72,18 +72,6 @@ public class LocalVariableTable extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitLocalVariableTable(this); - } - - - /** * Dump local variable table attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java b/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java index 7d97d2c82..ea17d804c 100755 --- a/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java +++ b/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java @@ -68,10 +68,6 @@ public class LocalVariableTypeTable extends Attribute { local_variable_type_table[i] = new LocalVariable(dis, cpool); } - public void accept(Visitor v) { - v.visitLocalVariableTypeTable(this); - } - public final void dump(DataOutputStream file) throws IOException { super.dump(file); diff --git a/java/org/apache/tomcat/util/bcel/classfile/Node.java b/java/org/apache/tomcat/util/bcel/classfile/Node.java deleted file mode 100644 index f5f67e006..000000000 --- a/java/org/apache/tomcat/util/bcel/classfile/Node.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.classfile; - -/** - * Denote class to have an accept method(); - * - * @version $Id$ - * @author M. Dahm - */ -public interface Node { - - -} diff --git a/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java b/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java index 0b0ac6f60..5ebc06644 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java +++ b/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java @@ -68,18 +68,6 @@ public final class PMGClass extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - System.err.println("Visiting non-standard PMGClass object"); - } - - - /** * Dump source file attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java b/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java index a1c5a37e7..ea50ac065 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java @@ -27,7 +27,7 @@ import org.apache.tomcat.util.bcel.Constants; * @author D. Brosius * @since 5.3 */ -public class ParameterAnnotationEntry implements Node, Constants { +public class ParameterAnnotationEntry implements Constants { private int annotation_table_length; private AnnotationEntry[] annotation_table; diff --git a/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java b/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java index 5c5ec9dc7..10ee72e1b 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java +++ b/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java @@ -66,18 +66,6 @@ public abstract class ParameterAnnotations extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - // v.visitParameterAnnotation(this); - } - - - /** * @param parameter_annotation_table the entries to set in this parameter annotation */ public final void setParameterAnnotationTable( diff --git a/java/org/apache/tomcat/util/bcel/classfile/Signature.java b/java/org/apache/tomcat/util/bcel/classfile/Signature.java index 7532ae552..0157a18e6 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Signature.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Signature.java @@ -16,7 +16,6 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.ByteArrayInputStream; import java.io.DataInput; import java.io.DataOutputStream; import java.io.IOException; @@ -66,19 +65,6 @@ public final class Signature extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - //System.err.println("Visiting non-standard Signature object"); - v.visitSignature(this); - } - - - /** * Dump source file attribute to file stream in binary format. * * @param file Output file stream @@ -106,17 +92,6 @@ public final class Signature extends Attribute { } /** - * Extends ByteArrayInputStream to make 'unreading' chars possible. - */ - private static final class MyByteArrayInputStream extends ByteArrayInputStream { - - MyByteArrayInputStream(String data) { - super(data.getBytes()); - } - } - - - /** * @return String representation */ public final String toString() { diff --git a/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java b/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java index 2be484d80..cfa1b2060 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java +++ b/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java @@ -74,18 +74,6 @@ public final class SourceFile extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitSourceFile(this); - } - - - /** * Dump source file attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/StackMap.java b/java/org/apache/tomcat/util/bcel/classfile/StackMap.java index 407e1501c..80be4009e 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/StackMap.java +++ b/java/org/apache/tomcat/util/bcel/classfile/StackMap.java @@ -36,7 +36,7 @@ import org.apache.tomcat.util.bcel.Constants; * @see StackMapEntry * @see StackMapType */ -public final class StackMap extends Attribute implements Node { +public final class StackMap extends Attribute { private int map_length; private StackMapEntry[] map; // Table of stack map entries @@ -128,19 +128,4 @@ public final class StackMap extends Attribute implements Node { c.constant_pool = _constant_pool; return c; } - - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitStackMap(this); - } - - - } diff --git a/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java b/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java index d933d8ad1..a5ce2b412 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java +++ b/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java @@ -37,7 +37,6 @@ public final class StackMapEntry implements Cloneable { private StackMapType[] types_of_locals; private int number_of_stack_items; private StackMapType[] types_of_stack_items; - private ConstantPool constant_pool; /** @@ -67,7 +66,6 @@ public final class StackMapEntry implements Cloneable { this.types_of_locals = types_of_locals; this.number_of_stack_items = number_of_stack_items; this.types_of_stack_items = types_of_stack_items; - this.constant_pool = constant_pool; } diff --git a/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java b/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java index cd437d961..37fdec37c 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java +++ b/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java @@ -36,7 +36,7 @@ import org.apache.tomcat.util.bcel.Constants; * @see StackMapEntry * @see StackMapType */ -public final class StackMapTable extends Attribute implements Node { +public final class StackMapTable extends Attribute { private int map_length; private StackMapTableEntry[] map; // Table of stack map entries @@ -128,19 +128,4 @@ public final class StackMapTable extends Attribute implements Node { c.constant_pool = _constant_pool; return c; } - - - /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitStackMapTable(this); - } - - - } diff --git a/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java b/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java index 5a3cbf238..76d79bcbf 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java +++ b/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java @@ -40,7 +40,6 @@ public final class StackMapTableEntry implements Cloneable { private StackMapType[] types_of_locals; private int number_of_stack_items; private StackMapType[] types_of_stack_items; - private ConstantPool constant_pool; /** @@ -102,7 +101,6 @@ public final class StackMapTableEntry implements Cloneable { this.types_of_locals = types_of_locals; this.number_of_stack_items = number_of_stack_items; this.types_of_stack_items = types_of_stack_items; - this.constant_pool = constant_pool; } diff --git a/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java b/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java index 680570095..d89bb507b 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java @@ -76,18 +76,6 @@ public final class Synthetic extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitSynthetic(this); - } - - - /** * Dump source file attribute to file stream in binary format. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/Unknown.java b/java/org/apache/tomcat/util/bcel/classfile/Unknown.java index 76fc60195..7a8c313c8 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Unknown.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Unknown.java @@ -88,18 +88,6 @@ public final class Unknown extends Attribute { /** - * Called by objects that are traversing the nodes of the tree implicitely - * defined by the contents of a Java class. I.e., the hierarchy of methods, - * fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ - public void accept( Visitor v ) { - v.visitUnknown(this); - } - - - /** * Dump unknown bytes to file stream. * * @param file Output file stream diff --git a/java/org/apache/tomcat/util/bcel/classfile/Utility.java b/java/org/apache/tomcat/util/bcel/classfile/Utility.java index 12ef5bf77..3ec73ed50 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Utility.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Utility.java @@ -16,11 +16,7 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.FilterReader; -import java.io.FilterWriter; import java.io.IOException; -import java.io.Reader; -import java.io.Writer; import org.apache.tomcat.util.bcel.Constants; import org.apache.tomcat.util.bcel.util.ByteSequence; @@ -855,7 +851,6 @@ public abstract class Utility { private static final int FREE_CHARS = 48; static int[] CHAR_MAP = new int[FREE_CHARS]; static int[] MAP_CHAR = new int[256]; // Reverse map - private static final char ESCAPE_CHAR = '$'; static { int j = 0; for (int i = 'A'; i <= 'Z'; i++) { @@ -875,93 +870,6 @@ public abstract class Utility { MAP_CHAR['_'] = j; } - /** Decode characters into bytes. - * Used by decode() - */ - private static class JavaReader extends FilterReader { - - public JavaReader(Reader in) { - super(in); - } - - - public int read() throws IOException { - int b = in.read(); - if (b != ESCAPE_CHAR) { - return b; - } - int i = in.read(); - if (i < 0) { - return -1; - } - if (((i >= '0') && (i <= '9')) || ((i >= 'a') && (i <= 'f'))) { // Normal escape - int j = in.read(); - if (j < 0) { - return -1; - } - char[] tmp = { - (char) i, (char) j - }; - int s = Integer.parseInt(new String(tmp), 16); - return s; - } - return MAP_CHAR[i]; - } - - - public int read( char[] cbuf, int off, int len ) throws IOException { - for (int i = 0; i < len; i++) { - cbuf[off + i] = (char) read(); - } - return len; - } - } - - /** Encode bytes into valid java identifier characters. - * Used by encode() - */ - private static class JavaWriter extends FilterWriter { - - public JavaWriter(Writer out) { - super(out); - } - - - public void write( int b ) throws IOException { - if (isJavaIdentifierPart((char) b) && (b != ESCAPE_CHAR)) { - out.write(b); - } else { - out.write(ESCAPE_CHAR); // Escape character - // Special escape - if (b >= 0 && b < FREE_CHARS) { - out.write(CHAR_MAP[b]); - } else { // Normal escape - char[] tmp = Integer.toHexString(b).toCharArray(); - if (tmp.length == 1) { - out.write('0'); - out.write(tmp[0]); - } else { - out.write(tmp[0]); - out.write(tmp[1]); - } - } - } - } - - - public void write( char[] cbuf, int off, int len ) throws IOException { - for (int i = 0; i < len; i++) { - write(cbuf[off + i]); - } - } - - - public void write( String str, int off, int len ) throws IOException { - write(str.toCharArray(), off, len); - } - } - - /** * Escape all occurences of newline chars '\n', quotes \", etc. */ diff --git a/java/org/apache/tomcat/util/bcel/classfile/Visitor.java b/java/org/apache/tomcat/util/bcel/classfile/Visitor.java deleted file mode 100644 index 5849b1306..000000000 --- a/java/org/apache/tomcat/util/bcel/classfile/Visitor.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.classfile; - -/** - * Interface to make use of the Visitor pattern programming style. I.e. a class - * that implements this interface can traverse the contents of a Java class just - * by calling the `accept' method which all classes have. - * - * @version $Id$ - * @author M. Dahm - */ -public interface Visitor -{ - public void visitCode(Code obj); - - - - public void visitConstantClass(ConstantClass obj); - - public void visitConstantDouble(ConstantDouble obj); - - public void visitConstantFieldref(ConstantFieldref obj); - - public void visitConstantFloat(ConstantFloat obj); - - public void visitConstantInteger(ConstantInteger obj); - - public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj); - - public void visitConstantLong(ConstantLong obj); - - public void visitConstantMethodref(ConstantMethodref obj); - - public void visitConstantNameAndType(ConstantNameAndType obj); - - - - public void visitConstantString(ConstantString obj); - - public void visitConstantUtf8(ConstantUtf8 obj); - - public void visitConstantValue(ConstantValue obj); - - public void visitDeprecated(Deprecated obj); - - public void visitExceptionTable(ExceptionTable obj); - - - - - - public void visitInnerClasses(InnerClasses obj); - - - - - - public void visitLineNumberTable(LineNumberTable obj); - - - - public void visitLocalVariableTable(LocalVariableTable obj); - - - - public void visitSignature(Signature obj); - - public void visitSourceFile(SourceFile obj); - - public void visitSynthetic(Synthetic obj); - - public void visitUnknown(Unknown obj); - - public void visitStackMap(StackMap obj); - - - - public void visitStackMapTable(StackMapTable obj); - - - - public void visitAnnotation(Annotations obj); - - - - - - - - public void visitLocalVariableTypeTable(LocalVariableTypeTable obj); - - public void visitEnclosingMethod(EnclosingMethod obj); -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ALOAD.java b/java/org/apache/tomcat/util/bcel/generic/ALOAD.java deleted file mode 100644 index 0bdba0371..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ALOAD.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * ALOAD - Load reference from local variable - *
Stack: ... -> ..., objectref
- * - * @version $Id$ - * @author M. Dahm - */ -public class ALOAD extends LoadInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - ALOAD() { - super(org.apache.tomcat.util.bcel.Constants.ALOAD, org.apache.tomcat.util.bcel.Constants.ALOAD_0); - } - - - /** Load reference from local variable - * @param n index of local variable - */ - public ALOAD(int n) { - super(org.apache.tomcat.util.bcel.Constants.ALOAD, org.apache.tomcat.util.bcel.Constants.ALOAD_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ANEWARRAY.java b/java/org/apache/tomcat/util/bcel/generic/ANEWARRAY.java deleted file mode 100644 index 355f1db7b..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ANEWARRAY.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * ANEWARRAY - Create new array of references - *
Stack: ..., count -> ..., arrayref
- * - * @version $Id$ - * @author M. Dahm - */ -public class ANEWARRAY extends CPInstruction implements LoadClass, AllocationInstruction, - ExceptionThrower, StackConsumer, StackProducer { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - ANEWARRAY() { - } - - - - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ASTORE.java b/java/org/apache/tomcat/util/bcel/generic/ASTORE.java deleted file mode 100644 index 5b6ec5bdb..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ASTORE.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * ASTORE - Store reference into local variable - *
Stack ..., objectref -> ... 
- * - * @version $Id$ - * @author M. Dahm - */ -public class ASTORE extends StoreInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - ASTORE() { - super(org.apache.tomcat.util.bcel.Constants.ASTORE, org.apache.tomcat.util.bcel.Constants.ASTORE_0); - } - - - /** Store reference into local variable - * @param n index of local variable - */ - public ASTORE(int n) { - super(org.apache.tomcat.util.bcel.Constants.ASTORE, org.apache.tomcat.util.bcel.Constants.ASTORE_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/BIPUSH.java b/java/org/apache/tomcat/util/bcel/generic/BIPUSH.java deleted file mode 100644 index 125010ad5..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/BIPUSH.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * BIPUSH - Push byte on stack - * - *
Stack: ... -> ..., value
- * - * @version $Id$ - * @author M. Dahm - */ -public class BIPUSH extends Instruction implements ConstantPushInstruction { - - private byte b; - - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - BIPUSH() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - */ - public void dump( DataOutputStream out ) throws IOException { - super.dump(out); - out.writeByte(b); - } - - - /** - * @return mnemonic for instruction - */ - public String toString( boolean verbose ) { - return super.toString(verbose) + " " + b; - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - length = 2; - b = bytes.readByte(); - } - - - public Number getValue() { - return new Integer(b); - } - - - /** @return Type.BYTE - */ - public Type getType( ConstantPoolGen cp ) { - return Type.BYTE; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/BREAKPOINT.java b/java/org/apache/tomcat/util/bcel/generic/BREAKPOINT.java deleted file mode 100644 index 5dcaed8b0..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/BREAKPOINT.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * BREAKPOINT, JVM dependent, ignored by default - * - * @version $Id$ - * @author M. Dahm - */ -public class BREAKPOINT extends Instruction { - - public BREAKPOINT() { - super(org.apache.tomcat.util.bcel.Constants.BREAKPOINT, (short) 1); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java b/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java index f800bb443..cfc7d42d6 100644 --- a/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java +++ b/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java @@ -43,15 +43,7 @@ public final class BranchHandle extends InstructionHandle { private static BranchHandle bh_list = null; // List of reusable handles - static final BranchHandle getBranchHandle( BranchInstruction i ) { - if (bh_list == null) { - return new BranchHandle(i); - } - BranchHandle bh = bh_list; - bh_list = (BranchHandle) bh.next; - bh.setInstruction(i); - return bh; - } + /** Handle adds itself to the list of resuable handles. diff --git a/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java b/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java index 3f2c2e76f..b36b8821e 100644 --- a/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java +++ b/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java @@ -158,12 +158,7 @@ public abstract class BranchInstruction extends Instruction implements Instructi } - /** - * @return target offset in byte code - */ - public final int getIndex() { - return index; - } + /** diff --git a/java/org/apache/tomcat/util/bcel/generic/CHECKCAST.java b/java/org/apache/tomcat/util/bcel/generic/CHECKCAST.java deleted file mode 100644 index b27395fbe..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/CHECKCAST.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * CHECKCAST - Check whether object is of given type - *
Stack: ..., objectref -> ..., objectref
- * - * @version $Id$ - * @author M. Dahm - */ -public class CHECKCAST extends CPInstruction implements LoadClass, ExceptionThrower, StackProducer, - StackConsumer { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - CHECKCAST() { - } - - - - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/CPInstruction.java b/java/org/apache/tomcat/util/bcel/generic/CPInstruction.java index eaf3e16fe..7043e2d89 100644 --- a/java/org/apache/tomcat/util/bcel/generic/CPInstruction.java +++ b/java/org/apache/tomcat/util/bcel/generic/CPInstruction.java @@ -48,13 +48,7 @@ public abstract class CPInstruction extends Instruction implements TypedInstruct } - /** - * @param index to constant pool - */ - protected CPInstruction(short opcode, int index) { - super(opcode, (short) 3); - setIndex(index); - } + /** diff --git a/java/org/apache/tomcat/util/bcel/generic/ClassGen.java b/java/org/apache/tomcat/util/bcel/generic/ClassGen.java index 130870a23..ab2969296 100644 --- a/java/org/apache/tomcat/util/bcel/generic/ClassGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/ClassGen.java @@ -16,10 +16,6 @@ */ package org.apache.tomcat.util.bcel.generic; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tomcat.util.bcel.Constants; import org.apache.tomcat.util.bcel.classfile.AccessFlags; import org.apache.tomcat.util.bcel.classfile.JavaClass; import org.apache.tomcat.util.bcel.util.BCELComparator; @@ -36,16 +32,7 @@ public class ClassGen extends AccessFlags implements Cloneable { /* Corresponds to the fields found in a JavaClass object. */ - private String class_name, super_class_name, file_name; - private int class_name_index = -1, superclass_name_index = -1; - private int major = Constants.MAJOR_1_1, minor = Constants.MINOR_1_1; - private ConstantPoolGen cp; // Template for building up constant pool - // ArrayLists instead of arrays to gather fields, methods, etc. - private List field_vec = new ArrayList(); - private List method_vec = new ArrayList(); - private List attribute_vec = new ArrayList(); - private List interface_vec = new ArrayList(); - private List annotation_vec = new ArrayList(); + private String class_name; private static BCELComparator _cmp = new BCELComparator() { @@ -61,88 +48,13 @@ public class ClassGen extends AccessFlags implements Cloneable { return THIS.getClassName().hashCode(); } }; - - - - - - - - public String getClassName() { return class_name; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - private ArrayList observers; - - - - - - - - - - - public Object clone() { try { return super.clone(); @@ -152,13 +64,7 @@ public class ClassGen extends AccessFlags implements Cloneable { } } - - - - - - /** * Return value as defined by given BCELComparator strategy. * By default two ClassGen objects are said to be equal when diff --git a/java/org/apache/tomcat/util/bcel/generic/CodeExceptionGen.java b/java/org/apache/tomcat/util/bcel/generic/CodeExceptionGen.java deleted file mode 100644 index e5fd00a3c..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/CodeExceptionGen.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import org.apache.tomcat.util.bcel.classfile.CodeException; - -/** - * This class represents an exception handler, i.e., specifies the region where - * a handler is active and an instruction where the actual handling is done. - * pool as parameters. Opposed to the JVM specification the end of the handled - * region is set to be inclusive, i.e. all instructions between start and end - * are protected including the start and end instructions (handles) themselves. - * The end of the region is automatically mapped to be exclusive when calling - * getCodeException(), i.e., there is no difference semantically. - * - * @version $Id$ - * @author M. Dahm - * @see MethodGen - * @see CodeException - * @see InstructionHandle - */ -public final class CodeExceptionGen implements InstructionTargeter, Cloneable, java.io.Serializable { - - private InstructionHandle start_pc; - private InstructionHandle end_pc; - private InstructionHandle handler_pc; - - - /** - * Add an exception handler, i.e., specify region where a handler is active and an - * instruction where the actual handling is done. - * - * @param start_pc Start of handled region (inclusive) - * @param end_pc End of handled region (inclusive) - * @param handler_pc Where handling is done - * @param catch_type which exception is handled, null for ANY - */ - public CodeExceptionGen(InstructionHandle start_pc, InstructionHandle end_pc, - InstructionHandle handler_pc, ObjectType catch_type) { - setStartPC(start_pc); - setEndPC(end_pc); - setHandlerPC(handler_pc); - } - - - - - - /* Set start of handler - * @param start_pc Start of handled region (inclusive) - */ - public void setStartPC( InstructionHandle start_pc ) { - BranchInstruction.notifyTarget(this.start_pc, start_pc, this); - this.start_pc = start_pc; - } - - - /* Set end of handler - * @param end_pc End of handled region (inclusive) - */ - public void setEndPC( InstructionHandle end_pc ) { - BranchInstruction.notifyTarget(this.end_pc, end_pc, this); - this.end_pc = end_pc; - } - - - /* Set handler code - * @param handler_pc Start of handler - */ - public void setHandlerPC( InstructionHandle handler_pc ) { - BranchInstruction.notifyTarget(this.handler_pc, handler_pc, this); - this.handler_pc = handler_pc; - } - - - - - - - - - - - - - - - - - - - - - - - - public String toString() { - return "CodeExceptionGen(" + start_pc + ", " + end_pc + ", " + handler_pc + ")"; - } - - - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - System.err.println(e); - return null; - } - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java b/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java index ca9a17ab9..b7a3d4fd9 100644 --- a/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java @@ -19,17 +19,11 @@ package org.apache.tomcat.util.bcel.generic; import java.util.HashMap; import java.util.Map; import org.apache.tomcat.util.bcel.classfile.Constant; -import org.apache.tomcat.util.bcel.classfile.ConstantClass; import org.apache.tomcat.util.bcel.classfile.ConstantDouble; -import org.apache.tomcat.util.bcel.classfile.ConstantFieldref; import org.apache.tomcat.util.bcel.classfile.ConstantFloat; import org.apache.tomcat.util.bcel.classfile.ConstantInteger; -import org.apache.tomcat.util.bcel.classfile.ConstantInterfaceMethodref; import org.apache.tomcat.util.bcel.classfile.ConstantLong; -import org.apache.tomcat.util.bcel.classfile.ConstantMethodref; -import org.apache.tomcat.util.bcel.classfile.ConstantNameAndType; import org.apache.tomcat.util.bcel.classfile.ConstantPool; -import org.apache.tomcat.util.bcel.classfile.ConstantString; import org.apache.tomcat.util.bcel.classfile.ConstantUtf8; /** @@ -51,9 +45,6 @@ public class ConstantPoolGen implements java.io.Serializable { protected int size; protected Constant[] constants; protected int index = 1; // First entry (0) used by JVM - private static final String METHODREF_DELIM = ":"; - private static final String IMETHODREF_DELIM = "#"; - private static final String FIELDREF_DELIM = "&"; private static final String NAT_DELIM = "%"; private static class Index implements java.io.Serializable { @@ -93,43 +84,6 @@ public class ConstantPoolGen implements java.io.Serializable { } } - private Map string_table = new HashMap(); - - - /** - * Look for ConstantString in ConstantPool containing String `str'. - * - * @param str String to search for - * @return index on success, -1 otherwise - */ - public int lookupString( String str ) { - Index index = (Index) string_table.get(str); - return (index != null) ? index.index : -1; - } - - - /** - * Add a new String constant to the ConstantPool, if it is not already in there. - * - * @param str String to add - * @return index of entry - */ - public int addString( String str ) { - int ret; - if ((ret = lookupString(str)) != -1) { - return ret; // Already in CP - } - int utf8 = addUtf8(str); - adjustSize(); - ConstantString s = new ConstantString(utf8); - ret = index; - constants[index++] = s; - if (!string_table.containsKey(str)) { - string_table.put(str, new Index(ret)); - } - return ret; - } - private Map class_table = new HashMap(); @@ -145,47 +99,6 @@ public class ConstantPoolGen implements java.io.Serializable { } - private int addClass_( String clazz ) { - int ret; - if ((ret = lookupClass(clazz)) != -1) { - return ret; // Already in CP - } - adjustSize(); - ConstantClass c = new ConstantClass(addUtf8(clazz)); - ret = index; - constants[index++] = c; - if (!class_table.containsKey(clazz)) { - class_table.put(clazz, new Index(ret)); - } - return ret; - } - - - /** - * Add a new Class reference to the ConstantPool, if it is not already in there. - * - * @param str Class to add - * @return index of entry - */ - public int addClass( String str ) { - return addClass_(str.replace('.', '/')); - } - - - /** - * Add a new Class reference to the ConstantPool for a given type. - * - * @param type Class to add - * @return index of entry - */ - public int addClass( ObjectType type ) { - return addClass(type.getClassName()); - } - - - - - /** * Look for ConstantInteger in ConstantPool. * @@ -387,175 +300,7 @@ public class ConstantPoolGen implements java.io.Serializable { return (_index != null) ? _index.index : -1; } - - /** - * Add a new NameAndType constant to the ConstantPool if it is not already - * in there. - * - * @param name Name string to add - * @param signature signature string to add - * @return index of entry - */ - public int addNameAndType( String name, String signature ) { - int ret; - int name_index, signature_index; - if ((ret = lookupNameAndType(name, signature)) != -1) { - return ret; // Already in CP - } - adjustSize(); - name_index = addUtf8(name); - signature_index = addUtf8(signature); - ret = index; - constants[index++] = new ConstantNameAndType(name_index, signature_index); - String key = name + NAT_DELIM + signature; - if (!n_a_t_table.containsKey(key)) { - n_a_t_table.put(key, new Index(ret)); - } - return ret; - } - - private Map cp_table = new HashMap(); - - - /** - * Look for ConstantMethodref in ConstantPool. - * - * @param class_name Where to find method - * @param method_name Guess what - * @param signature return and argument types - * @return index on success, -1 otherwise - */ - public int lookupMethodref( String class_name, String method_name, String signature ) { - Index index = (Index) cp_table.get(class_name + METHODREF_DELIM + method_name - + METHODREF_DELIM + signature); - return (index != null) ? index.index : -1; - } - - - - - - /** - * Add a new Methodref constant to the ConstantPool, if it is not already - * in there. - * - * @param class_name class name string to add - * @param method_name method name string to add - * @param signature method signature string to add - * @return index of entry - */ - public int addMethodref( String class_name, String method_name, String signature ) { - int ret, class_index, name_and_type_index; - if ((ret = lookupMethodref(class_name, method_name, signature)) != -1) { - return ret; // Already in CP - } - adjustSize(); - name_and_type_index = addNameAndType(method_name, signature); - class_index = addClass(class_name); - ret = index; - constants[index++] = new ConstantMethodref(class_index, name_and_type_index); - String key = class_name + METHODREF_DELIM + method_name + METHODREF_DELIM + signature; - if (!cp_table.containsKey(key)) { - cp_table.put(key, new Index(ret)); - } - return ret; - } - - - - - - /** - * Look for ConstantInterfaceMethodref in ConstantPool. - * - * @param class_name Where to find method - * @param method_name Guess what - * @param signature return and argument types - * @return index on success, -1 otherwise - */ - public int lookupInterfaceMethodref( String class_name, String method_name, String signature ) { - Index index = (Index) cp_table.get(class_name + IMETHODREF_DELIM + method_name - + IMETHODREF_DELIM + signature); - return (index != null) ? index.index : -1; - } - - - - - - /** - * Add a new InterfaceMethodref constant to the ConstantPool, if it is not already - * in there. - * - * @param class_name class name string to add - * @param method_name method name string to add - * @param signature signature string to add - * @return index of entry - */ - public int addInterfaceMethodref( String class_name, String method_name, String signature ) { - int ret, class_index, name_and_type_index; - if ((ret = lookupInterfaceMethodref(class_name, method_name, signature)) != -1) { - return ret; // Already in CP - } - adjustSize(); - class_index = addClass(class_name); - name_and_type_index = addNameAndType(method_name, signature); - ret = index; - constants[index++] = new ConstantInterfaceMethodref(class_index, name_and_type_index); - String key = class_name + IMETHODREF_DELIM + method_name + IMETHODREF_DELIM + signature; - if (!cp_table.containsKey(key)) { - cp_table.put(key, new Index(ret)); - } - return ret; - } - - - - - /** - * Look for ConstantFieldref in ConstantPool. - * - * @param class_name Where to find method - * @param field_name Guess what - * @param signature return and argument types - * @return index on success, -1 otherwise - */ - public int lookupFieldref( String class_name, String field_name, String signature ) { - Index index = (Index) cp_table.get(class_name + FIELDREF_DELIM + field_name - + FIELDREF_DELIM + signature); - return (index != null) ? index.index : -1; - } - - - /** - * Add a new Fieldref constant to the ConstantPool, if it is not already - * in there. - * - * @param class_name class name string to add - * @param field_name field name string to add - * @param signature signature string to add - * @return index of entry - */ - public int addFieldref( String class_name, String field_name, String signature ) { - int ret; - int class_index, name_and_type_index; - if ((ret = lookupFieldref(class_name, field_name, signature)) != -1) { - return ret; // Already in CP - } - adjustSize(); - class_index = addClass(class_name); - name_and_type_index = addNameAndType(field_name, signature); - ret = index; - constants[index++] = new ConstantFieldref(class_index, name_and_type_index); - String key = class_name + FIELDREF_DELIM + field_name + FIELDREF_DELIM + signature; - if (!cp_table.containsKey(key)) { - cp_table.put(key, new Index(ret)); - } - return ret; - } - - /** * @param i index in constant pool * @return constant pool entry at index i @@ -565,9 +310,6 @@ public class ConstantPoolGen implements java.io.Serializable { } - - - /** * @return intermediate constant pool */ diff --git a/java/org/apache/tomcat/util/bcel/generic/DLOAD.java b/java/org/apache/tomcat/util/bcel/generic/DLOAD.java deleted file mode 100644 index 21c3d3aae..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/DLOAD.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * DLOAD - Load double from local variable - *
Stack ... -> ..., result.word1, result.word2
- * - * @version $Id$ - * @author M. Dahm - */ -public class DLOAD extends LoadInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - DLOAD() { - super(org.apache.tomcat.util.bcel.Constants.DLOAD, org.apache.tomcat.util.bcel.Constants.DLOAD_0); - } - - - /** Load double from local variable - * @param n index of local variable - */ - public DLOAD(int n) { - super(org.apache.tomcat.util.bcel.Constants.DLOAD, org.apache.tomcat.util.bcel.Constants.DLOAD_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/DSTORE.java b/java/org/apache/tomcat/util/bcel/generic/DSTORE.java deleted file mode 100644 index acf573ad2..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/DSTORE.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * DSTORE - Store double into local variable - *
Stack: ..., value.word1, value.word2 -> ... 
- * - * @version $Id$ - * @author M. Dahm - */ -public class DSTORE extends StoreInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - DSTORE() { - super(org.apache.tomcat.util.bcel.Constants.DSTORE, org.apache.tomcat.util.bcel.Constants.DSTORE_0); - } - - - /** Store double into local variable - * @param n index of local variable - */ - public DSTORE(int n) { - super(org.apache.tomcat.util.bcel.Constants.DSTORE, org.apache.tomcat.util.bcel.Constants.DSTORE_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/FLOAD.java b/java/org/apache/tomcat/util/bcel/generic/FLOAD.java deleted file mode 100644 index 298dcf755..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/FLOAD.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * FLOAD - Load float from local variable - *
Stack ... -> ..., result
- * - * @version $Id$ - * @author M. Dahm - */ -public class FLOAD extends LoadInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - FLOAD() { - super(org.apache.tomcat.util.bcel.Constants.FLOAD, org.apache.tomcat.util.bcel.Constants.FLOAD_0); - } - - - /** Load float from local variable - * @param n index of local variable - */ - public FLOAD(int n) { - super(org.apache.tomcat.util.bcel.Constants.FLOAD, org.apache.tomcat.util.bcel.Constants.FLOAD_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/FSTORE.java b/java/org/apache/tomcat/util/bcel/generic/FSTORE.java deleted file mode 100644 index 869c4a62a..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/FSTORE.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * FSTORE - Store float into local variable - *
Stack: ..., value -> ... 
- * - * @version $Id$ - * @author M. Dahm - */ -public class FSTORE extends StoreInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - FSTORE() { - super(org.apache.tomcat.util.bcel.Constants.FSTORE, org.apache.tomcat.util.bcel.Constants.FSTORE_0); - } - - - /** Store float into local variable - * @param n index of local variable - */ - public FSTORE(int n) { - super(org.apache.tomcat.util.bcel.Constants.FSTORE, org.apache.tomcat.util.bcel.Constants.FSTORE_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/FieldGen.java b/java/org/apache/tomcat/util/bcel/generic/FieldGen.java index 79491c5bd..53907e1c1 100644 --- a/java/org/apache/tomcat/util/bcel/generic/FieldGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/FieldGen.java @@ -16,7 +16,6 @@ */ package org.apache.tomcat.util.bcel.generic; -import java.util.List; import org.apache.tomcat.util.bcel.classfile.Field; import org.apache.tomcat.util.bcel.classfile.Utility; import org.apache.tomcat.util.bcel.util.BCELComparator; @@ -60,18 +59,6 @@ public class FieldGen extends FieldGenOrMethodGen { return type.getSignature(); } - private List observers; - - - - - - - - - - - public String getInitValue() { if (value != null) { return value.toString(); diff --git a/java/org/apache/tomcat/util/bcel/generic/FieldGenOrMethodGen.java b/java/org/apache/tomcat/util/bcel/generic/FieldGenOrMethodGen.java index edf89e997..c32c18e52 100644 --- a/java/org/apache/tomcat/util/bcel/generic/FieldGenOrMethodGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/FieldGenOrMethodGen.java @@ -18,7 +18,6 @@ package org.apache.tomcat.util.bcel.generic; import java.util.ArrayList; import java.util.List; -import org.apache.tomcat.util.bcel.Constants; import org.apache.tomcat.util.bcel.classfile.AccessFlags; import org.apache.tomcat.util.bcel.classfile.Attribute; @@ -35,19 +34,14 @@ public abstract class FieldGenOrMethodGen extends AccessFlags implements NamedAn protected Type type; protected ConstantPoolGen cp; private List attribute_vec = new ArrayList(); - protected ArrayList annotation_vec= new ArrayList(); + protected FieldGenOrMethodGen() { } - public void setType( Type type ) { - if (type.getType() == Constants.T_ADDRESS) { - throw new IllegalArgumentException("Type can not be " + type); - } - this.type = type; - } + @@ -60,30 +54,16 @@ public abstract class FieldGenOrMethodGen extends AccessFlags implements NamedAn } - public void setName( String name ) { - this.name = name; - } + - public void setConstantPool( ConstantPoolGen cp ) { - this.cp = cp; - } + - /** - * Add an attribute to this method. Currently, the JVM knows about - * the `Code', `ConstantValue', `Synthetic' and `Exceptions' - * attributes. Other attributes will be ignored by the JVM but do no - * harm. - * - * @param a attribute to be added - */ - public void addAttribute( Attribute a ) { - attribute_vec.add(a); - } + diff --git a/java/org/apache/tomcat/util/bcel/generic/FieldOrMethod.java b/java/org/apache/tomcat/util/bcel/generic/FieldOrMethod.java index 8322e0375..56a6721b3 100644 --- a/java/org/apache/tomcat/util/bcel/generic/FieldOrMethod.java +++ b/java/org/apache/tomcat/util/bcel/generic/FieldOrMethod.java @@ -54,26 +54,7 @@ public abstract class FieldOrMethod extends CPInstruction implements LoadClass { - /** @return name of the referenced class/interface - * @deprecated If the instruction references an array class, - * this method will return "java.lang.Object". - * For code generated by Java 1.5, this answer is - * sometimes wrong (e.g., if the "clone()" method is - * called on an array). A better idea is to use - * the getReferenceType() method, which correctly distinguishes - * between class types and array types. - */ - public String getClassName( ConstantPoolGen cpg ) { - ConstantPool cp = cpg.getConstantPool(); - ConstantCP cmr = (ConstantCP) cp.getConstant(index); - String className = cp.getConstantString(cmr.getClassIndex(), - org.apache.tomcat.util.bcel.Constants.CONSTANT_Class); - if (className.startsWith("[")) { - // Turn array classes into java.lang.Object. - return "java.lang.Object"; - } - return className.replace('/', '.'); - } + diff --git a/java/org/apache/tomcat/util/bcel/generic/GETFIELD.java b/java/org/apache/tomcat/util/bcel/generic/GETFIELD.java deleted file mode 100644 index 1e69c394e..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/GETFIELD.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * GETFIELD - Fetch field from object - *
Stack: ..., objectref -> ..., value
- * OR - *
Stack: ..., objectref -> ..., value.word1, value.word2
- * - * @version $Id$ - * @author M. Dahm - */ -public class GETFIELD extends FieldInstruction implements ExceptionThrower, StackConsumer, - StackProducer { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - GETFIELD() { - } - - - - - - public int produceStack( ConstantPoolGen cpg ) { - return getFieldSize(cpg); - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/GETSTATIC.java b/java/org/apache/tomcat/util/bcel/generic/GETSTATIC.java deleted file mode 100644 index 3730797ec..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/GETSTATIC.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * GETSTATIC - Fetch static field from class - *
Stack: ..., -> ..., value
- * OR - *
Stack: ..., -> ..., value.word1, value.word2
- * - * @version $Id$ - * @author M. Dahm - */ -public class GETSTATIC extends FieldInstruction implements PushInstruction, ExceptionThrower { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - GETSTATIC() { - } - - - - - - public int produceStack( ConstantPoolGen cpg ) { - return getFieldSize(cpg); - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/GOTO.java b/java/org/apache/tomcat/util/bcel/generic/GOTO.java deleted file mode 100644 index 082265f58..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/GOTO.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; - -/** - * GOTO - Branch always (to relative offset, not absolute address) - * - * @version $Id$ - * @author M. Dahm - */ -public class GOTO extends GotoInstruction implements VariableLengthInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - GOTO() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - index = getTargetOffset(); - if (opcode == org.apache.tomcat.util.bcel.Constants.GOTO) { - super.dump(out); - } else { // GOTO_W - index = getTargetOffset(); - out.writeByte(opcode); - out.writeInt(index); - } - } - - - /** Called in pass 2 of InstructionList.setPositions() in order to update - * the branch target, that may shift due to variable length instructions. - */ - protected int updatePosition( int offset, int max_offset ) { - int i = getTargetOffset(); // Depending on old position value - position += offset; // Position may be shifted by preceding expansions - if (Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate) - opcode = org.apache.tomcat.util.bcel.Constants.GOTO_W; - length = 5; - return 2; // 5 - 3 - } - return 0; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/GOTO_W.java b/java/org/apache/tomcat/util/bcel/generic/GOTO_W.java deleted file mode 100644 index c678f32ca..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/GOTO_W.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * GOTO_W - Branch always (to relative offset, not absolute address) - * - * @version $Id$ - * @author M. Dahm - */ -public class GOTO_W extends GotoInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - GOTO_W() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - index = getTargetOffset(); - out.writeByte(opcode); - out.writeInt(index); - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - index = bytes.readInt(); - length = 5; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IINC.java b/java/org/apache/tomcat/util/bcel/generic/IINC.java deleted file mode 100644 index b152d50be..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IINC.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * IINC - Increment local variable by constant - * - * @version $Id$ - * @author M. Dahm - */ -public class IINC extends LocalVariableInstruction { - - private boolean wide; - private int c; - - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IINC() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - if (wide) { - out.writeByte(org.apache.tomcat.util.bcel.Constants.WIDE); - } - out.writeByte(opcode); - if (wide) { - out.writeShort(n); - out.writeShort(c); - } else { - out.writeByte(n); - out.writeByte(c); - } - } - - - private final void setWide() { - wide = (n > org.apache.tomcat.util.bcel.Constants.MAX_BYTE) || (Math.abs(c) > Byte.MAX_VALUE); - if (wide) { - length = 6; // wide byte included - } else { - length = 3; - } - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - this.wide = wide; - if (wide) { - length = 6; - n = bytes.readUnsignedShort(); - c = bytes.readShort(); - } else { - length = 3; - n = bytes.readUnsignedByte(); - c = bytes.readByte(); - } - } - - - /** - * @return mnemonic for instruction - */ - public String toString( boolean verbose ) { - return super.toString(verbose) + " " + c; - } - - - /** - * Set index of local variable. - */ - public final void setIndex( int n ) { - if (n < 0) { - throw new ClassGenException("Negative index value: " + n); - } - this.n = n; - setWide(); - } - - - - - - - - - /** @return int type - */ - public Type getType( ConstantPoolGen cp ) { - return Type.INT; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ILOAD.java b/java/org/apache/tomcat/util/bcel/generic/ILOAD.java deleted file mode 100644 index 33bbe6404..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ILOAD.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * ILOAD - Load int from local variable onto stack - *
Stack: ... -> ..., result
- * - * @version $Id$ - * @author M. Dahm - */ -public class ILOAD extends LoadInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - ILOAD() { - super(org.apache.tomcat.util.bcel.Constants.ILOAD, org.apache.tomcat.util.bcel.Constants.ILOAD_0); - } - - - /** Load int from local variable - * @param n index of local variable - */ - public ILOAD(int n) { - super(org.apache.tomcat.util.bcel.Constants.ILOAD, org.apache.tomcat.util.bcel.Constants.ILOAD_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IMPDEP1.java b/java/org/apache/tomcat/util/bcel/generic/IMPDEP1.java deleted file mode 100644 index 557c7cbb3..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IMPDEP1.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * IMPDEP1 - Implementation dependent - * - * @version $Id$ - * @author M. Dahm - */ -public class IMPDEP1 extends Instruction { - - public IMPDEP1() { - super(org.apache.tomcat.util.bcel.Constants.IMPDEP1, (short) 1); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IMPDEP2.java b/java/org/apache/tomcat/util/bcel/generic/IMPDEP2.java deleted file mode 100644 index 5469b0616..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IMPDEP2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * IMPDEP2 - Implementation dependent - * - * @version $Id$ - * @author M. Dahm - */ -public class IMPDEP2 extends Instruction { - - public IMPDEP2() { - super(org.apache.tomcat.util.bcel.Constants.IMPDEP2, (short) 1); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/INSTANCEOF.java b/java/org/apache/tomcat/util/bcel/generic/INSTANCEOF.java deleted file mode 100644 index d09f06eb0..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/INSTANCEOF.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * INSTANCEOF - Determine if object is of given type - *
Stack: ..., objectref -> ..., result
- * - * @version $Id$ - * @author M. Dahm - */ -public class INSTANCEOF extends CPInstruction implements LoadClass, ExceptionThrower, - StackProducer, StackConsumer { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - INSTANCEOF() { - } - - - - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/INVOKEINTERFACE.java b/java/org/apache/tomcat/util/bcel/generic/INVOKEINTERFACE.java deleted file mode 100644 index 703496bfe..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/INVOKEINTERFACE.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.classfile.ConstantPool; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * INVOKEINTERFACE - Invoke interface method - *
Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public final class INVOKEINTERFACE extends InvokeInstruction { - - private int nargs; // Number of arguments on stack (number of stack slots), called "count" in vmspec2 - - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - INVOKEINTERFACE() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - out.writeByte(opcode); - out.writeShort(index); - out.writeByte(nargs); - out.writeByte(0); - } - - - - - - /** - * Read needed data (i.e., index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - super.initFromFile(bytes, wide); - length = 5; - nargs = bytes.readUnsignedByte(); - bytes.readByte(); // Skip 0 byte - } - - - /** - * @return mnemonic for instruction with symbolic references resolved - */ - public String toString( ConstantPool cp ) { - return super.toString(cp) + " " + nargs; - } - - - public int consumeStack( ConstantPoolGen cpg ) { // nargs is given in byte-code - return nargs; // nargs includes this reference - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/INVOKESPECIAL.java b/java/org/apache/tomcat/util/bcel/generic/INVOKESPECIAL.java deleted file mode 100644 index 9e17157d6..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/INVOKESPECIAL.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * INVOKESPECIAL - Invoke instance method; special handling for superclass, private - * and instance initialization method invocations - * - *
Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class INVOKESPECIAL extends InvokeInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - INVOKESPECIAL() { - } - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/INVOKESTATIC.java b/java/org/apache/tomcat/util/bcel/generic/INVOKESTATIC.java deleted file mode 100644 index 09d130dd3..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/INVOKESTATIC.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * INVOKESTATIC - Invoke a class (static) method - * - *
Stack: ..., [arg1, [arg2 ...]] -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class INVOKESTATIC extends InvokeInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - INVOKESTATIC() { - } - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/INVOKEVIRTUAL.java b/java/org/apache/tomcat/util/bcel/generic/INVOKEVIRTUAL.java deleted file mode 100644 index 37e6fc1f2..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/INVOKEVIRTUAL.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * INVOKEVIRTUAL - Invoke instance method; dispatch based on class - * - *
Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class INVOKEVIRTUAL extends InvokeInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - INVOKEVIRTUAL() { - } - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ISTORE.java b/java/org/apache/tomcat/util/bcel/generic/ISTORE.java deleted file mode 100644 index 9b8d27915..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ISTORE.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * ISTORE - Store int from stack into local variable - *
Stack: ..., value -> ... 
- * - * @version $Id$ - * @author M. Dahm - */ -public class ISTORE extends StoreInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - ISTORE() { - super(org.apache.tomcat.util.bcel.Constants.ISTORE, org.apache.tomcat.util.bcel.Constants.ISTORE_0); - } - - - /** Store int into local variable - * @param n index of local variable - */ - public ISTORE(int n) { - super(org.apache.tomcat.util.bcel.Constants.ISTORE, org.apache.tomcat.util.bcel.Constants.ISTORE_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/Instruction.java b/java/org/apache/tomcat/util/bcel/generic/Instruction.java index a46d0bc4c..3cd4f689b 100644 --- a/java/org/apache/tomcat/util/bcel/generic/Instruction.java +++ b/java/org/apache/tomcat/util/bcel/generic/Instruction.java @@ -113,327 +113,7 @@ public abstract class Instruction implements Cloneable, Serializable { } - /** - * Read an instruction from (byte code) input stream and return the - * appropiate object. - * - * @param bytes input stream bytes - * @return instruction object being read - */ - public static final Instruction readInstruction( ByteSequence bytes ) throws IOException { - boolean wide = false; - short opcode = (short) bytes.readUnsignedByte(); - Instruction obj = null; - if (opcode == Constants.WIDE) { // Read next opcode after wide byte - wide = true; - opcode = (short) bytes.readUnsignedByte(); - } - if (InstructionConstants.INSTRUCTIONS[opcode] != null) { - return InstructionConstants.INSTRUCTIONS[opcode]; // Used predefined immutable object, if available - } - - switch (opcode) { - case Constants.BIPUSH: - obj = new BIPUSH(); - break; - case Constants.SIPUSH: - obj = new SIPUSH(); - break; - case Constants.LDC: - obj = new LDC(); - break; - case Constants.LDC_W: - obj = new LDC_W(); - break; - case Constants.LDC2_W: - obj = new LDC2_W(); - break; - case Constants.ILOAD: - obj = new ILOAD(); - break; - case Constants.LLOAD: - obj = new LLOAD(); - break; - case Constants.FLOAD: - obj = new FLOAD(); - break; - case Constants.DLOAD: - obj = new DLOAD(); - break; - case Constants.ALOAD: - obj = new ALOAD(); - break; - case Constants.ILOAD_0: - obj = new ILOAD(0); - break; - case Constants.ILOAD_1: - obj = new ILOAD(1); - break; - case Constants.ILOAD_2: - obj = new ILOAD(2); - break; - case Constants.ILOAD_3: - obj = new ILOAD(3); - break; - case Constants.LLOAD_0: - obj = new LLOAD(0); - break; - case Constants.LLOAD_1: - obj = new LLOAD(1); - break; - case Constants.LLOAD_2: - obj = new LLOAD(2); - break; - case Constants.LLOAD_3: - obj = new LLOAD(3); - break; - case Constants.FLOAD_0: - obj = new FLOAD(0); - break; - case Constants.FLOAD_1: - obj = new FLOAD(1); - break; - case Constants.FLOAD_2: - obj = new FLOAD(2); - break; - case Constants.FLOAD_3: - obj = new FLOAD(3); - break; - case Constants.DLOAD_0: - obj = new DLOAD(0); - break; - case Constants.DLOAD_1: - obj = new DLOAD(1); - break; - case Constants.DLOAD_2: - obj = new DLOAD(2); - break; - case Constants.DLOAD_3: - obj = new DLOAD(3); - break; - case Constants.ALOAD_0: - obj = new ALOAD(0); - break; - case Constants.ALOAD_1: - obj = new ALOAD(1); - break; - case Constants.ALOAD_2: - obj = new ALOAD(2); - break; - case Constants.ALOAD_3: - obj = new ALOAD(3); - break; - case Constants.ISTORE: - obj = new ISTORE(); - break; - case Constants.LSTORE: - obj = new LSTORE(); - break; - case Constants.FSTORE: - obj = new FSTORE(); - break; - case Constants.DSTORE: - obj = new DSTORE(); - break; - case Constants.ASTORE: - obj = new ASTORE(); - break; - case Constants.ISTORE_0: - obj = new ISTORE(0); - break; - case Constants.ISTORE_1: - obj = new ISTORE(1); - break; - case Constants.ISTORE_2: - obj = new ISTORE(2); - break; - case Constants.ISTORE_3: - obj = new ISTORE(3); - break; - case Constants.LSTORE_0: - obj = new LSTORE(0); - break; - case Constants.LSTORE_1: - obj = new LSTORE(1); - break; - case Constants.LSTORE_2: - obj = new LSTORE(2); - break; - case Constants.LSTORE_3: - obj = new LSTORE(3); - break; - case Constants.FSTORE_0: - obj = new FSTORE(0); - break; - case Constants.FSTORE_1: - obj = new FSTORE(1); - break; - case Constants.FSTORE_2: - obj = new FSTORE(2); - break; - case Constants.FSTORE_3: - obj = new FSTORE(3); - break; - case Constants.DSTORE_0: - obj = new DSTORE(0); - break; - case Constants.DSTORE_1: - obj = new DSTORE(1); - break; - case Constants.DSTORE_2: - obj = new DSTORE(2); - break; - case Constants.DSTORE_3: - obj = new DSTORE(3); - break; - case Constants.ASTORE_0: - obj = new ASTORE(0); - break; - case Constants.ASTORE_1: - obj = new ASTORE(1); - break; - case Constants.ASTORE_2: - obj = new ASTORE(2); - break; - case Constants.ASTORE_3: - obj = new ASTORE(3); - break; - case Constants.IINC: - obj = new IINC(); - break; - case Constants.IFEQ: - obj = new IFEQ(); - break; - case Constants.IFNE: - obj = new IFNE(); - break; - case Constants.IFLT: - obj = new IFLT(); - break; - case Constants.IFGE: - obj = new IFGE(); - break; - case Constants.IFGT: - obj = new IFGT(); - break; - case Constants.IFLE: - obj = new IFLE(); - break; - case Constants.IF_ICMPEQ: - obj = new IF_ICMPEQ(); - break; - case Constants.IF_ICMPNE: - obj = new IF_ICMPNE(); - break; - case Constants.IF_ICMPLT: - obj = new IF_ICMPLT(); - break; - case Constants.IF_ICMPGE: - obj = new IF_ICMPGE(); - break; - case Constants.IF_ICMPGT: - obj = new IF_ICMPGT(); - break; - case Constants.IF_ICMPLE: - obj = new IF_ICMPLE(); - break; - case Constants.IF_ACMPEQ: - obj = new IF_ACMPEQ(); - break; - case Constants.IF_ACMPNE: - obj = new IF_ACMPNE(); - break; - case Constants.GOTO: - obj = new GOTO(); - break; - case Constants.JSR: - obj = new JSR(); - break; - case Constants.RET: - obj = new RET(); - break; - case Constants.TABLESWITCH: - obj = new TABLESWITCH(); - break; - case Constants.LOOKUPSWITCH: - obj = new LOOKUPSWITCH(); - break; - case Constants.GETSTATIC: - obj = new GETSTATIC(); - break; - case Constants.PUTSTATIC: - obj = new PUTSTATIC(); - break; - case Constants.GETFIELD: - obj = new GETFIELD(); - break; - case Constants.PUTFIELD: - obj = new PUTFIELD(); - break; - case Constants.INVOKEVIRTUAL: - obj = new INVOKEVIRTUAL(); - break; - case Constants.INVOKESPECIAL: - obj = new INVOKESPECIAL(); - break; - case Constants.INVOKESTATIC: - obj = new INVOKESTATIC(); - break; - case Constants.INVOKEINTERFACE: - obj = new INVOKEINTERFACE(); - break; - case Constants.NEW: - obj = new NEW(); - break; - case Constants.NEWARRAY: - obj = new NEWARRAY(); - break; - case Constants.ANEWARRAY: - obj = new ANEWARRAY(); - break; - case Constants.CHECKCAST: - obj = new CHECKCAST(); - break; - case Constants.INSTANCEOF: - obj = new INSTANCEOF(); - break; - case Constants.MULTIANEWARRAY: - obj = new MULTIANEWARRAY(); - break; - case Constants.IFNULL: - obj = new IFNULL(); - break; - case Constants.IFNONNULL: - obj = new IFNONNULL(); - break; - case Constants.GOTO_W: - obj = new GOTO_W(); - break; - case Constants.JSR_W: - obj = new JSR_W(); - break; - case Constants.BREAKPOINT: - obj = new BREAKPOINT(); - break; - case Constants.IMPDEP1: - obj = new IMPDEP1(); - break; - case Constants.IMPDEP2: - obj = new IMPDEP2(); - break; - default: - throw new ClassGenException("Illegal opcode detected: " + opcode); - - } - - if (wide - && !((obj instanceof LocalVariableInstruction) || (obj instanceof IINC) || (obj instanceof RET))) { - throw new ClassGenException("Illegal opcode after wide: " + opcode); - } - obj.setOpcode(opcode); - obj.initFromFile(bytes, wide); // Do further initializations, if any - return obj; - } + /** * This method also gives right results for instructions whose @@ -475,14 +155,6 @@ public abstract class Instruction implements Cloneable, Serializable { } - /** - * Needed in readInstruction. - */ - private void setOpcode( short opcode ) { - this.opcode = opcode; - } - - /** Some instructions may be reused, so don't do anything by default. */ void dispose() { diff --git a/java/org/apache/tomcat/util/bcel/generic/InstructionConstants.java b/java/org/apache/tomcat/util/bcel/generic/InstructionConstants.java deleted file mode 100644 index ba5c7be41..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/InstructionConstants.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * This interface contains shareable instruction objects. - * - * In order to save memory you can use some instructions multiply, - * since they have an immutable state and are directly derived from - * Instruction. I.e. they have no instance fields that could be - * changed. Since some of these instructions like ICONST_0 occur - * very frequently this can save a lot of time and space. This - * feature is an adaptation of the FlyWeight design pattern, we - * just use an array instead of a factory. - * - * The Instructions can also accessed directly under their names, so - * it's possible to write il.append(Instruction.ICONST_0); - * - * @version $Id$ - * @author M. Dahm - */ -public interface InstructionConstants { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** Get object via its opcode, for immutable instructions like - * branch instructions entries are set to null. - */ - public static final Instruction[] INSTRUCTIONS = new Instruction[256]; - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java b/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java index 29501ccd0..5c1be76cd 100644 --- a/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java +++ b/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java @@ -17,7 +17,6 @@ package org.apache.tomcat.util.bcel.generic; import java.util.HashSet; -import java.util.Map; import java.util.Set; import org.apache.tomcat.util.bcel.classfile.Utility; @@ -45,7 +44,6 @@ public class InstructionHandle implements java.io.Serializable { Instruction instruction; protected int i_position = -1; // byte code offset of instruction private Set targeters; - private Map attributes; public final InstructionHandle getNext() { @@ -91,18 +89,7 @@ public class InstructionHandle implements java.io.Serializable { private static InstructionHandle ih_list = null; // List of reusable handles - /** Factory method. - */ - static final InstructionHandle getInstructionHandle( Instruction i ) { - if (ih_list == null) { - return new InstructionHandle(i); - } else { - InstructionHandle ih = ih_list; - ih_list = ih.next; - ih.setInstruction(i); - return ih; - } - } + /** diff --git a/java/org/apache/tomcat/util/bcel/generic/InstructionList.java b/java/org/apache/tomcat/util/bcel/generic/InstructionList.java index 58be38c5b..94dd0cac6 100644 --- a/java/org/apache/tomcat/util/bcel/generic/InstructionList.java +++ b/java/org/apache/tomcat/util/bcel/generic/InstructionList.java @@ -17,8 +17,6 @@ package org.apache.tomcat.util.bcel.generic; import java.io.Serializable; -import java.util.List; -import org.apache.tomcat.util.bcel.Constants; /** * This class is a container for a list of first appended instruction - */ - public InstructionHandle append( InstructionHandle ih, InstructionList il ) { - if (il == null) { - throw new ClassGenException("Appending null InstructionList"); - } - if (il.isEmpty()) { - return ih; - } - InstructionHandle next = ih.next, ret = il.start; - ih.next = il.start; - il.start.prev = ih; - il.end.next = next; - if (next != null) { - next.prev = il.end; - } else { - end = il.end; // Update end ... - } - length += il.length; // Update length - il.clear(); - return ret; - } - - - - - - - - /** - * Append an instruction to the end of this list. - * - * @param ih instruction to append - */ - private void append( InstructionHandle ih ) { - if (isEmpty()) { - start = end = ih; - ih.next = ih.prev = null; - } else { - end.next = ih; - ih.prev = end; - ih.next = null; - end = ih; - } - length++; // Update length - } - - - /** - * Append an instruction to the end of this list. - * - * @param i instruction to append - * @return instruction handle of the appended instruction - */ - public InstructionHandle append( Instruction i ) { - InstructionHandle ih = InstructionHandle.getInstructionHandle(i); - append(ih); - return ih; - } - - - /** - * Append a branch instruction to the end of this list. - * - * @param i branch instruction to append - * @return branch instruction handle of the appended instruction - */ - public BranchHandle append( BranchInstruction i ) { - BranchHandle ih = BranchHandle.getBranchHandle(i); - append(ih); - return ih; - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -265,102 +72,6 @@ public class InstructionList implements Serializable { } - public void setPositions() { - setPositions(false); - } - - - /** - * Give all instructions their position number (offset in byte stream), i.e., - * make the list ready to be dumped. - * - * @param check Perform sanity checks, e.g. if all targeted instructions really belong - * to this list - */ - public void setPositions( boolean check ) { - int max_additional_bytes = 0, additional_bytes = 0; - int index = 0, count = 0; - int[] pos = new int[length]; - /* Pass 0: Sanity checks - */ - if (check) { - for (InstructionHandle ih = start; ih != null; ih = ih.next) { - Instruction i = ih.instruction; - if (i instanceof BranchInstruction) { // target instruction within list? - Instruction inst = ((BranchInstruction) i).getTarget().instruction; - if (!contains(inst)) { - throw new ClassGenException("Branch target of " - + Constants.OPCODE_NAMES[i.opcode] + ":" + inst - + " not in instruction list"); - } - if (i instanceof Select) { - InstructionHandle[] targets = ((Select) i).getTargets(); - for (int j = 0; j < targets.length; j++) { - inst = targets[j].instruction; - if (!contains(inst)) { - throw new ClassGenException("Branch target of " - + Constants.OPCODE_NAMES[i.opcode] + ":" + inst - + " not in instruction list"); - } - } - } - if (!(ih instanceof BranchHandle)) { - throw new ClassGenException("Branch instruction " - + Constants.OPCODE_NAMES[i.opcode] + ":" + inst - + " not contained in BranchHandle."); - } - } - } - } - /* Pass 1: Set position numbers and sum up the maximum number of bytes an - * instruction may be shifted. - */ - for (InstructionHandle ih = start; ih != null; ih = ih.next) { - Instruction i = ih.instruction; - ih.setPosition(index); - pos[count++] = index; - /* Get an estimate about how many additional bytes may be added, because - * BranchInstructions may have variable length depending on the target - * offset (short vs. int) or alignment issues (TABLESWITCH and - * LOOKUPSWITCH). - */ - switch (i.getOpcode()) { - case Constants.JSR: - case Constants.GOTO: - max_additional_bytes += 2; - break; - case Constants.TABLESWITCH: - case Constants.LOOKUPSWITCH: - max_additional_bytes += 3; - break; - } - index += i.getLength(); - } - /* Pass 2: Expand the variable-length (Branch)Instructions depending on - * the target offset (short or int) and ensure that branch targets are - * within this list. - */ - for (InstructionHandle ih = start; ih != null; ih = ih.next) { - additional_bytes += ih.updatePosition(additional_bytes, max_additional_bytes); - } - /* Pass 3: Update position numbers (which may have changed due to the - * preceding expansions), like pass 1. - */ - index = count = 0; - for (InstructionHandle ih = start; ih != null; ih = ih.next) { - Instruction i = ih.instruction; - ih.setPosition(index); - pos[count++] = index; - index += i.getLength(); - } - byte_positions = new int[count]; // Trim to proper size - System.arraycopy(pos, 0, byte_positions, 0, count); - } - - - - - @@ -382,30 +93,6 @@ public class InstructionList implements Serializable { } - - - - - - - - - - - - - - - - private void clear() { - start = end = null; - length = 0; - } - - - - - /** * @return start of list */ @@ -420,30 +107,4 @@ public class InstructionList implements Serializable { public InstructionHandle getEnd() { return end; } - - - - - - - - - - - - - - - - - private List observers; - - - - - - - - - } diff --git a/java/org/apache/tomcat/util/bcel/generic/JSR.java b/java/org/apache/tomcat/util/bcel/generic/JSR.java deleted file mode 100644 index cb84ee690..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/JSR.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; - -/** - * JSR - Jump to subroutine - * - * @version $Id$ - * @author M. Dahm - */ -public class JSR extends JsrInstruction implements VariableLengthInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - JSR() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - index = getTargetOffset(); - if (opcode == org.apache.tomcat.util.bcel.Constants.JSR) { - super.dump(out); - } else { // JSR_W - index = getTargetOffset(); - out.writeByte(opcode); - out.writeInt(index); - } - } - - - protected int updatePosition( int offset, int max_offset ) { - int i = getTargetOffset(); // Depending on old position value - position += offset; // Position may be shifted by preceding expansions - if (Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate) - opcode = org.apache.tomcat.util.bcel.Constants.JSR_W; - length = 5; - return 2; // 5 - 3 - } - return 0; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/JSR_W.java b/java/org/apache/tomcat/util/bcel/generic/JSR_W.java deleted file mode 100644 index b5faadd75..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/JSR_W.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * JSR_W - Jump to subroutine - * - * @version $Id$ - * @author M. Dahm - */ -public class JSR_W extends JsrInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - JSR_W() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - index = getTargetOffset(); - out.writeByte(opcode); - out.writeInt(index); - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - index = bytes.readInt(); - length = 5; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/JsrInstruction.java b/java/org/apache/tomcat/util/bcel/generic/JsrInstruction.java index 241cf2a64..667e5d9ca 100644 --- a/java/org/apache/tomcat/util/bcel/generic/JsrInstruction.java +++ b/java/org/apache/tomcat/util/bcel/generic/JsrInstruction.java @@ -36,42 +36,8 @@ public abstract class JsrInstruction extends BranchInstruction implements Uncond } - /** @return return address type - */ - public Type getType( ConstantPoolGen cp ) { - return new ReturnaddressType(physicalSuccessor()); - } + - /** - * Returns an InstructionHandle to the physical successor - * of this JsrInstruction. For this method to work, - * this JsrInstruction object must not be shared between - * multiple InstructionHandle objects! - * Formally, there must not be InstructionHandle objects - * i, j where i != j and i.getInstruction() == this == - * j.getInstruction(). - * @return an InstructionHandle to the "next" instruction that - * will be executed when RETurned from a subroutine. - */ - public InstructionHandle physicalSuccessor() { - InstructionHandle ih = this.target; - // Rewind! - while (ih.getPrev() != null) { - ih = ih.getPrev(); - } - // Find the handle for "this" JsrInstruction object. - while (ih.getInstruction() != this) { - ih = ih.getNext(); - } - InstructionHandle toThis = ih; - while (ih != null) { - ih = ih.getNext(); - if ((ih != null) && (ih.getInstruction() == this)) { - throw new RuntimeException("physicalSuccessor() called on a shared JsrInstruction."); - } - } - // Return the physical successor - return toThis.getNext(); - } + } diff --git a/java/org/apache/tomcat/util/bcel/generic/LDC2_W.java b/java/org/apache/tomcat/util/bcel/generic/LDC2_W.java deleted file mode 100644 index 3872cd34c..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/LDC2_W.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * LDC2_W - Push long or double from constant pool - * - *
Stack: ... -> ..., item.word1, item.word2
- * - * @version $Id$ - * @author M. Dahm - */ -public class LDC2_W extends CPInstruction implements PushInstruction, TypedInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - LDC2_W() { - } - - - - - - public Type getType( ConstantPoolGen cpg ) { - switch (cpg.getConstantPool().getConstant(index).getTag()) { - case org.apache.tomcat.util.bcel.Constants.CONSTANT_Long: - return Type.LONG; - case org.apache.tomcat.util.bcel.Constants.CONSTANT_Double: - return Type.DOUBLE; - default: // Never reached - throw new RuntimeException("Unknown constant type " + opcode); - } - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LDC_W.java b/java/org/apache/tomcat/util/bcel/generic/LDC_W.java deleted file mode 100644 index e48a2dbda..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/LDC_W.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * LDC_W - Push item from constant pool (wide index) - * - *
Stack: ... -> ..., item.word1, item.word2
- * - * @version $Id$ - * @author M. Dahm - */ -public class LDC_W extends LDC { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - LDC_W() { - } - - - - - - /** - * Read needed data (i.e., index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - setIndex(bytes.readUnsignedShort()); - // Override just in case it has been changed - opcode = org.apache.tomcat.util.bcel.Constants.LDC_W; - length = 3; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LLOAD.java b/java/org/apache/tomcat/util/bcel/generic/LLOAD.java deleted file mode 100644 index b2ce86779..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/LLOAD.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * LLOAD - Load long from local variable - *
Stack ... -> ..., result.word1, result.word2
- * - * @version $Id$ - * @author M. Dahm - */ -public class LLOAD extends LoadInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - LLOAD() { - super(org.apache.tomcat.util.bcel.Constants.LLOAD, org.apache.tomcat.util.bcel.Constants.LLOAD_0); - } - - - public LLOAD(int n) { - super(org.apache.tomcat.util.bcel.Constants.LLOAD, org.apache.tomcat.util.bcel.Constants.LLOAD_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LOOKUPSWITCH.java b/java/org/apache/tomcat/util/bcel/generic/LOOKUPSWITCH.java deleted file mode 100644 index 08ca015c6..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/LOOKUPSWITCH.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * LOOKUPSWITCH - Switch with unordered set of values - * - * @version $Id$ - * @author M. Dahm - * @see SWITCH - */ -public class LOOKUPSWITCH extends Select { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - LOOKUPSWITCH() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - super.dump(out); - out.writeInt(match_length); // npairs - for (int i = 0; i < match_length; i++) { - out.writeInt(match[i]); // match-offset pairs - out.writeInt(indices[i] = getTargetOffset(targets[i])); - } - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - super.initFromFile(bytes, wide); // reads padding - match_length = bytes.readInt(); - fixed_length = (short) (9 + match_length * 8); - length = (short) (fixed_length + padding); - match = new int[match_length]; - indices = new int[match_length]; - targets = new InstructionHandle[match_length]; - for (int i = 0; i < match_length; i++) { - match[i] = bytes.readInt(); - indices[i] = bytes.readInt(); - } - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LSTORE.java b/java/org/apache/tomcat/util/bcel/generic/LSTORE.java deleted file mode 100644 index 6e5ca8ecc..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/LSTORE.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * LSTORE - Store long into local variable - *
Stack: ..., value.word1, value.word2 -> ... 
- * - * @version $Id$ - * @author M. Dahm - */ -public class LSTORE extends StoreInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - LSTORE() { - super(org.apache.tomcat.util.bcel.Constants.LSTORE, org.apache.tomcat.util.bcel.Constants.LSTORE_0); - } - - - public LSTORE(int n) { - super(org.apache.tomcat.util.bcel.Constants.LSTORE, org.apache.tomcat.util.bcel.Constants.LSTORE_0, n); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LineNumberGen.java b/java/org/apache/tomcat/util/bcel/generic/LineNumberGen.java deleted file mode 100644 index eafb2921a..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/LineNumberGen.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import org.apache.tomcat.util.bcel.classfile.LineNumber; - -/** - * This class represents a line number within a method, i.e., give an instruction - * a line number corresponding to the source code line. - * - * @version $Id$ - * @author M. Dahm - * @see LineNumber - * @see MethodGen - */ -public class LineNumberGen implements InstructionTargeter, Cloneable, java.io.Serializable { - - private InstructionHandle ih; - private int src_line; - - - /** - * Create a line number. - * - * @param ih instruction handle to reference - */ - public LineNumberGen(InstructionHandle ih, int src_line) { - setInstruction(ih); - setSourceLine(src_line); - } - - - - - - - - - /** - * Get LineNumber attribute . - * - * This relies on that the instruction list has already been dumped to byte code or - * or that the `setPositions' methods has been called for the instruction list. - */ - public LineNumber getLineNumber() { - return new LineNumber(ih.getPosition(), src_line); - } - - - public void setInstruction( InstructionHandle ih ) { - BranchInstruction.notifyTarget(this.ih, ih, this); - this.ih = ih; - } - - - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - System.err.println(e); - return null; - } - } - - - - - - public void setSourceLine( int src_line ) { - this.src_line = src_line; - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java b/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java index 1f478f742..97ebeb8a8 100644 --- a/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java @@ -76,9 +76,7 @@ public class LocalVariableGen implements InstructionTargeter, NamedAndTyped, Clo } - public void setName( String name ) { - this.name = name; - } + public String getName() { @@ -86,9 +84,7 @@ public class LocalVariableGen implements InstructionTargeter, NamedAndTyped, Clo } - public void setType( Type type ) { - this.type = type; - } + diff --git a/java/org/apache/tomcat/util/bcel/generic/MULTIANEWARRAY.java b/java/org/apache/tomcat/util/bcel/generic/MULTIANEWARRAY.java deleted file mode 100644 index 64ba8a611..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/MULTIANEWARRAY.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.classfile.ConstantPool; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * MULTIANEWARRAY - Create new mutidimensional array of references - *
Stack: ..., count1, [count2, ...] -> ..., arrayref
- * - * @version $Id$ - * @author M. Dahm - */ -public class MULTIANEWARRAY extends CPInstruction implements LoadClass, AllocationInstruction, - ExceptionThrower { - - private short dimensions; - - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - MULTIANEWARRAY() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - out.writeByte(opcode); - out.writeShort(index); - out.writeByte(dimensions); - } - - - /** - * Read needed data (i.e., no. dimension) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - super.initFromFile(bytes, wide); - dimensions = bytes.readByte(); - length = 4; - } - - - - - - /** - * @return mnemonic for instruction - */ - public String toString( boolean verbose ) { - return super.toString(verbose) + " " + index + " " + dimensions; - } - - - /** - * @return mnemonic for instruction with symbolic references resolved - */ - public String toString( ConstantPool cp ) { - return super.toString(cp) + " " + dimensions; - } - - - /** - * Also works for instructions whose stack effect depends on the - * constant pool entry they reference. - * @return Number of words consumed from stack by this instruction - */ - public int consumeStack( ConstantPoolGen cpg ) { - return dimensions; - } - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/MethodGen.java b/java/org/apache/tomcat/util/bcel/generic/MethodGen.java index 1cd16d095..d6f8599f7 100644 --- a/java/org/apache/tomcat/util/bcel/generic/MethodGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/MethodGen.java @@ -46,22 +46,10 @@ import org.apache.tomcat.util.bcel.util.BCELComparator; */ public class MethodGen extends FieldGenOrMethodGen { - private String class_name; private Type[] arg_types; - private String[] arg_names; - private int max_locals; - private int max_stack; private InstructionList il; - private boolean strip_attributes; private List variable_vec = new ArrayList(); - private List line_number_vec = new ArrayList(); - private List exception_vec = new ArrayList(); private List throws_vec = new ArrayList(); - private List code_attrs_vec = new ArrayList(); - - private List[] param_annotations; // Array of lists containing AnnotationGen objects - private boolean hasParameterAnnotations = false; - private boolean haveUnpackedParameterAnnotations = false; private static BCELComparator _cmp = new BCELComparator() { @@ -80,24 +68,6 @@ public class MethodGen extends FieldGenOrMethodGen { }; - - - - - - - - - - - - - - - - - - /** * Sort local variables by index */ @@ -169,153 +139,11 @@ public class MethodGen extends FieldGenOrMethodGen { } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public String getSignature() { return Type.getMethodSignature(type, arg_types); } - - - - - - - - - - - - - - - - private List observers; - - - - - - - - - - - /** * Return string representation close to declaration format, * `public static void main(String[]) throws IOException', e.g. diff --git a/java/org/apache/tomcat/util/bcel/generic/NEW.java b/java/org/apache/tomcat/util/bcel/generic/NEW.java deleted file mode 100644 index 749a4f0f3..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/NEW.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * NEW - Create new object - *
Stack: ... -> ..., objectref
- * - * @version $Id$ - * @author M. Dahm - */ -public class NEW extends CPInstruction implements LoadClass, AllocationInstruction, - ExceptionThrower, StackProducer { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - NEW() { - } - - - - - - - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java b/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java index 053a8cb4e..e8982c492 100644 --- a/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java +++ b/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java @@ -31,8 +31,8 @@ public interface NamedAndTyped { - public void setName( String name ); + - public void setType( Type type ); + } diff --git a/java/org/apache/tomcat/util/bcel/generic/ObjectType.java b/java/org/apache/tomcat/util/bcel/generic/ObjectType.java index 59908ac66..e1a5065bb 100644 --- a/java/org/apache/tomcat/util/bcel/generic/ObjectType.java +++ b/java/org/apache/tomcat/util/bcel/generic/ObjectType.java @@ -38,11 +38,7 @@ public class ObjectType extends ReferenceType { } - /** @return name of referenced class - */ - public String getClassName() { - return class_name; - } + /** @return a hash code value for the object. diff --git a/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java b/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java deleted file mode 100644 index d7eeba81e..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * PUTFIELD - Put field in object - *
Stack: ..., objectref, value -> ...
- * OR - *
Stack: ..., objectref, value.word1, value.word2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class PUTFIELD extends FieldInstruction implements PopInstruction, ExceptionThrower { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - PUTFIELD() { - } - - - - - - public int consumeStack( ConstantPoolGen cpg ) { - return getFieldSize(cpg) + 1; - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java b/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java deleted file mode 100644 index 251b2d19d..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -/** - * PUTSTATIC - Put static field in class - *
Stack: ..., value -> ...
- * OR - *
Stack: ..., value.word1, value.word2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class PUTSTATIC extends FieldInstruction implements ExceptionThrower, PopInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - PUTSTATIC() { - } - - - - - - public int consumeStack( ConstantPoolGen cpg ) { - return getFieldSize(cpg); - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/RET.java b/java/org/apache/tomcat/util/bcel/generic/RET.java deleted file mode 100644 index 573d31159..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/RET.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * RET - Return from subroutine - * - *
Stack: ... -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class RET extends Instruction implements IndexedInstruction, TypedInstruction { - - private boolean wide; - private int index; // index to local variable containg the return address - - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - RET() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - if (wide) { - out.writeByte(org.apache.tomcat.util.bcel.Constants.WIDE); - } - out.writeByte(opcode); - if (wide) { - out.writeShort(index); - } else { - out.writeByte(index); - } - } - - - private final void setWide() { - wide = index > org.apache.tomcat.util.bcel.Constants.MAX_BYTE; - if (wide) { - length = 4; // Including the wide byte - } else { - length = 2; - } - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - this.wide = wide; - if (wide) { - index = bytes.readUnsignedShort(); - length = 4; - } else { - index = bytes.readUnsignedByte(); - length = 2; - } - } - - - /** - * @return index of local variable containg the return address - */ - public final int getIndex() { - return index; - } - - - /** - * Set index of local variable containg the return address - */ - public final void setIndex( int n ) { - if (n < 0) { - throw new ClassGenException("Negative index value: " + n); - } - index = n; - setWide(); - } - - - /** - * @return mnemonic for instruction - */ - public String toString( boolean verbose ) { - return super.toString(verbose) + " " + index; - } - - - /** @return return address type - */ - public Type getType( ConstantPoolGen cp ) { - return ReturnaddressType.NO_TARGET; - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java b/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java deleted file mode 100644 index 08015730b..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import org.apache.tomcat.util.bcel.Constants; - -/** - * Returnaddress, the type JSR or JSR_W instructions push upon the stack. - * - * see vmspec2 �3.3.3 - * @version $Id$ - * @author Enver Haase - */ -public class ReturnaddressType extends Type { - - public static final ReturnaddressType NO_TARGET = new ReturnaddressType(); - private InstructionHandle returnTarget; - - - /** - * A Returnaddress [that doesn't know where to return to]. - */ - private ReturnaddressType() { - super(Constants.T_ADDRESS, ""); - } - - - /** - * Creates a ReturnaddressType object with a target. - */ - public ReturnaddressType(InstructionHandle returnTarget) { - super(Constants.T_ADDRESS, ""); - this.returnTarget = returnTarget; - } - - - /** @return a hash code value for the object. - */ - public int hashCode() { - if (returnTarget == null) { - return 0; - } - return returnTarget.hashCode(); - } - - - /** - * Returns if the two Returnaddresses refer to the same target. - */ - public boolean equals( Object rat ) { - if (!(rat instanceof ReturnaddressType)) { - return false; - } - ReturnaddressType that = (ReturnaddressType) rat; - if (this.returnTarget == null || that.returnTarget == null) { - return that.returnTarget == this.returnTarget; - } - return that.returnTarget.equals(this.returnTarget); - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java b/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java deleted file mode 100644 index 936773906..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * SIPUSH - Push short - * - *
Stack: ... -> ..., value
- * - * @version $Id$ - * @author M. Dahm - */ -public class SIPUSH extends Instruction implements ConstantPushInstruction { - - private short b; - - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - SIPUSH() { - } - - - - - - /** - * Dump instruction as short code to stream out. - */ - public void dump( DataOutputStream out ) throws IOException { - super.dump(out); - out.writeShort(b); - } - - - /** - * @return mnemonic for instruction - */ - public String toString( boolean verbose ) { - return super.toString(verbose) + " " + b; - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - length = 3; - b = bytes.readShort(); - } - - - public Number getValue() { - return new Integer(b); - } - - - -} diff --git a/java/org/apache/tomcat/util/bcel/generic/Select.java b/java/org/apache/tomcat/util/bcel/generic/Select.java index c6c244618..d08d6a912 100644 --- a/java/org/apache/tomcat/util/bcel/generic/Select.java +++ b/java/org/apache/tomcat/util/bcel/generic/Select.java @@ -195,12 +195,7 @@ public abstract class Select extends BranchInstruction implements VariableLength - /** - * @return array of match target offsets - */ - public int[] getIndices() { - return indices; - } + /** diff --git a/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java b/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java deleted file mode 100644 index 35dc981e6..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2000-2009 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.apache.tomcat.util.bcel.generic; - -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.tomcat.util.bcel.util.ByteSequence; - -/** - * TABLESWITCH - Switch within given range of values, i.e., low..high - * - * @version $Id$ - * @author M. Dahm - * @see SWITCH - */ -public class TABLESWITCH extends Select { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - TABLESWITCH() { - } - - - - - - /** - * Dump instruction as byte code to stream out. - * @param out Output stream - */ - public void dump( DataOutputStream out ) throws IOException { - super.dump(out); - int low = (match_length > 0) ? match[0] : 0; - out.writeInt(low); - int high = (match_length > 0) ? match[match_length - 1] : 0; - out.writeInt(high); - for (int i = 0; i < match_length; i++) { - out.writeInt(indices[i] = getTargetOffset(targets[i])); - } - } - - - /** - * Read needed data (e.g. index) from file. - */ - protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { - super.initFromFile(bytes, wide); - int low = bytes.readInt(); - int high = bytes.readInt(); - match_length = high - low + 1; - fixed_length = (short) (13 + match_length * 4); - length = (short) (fixed_length + padding); - match = new int[match_length]; - indices = new int[match_length]; - targets = new InstructionHandle[match_length]; - for (int i = low; i <= high; i++) { - match[i - low] = i; - } - for (int i = 0; i < match_length; i++) { - indices[i] = bytes.readInt(); - } - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/Type.java b/java/org/apache/tomcat/util/bcel/generic/Type.java index 1ede105e8..bc6b1d92e 100644 --- a/java/org/apache/tomcat/util/bcel/generic/Type.java +++ b/java/org/apache/tomcat/util/bcel/generic/Type.java @@ -235,7 +235,6 @@ public abstract class Type implements java.io.Serializable { static int getArgumentTypesSize( String signature ) { int res = 0; int index; - Type[] types; try { // Read all declarations between for `(' and `)' if (signature.charAt(0) != '(') { throw new ClassFormatException("Invalid method signature: " + signature); -- 2.11.0