tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r887610 [5/6] - in /tomcat/trunk/java/org/apache/tomcat/util/bcel: ./ classfile/ generic/ util/
Date Sat, 05 Dec 2009 23:22:52 GMT
Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/MethodGen.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/MethodGen.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/MethodGen.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/MethodGen.java Sat Dec  5 23:22:46 2009
@@ -17,26 +17,14 @@
 package org.apache.tomcat.util.bcel.generic;
 
 import java.util.ArrayList;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Stack;
-import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.classfile.AnnotationEntry;
-import org.apache.tomcat.util.bcel.classfile.Annotations;
 import org.apache.tomcat.util.bcel.classfile.Attribute;
 import org.apache.tomcat.util.bcel.classfile.Code;
-import org.apache.tomcat.util.bcel.classfile.CodeException;
 import org.apache.tomcat.util.bcel.classfile.ExceptionTable;
-import org.apache.tomcat.util.bcel.classfile.LineNumber;
-import org.apache.tomcat.util.bcel.classfile.LineNumberTable;
 import org.apache.tomcat.util.bcel.classfile.LocalVariable;
 import org.apache.tomcat.util.bcel.classfile.LocalVariableTable;
-import org.apache.tomcat.util.bcel.classfile.LocalVariableTypeTable;
 import org.apache.tomcat.util.bcel.classfile.Method;
-import org.apache.tomcat.util.bcel.classfile.ParameterAnnotationEntry;
-import org.apache.tomcat.util.bcel.classfile.ParameterAnnotations;
-import org.apache.tomcat.util.bcel.classfile.RuntimeVisibleParameterAnnotations;
 import org.apache.tomcat.util.bcel.classfile.Utility;
 import org.apache.tomcat.util.bcel.util.BCELComparator;
 
@@ -92,260 +80,22 @@
     };
 
 
-    /**
-     * Declare method. If the method is non-static the constructor
-     * automatically declares a local variable `$this' in slot 0. The
-     * actual code is contained in the `il' parameter, which may further
-     * manipulated by the user. But he must take care not to remove any
-     * instruction (handles) that are still referenced from this object.
-     *
-     * For example one may not add a local variable and later remove the
-     * instructions it refers to without causing havoc. It is safe
-     * however if you remove that local variable, too.
-     *
-     * @param access_flags access qualifiers
-     * @param return_type  method type
-     * @param arg_types argument types
-     * @param arg_names argument names (if this is null, default names will be provided
-     * for them)
-     * @param method_name name of method
-     * @param class_name class name containing this method (may be null, if you don't care)
-     * @param il instruction list associated with this method, may be null only for
-     * abstract or native methods
-     * @param cp constant pool
-     */
-    public MethodGen(int access_flags, Type return_type, Type[] arg_types, String[] arg_names,
-            String method_name, String class_name, InstructionList il, ConstantPoolGen cp) {
-        setAccessFlags(access_flags);
-        setType(return_type);
-        setArgumentTypes(arg_types);
-        setArgumentNames(arg_names);
-        setName(method_name);
-        setClassName(class_name);
-        setInstructionList(il);
-        setConstantPool(cp);
-        boolean abstract_ = isAbstract() || isNative();
-        InstructionHandle start = null;
-        InstructionHandle end = null;
-        if (!abstract_) {
-            start = il.getStart();
-            end = il.getEnd();
-            /* Add local variables, namely the implicit `this' and the arguments
-             */
-            if (!isStatic() && (class_name != null)) { // Instance method -> `this' is local var 0
-                addLocalVariable("this", new ObjectType(class_name), start, end);
-            }
-        }
-        if (arg_types != null) {
-            int size = arg_types.length;
-            for (int i = 0; i < size; i++) {
-                if (Type.VOID == arg_types[i]) {
-                    throw new ClassGenException("'void' is an illegal argument type for a method");
-                }
-            }
-            if (arg_names != null) { // Names for variables provided?
-                if (size != arg_names.length) {
-                    throw new ClassGenException("Mismatch in argument array lengths: " + size
-                            + " vs. " + arg_names.length);
-                }
-            } else { // Give them dummy names
-                arg_names = new String[size];
-                for (int i = 0; i < size; i++) {
-                    arg_names[i] = "arg" + i;
-                }
-                setArgumentNames(arg_names);
-            }
-            if (!abstract_) {
-                for (int i = 0; i < size; i++) {
-                    addLocalVariable(arg_names[i], arg_types[i], start, end);
-                }
-            }
-        }
-    }
+    
 
 
-    /**
-     * Instantiate from existing method.
-     *
-     * @param m method
-     * @param class_name class name containing this method
-     * @param cp constant pool
-     */
-    public MethodGen(Method m, String class_name, ConstantPoolGen cp) {
-        this(m.getAccessFlags(), Type.getReturnType(m.getSignature()), Type.getArgumentTypes(m
-                .getSignature()), null /* may be overridden anyway */
-        , m.getName(), class_name,
-                ((m.getAccessFlags() & (Constants.ACC_ABSTRACT | Constants.ACC_NATIVE)) == 0)
-                        ? new InstructionList(m.getCode().getCode())
-                        : null, cp);
-        Attribute[] attributes = m.getAttributes();
-        for (int i = 0; i < attributes.length; i++) {
-            Attribute a = attributes[i];
-            if (a instanceof Code) {
-                Code c = (Code) a;
-                setMaxStack(c.getMaxStack());
-                setMaxLocals(c.getMaxLocals());
-                CodeException[] ces = c.getExceptionTable();
-                if (ces != null) {
-                    for (int j = 0; j < ces.length; j++) {
-                        CodeException ce = ces[j];
-                        int type = ce.getCatchType();
-                        ObjectType c_type = null;
-                        if (type > 0) {
-                            String cen = m.getConstantPool().getConstantString(type,
-                                    Constants.CONSTANT_Class);
-                            c_type = new ObjectType(cen);
-                        }
-                        int end_pc = ce.getEndPC();
-                        int length = m.getCode().getCode().length;
-                        InstructionHandle end;
-                        if (length == end_pc) { // May happen, because end_pc is exclusive
-                            end = il.getEnd();
-                        } else {
-                            end = il.findHandle(end_pc);
-                            end = end.getPrev(); // Make it inclusive
-                        }
-                        addExceptionHandler(il.findHandle(ce.getStartPC()), end, il.findHandle(ce
-                                .getHandlerPC()), c_type);
-                    }
-                }
-                Attribute[] c_attributes = c.getAttributes();
-                for (int j = 0; j < c_attributes.length; j++) {
-                    a = c_attributes[j];
-                    if (a instanceof LineNumberTable) {
-                        LineNumber[] ln = ((LineNumberTable) a).getLineNumberTable();
-                        for (int k = 0; k < ln.length; k++) {
-                            LineNumber l = ln[k];
-                            InstructionHandle ih = il.findHandle(l.getStartPC());
-                            if (ih != null) {
-                                addLineNumber(ih, l.getLineNumber());
-                            }
-                        }
-                    } else if (a instanceof LocalVariableTable) {
-                        LocalVariable[] lv = ((LocalVariableTable) a).getLocalVariableTable();
-                        removeLocalVariables();
-                        for (int k = 0; k < lv.length; k++) {
-                            LocalVariable l = lv[k];
-                            InstructionHandle start = il.findHandle(l.getStartPC());
-                            InstructionHandle end = il.findHandle(l.getStartPC() + l.getLength());
-                            // Repair malformed handles
-                            if (null == start) {
-                                start = il.getStart();
-                            }
-                            if (null == end) {
-                                end = il.getEnd();
-                            }
-                            addLocalVariable(l.getName(), Type.getType(l.getSignature()), l
-                                    .getIndex(), start, end);
-                        }
-                    } else if (a instanceof LocalVariableTypeTable) {
-                        LocalVariable[] lv = ((LocalVariableTypeTable) a).getLocalVariableTypeTable();
-                        removeLocalVariables();
-                        for (int k = 0; k < lv.length; k++) {
-                            LocalVariable l = lv[k];
-                            InstructionHandle start = il.findHandle(l.getStartPC());
-                            InstructionHandle end = il.findHandle(l.getStartPC() + l.getLength());
-                            // Repair malformed handles
-                            if (null == start) {
-                                start = il.getStart();
-                            }
-                            if (null == end) {
-                                end = il.getEnd();
-                            }
-                            addLocalVariable(l.getName(), Type.getType(l.getSignature()), l
-                                    .getIndex(), start, end);
-                        }
-                    } else {
-                        addCodeAttribute(a);
-                    }
-                }
-            } else if (a instanceof ExceptionTable) {
-                String[] names = ((ExceptionTable) a).getExceptionNames();
-                for (int j = 0; j < names.length; j++) {
-                    addException(names[j]);
-                }
-            } else if (a instanceof Annotations) {
-    			Annotations runtimeAnnotations = (Annotations) a;
-    			AnnotationEntry[] aes = runtimeAnnotations.getAnnotationEntries();
-    			for (int k = 0; k < aes.length; k++) {
-    				AnnotationEntry element = aes[k];
-    				addAnnotationEntry(new AnnotationEntryGen(element, cp, false));
-    			}
-            } else {
-                addAttribute(a);
-            }
-        }
-    }
+    
 
 
-    /**
-     * Adds a local variable to this method.
-     *
-     * @param name variable name
-     * @param type variable type
-     * @param slot the index of the local variable, if type is long or double, the next available
-     * index is slot+2
-     * @param start from where the variable is valid
-     * @param end until where the variable is valid
-     * @return new local variable object
-     * @see LocalVariable
-     */
-    public LocalVariableGen addLocalVariable( String name, Type type, int slot,
-            InstructionHandle start, InstructionHandle end ) {
-        byte t = type.getType();
-        if (t != Constants.T_ADDRESS) {
-            int add = type.getSize();
-            if (slot + add > max_locals) {
-                max_locals = slot + add;
-            }
-            LocalVariableGen l = new LocalVariableGen(slot, name, type, start, end);
-            int i;
-            if ((i = variable_vec.indexOf(l)) >= 0) {
-                variable_vec.set(i, l);
-            } else {
-                variable_vec.add(l);
-            }
-            return l;
-        } else {
-            throw new IllegalArgumentException("Can not use " + type
-                    + " as type for local variable");
-        }
-    }
+    
 
 
-    /**
-     * Adds a local variable to this method and assigns an index automatically.
-     *
-     * @param name variable name
-     * @param type variable type
-     * @param start from where the variable is valid, if this is null,
-     * it is valid from the start
-     * @param end until where the variable is valid, if this is null,
-     * it is valid to the end
-     * @return new local variable object
-     * @see LocalVariable
-     */
-    public LocalVariableGen addLocalVariable( String name, Type type, InstructionHandle start,
-            InstructionHandle end ) {
-        return addLocalVariable(name, type, max_locals, start, end);
-    }
+    
 
 
-    /**
-     * Remove a local variable, its slot will not be reused, if you do not use addLocalVariable
-     * with an explicit index argument.
-     */
-    public void removeLocalVariable( LocalVariableGen l ) {
-        variable_vec.remove(l);
-    }
+    
 
 
-    /**
-     * Remove all local variables.
-     */
-    public void removeLocalVariables() {
-        variable_vec.clear();
-    }
+    
 
 
     /**
@@ -419,440 +169,119 @@
     }
 
 
-    /**
-     * Give an instruction a line number corresponding to the source code line.
-     *
-     * @param ih instruction to tag
-     * @return new line number object
-     * @see LineNumber
-     */
-    public LineNumberGen addLineNumber( InstructionHandle ih, int src_line ) {
-        LineNumberGen l = new LineNumberGen(ih, src_line);
-        line_number_vec.add(l);
-        return l;
-    }
-
-
-    /**
-     * Remove a line number.
-     */
-    public void removeLineNumber( LineNumberGen l ) {
-        line_number_vec.remove(l);
-    }
-
-
-    /**
-     * Remove all line numbers.
-     */
-    public void removeLineNumbers() {
-        line_number_vec.clear();
-    }
+    
 
 
-    /*
-     * @return array of line numbers
-     */
-    public LineNumberGen[] getLineNumbers() {
-        LineNumberGen[] lg = new LineNumberGen[line_number_vec.size()];
-        line_number_vec.toArray(lg);
-        return lg;
-    }
+    
 
 
-    /**
-     * @return `LineNumberTable' attribute of all the local variables of this method.
-     */
-    public LineNumberTable getLineNumberTable( ConstantPoolGen cp ) {
-        int size = line_number_vec.size();
-        LineNumber[] ln = new LineNumber[size];
-        try {
-            for (int i = 0; i < size; i++) {
-                ln[i] = ((LineNumberGen) line_number_vec.get(i)).getLineNumber();
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
-        } // Never occurs
-        return new LineNumberTable(cp.addUtf8("LineNumberTable"), 2 + ln.length * 4, ln, cp
-                .getConstantPool());
-    }
+    
 
 
-    /**
-     * 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 region (inclusive)
-     * @param end_pc End of region (inclusive)
-     * @param handler_pc Where handling is done
-     * @param catch_type class type of handled exception or null if any
-     * exception is handled
-     * @return new exception handler object
-     */
-    public CodeExceptionGen addExceptionHandler( InstructionHandle start_pc,
-            InstructionHandle end_pc, InstructionHandle handler_pc, ObjectType catch_type ) {
-        if ((start_pc == null) || (end_pc == null) || (handler_pc == null)) {
-            throw new ClassGenException("Exception handler target is null instruction");
-        }
-        CodeExceptionGen c = new CodeExceptionGen(start_pc, end_pc, handler_pc, catch_type);
-        exception_vec.add(c);
-        return c;
-    }
+    
 
 
-    /**
-     * Remove an exception handler.
-     */
-    public void removeExceptionHandler( CodeExceptionGen c ) {
-        exception_vec.remove(c);
-    }
+    
 
 
-    /**
-     * Remove all line numbers.
-     */
-    public void removeExceptionHandlers() {
-        exception_vec.clear();
-    }
+    
 
 
-    /*
-     * @return array of declared exception handlers
-     */
-    public CodeExceptionGen[] getExceptionHandlers() {
-        CodeExceptionGen[] cg = new CodeExceptionGen[exception_vec.size()];
-        exception_vec.toArray(cg);
-        return cg;
-    }
+    
 
 
-    /**
-     * @return code exceptions for `Code' attribute
-     */
-    private CodeException[] getCodeExceptions() {
-        int size = exception_vec.size();
-        CodeException[] c_exc = new CodeException[size];
-        try {
-            for (int i = 0; i < size; i++) {
-                CodeExceptionGen c = (CodeExceptionGen) exception_vec.get(i);
-                c_exc[i] = c.getCodeException(cp);
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
-        }
-        return c_exc;
-    }
+    
 
 
-    /**
-     * Add an exception possibly thrown by this method.
-     *
-     * @param class_name (fully qualified) name of exception
-     */
-    public void addException( String class_name ) {
-        throws_vec.add(class_name);
-    }
+    
 
 
-    /**
-     * Remove an exception.
-     */
-    public void removeException( String c ) {
-        throws_vec.remove(c);
-    }
+    
 
 
-    /**
-     * Remove all exceptions.
-     */
-    public void removeExceptions() {
-        throws_vec.clear();
-    }
+    
 
 
-    /*
-     * @return array of thrown exceptions
-     */
-    public String[] getExceptions() {
-        String[] e = new String[throws_vec.size()];
-        throws_vec.toArray(e);
-        return e;
-    }
+    
 
 
-    /**
-     * @return `Exceptions' attribute of all the exceptions thrown by this method.
-     */
-    private ExceptionTable getExceptionTable( ConstantPoolGen cp ) {
-        int size = throws_vec.size();
-        int[] ex = new int[size];
-        try {
-            for (int i = 0; i < size; i++) {
-                ex[i] = cp.addClass((String) throws_vec.get(i));
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
-        }
-        return new ExceptionTable(cp.addUtf8("Exceptions"), 2 + 2 * size, ex, cp.getConstantPool());
-    }
+    
 
 
-    /**
-     * Add an attribute to the code. Currently, the JVM knows about the
-     * LineNumberTable, LocalVariableTable and StackMap attributes,
-     * where the former two will be generated automatically and the
-     * latter is used for the MIDP only. Other attributes will be
-     * ignored by the JVM but do no harm.
-     *
-     * @param a attribute to be added
-     */
-    public void addCodeAttribute( Attribute a ) {
-        code_attrs_vec.add(a);
-    }
+    
 
 
-    /**
-     * Remove a code attribute.
-     */
-    public void removeCodeAttribute( Attribute a ) {
-        code_attrs_vec.remove(a);
-    }
+    
 
 
-    /**
-     * Remove all code attributes.
-     */
-    public void removeCodeAttributes() {
-        code_attrs_vec.clear();
-    }
+    
 
 
-    /**
-     * @return all attributes of this method.
-     */
-    public Attribute[] getCodeAttributes() {
-        Attribute[] attributes = new Attribute[code_attrs_vec.size()];
-        code_attrs_vec.toArray(attributes);
-        return attributes;
-    }
     
-    public void addAnnotationsAsAttribute(ConstantPoolGen cp) {
-      	Attribute[] attrs = Utility.getAnnotationAttributes(cp,annotation_vec);
-        for (int i = 0; i < attrs.length; i++) {
-    		addAttribute(attrs[i]);
-    	}
-      }
+    
+    
+      
       
-      public void addParameterAnnotationsAsAttribute(ConstantPoolGen cp) {
-      	if (!hasParameterAnnotations) return;
-      	Attribute[] attrs = Utility.getParameterAnnotationAttributes(cp,param_annotations);
-      	if (attrs!=null) {
-          for (int i = 0; i < attrs.length; i++) {
-    		  addAttribute(attrs[i]);
-    	  }
-      	}
-      }
 
 
-    /**
-     * Get method object. Never forget to call setMaxStack() or setMaxStack(max), respectively,
-     * before calling this method (the same applies for max locals).
-     *
-     * @return method object
-     */
-    public Method getMethod() {
-        String signature = getSignature();
-        int name_index = cp.addUtf8(name);
-        int signature_index = cp.addUtf8(signature);
-        /* Also updates positions of instructions, i.e., their indices
-         */
-        byte[] byte_code = null;
-        if (il != null) {
-            byte_code = il.getByteCode();
-        }
-        LineNumberTable lnt = null;
-        LocalVariableTable lvt = null;
-        /* Create LocalVariableTable and LineNumberTable attributes (for debuggers, e.g.)
-         */
-        if ((variable_vec.size() > 0) && !strip_attributes) {
-            addCodeAttribute(lvt = getLocalVariableTable(cp));
-        }
-        if ((line_number_vec.size() > 0) && !strip_attributes) {
-            addCodeAttribute(lnt = getLineNumberTable(cp));
-        }
-        Attribute[] code_attrs = getCodeAttributes();
-        /* Each attribute causes 6 additional header bytes
-         */
-        int attrs_len = 0;
-        for (int i = 0; i < code_attrs.length; i++) {
-            attrs_len += (code_attrs[i].getLength() + 6);
-        }
-        CodeException[] c_exc = getCodeExceptions();
-        int exc_len = c_exc.length * 8; // Every entry takes 8 bytes
-        Code code = null;
-        if ((il != null) && !isAbstract() && !isNative()) {
-            // Remove any stale code attribute
-            Attribute[] attributes = getAttributes();
-            for (int i = 0; i < attributes.length; i++) {
-                Attribute a = attributes[i];
-                if (a instanceof Code) {
-                    removeAttribute(a);
-                }
-            }
-            code = new Code(cp.addUtf8("Code"), 8 + byte_code.length + // prologue byte code
-                    2 + exc_len + // exceptions
-                    2 + attrs_len, // attributes
-                    max_stack, max_locals, byte_code, c_exc, code_attrs, cp.getConstantPool());
-            addAttribute(code);
-        }
-        addAnnotationsAsAttribute(cp);
-        addParameterAnnotationsAsAttribute(cp);
-        ExceptionTable et = null;
-        if (throws_vec.size() > 0) {
-            addAttribute(et = getExceptionTable(cp));
-            // Add `Exceptions' if there are "throws" clauses
-        }
-        Method m = new Method(access_flags, name_index, signature_index, getAttributes(), cp
-                .getConstantPool());
-        // Undo effects of adding attributes
-        if (lvt != null) {
-            removeCodeAttribute(lvt);
-        }
-        if (lnt != null) {
-            removeCodeAttribute(lnt);
-        }
-        if (code != null) {
-            removeAttribute(code);
-        }
-        if (et != null) {
-            removeAttribute(et);
-        }
-        return m;
-    }
+    
 
 
-    /**
-     * Remove all NOPs from the instruction list (if possible) and update every
-     * object refering to them, i.e., branch instructions, local variables and
-     * exception handlers.
-     */
-    public void removeNOPs() {
-        if (il != null) {
-            InstructionHandle next;
-            /* Check branch instructions.
-             */
-            for (InstructionHandle ih = il.getStart(); ih != null; ih = next) {
-                next = ih.next;
-                if ((next != null) && (ih.getInstruction() instanceof NOP)) {
-                    try {
-                        il.delete(ih);
-                    } catch (TargetLostException e) {
-                        InstructionHandle[] targets = e.getTargets();
-                        for (int i = 0; i < targets.length; i++) {
-                            InstructionTargeter[] targeters = targets[i].getTargeters();
-                            for (int j = 0; j < targeters.length; j++) {
-                                targeters[j].updateTarget(targets[i], next);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
+    
 
 
-    /**
-     * Set maximum number of local variables.
-     */
-    public void setMaxLocals( int m ) {
-        max_locals = m;
-    }
+    
 
 
-    public int getMaxLocals() {
-        return max_locals;
-    }
+    
 
 
-    /**
-     * Set maximum stack size for this method.
-     */
-    public void setMaxStack( int m ) {
-        max_stack = m;
-    }
+    
 
 
-    public int getMaxStack() {
-        return max_stack;
-    }
+    
 
 
-    /** @return class that contains this method
-     */
-    public String getClassName() {
-        return class_name;
-    }
+    
 
 
-    public void setClassName( String class_name ) {
-        this.class_name = class_name;
-    }
+    
 
 
-    public void setReturnType( Type return_type ) {
-        setType(return_type);
-    }
+    
 
 
-    public Type getReturnType() {
-        return getType();
-    }
+    
 
 
-    public void setArgumentTypes( Type[] arg_types ) {
-        this.arg_types = arg_types;
-    }
+    
 
 
-    public Type[] getArgumentTypes() {
-        return (Type[]) arg_types.clone();
-    }
+    
 
 
-    public void setArgumentType( int i, Type type ) {
-        arg_types[i] = type;
-    }
+    
 
 
-    public Type getArgumentType( int i ) {
-        return arg_types[i];
-    }
+    
 
 
-    public void setArgumentNames( String[] arg_names ) {
-        this.arg_names = arg_names;
-    }
+    
 
 
-    public String[] getArgumentNames() {
-        return (String[]) arg_names.clone();
-    }
+    
 
 
-    public void setArgumentName( int i, String name ) {
-        arg_names[i] = name;
-    }
+    
 
 
-    public String getArgumentName( int i ) {
-        return arg_names[i];
-    }
+    
 
 
-    public InstructionList getInstructionList() {
-        return il;
-    }
+    
 
 
-    public void setInstructionList( InstructionList il ) {
-        this.il = il;
-    }
+    
 
 
     public String getSignature() {
@@ -860,210 +289,31 @@
     }
 
 
-    /**
-     * Computes max. stack size by performing control flow analysis.
-     */
-    public void setMaxStack() {
-        if (il != null) {
-            max_stack = getMaxStack(cp, il, getExceptionHandlers());
-        } else {
-            max_stack = 0;
-        }
-    }
-
-
-    /**
-     * Compute maximum number of local variables.
-     */
-    public void setMaxLocals() {
-        if (il != null) {
-            int max = isStatic() ? 0 : 1;
-            if (arg_types != null) {
-                for (int i = 0; i < arg_types.length; i++) {
-                    max += arg_types[i].getSize();
-                }
-            }
-            for (InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) {
-                Instruction ins = ih.getInstruction();
-                if ((ins instanceof LocalVariableInstruction) || (ins instanceof RET)
-                        || (ins instanceof IINC)) {
-                    int index = ((IndexedInstruction) ins).getIndex()
-                            + ((TypedInstruction) ins).getType(cp).getSize();
-                    if (index > max) {
-                        max = index;
-                    }
-                }
-            }
-            max_locals = max;
-        } else {
-            max_locals = 0;
-        }
-    }
-
-
-    /** Do not/Do produce attributes code attributesLineNumberTable and
-     * LocalVariableTable, like javac -O
-     */
-    public void stripAttributes( boolean flag ) {
-        strip_attributes = flag;
-    }
-
-    static final class BranchTarget {
-
-        InstructionHandle target;
-        int stackDepth;
-
-
-        BranchTarget(InstructionHandle target, int stackDepth) {
-            this.target = target;
-            this.stackDepth = stackDepth;
-        }
-    }
-
-    static final class BranchStack {
-
-        Stack branchTargets = new Stack();
-        Hashtable visitedTargets = new Hashtable();
-
-
-        public void push( InstructionHandle target, int stackDepth ) {
-            if (visited(target)) {
-                return;
-            }
-            branchTargets.push(visit(target, stackDepth));
-        }
+    
 
 
-        public BranchTarget pop() {
-            if (!branchTargets.empty()) {
-                BranchTarget bt = (BranchTarget) branchTargets.pop();
-                return bt;
-            }
-            return null;
-        }
+    
 
 
-        private final BranchTarget visit( InstructionHandle target, int stackDepth ) {
-            BranchTarget bt = new BranchTarget(target, stackDepth);
-            visitedTargets.put(target, bt);
-            return bt;
-        }
+    
 
+    
 
-        private final boolean visited( InstructionHandle target ) {
-            return (visitedTargets.get(target) != null);
-        }
-    }
+    
 
 
-    /**
-     * Computes stack usage of an instruction list by performing control flow analysis.
-     *
-     * @return maximum stack depth used by method
-     */
-    public static int getMaxStack( ConstantPoolGen cp, InstructionList il, CodeExceptionGen[] et ) {
-        BranchStack branchTargets = new BranchStack();
-        /* Initially, populate the branch stack with the exception
-         * handlers, because these aren't (necessarily) branched to
-         * explicitly. in each case, the stack will have depth 1,
-         * containing the exception object.
-         */
-        for (int i = 0; i < et.length; i++) {
-            InstructionHandle handler_pc = et[i].getHandlerPC();
-            if (handler_pc != null) {
-                branchTargets.push(handler_pc, 1);
-            }
-        }
-        int stackDepth = 0, maxStackDepth = 0;
-        InstructionHandle ih = il.getStart();
-        while (ih != null) {
-            Instruction instruction = ih.getInstruction();
-            short opcode = instruction.getOpcode();
-            int delta = instruction.produceStack(cp) - instruction.consumeStack(cp);
-            stackDepth += delta;
-            if (stackDepth > maxStackDepth) {
-                maxStackDepth = stackDepth;
-            }
-            // choose the next instruction based on whether current is a branch.
-            if (instruction instanceof BranchInstruction) {
-                BranchInstruction branch = (BranchInstruction) instruction;
-                if (instruction instanceof Select) {
-                    // explore all of the select's targets. the default target is handled below.
-                    Select select = (Select) branch;
-                    InstructionHandle[] targets = select.getTargets();
-                    for (int i = 0; i < targets.length; i++) {
-                        branchTargets.push(targets[i], stackDepth);
-                    }
-                    // nothing to fall through to.
-                    ih = null;
-                } else if (!(branch instanceof IfInstruction)) {
-                    // if an instruction that comes back to following PC,
-                    // push next instruction, with stack depth reduced by 1.
-                    if (opcode == Constants.JSR || opcode == Constants.JSR_W) {
-                        branchTargets.push(ih.getNext(), stackDepth - 1);
-                    }
-                    ih = null;
-                }
-                // for all branches, the target of the branch is pushed on the branch stack.
-                // conditional branches have a fall through case, selects don't, and
-                // jsr/jsr_w return to the next instruction.
-                branchTargets.push(branch.getTarget(), stackDepth);
-            } else {
-                // check for instructions that terminate the method.
-                if (opcode == Constants.ATHROW || opcode == Constants.RET
-                        || (opcode >= Constants.IRETURN && opcode <= Constants.RETURN)) {
-                    ih = null;
-                }
-            }
-            // normal case, go to the next instruction.
-            if (ih != null) {
-                ih = ih.getNext();
-            }
-            // if we have no more instructions, see if there are any deferred branches to explore.
-            if (ih == null) {
-                BranchTarget bt = branchTargets.pop();
-                if (bt != null) {
-                    ih = bt.target;
-                    stackDepth = bt.stackDepth;
-                }
-            }
-        }
-        return maxStackDepth;
-    }
+    
 
     private List observers;
 
 
-    /** Add observer for this object.
-     */
-    public void addObserver( MethodObserver o ) {
-        if (observers == null) {
-            observers = new ArrayList();
-        }
-        observers.add(o);
-    }
+    
 
 
-    /** Remove observer for this object.
-     */
-    public void removeObserver( MethodObserver o ) {
-        if (observers != null) {
-            observers.remove(o);
-        }
-    }
+    
 
 
-    /** Call notify() method on all observers. This method is not called
-     * automatically whenever the state has changed, but has to be
-     * called by the user after he has finished editing the object.
-     */
-    public void update() {
-        if (observers != null) {
-            for (Iterator e = observers.iterator(); e.hasNext();) {
-                ((MethodObserver) e.next()).notify(this);
-            }
-        }
-    }
+    
 
 
     /**
@@ -1094,134 +344,10 @@
     }
 
 
-    /** @return deep copy of this method
-     */
-    public MethodGen copy( String class_name, ConstantPoolGen cp ) {
-        Method m = ((MethodGen) clone()).getMethod();
-        MethodGen mg = new MethodGen(m, class_name, this.cp);
-        if (this.cp != cp) {
-            mg.setConstantPool(cp);
-            mg.getInstructionList().replaceConstantPool(this.cp, cp);
-        }
-        return mg;
-    }
     
-    //J5TODO: Should param_annotations be an array of arrays? Rather than an array of lists, this
-    // is more likely to suggest to the caller it is readonly (which a List does not). 
-    /**
-     * Return a list of AnnotationGen objects representing parameter annotations
-     */
-    public List getAnnotationsOnParameter(int i) {
-    	ensureExistingParameterAnnotationsUnpacked();
-    	if (!hasParameterAnnotations || i>arg_types.length) return null;
-    	return param_annotations[i];
-    }
     
-    /**
-	 * Goes through the attributes on the method and identifies any that are
-	 * RuntimeParameterAnnotations, extracting their contents and storing them
-	 * as parameter annotations. There are two kinds of parameter annotation -
-	 * visible and invisible. Once they have been unpacked, these attributes are
-	 * deleted. (The annotations will be rebuilt as attributes when someone
-	 * builds a Method object out of this MethodGen object).
-	 */
-	private void ensureExistingParameterAnnotationsUnpacked()
-	{
-		if (haveUnpackedParameterAnnotations)
-			return;
-		// Find attributes that contain parameter annotation data
-		Attribute[] attrs = getAttributes();
-		ParameterAnnotations paramAnnVisAttr = null;
-		ParameterAnnotations paramAnnInvisAttr = null;
-		for (int i = 0; i < attrs.length; i++)
-		{
-			Attribute attribute = attrs[i];
-			if (attribute instanceof ParameterAnnotations)
-			{
-				// Initialize param_annotations
-				if (!hasParameterAnnotations)
-				{
-					param_annotations = new List[arg_types.length];
-					for (int j = 0; j < arg_types.length; j++)
-						param_annotations[j] = new ArrayList();
-				}
-				hasParameterAnnotations = true;
-				ParameterAnnotations rpa = (ParameterAnnotations) attribute;
-				if (rpa instanceof RuntimeVisibleParameterAnnotations)
-					paramAnnVisAttr = rpa;
-				else
-					paramAnnInvisAttr = rpa;
-				for (int j = 0; j < arg_types.length; j++)
-				{
-					// This returns Annotation[] ...
-					ParameterAnnotationEntry immutableArray = rpa
-							.getParameterAnnotationEntries()[j];
-					// ... which needs transforming into an AnnotationGen[] ...
-					List mutable = makeMutableVersion(immutableArray.getAnnotationEntries());
-					// ... then add these to any we already know about
-					param_annotations[j].addAll(mutable);
-				}
-			}
-		}
-		if (paramAnnVisAttr != null)
-			removeAttribute(paramAnnVisAttr);
-		if (paramAnnInvisAttr != null)
-			removeAttribute(paramAnnInvisAttr);
-		haveUnpackedParameterAnnotations = true;
-	}
-
-	private List /* AnnotationGen */makeMutableVersion(AnnotationEntry[] mutableArray)
-	{
-		List result = new ArrayList();
-		for (int i = 0; i < mutableArray.length; i++)
-		{
-			result.add(new AnnotationEntryGen(mutableArray[i], getConstantPool(),
-					false));
-		}
-		return result;
-	}
-
-	public void addParameterAnnotation(int parameterIndex,
-			AnnotationEntryGen annotation)
-	{
-		ensureExistingParameterAnnotationsUnpacked();
-		if (!hasParameterAnnotations)
-		{
-			param_annotations = new List[arg_types.length];
-			hasParameterAnnotations = true;
-		}
-		List existingAnnotations = param_annotations[parameterIndex];
-		if (existingAnnotations != null)
-		{
-			existingAnnotations.add(annotation);
-		}
-		else
-		{
-			List l = new ArrayList();
-			l.add(annotation);
-			param_annotations[parameterIndex] = l;
-		}
-	}          
-
-
-
-
-    /**
-	 * @return Comparison strategy object
-	 */
-    public static BCELComparator getComparator() {
-        return _cmp;
-    }
-
-
-    /**
-     * @param comparator Comparison strategy object
-     */
-    public static void setComparator( BCELComparator comparator ) {
-        _cmp = comparator;
-    }
-
-
+    
+    
     /**
      * Return value as defined by given BCELComparator strategy.
      * By default two MethodGen objects are said to be equal when

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEW.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEW.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEW.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NEW.java Sat Dec  5 23:22:46 2009
@@ -16,8 +16,6 @@
  */
 package org.apache.tomcat.util.bcel.generic;
 
-import org.apache.tomcat.util.bcel.ExceptionConstants;
-
 /** 
  * NEW - Create new object
  * <PRE>Stack: ... -&gt; ..., objectref</PRE>
@@ -36,22 +34,11 @@
     }
 
 
-    public NEW(int index) {
-        super(org.apache.tomcat.util.bcel.Constants.NEW, index);
-    }
+    
 
 
-    public Class[] getExceptions() {
-        Class[] cs = new Class[2 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
-        System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0, cs, 0,
-                ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
-        cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length + 1] = ExceptionConstants.INSTANTIATION_ERROR;
-        cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] = ExceptionConstants.ILLEGAL_ACCESS_ERROR;
-        return cs;
-    }
+    
 
 
-    public ObjectType getLoadClassType( ConstantPoolGen cpg ) {
-        return (ObjectType) getType(cpg);
-    }
+    
 }

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=887610&r1=887609&r2=887610&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 Sat Dec  5 23:22:46 2009
@@ -42,15 +42,10 @@
     }
 
 
-    public NEWARRAY(byte type) {
-        super(org.apache.tomcat.util.bcel.Constants.NEWARRAY, (short) 2);
-        this.type = type;
-    }
+    
 
 
-    public NEWARRAY(BasicType type) {
-        this(type.getType());
-    }
+    
 
 
     /**
@@ -71,12 +66,7 @@
     }
 
 
-    /**
-     * @return type of constructed array
-     */
-    public final Type getType() {
-        return new ArrayType(BasicType.getType(type), 1);
-    }
+    
 
 
     /**
@@ -96,9 +86,5 @@
     }
 
 
-    public Class[] getExceptions() {
-        return new Class[] {
-            org.apache.tomcat.util.bcel.ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION
-        };
-    }
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/NamedAndTyped.java Sat Dec  5 23:22:46 2009
@@ -28,7 +28,7 @@
     public String getName();
 
 
-    public Type getType();
+    
 
 
     public void setName( String name );

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ObjectType.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ObjectType.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ObjectType.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ObjectType.java Sat Dec  5 23:22:46 2009
@@ -17,8 +17,6 @@
 package org.apache.tomcat.util.bcel.generic;
 
 import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.Repository;
-import org.apache.tomcat.util.bcel.classfile.JavaClass;
 
 /** 
  * Denotes reference such as java.lang.String.
@@ -63,93 +61,20 @@
     }
 
 
-    /**
-     * If "this" doesn't reference a class, it references an interface
-     * or a non-existant entity.
-     * @deprecated this method returns an inaccurate result
-     *   if the class or interface referenced cannot
-     *   be found: use referencesClassExact() instead
-     */
-    public boolean referencesClass() {
-        try {
-            JavaClass jc = Repository.lookupClass(class_name);
-            return jc.isClass();
-        } catch (ClassNotFoundException e) {
-            return false;
-        }
-    }
+    
 
 
-    /**
-     * If "this" doesn't reference an interface, it references a class
-     * or a non-existant entity.
-     * @deprecated this method returns an inaccurate result
-     *   if the class or interface referenced cannot
-     *   be found: use referencesInterfaceExact() instead
-     */
-    public boolean referencesInterface() {
-        try {
-            JavaClass jc = Repository.lookupClass(class_name);
-            return !jc.isClass();
-        } catch (ClassNotFoundException e) {
-            return false;
-        }
-    }
+    
 
 
-    /**
-     * Return true if this type references a class,
-     * false if it references an interface.
-     * @return true if the type references a class, false if
-     *   it references an interface
-     * @throws ClassNotFoundException if the class or interface
-     *   referenced by this type can't be found
-     */
-    public boolean referencesClassExact() throws ClassNotFoundException {
-        JavaClass jc = Repository.lookupClass(class_name);
-        return jc.isClass();
-    }
+    
 
 
-    /**
-     * Return true if this type references an interface,
-     * false if it references a class.
-     * @return true if the type references an interface, false if
-     *   it references a class
-     * @throws ClassNotFoundException if the class or interface
-     *   referenced by this type can't be found
-     */
-    public boolean referencesInterfaceExact() throws ClassNotFoundException {
-        JavaClass jc = Repository.lookupClass(class_name);
-        return !jc.isClass();
-    }
+    
 
 
-    /**
-     * Return true if this type is a subclass of given ObjectType.
-     * @throws ClassNotFoundException if any of this class's superclasses
-     *  can't be found
-     */
-    public boolean subclassOf( ObjectType superclass ) throws ClassNotFoundException {
-        if (this.referencesInterface() || superclass.referencesInterface()) {
-            return false;
-        }
-        return Repository.instanceOf(this.class_name, superclass.class_name);
-    }
+    
 
 
-    /**
-     * Java Virtual Machine Specification edition 2, � 5.4.4 Access Control
-     * @throws ClassNotFoundException if the class referenced by this type
-     *   can't be found
-     */
-    public boolean accessibleTo( ObjectType accessor ) throws ClassNotFoundException {
-        JavaClass jc = Repository.lookupClass(class_name);
-        if (jc.isPublic()) {
-            return true;
-        } else {
-            JavaClass acc = Repository.lookupClass(accessor.class_name);
-            return acc.getPackageName().equals(jc.getPackageName());
-        }
-    }
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTFIELD.java Sat Dec  5 23:22:46 2009
@@ -16,9 +16,6 @@
  */
 package org.apache.tomcat.util.bcel.generic;
 
-import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.ExceptionConstants;
-
 /** 
  * PUTFIELD - Put field in object
  * <PRE>Stack: ..., objectref, value -&gt; ...</PRE>
@@ -38,9 +35,7 @@
     }
 
 
-    public PUTFIELD(int index) {
-        super(Constants.PUTFIELD, index);
-    }
+    
 
 
     public int consumeStack( ConstantPoolGen cpg ) {
@@ -48,12 +43,5 @@
     }
 
 
-    public Class[] getExceptions() {
-        Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-        System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, cs, 0,
-                ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-        cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length + 1] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-        cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.NULL_POINTER_EXCEPTION;
-        return cs;
-    }
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/PUTSTATIC.java Sat Dec  5 23:22:46 2009
@@ -16,9 +16,6 @@
  */
 package org.apache.tomcat.util.bcel.generic;
 
-import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.ExceptionConstants;
-
 /** 
  * PUTSTATIC - Put static field in class
  * <PRE>Stack: ..., value -&gt; ...</PRE>
@@ -38,9 +35,7 @@
     }
 
 
-    public PUTSTATIC(int index) {
-        super(Constants.PUTSTATIC, index);
-    }
+    
 
 
     public int consumeStack( ConstantPoolGen cpg ) {
@@ -48,11 +43,5 @@
     }
 
 
-    public Class[] getExceptions() {
-        Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-        System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, cs, 0,
-                ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-        cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-        return cs;
-    }
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/RET.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/RET.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/RET.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/RET.java Sat Dec  5 23:22:46 2009
@@ -42,10 +42,7 @@
     }
 
 
-    public RET(int index) {
-        super(org.apache.tomcat.util.bcel.Constants.RET, (short) 2);
-        setIndex(index); // May set wide as side effect
-    }
+    
 
 
     /**

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=887610&r1=887609&r2=887610&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 Sat Dec  5 23:22:46 2009
@@ -17,8 +17,6 @@
 package org.apache.tomcat.util.bcel.generic;
 
 import org.apache.tomcat.util.bcel.Constants;
-import org.apache.tomcat.util.bcel.Repository;
-import org.apache.tomcat.util.bcel.classfile.JavaClass;
 
 /**
  * Super class for object and array types.
@@ -40,291 +38,14 @@
     }
 
 
-    /**
-     * Return true iff this type is castable to another type t as defined in
-     * the JVM specification.  The case where this is Type.NULL is not
-     * defined (see the CHECKCAST definition in the JVM specification).
-     * However, because e.g. CHECKCAST doesn't throw a
-     * ClassCastException when casting a null reference to any Object,
-     * true is returned in this case.
-     *
-     * @throws ClassNotFoundException if any classes or interfaces required
-     *  to determine assignment compatibility can't be found
-     */
-    public boolean isCastableTo( Type t ) throws ClassNotFoundException {
-        if (this.equals(Type.NULL)) {
-            return true; // If this is ever changed in isAssignmentCompatible()
-        }
-        return isAssignmentCompatibleWith(t);
-        /* Yes, it's true: It's the same definition.
-         * See vmspec2 AASTORE / CHECKCAST definitions.
-         */
-    }
+    
 
 
-    /**
-     * Return true iff this is assignment compatible with another type t
-     * as defined in the JVM specification; see the AASTORE definition
-     * there.
-     * @throws ClassNotFoundException if any classes or interfaces required
-     *  to determine assignment compatibility can't be found
-     */
-    public boolean isAssignmentCompatibleWith( Type t ) throws ClassNotFoundException {
-        if (!(t instanceof ReferenceType)) {
-            return false;
-        }
-        ReferenceType T = (ReferenceType) t;
-        if (this.equals(Type.NULL)) {
-            return true; // This is not explicitely stated, but clear. Isn't it?
-        }
-        /* If this is a class type then
-         */
-        if ((this instanceof ObjectType) && (((ObjectType) this).referencesClassExact())) {
-            /* If T is a class type, then this must be the same class as T,
-             or this must be a subclass of T;
-             */
-            if ((T instanceof ObjectType) && (((ObjectType) T).referencesClassExact())) {
-                if (this.equals(T)) {
-                    return true;
-                }
-                if (Repository.instanceOf(((ObjectType) this).getClassName(), ((ObjectType) T)
-                        .getClassName())) {
-                    return true;
-                }
-            }
-            /* If T is an interface type, this must implement interface T.
-             */
-            if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterfaceExact())) {
-                if (Repository.implementationOf(((ObjectType) this).getClassName(),
-                        ((ObjectType) T).getClassName())) {
-                    return true;
-                }
-            }
-        }
-        /* If this is an interface type, then:
-         */
-        if ((this instanceof ObjectType) && (((ObjectType) this).referencesInterfaceExact())) {
-            /* If T is a class type, then T must be Object (�2.4.7).
-             */
-            if ((T instanceof ObjectType) && (((ObjectType) T).referencesClassExact())) {
-                if (T.equals(Type.OBJECT)) {
-                    return true;
-                }
-            }
-            /* If T is an interface type, then T must be the same interface
-             * as this or a superinterface of this (�2.13.2).
-             */
-            if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterfaceExact())) {
-                if (this.equals(T)) {
-                    return true;
-                }
-                if (Repository.implementationOf(((ObjectType) this).getClassName(),
-                        ((ObjectType) T).getClassName())) {
-                    return true;
-                }
-            }
-        }
-        /* If this is an array type, namely, the type SC[], that is, an
-         * array of components of type SC, then:
-         */
-        if (this instanceof ArrayType) {
-            /* If T is a class type, then T must be Object (�2.4.7).
-             */
-            if ((T instanceof ObjectType) && (((ObjectType) T).referencesClassExact())) {
-                if (T.equals(Type.OBJECT)) {
-                    return true;
-                }
-            }
-            /* If T is an array type TC[], that is, an array of components
-             * of type TC, then one of the following must be true:
-             */
-            if (T instanceof ArrayType) {
-                /* TC and SC are the same primitive type (�2.4.1).
-                 */
-                Type sc = ((ArrayType) this).getElementType();
-                Type tc = ((ArrayType) T).getElementType();
-                if (sc instanceof BasicType && tc instanceof BasicType && sc.equals(tc)) {
-                    return true;
-                }
-                /* TC and SC are reference types (�2.4.6), and type SC is
-                 * assignable to TC by these runtime rules.
-                 */
-                if (tc instanceof ReferenceType && sc instanceof ReferenceType
-                        && ((ReferenceType) sc).isAssignmentCompatibleWith(tc)) {
-                    return true;
-                }
-            }
-            /* If T is an interface type, T must be one of the interfaces implemented by arrays (�2.15). */
-            // TODO: Check if this is still valid or find a way to dynamically find out which
-            // interfaces arrays implement. However, as of the JVM specification edition 2, there
-            // are at least two different pages where assignment compatibility is defined and
-            // on one of them "interfaces implemented by arrays" is exchanged with "'Cloneable' or
-            // 'java.io.Serializable'"
-            if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterfaceExact())) {
-                for (int ii = 0; ii < Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS.length; ii++) {
-                    if (T.equals(new ObjectType(Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS[ii]))) {
-                        return true;
-                    }
-                }
-            }
-        }
-        return false; // default.
-    }
+    
 
 
-    /**
-     * This commutative operation returns the first common superclass (narrowest ReferenceType
-     * referencing a class, not an interface).
-     * If one of the types is a superclass of the other, the former is returned.
-     * If "this" is Type.NULL, then t is returned.
-     * If t is Type.NULL, then "this" is returned.
-     * If "this" equals t ['this.equals(t)'] "this" is returned.
-     * If "this" or t is an ArrayType, then Type.OBJECT is returned;
-     * unless their dimensions match. Then an ArrayType of the same
-     * number of dimensions is returned, with its basic type being the
-     * first common super class of the basic types of "this" and t.
-     * If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned.
-     * If not all of the two classes' superclasses cannot be found, "null" is returned.
-     * See the JVM specification edition 2, "�4.9.2 The Bytecode Verifier".
-     *
-     * @throws ClassNotFoundException on failure to find superclasses of this
-     *  type, or the type passed as a parameter
-     */
-    public ReferenceType getFirstCommonSuperclass( ReferenceType t ) throws ClassNotFoundException {
-        if (this.equals(Type.NULL)) {
-            return t;
-        }
-        if (t.equals(Type.NULL)) {
-            return this;
-        }
-        if (this.equals(t)) {
-            return this;
-            /*
-             * TODO: Above sounds a little arbitrary. On the other hand, there is
-             * no object referenced by Type.NULL so we can also say all the objects
-             * referenced by Type.NULL were derived from java.lang.Object.
-             * However, the Java Language's "instanceof" operator proves us wrong:
-             * "null" is not referring to an instance of java.lang.Object :)
-             */
-        }
-        /* This code is from a bug report by Konstantin Shagin <konst@cs.technion.ac.il> */
-        if ((this instanceof ArrayType) && (t instanceof ArrayType)) {
-            ArrayType arrType1 = (ArrayType) this;
-            ArrayType arrType2 = (ArrayType) t;
-            if ((arrType1.getDimensions() == arrType2.getDimensions())
-                    && arrType1.getBasicType() instanceof ObjectType
-                    && arrType2.getBasicType() instanceof ObjectType) {
-                return new ArrayType(((ObjectType) arrType1.getBasicType())
-                        .getFirstCommonSuperclass((ObjectType) arrType2.getBasicType()), arrType1
-                        .getDimensions());
-            }
-        }
-        if ((this instanceof ArrayType) || (t instanceof ArrayType)) {
-            return Type.OBJECT;
-            // TODO: Is there a proof of OBJECT being the direct ancestor of every ArrayType?
-        }
-        if (((this instanceof ObjectType) && ((ObjectType) this).referencesInterface())
-                || ((t instanceof ObjectType) && ((ObjectType) t).referencesInterface())) {
-            return Type.OBJECT;
-            // TODO: The above line is correct comparing to the vmspec2. But one could
-            // make class file verification a bit stronger here by using the notion of
-            // superinterfaces or even castability or assignment compatibility.
-        }
-        // this and t are ObjectTypes, see above.
-        ObjectType thiz = (ObjectType) this;
-        ObjectType other = (ObjectType) t;
-        JavaClass[] thiz_sups = Repository.getSuperClasses(thiz.getClassName());
-        JavaClass[] other_sups = Repository.getSuperClasses(other.getClassName());
-        if ((thiz_sups == null) || (other_sups == null)) {
-            return null;
-        }
-        // Waaahh...
-        JavaClass[] this_sups = new JavaClass[thiz_sups.length + 1];
-        JavaClass[] t_sups = new JavaClass[other_sups.length + 1];
-        System.arraycopy(thiz_sups, 0, this_sups, 1, thiz_sups.length);
-        System.arraycopy(other_sups, 0, t_sups, 1, other_sups.length);
-        this_sups[0] = Repository.lookupClass(thiz.getClassName());
-        t_sups[0] = Repository.lookupClass(other.getClassName());
-        for (int i = 0; i < t_sups.length; i++) {
-            for (int j = 0; j < this_sups.length; j++) {
-                if (this_sups[j].equals(t_sups[i])) {
-                    return new ObjectType(this_sups[j].getClassName());
-                }
-            }
-        }
-        // Huh? Did you ask for Type.OBJECT's superclass??
-        return null;
-    }
+    
 
 
-    /**
-     * This commutative operation returns the first common superclass (narrowest ReferenceType
-     * referencing a class, not an interface).
-     * If one of the types is a superclass of the other, the former is returned.
-     * If "this" is Type.NULL, then t is returned.
-     * If t is Type.NULL, then "this" is returned.
-     * If "this" equals t ['this.equals(t)'] "this" is returned.
-     * If "this" or t is an ArrayType, then Type.OBJECT is returned.
-     * If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned.
-     * If not all of the two classes' superclasses cannot be found, "null" is returned.
-     * See the JVM specification edition 2, "�4.9.2 The Bytecode Verifier".
-     *
-     * @deprecated use getFirstCommonSuperclass(ReferenceType t) which has
-     *             slightly changed semantics.
-     * @throws ClassNotFoundException on failure to find superclasses of this
-     *  type, or the type passed as a parameter
-     */
-    public ReferenceType firstCommonSuperclass( ReferenceType t ) throws ClassNotFoundException {
-        if (this.equals(Type.NULL)) {
-            return t;
-        }
-        if (t.equals(Type.NULL)) {
-            return this;
-        }
-        if (this.equals(t)) {
-            return this;
-            /*
-             * TODO: Above sounds a little arbitrary. On the other hand, there is
-             * no object referenced by Type.NULL so we can also say all the objects
-             * referenced by Type.NULL were derived from java.lang.Object.
-             * However, the Java Language's "instanceof" operator proves us wrong:
-             * "null" is not referring to an instance of java.lang.Object :)
-             */
-        }
-        if ((this instanceof ArrayType) || (t instanceof ArrayType)) {
-            return Type.OBJECT;
-            // TODO: Is there a proof of OBJECT being the direct ancestor of every ArrayType?
-        }
-        if (((this instanceof ObjectType) && ((ObjectType) this).referencesInterface())
-                || ((t instanceof ObjectType) && ((ObjectType) t).referencesInterface())) {
-            return Type.OBJECT;
-            // TODO: The above line is correct comparing to the vmspec2. But one could
-            // make class file verification a bit stronger here by using the notion of
-            // superinterfaces or even castability or assignment compatibility.
-        }
-        // this and t are ObjectTypes, see above.
-        ObjectType thiz = (ObjectType) this;
-        ObjectType other = (ObjectType) t;
-        JavaClass[] thiz_sups = Repository.getSuperClasses(thiz.getClassName());
-        JavaClass[] other_sups = Repository.getSuperClasses(other.getClassName());
-        if ((thiz_sups == null) || (other_sups == null)) {
-            return null;
-        }
-        // Waaahh...
-        JavaClass[] this_sups = new JavaClass[thiz_sups.length + 1];
-        JavaClass[] t_sups = new JavaClass[other_sups.length + 1];
-        System.arraycopy(thiz_sups, 0, this_sups, 1, thiz_sups.length);
-        System.arraycopy(other_sups, 0, t_sups, 1, other_sups.length);
-        this_sups[0] = Repository.lookupClass(thiz.getClassName());
-        t_sups[0] = Repository.lookupClass(other.getClassName());
-        for (int i = 0; i < t_sups.length; i++) {
-            for (int j = 0; j < this_sups.length; j++) {
-                if (this_sups[j].equals(t_sups[i])) {
-                    return new ObjectType(this_sups[j].getClassName());
-                }
-            }
-        }
-        // Huh? Did you ask for Type.OBJECT's superclass??
-        return null;
-    }
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/ReturnaddressType.java Sat Dec  5 23:22:46 2009
@@ -73,10 +73,5 @@
     }
 
 
-    /**
-     * @return the target of this ReturnaddressType
-     */
-    public InstructionHandle getTarget() {
-        return returnTarget;
-    }
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SIPUSH.java Sat Dec  5 23:22:46 2009
@@ -41,10 +41,7 @@
     }
 
 
-    public SIPUSH(short b) {
-        super(org.apache.tomcat.util.bcel.Constants.SIPUSH, (short) 3);
-        this.b = b;
-    }
+    
 
 
     /**
@@ -78,9 +75,5 @@
     }
 
 
-    /** @return Type.SHORT
-     */
-    public Type getType( ConstantPoolGen cp ) {
-        return Type.SHORT;
-    }
+    
 }

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=887610&r1=887609&r2=887610&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 Sat Dec  5 23:22:46 2009
@@ -50,26 +50,7 @@
     }
 
 
-    /**
-     * (Match, target) pairs for switch.
-     * `Match' and `targets' must have the same length of course.
-     *
-     * @param match array of matching values
-     * @param targets instruction targets
-     * @param defaultTarget default instruction target
-     */
-    Select(short opcode, int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) {
-        super(opcode, defaultTarget);
-        this.targets = targets;
-        for (int i = 0; i < targets.length; i++) {
-            notifyTarget(null, targets[i], this);
-        }
-        this.match = match;
-        if ((match_length = match.length) != targets.length) {
-            throw new ClassGenException("Match and target array have not the same length: Match length: " + match.length + " Target length: " + targets.length);
-        }
-        indices = new int[match_length];
-    }
+    
 
 
     /**
@@ -211,12 +192,7 @@
     }
 
 
-    /**
-     * @return array of match indices
-     */
-    public int[] getMatchs() {
-        return match;
-    }
+    
 
 
     /**

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SimpleElementValueGen.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SimpleElementValueGen.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SimpleElementValueGen.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/SimpleElementValueGen.java Sat Dec  5 23:22:46 2009
@@ -17,74 +17,25 @@
 	// For 'class' this points to the class entry in the cpGen
 	private int idx;
 
-	// ctors for each supported type... type could be inferred but for now lets
-	// force it to be passed
-	/**
-	 * Protected ctor used for deserialization, doesn't *put* an entry in the
-	 * constant pool, assumes the one at the supplied index is correct.
-	 */
-	protected SimpleElementValueGen(int type, int idx, ConstantPoolGen cpGen)
-	{
-		super(type, cpGen);
-		this.idx = idx;
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, int value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addInteger(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, long value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addLong(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, double value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addDouble(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, float value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addFloat(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, short value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addInteger(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, byte value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addInteger(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, char value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addInteger(value);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, boolean value)
-	{
-		super(type, cpGen);
-		if (value)
-			idx = cpGen.addInteger(1);
-		else
-			idx = cpGen.addInteger(0);
-	}
+	
 
-	public SimpleElementValueGen(int type, ConstantPoolGen cpGen, String value)
-	{
-		super(type, cpGen);
-		idx = cpGen.addUtf8(value);
-	}
+	
 
 	/**
 	 * The boolean controls whether we copy info from the 'old' constant pool to
@@ -155,28 +106,11 @@
 		return new SimpleElementValue(type, idx, cpGen.getConstantPool());
 	}
 
-	public int getIndex()
-	{
-		return idx;
-	}
+	
 
-	public String getValueString()
-	{
-		if (type != STRING)
-			throw new RuntimeException(
-					"Dont call getValueString() on a non STRING ElementValue");
-		ConstantUtf8 c = (ConstantUtf8) cpGen.getConstant(idx);
-		return c.getBytes();
-	}
+	
 
-	public int getValueInt()
-	{
-		if (type != PRIMITIVE_INT)
-			throw new RuntimeException(
-					"Dont call getValueString() on a non STRING ElementValue");
-		ConstantInteger c = (ConstantInteger) cpGen.getConstant(idx);
-		return c.getBytes();
-	}
+	
 
 	// Whatever kind of value it is, return it as a string
 	public String stringifyValue()

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java Sat Dec  5 23:22:46 2009
@@ -24,7 +24,5 @@
  */
 public interface StackConsumer {
 
-    /** @return how many words are consumed from stack
-     */
-    public int consumeStack( ConstantPoolGen cpg );
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackProducer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackProducer.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackProducer.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/StackProducer.java Sat Dec  5 23:22:46 2009
@@ -25,7 +25,5 @@
  */
 public interface StackProducer {
 
-    /** @return how many words are produced on stack
-     */
-    public int produceStack( ConstantPoolGen cpg );
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TABLESWITCH.java Sat Dec  5 23:22:46 2009
@@ -37,18 +37,7 @@
     }
 
 
-    /**
-     * @param match sorted array of match values, match[0] must be low value, 
-     * match[match_length - 1] high value
-     * @param targets where to branch for matched values
-     * @param defaultTarget default branch
-     */
-    public TABLESWITCH(int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) {
-        super(org.apache.tomcat.util.bcel.Constants.TABLESWITCH, match, targets, defaultTarget);
-        length = (short) (13 + match_length * 4); /* Alignment remainder assumed
-         * 0 here, until dump time */
-        fixed_length = length;
-    }
+    
 
 
     /**

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=887610&r1=887609&r2=887610&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 Sat Dec  5 23:22:46 2009
@@ -16,8 +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.ClassFormatException;
 import org.apache.tomcat.util.bcel.classfile.Utility;
@@ -47,13 +45,12 @@
     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");
-    public static final ObjectType STRINGBUFFER = new ObjectType("java.lang.StringBuffer");
-    public static final ObjectType THROWABLE = new ObjectType("java.lang.Throwable");
-    public static final Type[] NO_ARGS = new Type[0];
+    
+    
+    
     public static final ReferenceType NULL = new ReferenceType() {
     };
-    public static final Type UNKNOWN = new Type(Constants.T_UNKNOWN, "<unknown object>") {
-    };
+    
 
 
     protected Type(byte t, String s) {
@@ -212,101 +209,16 @@
     }
 
 
-    /**
-     * Convert arguments of a method (signature) to an array of Type objects.
-     * @param signature signature string such as (Ljava/lang/String;)V
-     * @return array of argument types
-     */
-    public static Type[] getArgumentTypes( String signature ) {
-        List vec = new ArrayList();
-        int index;
-        Type[] types;
-        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) != ')') {
-                vec.add(getType(signature.substring(index)));
-                //corrected concurrent private static field acess
-                index += unwrap(consumed_chars); // update position
-            }
-        } catch (StringIndexOutOfBoundsException e) { // Should never occur
-            throw new ClassFormatException("Invalid method signature: " + signature, e);
-        }
-        types = new Type[vec.size()];
-        vec.toArray(types);
-        return types;
-    }
+    
 
 
-    /** Convert runtime java.lang.Class to BCEL Type object.
-     * @param cl Java class
-     * @return corresponding Type object
-     */
-    public static Type getType( java.lang.Class cl ) {
-        if (cl == null) {
-            throw new IllegalArgumentException("Class must not be null");
-        }
-        /* That's an amzingly easy case, because getName() returns
-         * the signature. That's what we would have liked anyway.
-         */
-        if (cl.isArray()) {
-            return getType(cl.getName());
-        } else if (cl.isPrimitive()) {
-            if (cl == Integer.TYPE) {
-                return INT;
-            } else if (cl == Void.TYPE) {
-                return VOID;
-            } else if (cl == Double.TYPE) {
-                return DOUBLE;
-            } else if (cl == Float.TYPE) {
-                return FLOAT;
-            } else if (cl == Boolean.TYPE) {
-                return BOOLEAN;
-            } else if (cl == Byte.TYPE) {
-                return BYTE;
-            } else if (cl == Short.TYPE) {
-                return SHORT;
-            } else if (cl == Byte.TYPE) {
-                return BYTE;
-            } else if (cl == Long.TYPE) {
-                return LONG;
-            } else if (cl == Character.TYPE) {
-                return CHAR;
-            } else {
-                throw new IllegalStateException("Ooops, what primitive type is " + cl);
-            }
-        } else { // "Real" class
-            return new ObjectType(cl.getName());
-        }
-    }
+    
 
 
-    /**
-     * Convert runtime java.lang.Class[] to BCEL Type objects.
-     * @param classes an array of runtime class objects
-     * @return array of corresponding Type objects
-     */
-    public static Type[] getTypes( java.lang.Class[] classes ) {
-        Type[] ret = new Type[classes.length];
-        for (int i = 0; i < ret.length; i++) {
-            ret[i] = getType(classes[i]);
-        }
-        return ret;
-    }
+    
 
 
-    public static String getSignature( java.lang.reflect.Method meth ) {
-        StringBuffer sb = new StringBuffer("(");
-        Class[] params = meth.getParameterTypes(); // avoid clone
-        for (int j = 0; j < params.length; j++) {
-            sb.append(getType(params[j]).getSignature());
-        }
-        sb.append(")");
-        sb.append(getType(meth.getReturnType()).getSignature());
-        return sb.toString();
-    }
+    
     
     private static int size(int coded) {
     	return coded & 3;

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TypedInstruction.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TypedInstruction.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TypedInstruction.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/generic/TypedInstruction.java Sat Dec  5 23:22:46 2009
@@ -25,5 +25,5 @@
  */
 public interface TypedInstruction {
 
-    public Type getType( ConstantPoolGen cpg );
+    
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ByteSequence.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ByteSequence.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ByteSequence.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ByteSequence.java Sat Dec  5 23:22:46 2009
@@ -43,9 +43,7 @@
     }
 
 
-    final void unreadByte() {
-        byte_stream.unreadByte();
-    }
+    
 
     private static final class ByteArrayStream extends ByteArrayInputStream {
 
@@ -57,12 +55,5 @@
         final int getPosition() {
             return pos;
         } // is protected in ByteArrayInputStream
-
-
-        final void unreadByte() {
-            if (pos > 0) {
-                pos--;
-            }
-        }
     }
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ClassPath.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ClassPath.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ClassPath.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/util/ClassPath.java Sat Dec  5 23:22:46 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.tomcat.util.bcel.util;
 
-import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FilenameFilter;
@@ -26,12 +25,10 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.StringTokenizer;
-import java.util.Vector;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
@@ -189,49 +186,11 @@
         return getClassFile(name, suffix).getInputStream();
     }
 
-    /**
-     * @param name fully qualified resource name, e.g. java/lang/String.class
-     * @return InputStream supplying the resource, or null if no resource with that name.
-     */
-    public InputStream getResourceAsStream(String name) {
-        for (int i = 0; i < paths.length; i++) {
-            InputStream is;
-            if ((is = paths[i].getResourceAsStream(name)) != null) {
-                return is;
-            }
-        }
-        return null;
-    }
     
-    /**
-     * @param name fully qualified resource name, e.g. java/lang/String.class
-     * @return URL supplying the resource, or null if no resource with that name.
-     */
-    public URL getResource(String name) {
-        for (int i = 0; i < paths.length; i++) {
-            URL url;
-            if ((url = paths[i].getResource(name)) != null) {
-                return url;
-            }
-        }
-        return null;
-    }
+    
+    
 
-    /**
-     * @param name fully qualified resource name, e.g. java/lang/String.class
-     * @return An Enumeration of URLs supplying the resource, or an
-     * empty Enumeration if no resource with that name.
-     */
-    public Enumeration getResources(String name) {
-        Vector results = new Vector();
-        for (int i = 0; i < paths.length; i++) {
-            URL url;
-            if ((url = paths[i].getResource(name)) != null) {
-                results.add(url);
-            }
-        }
-        return results.elements();
-    }
+    
 
     /**
      * @param name fully qualified file name, e.g. java/lang/String
@@ -249,70 +208,19 @@
     }
 
 
-    /**
-     * @param name fully qualified class name, e.g. java.lang.String
-     * @return input stream for class
-     */
-    public ClassFile getClassFile( String name ) throws IOException {
-        return getClassFile(name, ".class");
-    }
+    
 
 
-    /**
-     * @param name fully qualified file name, e.g. java/lang/String
-     * @param suffix file name ends with suffix, e.g. .java
-     * @return byte array for file on class path
-     */
-    public byte[] getBytes( String name, String suffix ) throws IOException {
-        DataInputStream dis = null;
-        try {
-            InputStream is = getInputStream(name, suffix);
-            if (is == null) {
-                throw new IOException("Couldn't find: " + name + suffix);
-            }
-            dis = new DataInputStream(is);
-            byte[] bytes = new byte[is.available()];
-            dis.readFully(bytes);
-            return bytes;
-        } finally {
-            if (dis != null) {
-                dis.close();
-            }
-        }
-    }
+    
 
 
-    /**
-     * @return byte array for class
-     */
-    public byte[] getBytes( String name ) throws IOException {
-        return getBytes(name, ".class");
-    }
+    
 
 
-    /**
-     * @param name name of file to search for, e.g. java/lang/String.java
-     * @return full (canonical) path for file
-     */
-    public String getPath( String name ) throws IOException {
-        int index = name.lastIndexOf('.');
-        String suffix = "";
-        if (index > 0) {
-            suffix = name.substring(index);
-            name = name.substring(0, index);
-        }
-        return getPath(name, suffix);
-    }
+    
 
 
-    /**
-     * @param name name of file to search for, e.g. java/lang/String
-     * @param suffix file name suffix, e.g. .java
-     * @return full (canonical) path for file, if it exists
-     */
-    public String getPath( String name, String suffix ) throws IOException {
-        return getClassFile(name, suffix).getPath();
-    }
+    
 
     private static abstract class PathEntry implements Serializable {
 
@@ -330,25 +238,16 @@
         public abstract InputStream getInputStream() throws IOException;
 
 
-        /** @return canonical path to class file.
-         */
-        public abstract String getPath();
+        
 
 
-        /** @return base path of found class, i.e. class is contained relative
-         * to that path, which may either denote a directory, or zip file
-         */
-        public abstract String getBase();
+        
 
 
-        /** @return modification time of class file.
-         */
-        public abstract long getTime();
+        
 
 
-        /** @return size of class file.
-         */
-        public abstract long getSize();
+        
     }
 
     private static class Dir extends PathEntry {
@@ -388,30 +287,6 @@
                 public InputStream getInputStream() throws IOException {
                     return new FileInputStream(file);
                 }
-
-
-                public String getPath() {
-                    try {
-                        return file.getCanonicalPath();
-                    } catch (IOException e) {
-                        return null;
-                    }
-                }
-
-
-                public long getTime() {
-                    return file.lastModified();
-                }
-
-
-                public long getSize() {
-                    return file.length();
-                }
-
-
-                public String getBase() {
-                    return dir;
-                }
             } : null;
         }
 
@@ -459,26 +334,6 @@
                 public InputStream getInputStream() throws IOException {
                     return zip.getInputStream(entry);
                 }
-
-
-                public String getPath() {
-                    return entry.toString();
-                }
-
-
-                public long getTime() {
-                    return entry.getTime();
-                }
-
-
-                public long getSize() {
-                    return entry.getSize();
-                }
-
-
-                public String getBase() {
-                    return zip.getName();
-                }
             };
         }
     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/util/Repository.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/util/Repository.java?rev=887610&r1=887609&r2=887610&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/util/Repository.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/util/Repository.java Sat Dec  5 23:22:46 2009
@@ -36,10 +36,7 @@
     public void storeClass( JavaClass clazz );
 
 
-    /**
-     * Remove class from repository
-     */
-    public void removeClass( JavaClass clazz );
+    
 
 
     /**
@@ -56,18 +53,11 @@
     public JavaClass loadClass( String className ) throws java.lang.ClassNotFoundException;
 
 
-    /**
-     * Find the JavaClass instance for the given run-time class object
-     */
-    public JavaClass loadClass( Class clazz ) throws java.lang.ClassNotFoundException;
+    
 
 
-    /** Clear all entries from cache.
-     */
-    public void clear();
+    
 
 
-    /** Get the ClassPath associated with this Repository
-     */
-    public ClassPath getClassPath();
+    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message