Author: markt
Date: Sun Dec 6 01:03:55 2009
New Revision: 887625
URL: http://svn.apache.org/viewvc?rev=887625&view=rev
Log:
Last cleanup of unused code for today. Still more todo.
Removed:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ArrayType.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/CPInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/FieldInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/FieldOrMethod.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/GotoInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InvokeInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/JsrInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/LDC.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/LoadClass.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/LoadInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/LocalVariableInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ObjectType.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PopInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StoreInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/UnconditionalBranch.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ClassPath.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ClassQueue.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/util/Repository.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/util/SyntheticRepository.java
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BasicType.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/IndexedInstruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Instruction.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionList.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEWARRAY.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReferenceType.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Select.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Type.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/Constants.java Sun Dec 6
01:03:55 2009
@@ -24,13 +24,9 @@
*/
public interface Constants {
- /** Maximum value for an unsigned short.
- */
- public final static int MAX_SHORT = 65535; // 2^16 - 1
+
- /** Maximum value for an unsigned byte.
- */
- public final static int MAX_BYTE = 255; // 2^8 - 1
+
/** One of the access flags for fields, methods, or classes.
* @see #ACC_PUBLIC
@@ -135,29 +131,6 @@
/** Java VM opcode.
* @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
public static final short ALOAD = 25;
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short ILOAD_0 = 26;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short LLOAD_0 = 30;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short FLOAD_0 = 34;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short DLOAD_0 = 38;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short ALOAD_0 = 42;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short ALOAD_3 = 45;
/** Java VM opcode.
* @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
@@ -174,29 +147,6 @@
/** Java VM opcode.
* @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
public static final short ASTORE = 58;
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short ISTORE_0 = 59;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short LSTORE_0 = 63;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short FSTORE_0 = 67;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short DSTORE_0 = 71;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short ASTORE_0 = 75;
-
- /** Java VM opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
- public static final short ASTORE_3 = 78;
/** Java VM opcode.
* @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
@@ -321,16 +271,10 @@
* @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode
definitions in The Java Virtual Machine Specification</a> */
public static final short JSR_W = 201;
- /** JVM internal opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions.doc.html#60105">Reserved
opcodes in the Java Virtual Machine Specification</a> */
- public static final short BREAKPOINT = 202;
-
- /** JVM internal opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions.doc.html#60105">Reserved
opcodes in the Java Virtual Machine Specification</a> */
- public static final short IMPDEP1 = 254;
- /** JVM internal opcode.
- * @see <a
href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions.doc.html#60105">Reserved
opcodes in the Java Virtual Machine Specification</a> */
- public static final short IMPDEP2 = 255;
+
+
+
+
/** Illegal opcode. */
public static final short UNDEFINED = -1;
@@ -362,16 +306,13 @@
/** Void data type (non-standard). */
public static final byte T_VOID = 12; // Non-standard
- /** Array data type. */
- public static final byte T_ARRAY = 13;
+
/** Object data type. */
public static final byte T_OBJECT = 14;
- /** Reference data type (deprecated). */
- public static final byte T_REFERENCE = 14; // Deprecated
+
/** Unknown data type. */
public static final byte T_UNKNOWN = 15;
- /** Address data type. */
- public static final byte T_ADDRESS = 16;
+
/** The primitive type names corresponding to the T_XX constants,
* e.g., TYPE_NAMES[T_INT] = "int"
@@ -578,117 +519,9 @@
ILLEGAL_OPCODE, "impdep1", "impdep2"
};
- /**
- * Number of words consumed on operand stack by instructions.
- * Indexed by opcode. CONSUME_STACK[FALOAD] = number of words
- * consumed from the stack by a faload instruction.
- */
- public static final int[] CONSUME_STACK = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/, 0/*iconst_1*/,
- 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/, 0/*iconst_5*/, 0/*lconst_0*/,
- 0/*lconst_1*/, 0/*fconst_0*/, 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/,
- 0/*dconst_1*/, 0/*bipush*/, 0/*sipush*/, 0/*ldc*/, 0/*ldc_w*/,
0/*ldc2_w*/, 0/*iload*/,
- 0/*lload*/, 0/*fload*/, 0/*dload*/, 0/*aload*/, 0/*iload_0*/,
0/*iload_1*/, 0/*iload_2*/,
- 0/*iload_3*/, 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/,
0/*fload_0*/,
- 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/, 0/*dload_0*/, 0/*dload_1*/,
0/*dload_2*/,
- 0/*dload_3*/, 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/,
2/*iaload*/,
- 2/*laload*/, 2/*faload*/, 2/*daload*/, 2/*aaload*/, 2/*baload*/,
2/*caload*/, 2/*saload*/,
- 1/*istore*/, 2/*lstore*/, 1/*fstore*/, 2/*dstore*/, 1/*astore*/,
1/*istore_0*/,
- 1/*istore_1*/, 1/*istore_2*/, 1/*istore_3*/, 2/*lstore_0*/, 2/*lstore_1*/,
- 2/*lstore_2*/, 2/*lstore_3*/, 1/*fstore_0*/, 1/*fstore_1*/, 1/*fstore_2*/,
- 1/*fstore_3*/, 2/*dstore_0*/, 2/*dstore_1*/, 2/*dstore_2*/, 2/*dstore_3*/,
- 1/*astore_0*/, 1/*astore_1*/, 1/*astore_2*/, 1/*astore_3*/, 3/*iastore*/,
4/*lastore*/,
- 3/*fastore*/, 4/*dastore*/, 3/*aastore*/, 3/*bastore*/, 3/*castore*/,
3/*sastore*/,
- 1/*pop*/, 2/*pop2*/, 1/*dup*/, 2/*dup_x1*/, 3/*dup_x2*/, 2/*dup2*/,
3/*dup2_x1*/,
- 4/*dup2_x2*/, 2/*swap*/, 2/*iadd*/, 4/*ladd*/, 2/*fadd*/, 4/*dadd*/,
2/*isub*/, 4/*lsub*/,
- 2/*fsub*/, 4/*dsub*/, 2/*imul*/, 4/*lmul*/, 2/*fmul*/, 4/*dmul*/,
2/*idiv*/, 4/*ldiv*/,
- 2/*fdiv*/, 4/*ddiv*/, 2/*irem*/, 4/*lrem*/, 2/*frem*/, 4/*drem*/,
1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 2/*ishl*/, 3/*lshl*/, 2/*ishr*/, 3/*lshr*/,
2/*iushr*/, 3/*lushr*/,
- 2/*iand*/, 4/*land*/, 2/*ior*/, 4/*lor*/, 2/*ixor*/, 4/*lxor*/, 0/*iinc*/,
- 1/*i2l*/, 1/*i2f*/, 1/*i2d*/, 2/*l2i*/, 2/*l2f*/, 2/*l2d*/, 1/*f2i*/,
1/*f2l*/,
- 1/*f2d*/, 2/*d2i*/, 2/*d2l*/, 2/*d2f*/, 1/*i2b*/, 1/*i2c*/, 1/*i2s*/,
- 4/*lcmp*/, 2/*fcmpl*/, 2/*fcmpg*/, 4/*dcmpl*/, 4/*dcmpg*/, 1/*ifeq*/,
1/*ifne*/,
- 1/*iflt*/, 1/*ifge*/, 1/*ifgt*/, 1/*ifle*/, 2/*if_icmpeq*/,
2/*if_icmpne*/, 2/*if_icmplt*/,
- 2 /*if_icmpge*/, 2/*if_icmpgt*/, 2/*if_icmple*/, 2/*if_acmpeq*/,
2/*if_acmpne*/,
- 0/*goto*/, 0/*jsr*/, 0/*ret*/, 1/*tableswitch*/, 1/*lookupswitch*/,
1/*ireturn*/,
- 2/*lreturn*/, 1/*freturn*/, 2/*dreturn*/, 1/*areturn*/, 0/*return*/,
0/*getstatic*/,
- UNPREDICTABLE/*putstatic*/, 1/*getfield*/, UNPREDICTABLE/*putfield*/,
- UNPREDICTABLE/*invokevirtual*/, UNPREDICTABLE/*invokespecial*/,
- UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNDEFINED, 0/*new*/, 1/*newarray*/,
1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/,
1/*monitorenter*/,
- 1/*monitorexit*/, 0/*wide*/, UNPREDICTABLE/*multianewarray*/, 1/*ifnull*/,
1/*ifnonnull*/,
- 0/*goto_w*/, 0/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
+
- /**
- * Number of words produced onto operand stack by instructions.
- * Indexed by opcode. CONSUME_STACK[DALOAD] = number of words
- * consumed from the stack by a daload instruction.
- */
- public static final int[] PRODUCE_STACK = {
- 0/*nop*/, 1/*aconst_null*/, 1/*iconst_m1*/, 1/*iconst_0*/, 1/*iconst_1*/,
- 1/*iconst_2*/, 1/*iconst_3*/, 1/*iconst_4*/, 1/*iconst_5*/, 2/*lconst_0*/,
- 2/*lconst_1*/, 1/*fconst_0*/, 1/*fconst_1*/, 1/*fconst_2*/, 2/*dconst_0*/,
- 2/*dconst_1*/, 1/*bipush*/, 1/*sipush*/, 1/*ldc*/, 1/*ldc_w*/,
2/*ldc2_w*/, 1/*iload*/,
- 2/*lload*/, 1/*fload*/, 2/*dload*/, 1/*aload*/, 1/*iload_0*/,
1/*iload_1*/, 1/*iload_2*/,
- 1/*iload_3*/, 2/*lload_0*/, 2/*lload_1*/, 2/*lload_2*/, 2/*lload_3*/,
1/*fload_0*/,
- 1/*fload_1*/, 1/*fload_2*/, 1/*fload_3*/, 2/*dload_0*/, 2/*dload_1*/,
2/*dload_2*/,
- 2/*dload_3*/, 1/*aload_0*/, 1/*aload_1*/, 1/*aload_2*/, 1/*aload_3*/,
1/*iaload*/,
- 2/*laload*/, 1/*faload*/, 2/*daload*/, 1/*aaload*/, 1/*baload*/,
1/*caload*/, 1/*saload*/,
- 0/*istore*/, 0/*lstore*/, 0/*fstore*/, 0/*dstore*/, 0/*astore*/,
0/*istore_0*/,
- 0/*istore_1*/, 0/*istore_2*/, 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/,
- 0/*lstore_2*/, 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/, 0/*dstore_3*/,
- 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/, 0/*astore_3*/, 0/*iastore*/,
0/*lastore*/,
- 0/*fastore*/, 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/,
0/*sastore*/,
- 0/*pop*/, 0/*pop2*/, 2/*dup*/, 3/*dup_x1*/, 4/*dup_x2*/, 4/*dup2*/,
5/*dup2_x1*/,
- 6/*dup2_x2*/, 2/*swap*/, 1/*iadd*/, 2/*ladd*/, 1/*fadd*/, 2/*dadd*/,
1/*isub*/, 2/*lsub*/,
- 1/*fsub*/, 2/*dsub*/, 1/*imul*/, 2/*lmul*/, 1/*fmul*/, 2/*dmul*/,
1/*idiv*/, 2/*ldiv*/,
- 1/*fdiv*/, 2/*ddiv*/, 1/*irem*/, 2/*lrem*/, 1/*frem*/, 2/*drem*/,
1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 1/*ishl*/, 2/*lshl*/, 1/*ishr*/, 2/*lshr*/,
1/*iushr*/, 2/*lushr*/,
- 1/*iand*/, 2/*land*/, 1/*ior*/, 2/*lor*/, 1/*ixor*/, 2/*lxor*/,
- 0/*iinc*/, 2/*i2l*/, 1/*i2f*/, 2/*i2d*/, 1/*l2i*/, 1/*l2f*/, 2/*l2d*/,
1/*f2i*/,
- 2/*f2l*/, 2/*f2d*/, 1/*d2i*/, 2/*d2l*/, 1/*d2f*/,
- 1/*i2b*/, 1/*i2c*/, 1/*i2s*/, 1/*lcmp*/, 1/*fcmpl*/, 1/*fcmpg*/,
- 1/*dcmpl*/, 1/*dcmpg*/, 0/*ifeq*/, 0/*ifne*/, 0/*iflt*/, 0/*ifge*/,
0/*ifgt*/, 0/*ifle*/,
- 0/*if_icmpeq*/, 0/*if_icmpne*/, 0/*if_icmplt*/, 0/*if_icmpge*/,
0/*if_icmpgt*/,
- 0/*if_icmple*/, 0/*if_acmpeq*/, 0/*if_acmpne*/, 0/*goto*/, 1/*jsr*/,
0/*ret*/,
- 0/*tableswitch*/, 0/*lookupswitch*/, 0/*ireturn*/, 0/*lreturn*/,
0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/, UNPREDICTABLE/*getstatic*/,
0/*putstatic*/,
- UNPREDICTABLE/*getfield*/, 0/*putfield*/, UNPREDICTABLE/*invokevirtual*/,
- UNPREDICTABLE/*invokespecial*/, UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNDEFINED, 1/*new*/, 1/*newarray*/,
1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/,
0/*monitorenter*/,
- 0/*monitorexit*/, 0/*wide*/, 1/*multianewarray*/, 0/*ifnull*/,
0/*ifnonnull*/,
- 0/*goto_w*/, 1/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
+
/** Attributes and their corresponding names.
*/
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java
Sun Dec 6 01:03:55 2009
@@ -16,8 +16,6 @@
*/
package org.apache.tomcat.util.bcel.classfile;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* Super class for all objects that have modifiers like private, final, ...
* I.e. classes, fields, and methods.
@@ -103,9 +101,7 @@
- public final boolean isInterface() {
- return (access_flags & Constants.ACC_INTERFACE) != 0;
- }
+
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
Sun Dec 6 01:03:55 2009
@@ -42,7 +42,7 @@
*/
public Annotations(byte annotation_type, int name_index, int length,
DataInputStream file,
ConstantPool constant_pool, boolean isRuntimeVisible) throws
IOException {
- this(annotation_type, name_index, length, (AnnotationEntry[]) null,
constant_pool, isRuntimeVisible);
+ this(annotation_type, name_index, length, (AnnotationEntry[]) null,
constant_pool);
annotation_table_length = (file.readUnsignedShort());
annotation_table = new AnnotationEntry[annotation_table_length];
for (int i = 0; i < annotation_table_length; i++) {
@@ -59,7 +59,7 @@
* @param constant_pool Array of constants
*/
public Annotations(byte annotation_type, int name_index, int length,
- AnnotationEntry[] annotation_table, ConstantPool constant_pool ,
boolean isRuntimeVisible) {
+ AnnotationEntry[] annotation_table, ConstantPool constant_pool) {
super(annotation_type, name_index, length, constant_pool);
setAnnotationTable(annotation_table);
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
Sun Dec 6 01:03:55 2009
@@ -159,9 +159,7 @@
}
// Return the information we have gathered in a new object
return new JavaClass(class_name_index, superclass_name_index,
file_name, major, minor,
- access_flags, constant_pool, interfaces, fields, methods,
attributes, is_zip
- ? JavaClass.ZIP
- : JavaClass.FILE);
+ access_flags, constant_pool, interfaces, fields, methods,
attributes);
}
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java Sun
Dec 6 01:03:55 2009
@@ -18,13 +18,9 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Set;
import java.util.StringTokenizer;
-import java.util.TreeSet;
import org.apache.tomcat.util.bcel.Constants;
import org.apache.tomcat.util.bcel.util.BCELComparator;
-import org.apache.tomcat.util.bcel.util.ClassQueue;
-import org.apache.tomcat.util.bcel.util.SyntheticRepository;
/**
* Represents a Java class, i.e., the data structures, constant pool,
@@ -75,13 +71,6 @@
return THIS.getClassName().hashCode();
}
};
- /**
- * In cases where we go ahead and create something,
- * use the default SyntheticRepository, because we
- * don't know any better.
- */
- private transient org.apache.tomcat.util.bcel.util.Repository repository =
SyntheticRepository
- .getInstance();
/**
@@ -104,7 +93,7 @@
*/
public JavaClass(int class_name_index, int superclass_name_index, String
file_name, int major,
int minor, int access_flags, ConstantPool constant_pool, int[]
interfaces,
- Field[] fields, Method[] methods, Attribute[] attributes, byte
source) {
+ Field[] fields, Method[] methods, Attribute[] attributes) {
if (interfaces == null) {
interfaces = new int[0];
}
@@ -213,55 +202,6 @@
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * @return Names of implemented interfaces.
- */
- public String[] getInterfaceNames() {
- return interface_names;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * @return Superclass name.
- */
- public String getSuperclassName() {
- return superclass_name;
- }
-
-
/**
* @return String representing class contents.
*/
@@ -334,120 +274,6 @@
return (access_flags & Constants.ACC_SUPER) != 0;
}
-
-
-
-
-
-
-
- /**
- * Sets the ClassRepository which loaded the JavaClass.
- * Should be called immediately after parsing is done.
- */
- public void setRepository( org.apache.tomcat.util.bcel.util.Repository
repository ) {
- this.repository = repository;
- }
-
-
-
-
-
- /**
- * @return true, if this class is an implementation of interface inter
- * @throws ClassNotFoundException if superclasses or superinterfaces
- * of this class can't be found
- */
- public boolean implementationOf( JavaClass inter ) throws
ClassNotFoundException {
- if (!inter.isInterface()) {
- throw new IllegalArgumentException(inter.getClassName() + " is no
interface");
- }
- if (this.equals(inter)) {
- return true;
- }
- JavaClass[] super_interfaces = getAllInterfaces();
- for (int i = 0; i < super_interfaces.length; i++) {
- if (super_interfaces[i].equals(inter)) {
- return true;
- }
- }
- return false;
- }
-
-
- /**
- * @return the superclass for this JavaClass object, or null if this
- * is java.lang.Object
- * @throws ClassNotFoundException if the superclass can't be found
- */
- public JavaClass getSuperClass() throws ClassNotFoundException {
- if ("java.lang.Object".equals(getClassName())) {
- return null;
- }
- return repository.loadClass(getSuperclassName());
- }
-
-
- /**
- * @return list of super classes of this class in ascending order, i.e.,
- * java.lang.Object is always the last element
- * @throws ClassNotFoundException if any of the superclasses can't be found
- */
- public JavaClass[] getSuperClasses() throws ClassNotFoundException {
- JavaClass clazz = this;
- List allSuperClasses = new ArrayList();
- for (clazz = clazz.getSuperClass(); clazz != null; clazz =
clazz.getSuperClass()) {
- allSuperClasses.add(clazz);
- }
- return (JavaClass[]) allSuperClasses.toArray(new
JavaClass[allSuperClasses.size()]);
- }
-
-
- /**
- * Get interfaces directly implemented by this JavaClass.
- */
- public JavaClass[] getInterfaces() throws ClassNotFoundException {
- String[] _interfaces = getInterfaceNames();
- JavaClass[] classes = new JavaClass[_interfaces.length];
- for (int i = 0; i < _interfaces.length; i++) {
- classes[i] = repository.loadClass(_interfaces[i]);
- }
- return classes;
- }
-
-
- /**
- * Get all interfaces implemented by this JavaClass (transitively).
- */
- public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
- ClassQueue queue = new ClassQueue();
- Set allInterfaces = new TreeSet();
- queue.enqueue(this);
- while (!queue.empty()) {
- JavaClass clazz = queue.dequeue();
- JavaClass souper = clazz.getSuperClass();
- JavaClass[] _interfaces = clazz.getInterfaces();
- if (clazz.isInterface()) {
- allInterfaces.add(clazz);
- } else {
- if (souper != null) {
- queue.enqueue(souper);
- }
- }
- for (int i = 0; i < _interfaces.length; i++) {
- queue.enqueue(_interfaces[i]);
- }
- }
- return (JavaClass[]) allInterfaces.toArray(new
JavaClass[allInterfaces.size()]);
- }
-
-
-
-
-
-
-
-
/**
* Return value as defined by given BCELComparator strategy.
* By default two JavaClass objects are said to be equal when
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
Sun Dec 6 01:03:55 2009
@@ -45,7 +45,7 @@
* @throws IOException
*/
StackMapEntry(DataInputStream file, ConstantPool constant_pool) throws
IOException {
- this(file.readShort(), file.readShort(), null, -1, null,
constant_pool);
+ this(file.readShort(), file.readShort(), null, -1, null);
types_of_locals = new StackMapType[number_of_locals];
for (int i = 0; i < number_of_locals; i++) {
types_of_locals[i] = new StackMapType(file, constant_pool);
@@ -60,7 +60,7 @@
public StackMapEntry(int byte_code_offset, int number_of_locals,
StackMapType[] types_of_locals, int number_of_stack_items,
- StackMapType[] types_of_stack_items, ConstantPool constant_pool) {
+ StackMapType[] types_of_stack_items) {
this.byte_code_offset = byte_code_offset;
this.number_of_locals = number_of_locals;
this.types_of_locals = types_of_locals;
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
Sun Dec 6 01:03:55 2009
@@ -48,7 +48,7 @@
* @throws IOException
*/
StackMapTableEntry(DataInputStream file, ConstantPool constant_pool)
throws IOException {
- this(file.read(), -1, -1, null, -1, null, constant_pool);
+ this(file.read(), -1, -1, null, -1, null);
if (frame_type >= Constants.SAME_FRAME && frame_type <=
Constants.SAME_FRAME_MAX) {
byte_code_offset_delta = frame_type - Constants.SAME_FRAME;
@@ -94,7 +94,7 @@
public StackMapTableEntry(int tag, int byte_code_offset_delta, int
number_of_locals,
StackMapType[] types_of_locals, int number_of_stack_items,
- StackMapType[] types_of_stack_items, ConstantPool constant_pool) {
+ StackMapType[] types_of_stack_items) {
this.frame_type = tag;
this.byte_code_offset_delta = byte_code_offset_delta;
this.number_of_locals = number_of_locals;
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Sun
Dec 6 01:03:55 2009
@@ -705,45 +705,7 @@
- /**
- * Return type of signature as a byte value as defined in
<em>Constants</em>
- *
- * @param signature in format described above
- * @return type of signature
- * @see Constants
- */
- public static final byte typeOfSignature( String signature ) throws
ClassFormatException {
- try {
- switch (signature.charAt(0)) {
- case 'B':
- return Constants.T_BYTE;
- case 'C':
- return Constants.T_CHAR;
- case 'D':
- return Constants.T_DOUBLE;
- case 'F':
- return Constants.T_FLOAT;
- case 'I':
- return Constants.T_INT;
- case 'J':
- return Constants.T_LONG;
- case 'L':
- return Constants.T_REFERENCE;
- case '[':
- return Constants.T_ARRAY;
- case 'V':
- return Constants.T_VOID;
- case 'Z':
- return Constants.T_BOOLEAN;
- case 'S':
- return Constants.T_SHORT;
- default:
- throw new ClassFormatException("Invalid method signature:
" + signature);
- }
- } catch (StringIndexOutOfBoundsException e) {
- throw new ClassFormatException("Invalid method signature: " +
signature, e);
- }
- }
+
@@ -834,12 +796,7 @@
- /** @return true, if character is one of (a, ... z, A, ... Z, 0, ... 9, _)
- */
- public static boolean isJavaIdentifierPart( char ch ) {
- return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))
- || ((ch >= '0') && (ch <= '9')) || (ch == '_');
- }
+
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BasicType.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BasicType.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BasicType.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BasicType.java Sun
Dec 6 01:03:55 2009
@@ -40,30 +40,7 @@
}
- public static final BasicType getType( byte type ) {
- switch (type) {
- case Constants.T_VOID:
- return VOID;
- case Constants.T_BOOLEAN:
- return BOOLEAN;
- case Constants.T_BYTE:
- return BYTE;
- case Constants.T_SHORT:
- return SHORT;
- case Constants.T_CHAR:
- return CHAR;
- case Constants.T_INT:
- return INT;
- case Constants.T_LONG:
- return LONG;
- case Constants.T_DOUBLE:
- return DOUBLE;
- case Constants.T_FLOAT:
- return FLOAT;
- default:
- throw new ClassGenException("Invalid type: " + type);
- }
- }
+
/** @return a hash code value for the object.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchHandle.java Sun
Dec 6 01:03:55 2009
@@ -68,22 +68,6 @@
}
- protected int updatePosition( int offset, int max_offset ) {
- int x = bi.updatePosition(offset, max_offset);
- i_position = bi.position;
- return x;
- }
-
-
-
-
-
-
-
-
-
-
-
/**
* Set new contents. Old instruction is disposed and may not be used
anymore.
*/
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java
Sun Dec 6 01:03:55 2009
@@ -18,7 +18,6 @@
import java.io.DataOutputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.util.ByteSequence;
/**
* Abstract super class for branching instructions like GOTO, IFEQ, etc..
@@ -95,22 +94,6 @@
/**
- * Called by InstructionList.setPositions when setting the position for
every
- * instruction. In the presence of variable length instructions
`setPositions'
- * performs multiple passes over the instruction list to calculate the
- * correct (byte) positions and offsets by calling this function.
- *
- * @param offset additional offset caused by preceding (variable length)
instructions
- * @param max_offset the maximum offset that may be caused by these
instructions
- * @return additional offset caused by possible change of this
instruction's length
- */
- protected int updatePosition( int offset, int max_offset ) {
- position += offset;
- return 0;
- }
-
-
- /**
* Long output format:
*
* <position in byte code>
@@ -145,31 +128,6 @@
/**
- * Read needed data (e.g. index) from file. Conversion to a
InstructionHandle
- * is done in InstructionList(byte[]).
- *
- * @param bytes input stream
- * @param wide wide prefix?
- * @see InstructionList
- */
- protected void initFromFile( ByteSequence bytes, boolean wide ) throws
IOException {
- length = 3;
- index = bytes.readShort();
- }
-
-
-
-
-
- /**
- * @return target of branch instruction
- */
- public InstructionHandle getTarget() {
- return target;
- }
-
-
- /**
* Set branch target
* @param target branch target
*/
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ConstantPoolGen.java
Sun Dec 6 01:03:55 2009
@@ -45,7 +45,6 @@
protected int size;
protected Constant[] constants;
protected int index = 1; // First entry (0) used by JVM
- private static final String NAT_DELIM = "%";
private static class Index implements java.io.Serializable {
@@ -84,21 +83,6 @@
}
}
- private Map class_table = new HashMap();
-
-
- /**
- * Look for ConstantClass in ConstantPool named `str'.
- *
- * @param str String to search for
- * @return index on success, -1 otherwise
- */
- public int lookupClass( String str ) {
- Index index = (Index) class_table.get(str.replace('.', '/'));
- return (index != null) ? index.index : -1;
- }
-
-
/**
* Look for ConstantInteger in ConstantPool.
*
@@ -285,22 +269,6 @@
return ret;
}
- private Map n_a_t_table = new HashMap();
-
-
- /**
- * Look for ConstantNameAndType in ConstantPool.
- *
- * @param name of variable/method
- * @param signature of variable/method
- * @return index on success, -1 otherwise
- */
- public int lookupNameAndType( String name, String signature ) {
- Index _index = (Index) n_a_t_table.get(name + NAT_DELIM + signature);
- return (_index != null) ? _index.index : -1;
- }
-
-
/**
* @param i index in constant pool
* @return constant pool entry at index i
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/IndexedInstruction.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/IndexedInstruction.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/IndexedInstruction.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/IndexedInstruction.java
Sun Dec 6 01:03:55 2009
@@ -28,5 +28,5 @@
public int getIndex();
- public void setIndex( int index );
+
}
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Instruction.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Instruction.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Instruction.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Instruction.java Sun
Dec 6 01:03:55 2009
@@ -20,8 +20,6 @@
import java.io.IOException;
import java.io.Serializable;
import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.classfile.ConstantPool;
-import org.apache.tomcat.util.bcel.util.ByteSequence;
/**
* Abstract super class for all Java byte codes.
@@ -93,61 +91,6 @@
/**
- * @return mnemonic for instruction with sumbolic references resolved
- */
- public String toString( ConstantPool cp ) {
- return toString(false);
- }
-
-
-
-
-
- /**
- * Read needed data (e.g. index) from file.
- *
- * @param bytes byte sequence to read from
- * @param wide "wide" instruction flag
- */
- protected void initFromFile( ByteSequence bytes, boolean wide ) throws
IOException {
- }
-
-
-
-
- /**
- * This method also gives right results for instructions whose
- * effect on the stack depends on the constant pool entry they
- * reference.
- * @return Number of words consumed from stack by this instruction,
- * or Constants.UNPREDICTABLE, if this can not be computed statically
- */
- public int consumeStack( ConstantPoolGen cpg ) {
- return Constants.CONSUME_STACK[opcode];
- }
-
-
- /**
- * This method also gives right results for instructions whose
- * effect on the stack depends on the constant pool entry they
- * reference.
- * @return Number of words produced onto stack by this instruction,
- * or Constants.UNPREDICTABLE, if this can not be computed statically
- */
- public int produceStack( ConstantPoolGen cpg ) {
- return Constants.PRODUCE_STACK[opcode];
- }
-
-
- /**
- * @return this instructions opcode
- */
- public short getOpcode() {
- return opcode;
- }
-
-
- /**
* @return length (in bytes) of instruction
*/
public int getLength() {
@@ -160,13 +103,6 @@
void dispose() {
}
-
-
-
-
-
-
-
/** Check for equality, delegated to comparator
* @return true if that is an Instruction and has the same opcode
*/
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionHandle.java
Sun Dec 6 01:03:55 2009
@@ -40,20 +40,16 @@
*/
public class InstructionHandle implements java.io.Serializable {
- InstructionHandle next, prev; // Will be set from the outside
+ InstructionHandle next; // Will be set from the outside
Instruction instruction;
protected int i_position = -1; // byte code offset of instruction
private Set targeters;
- public final InstructionHandle getNext() {
- return next;
- }
+
- public final InstructionHandle getPrev() {
- return prev;
- }
+
public final Instruction getInstruction() {
@@ -88,26 +84,6 @@
private static InstructionHandle ih_list = null; // List of reusable
handles
-
-
-
-
- /**
- * Called by InstructionList.setPositions when setting the position for
every
- * instruction. In the presence of variable length instructions
`setPositions()'
- * performs multiple passes over the instruction list to calculate the
- * correct (byte) positions and offsets by calling this function.
- *
- * @param offset additional offset caused by preceding (variable length)
instructions
- * @param max_offset the maximum offset that may be caused by these
instructions
- * @return additional offset caused by possible change of this
instruction's length
- */
- protected int updatePosition( int offset, int max_offset ) {
- i_position += offset;
- return 0;
- }
-
-
/** @return the position, i.e., the byte code offset of the contained
* instruction. This is accurate only after
* InstructionList.setPositions() has been called.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionList.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionList.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionList.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/InstructionList.java
Sun Dec 6 01:03:55 2009
@@ -51,30 +51,6 @@
- /**
- * Search for given Instruction reference, start at beginning of list.
- *
- * @param i instruction to search for
- * @return instruction found on success, null otherwise
- */
- private InstructionHandle findInstruction1( Instruction i ) {
- for (InstructionHandle ih = start; ih != null; ih = ih.next) {
- if (ih.instruction == i) {
- return ih;
- }
- }
- return null;
- }
-
-
- public boolean contains( Instruction i ) {
- return findInstruction1(i) != null;
- }
-
-
-
-
-
public String toString() {
return toString(true);
}
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEWARRAY.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEWARRAY.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEWARRAY.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEWARRAY.java Sun Dec
6 01:03:55 2009
@@ -18,7 +18,6 @@
import java.io.DataOutputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.util.ByteSequence;
/**
* NEWARRAY - Create new array of basic type (int, short, ...)
@@ -75,16 +74,4 @@
public String toString( boolean verbose ) {
return super.toString(verbose) + " " +
org.apache.tomcat.util.bcel.Constants.TYPE_NAMES[type];
}
-
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile( ByteSequence bytes, boolean wide ) throws
IOException {
- type = bytes.readByte();
- length = 2;
- }
-
-
-
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReferenceType.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReferenceType.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReferenceType.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReferenceType.java
Sun Dec 6 01:03:55 2009
@@ -26,9 +26,7 @@
*/
public abstract class ReferenceType extends Type {
- protected ReferenceType(byte t, String s) {
- super(t, s);
- }
+
/** Class is non-abstract but not instantiable from the outside
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Select.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Select.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Select.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Select.java Sun Dec
6 01:03:55 2009
@@ -18,7 +18,6 @@
import java.io.DataOutputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.util.ByteSequence;
/**
* Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
@@ -51,32 +50,6 @@
-
-
- /**
- * Since this is a variable length instruction, it may shift the following
- * instructions which then need to update their position.
- *
- * Called by InstructionList.setPositions when setting the position for
every
- * instruction. In the presence of variable length instructions
`setPositions'
- * performs multiple passes over the instruction list to calculate the
- * correct (byte) positions and offsets by calling this function.
- *
- * @param offset additional offset caused by preceding (variable length)
instructions
- * @param max_offset the maximum offset that may be caused by these
instructions
- * @return additional offset caused by possible change of this
instruction's length
- */
- protected int updatePosition( int offset, int max_offset ) {
- position += offset; // Additional offset caused by preceding SWITCHs,
GOTOs, etc.
- short old_length = length;
- /* Alignment on 4-byte-boundary, + 1, because of tag byte.
- */
- padding = (4 - ((position + 1) % 4)) % 4;
- length = (short) (fixed_length + padding); // Update length
- return length - old_length;
- }
-
-
/**
* Dump instruction as byte code to stream out.
* @param out Output stream
@@ -92,19 +65,6 @@
/**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile( ByteSequence bytes, boolean wide ) throws
IOException {
- padding = (4 - (bytes.getIndex() % 4)) % 4; // Compute number of pad
bytes
- for (int i = 0; i < padding; i++) {
- bytes.readByte();
- }
- // Default branch target common for both cases (TABLESWITCH,
LOOKUPSWITCH)
- index = bytes.readInt();
- }
-
-
- /**
* @return mnemonic for instruction
*/
public String toString( boolean verbose ) {
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Type.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Type.java?rev=887625&r1=887624&r2=887625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Type.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/Type.java Sun Dec 6
01:03:55 2009
@@ -17,7 +17,6 @@
package org.apache.tomcat.util.bcel.generic;
import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.classfile.ClassFormatException;
import org.apache.tomcat.util.bcel.classfile.Utility;
/**
@@ -31,20 +30,15 @@
protected byte type;
protected String signature; // signature for the type
- /** Predefined constants
- */
- public static final BasicType VOID = new BasicType(Constants.T_VOID);
- public static final BasicType BOOLEAN = new BasicType(Constants.T_BOOLEAN);
- public static final BasicType INT = new BasicType(Constants.T_INT);
- public static final BasicType SHORT = new BasicType(Constants.T_SHORT);
- public static final BasicType BYTE = new BasicType(Constants.T_BYTE);
- public static final BasicType LONG = new BasicType(Constants.T_LONG);
- public static final BasicType DOUBLE = new BasicType(Constants.T_DOUBLE);
- public static final BasicType FLOAT = new BasicType(Constants.T_FLOAT);
- public static final BasicType CHAR = new BasicType(Constants.T_CHAR);
- public static final ObjectType OBJECT = new ObjectType("java.lang.Object");
- public static final ObjectType CLASS = new ObjectType("java.lang.Class");
- public static final ObjectType STRING = new ObjectType("java.lang.String");
+
+
+
+
+
+
+
+
+
@@ -87,28 +81,10 @@
}
- /**
- * @return type as defined in Constants
- */
- public byte getType() {
- return type;
- }
+
- /**
- * @return stack size of this type (2 for long and double, 0 for void, 1
otherwise)
- */
- public int getSize() {
- switch (type) {
- case Constants.T_DOUBLE:
- case Constants.T_LONG:
- return 2;
- case Constants.T_VOID:
- return 0;
- default:
- return 1;
- }
- }
+
/**
@@ -139,142 +115,4 @@
return buf.toString();
}
- private static ThreadLocal consumed_chars = new ThreadLocal() {
-
- protected Object initialValue() {
- return new Integer(0);
- }
- };//int consumed_chars=0; // Remember position in string, see
getArgumentTypes
-
-
- private static int unwrap( ThreadLocal tl ) {
- return ((Integer) tl.get()).intValue();
- }
-
-
- private static void wrap( ThreadLocal tl, int value ) {
- tl.set(new Integer(value));
- }
-
-
- /**
- * Convert signature to a Type object.
- * @param signature signature string such as Ljava/lang/String;
- * @return type object
- */
- public static final Type getType( String signature ) throws
StringIndexOutOfBoundsException {
- byte type = Utility.typeOfSignature(signature);
- if (type <= Constants.T_VOID) {
- //corrected concurrent private static field acess
- wrap(consumed_chars, 1);
- return BasicType.getType(type);
- } else if (type == Constants.T_ARRAY) {
- int dim = 0;
- do { // Count dimensions
- dim++;
- } while (signature.charAt(dim) == '[');
- // Recurse, but just once, if the signature is ok
- Type t = getType(signature.substring(dim));
- //corrected concurrent private static field acess
- // consumed_chars += dim; // update counter - is replaced by
- int _temp = unwrap(consumed_chars) + dim;
- wrap(consumed_chars, _temp);
- return new ArrayType(t, dim);
- } else { // type == T_REFERENCE
- int index = signature.indexOf(';'); // Look for closing `;'
- if (index < 0) {
- throw new ClassFormatException("Invalid signature: " +
signature);
- }
- //corrected concurrent private static field acess
- wrap(consumed_chars, index + 1); // "Lblabla;" `L' and `;' are
removed
- return new ObjectType(signature.substring(1, index).replace('/',
'.'));
- }
- }
-
-
- /**
- * Convert return value of a method (signature) to a Type object.
- *
- * @param signature signature string such as (Ljava/lang/String;)V
- * @return return type
- */
- public static Type getReturnType( String signature ) {
- try {
- // Read return type after `)'
- int index = signature.lastIndexOf(')') + 1;
- return getType(signature.substring(index));
- } catch (StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " +
signature, e);
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- private static int size(int coded) {
- return coded & 3;
- }
-
- private static int consumed(int coded) {
- return coded >> 2;
- }
-
- private static int encode(int size, int consumed) {
- return consumed << 2 | size;
- }
-
- static int getArgumentTypesSize( String signature ) {
- int res = 0;
- int index;
- try { // Read all declarations between for `(' and `)'
- if (signature.charAt(0) != '(') {
- throw new ClassFormatException("Invalid method signature: " +
signature);
- }
- index = 1; // current string position
- while (signature.charAt(index) != ')') {
- int coded = getTypeSize(signature.substring(index));
- res += size(coded);
- index += consumed(coded);
- }
- } catch (StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " +
signature, e);
- }
- return res;
- }
-
- static final int getTypeSize( String signature ) throws
StringIndexOutOfBoundsException {
- byte type = Utility.typeOfSignature(signature);
- if (type <= Constants.T_VOID) {
- return encode(BasicType.getType(type).getSize(), 1);
- } else if (type == Constants.T_ARRAY) {
- int dim = 0;
- do { // Count dimensions
- dim++;
- } while (signature.charAt(dim) == '[');
- // Recurse, but just once, if the signature is ok
- int consumed = consumed(getTypeSize(signature.substring(dim)));
- return encode(1, dim + consumed);
- } else { // type == T_REFERENCE
- int index = signature.indexOf(';'); // Look for closing `;'
- if (index < 0) {
- throw new ClassFormatException("Invalid signature: " +
signature);
- }
- return encode(1, index + 1);
- }
- }
-
-
- static int getReturnTypeSize(String signature) {
- int index = signature.lastIndexOf(')') + 1;
- return getTypeSize(signature.substring(index));
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]