Author: markt Date: Fri Sep 12 12:31:01 2014 New Revision: 1624520 URL: http://svn.apache.org/r1624520 Log: Merge more unused code removal from trunk
Removed: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AttributeReader.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/CodeException.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Unknown.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1397989,1398089,1398107,1398109-1398110,1398112 Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/ ------------------------------------------------------------------------------ Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1398089,1398107,1398109-1398110,1398112 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java Fri Sep 12 12:31:01 2014 @@ -17,9 +17,6 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.DataOutputStream; -import java.io.IOException; - public class AnnotationElementValue extends ElementValue { // For annotation element values, this is the annotation @@ -37,13 +34,6 @@ public class AnnotationElementValue exte } @Override - public void dump(DataOutputStream dos) throws IOException - { - dos.writeByte(type); // u1 type of value (ANNOTATION == '@') - annotationEntry.dump(dos); - } - - @Override public String stringifyValue() { return annotationEntry.toString(); Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java Fri Sep 12 12:31:01 2014 @@ -18,7 +18,6 @@ package org.apache.tomcat.util.bcel.classfile; import java.io.DataInputStream; -import java.io.DataOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -78,14 +77,4 @@ public class AnnotationEntry implements // TODO return List return element_value_pairs.toArray(new ElementValuePair[element_value_pairs.size()]); } - - public void dump(DataOutputStream dos) throws IOException { - dos.writeShort(type_index); // u2 index of type name in cpool - dos.writeShort(element_value_pairs.size()); // u2 element_value pair - // count - for (int i = 0; i < element_value_pairs.size(); i++) { - final ElementValuePair envp = element_value_pairs.get(i); - envp.dump(dos); - } - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java Fri Sep 12 12:31:01 2014 @@ -17,9 +17,6 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.DataOutputStream; -import java.io.IOException; - public class ArrayElementValue extends ElementValue { // For array types, this is the array @@ -36,17 +33,6 @@ public class ArrayElementValue extends E } @Override - public void dump(DataOutputStream dos) throws IOException - { - dos.writeByte(type); // u1 type of value (ARRAY == '[') - dos.writeShort(evalues.length); - for (int i = 0; i < evalues.length; i++) - { - evalues[i].dump(dos); - } - } - - @Override public String stringifyValue() { StringBuilder sb = new StringBuilder(); Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java Fri Sep 12 12:31:01 2014 @@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas import java.io.DataInputStream; import java.io.IOException; import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; import org.apache.tomcat.util.bcel.Constants; @@ -64,9 +62,6 @@ public abstract class Attribute implemen this.constant_pool = constant_pool; } - private static final Map<String,AttributeReader> readers = - new HashMap<String,AttributeReader>(); - /* * Class method reads one attribute from the input data stream. This method * must not be accessible from the outside. It is called by the Field and @@ -107,12 +102,6 @@ public abstract class Attribute implemen switch (tag) { case Constants.ATTR_UNKNOWN: - AttributeReader r = readers.get(name); - if (r != null) - { - return r.createAttribute(name_index, length, file, - constant_pool); - } return new Unknown(name_index, length, file, constant_pool); case Constants.ATTR_CONSTANT_VALUE: return new ConstantValue(name_index, length, file, constant_pool); Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java Fri Sep 12 12:31:01 2014 @@ -17,9 +17,6 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.DataOutputStream; -import java.io.IOException; - import org.apache.tomcat.util.bcel.Constants; public class ClassElementValue extends ElementValue @@ -43,11 +40,4 @@ public class ClassElementValue extends E Constants.CONSTANT_Utf8); return cu8.getBytes(); } - - @Override - public void dump(DataOutputStream dos) throws IOException - { - dos.writeByte(type); // u1 kind of value - dos.writeShort(idx); - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java Fri Sep 12 12:31:01 2014 @@ -34,7 +34,6 @@ import java.io.IOException; * * @author <A HREF="mailto:m.d...@gmx.de">M. Dahm</A> * @see Attribute - * @see CodeException * @see LineNumberTable * @see LocalVariableTable */ @@ -44,7 +43,6 @@ public final class Code extends Attribut private int code_length; // Length of code in bytes private byte[] code; // Actual byte code private int exception_table_length; - private CodeException[] exception_table; // Table of handled exceptions private int attributes_count; // Attributes of code: LineNumber private Attribute[] attributes; // or LocalVariable @@ -58,8 +56,8 @@ public final class Code extends Attribut Code(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException { // Initialize with some default values which will be overwritten later - this(name_index, length, (byte[]) null, - (CodeException[]) null, (Attribute[]) null, constant_pool); + this(name_index, length, (byte[]) null, (Attribute[]) null, + constant_pool); file.readUnsignedShort(); // Unused max_stack file.readUnsignedShort(); // Unused max_locals code_length = file.readInt(); @@ -69,9 +67,8 @@ public final class Code extends Attribut * handler is active, i.e., a try { ... } catch() block. */ exception_table_length = file.readUnsignedShort(); - exception_table = new CodeException[exception_table_length]; for (int i = 0; i < exception_table_length; i++) { - exception_table[i] = new CodeException(file); + Utility.swallowCodeException(file); } /* Read all attributes, currently `LineNumberTable' and * `LocalVariableTable' @@ -93,15 +90,13 @@ public final class Code extends Attribut * @param name_index Index pointing to the name <em>Code</em> * @param length Content length in bytes * @param code Actual byte code - * @param exception_table Table of handled exceptions * @param attributes Attributes of code: LineNumber or LocalVariable * @param constant_pool Array of constants */ public Code(int name_index, int length, byte[] code, - CodeException[] exception_table, Attribute[] attributes, ConstantPool constant_pool) { + Attribute[] attributes, ConstantPool constant_pool) { super(name_index, length, constant_pool); setCode(code); - setExceptionTable(exception_table); setAttributes(attributes); // Overwrites length! } @@ -150,14 +145,4 @@ public final class Code extends Attribut code_length = (code == null) ? 0 : code.length; length = calculateLength(); // Adjust length } - - - /** - * @param exception_table exception table - */ - public final void setExceptionTable( CodeException[] exception_table ) { - this.exception_table = exception_table; - exception_table_length = (exception_table == null) ? 0 : exception_table.length; - length = calculateLength(); // Adjust length - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java Fri Sep 12 12:31:01 2014 @@ -18,7 +18,6 @@ package org.apache.tomcat.util.bcel.classfile; import java.io.DataInputStream; -import java.io.DataOutputStream; import java.io.IOException; /** @@ -40,8 +39,6 @@ public abstract class ElementValue public abstract String stringifyValue(); - public abstract void dump(DataOutputStream dos) throws IOException; - public static final int STRING = 's'; public static final int ENUM_CONSTANT = 'e'; @@ -102,7 +99,8 @@ public abstract class ElementValue return new SimpleElementValue(STRING, dis.readUnsignedShort(), cpool); case 'e': // Enum constant - return new EnumElementValue(ENUM_CONSTANT, dis.readUnsignedShort(), + dis.readUnsignedShort(); // Unused type_index + return new EnumElementValue(ENUM_CONSTANT, dis.readUnsignedShort(), cpool); case 'c': // Class return new ClassElementValue(CLASS, dis.readUnsignedShort(), cpool); Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java Fri Sep 12 12:31:01 2014 @@ -17,9 +17,6 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.DataOutputStream; -import java.io.IOException; - import org.apache.tomcat.util.bcel.Constants; /** @@ -55,9 +52,4 @@ public class ElementValuePair { return elementValue; } - - protected void dump(DataOutputStream dos) throws IOException { - dos.writeShort(elementNameIndex); // u2 name of the element - elementValue.dump(dos); - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java Fri Sep 12 12:31:01 2014 @@ -17,38 +17,22 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.DataOutputStream; -import java.io.IOException; - import org.apache.tomcat.util.bcel.Constants; public class EnumElementValue extends ElementValue { - // For enum types, these two indices point to the type and value - private int typeIdx; - private int valueIdx; - public EnumElementValue(int type, int typeIdx, int valueIdx, - ConstantPool cpool) + public EnumElementValue(int type, int valueIdx, ConstantPool cpool) { super(type, cpool); if (type != ENUM_CONSTANT) throw new RuntimeException( "Only element values of type enum can be built with this ctor - type specified: " + type); - this.typeIdx = typeIdx; this.valueIdx = valueIdx; } @Override - public void dump(DataOutputStream dos) throws IOException - { - dos.writeByte(type); // u1 type of value (ENUM_CONSTANT == 'e') - dos.writeShort(typeIdx); // u2 - dos.writeShort(valueIdx); // u2 - } - - @Override public String stringifyValue() { ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx, Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClasses.java Fri Sep 12 12:31:01 2014 @@ -32,24 +32,10 @@ import java.io.IOException; public final class InnerClasses extends Attribute { private static final long serialVersionUID = 54179484605570305L; - private InnerClass[] inner_classes; private int number_of_classes; /** - * @param name_index Index in constant pool to CONSTANT_Utf8 - * @param length Content length in bytes - * @param inner_classes array of inner classes attributes - * @param constant_pool Array of constants - */ - public InnerClasses(int name_index, int length, InnerClass[] inner_classes, - ConstantPool constant_pool) { - super(name_index, length, constant_pool); - setInnerClasses(inner_classes); - } - - - /** * Construct object from file stream. * * @param name_index Index in constant pool to CONSTANT_Utf8 @@ -60,20 +46,10 @@ public final class InnerClasses extends */ InnerClasses(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException { - this(name_index, length, (InnerClass[]) null, constant_pool); + super(name_index, length, constant_pool); number_of_classes = file.readUnsignedShort(); - inner_classes = new InnerClass[number_of_classes]; for (int i = 0; i < number_of_classes; i++) { - inner_classes[i] = new InnerClass(file); + Utility.swallowInnerClass(file); } } - - - /** - * @param inner_classes the array of inner classes - */ - public final void setInnerClasses( InnerClass[] inner_classes ) { - this.inner_classes = inner_classes; - number_of_classes = (inner_classes == null) ? 0 : inner_classes.length; - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumberTable.java Fri Sep 12 12:31:01 2014 @@ -27,26 +27,10 @@ import java.io.IOException; * * @author <A HREF="mailto:m.d...@gmx.de">M. Dahm</A> * @see Code - * @see LineNumber */ public final class LineNumberTable extends Attribute { private static final long serialVersionUID = 6585122636118666124L; - private int line_number_table_length; - private LineNumber[] line_number_table; // Table of line/numbers pairs - - - /* - * @param name_index Index of name - * @param length Content length in bytes - * @param line_number_table Table of line/numbers pairs - * @param constant_pool Array of constants - */ - public LineNumberTable(int name_index, int length, LineNumber[] line_number_table, - ConstantPool constant_pool) { - super(name_index, length, constant_pool); - setLineNumberTable(line_number_table); - } /** @@ -59,20 +43,10 @@ public final class LineNumberTable exten */ LineNumberTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException { - this(name_index, length, (LineNumber[]) null, constant_pool); - line_number_table_length = (file.readUnsignedShort()); - line_number_table = new LineNumber[line_number_table_length]; + super(name_index, length, constant_pool); + int line_number_table_length = (file.readUnsignedShort()); for (int i = 0; i < line_number_table_length; i++) { - line_number_table[i] = new LineNumber(file); + Utility.swallowLineNumber(file); } } - - - /** - * @param line_number_table the line number entries for this table - */ - public final void setLineNumberTable( LineNumber[] line_number_table ) { - this.line_number_table = line_number_table; - line_number_table_length = (line_number_table == null) ? 0 : line_number_table.length; - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTable.java Fri Sep 12 12:31:01 2014 @@ -26,26 +26,10 @@ import java.io.IOException; * * @author <A HREF="mailto:m.d...@gmx.de">M. Dahm</A> * @see Code - * @see LocalVariable */ public class LocalVariableTable extends Attribute { private static final long serialVersionUID = -3904314258294133920L; - private int local_variable_table_length; // Table of local - private LocalVariable[] local_variable_table; // variables - - - /** - * @param name_index Index in constant pool to `LocalVariableTable' - * @param length Content length in bytes - * @param local_variable_table Table of local variables - * @param constant_pool Array of constants - */ - public LocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, - ConstantPool constant_pool) { - super(name_index, length, constant_pool); - setLocalVariableTable(local_variable_table); - } /** @@ -58,19 +42,10 @@ public class LocalVariableTable extends */ LocalVariableTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException { - this(name_index, length, (LocalVariable[]) null, constant_pool); - local_variable_table_length = (file.readUnsignedShort()); - local_variable_table = new LocalVariable[local_variable_table_length]; + super(name_index, length, constant_pool); + int local_variable_table_length = (file.readUnsignedShort()); for (int i = 0; i < local_variable_table_length; i++) { - local_variable_table[i] = new LocalVariable(file); + Utility.swallowLocalVariable(file); } } - - - public final void setLocalVariableTable( LocalVariable[] local_variable_table ) { - this.local_variable_table = local_variable_table; - local_variable_table_length = (local_variable_table == null) - ? 0 - : local_variable_table.length; - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariableTypeTable.java Fri Sep 12 12:31:01 2014 @@ -47,32 +47,16 @@ import java.io.IOException; // } // J5TODO: Needs some testing ! public class LocalVariableTypeTable extends Attribute { - private static final long serialVersionUID = -5466082154076451597L; -private int local_variable_type_table_length; // Table of local - private LocalVariable[] local_variable_type_table; // variables + private static final long serialVersionUID = -5466082154076451597L; - public LocalVariableTypeTable(int name_index, int length, - LocalVariable[] local_variable_table, - ConstantPool constant_pool) - { - super(name_index, length, constant_pool); - setLocalVariableTable(local_variable_table); - } + LocalVariableTypeTable(int name_index, int length, + DataInputStream dis, ConstantPool constant_pool) + throws IOException { + super(name_index, length, constant_pool); - LocalVariableTypeTable(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException { - this(nameIdx, len, (LocalVariable[])null, cpool); + int local_variable_type_table_length = (dis.readUnsignedShort()); - local_variable_type_table_length = (dis.readUnsignedShort()); - local_variable_type_table = new LocalVariable[local_variable_type_table_length]; - - for(int i=0; i < local_variable_type_table_length; i++) - local_variable_type_table[i] = new LocalVariable(dis); - } - - public final void setLocalVariableTable(LocalVariable[] local_variable_table) - { - this.local_variable_type_table = local_variable_table; - local_variable_type_table_length = (local_variable_table == null)? 0 : - local_variable_table.length; - } + for(int i=0; i < local_variable_type_table_length; i++) + Utility.swallowLocalVariable(dis); + } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java Fri Sep 12 12:31:01 2014 @@ -17,9 +17,6 @@ */ package org.apache.tomcat.util.bcel.classfile; -import java.io.DataOutputStream; -import java.io.IOException; - import org.apache.tomcat.util.bcel.Constants; public class SimpleElementValue extends ElementValue @@ -92,28 +89,4 @@ public class SimpleElementValue extends + type); } } - - @Override - public void dump(DataOutputStream dos) throws IOException - { - dos.writeByte(type); // u1 kind of value - switch (type) - { - case PRIMITIVE_INT: - case PRIMITIVE_BYTE: - case PRIMITIVE_CHAR: - case PRIMITIVE_FLOAT: - case PRIMITIVE_LONG: - case PRIMITIVE_BOOLEAN: - case PRIMITIVE_SHORT: - case PRIMITIVE_DOUBLE: - case STRING: - dos.writeShort(getIndex()); - break; - default: - throw new RuntimeException( - "SimpleElementValue doesnt know how to write out type " - + type); - } - } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Unknown.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Unknown.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Unknown.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Unknown.java Fri Sep 12 12:31:01 2014 @@ -36,7 +36,6 @@ import org.apache.tomcat.util.bcel.Const * * @see org.apache.tomcat.util.bcel.classfile.Attribute - * @see org.apache.tomcat.util.bcel.classfile.AttributeReader * @author <A HREF="mailto:m.d...@gmx.de">M. Dahm</A> */ public final class Unknown extends Attribute { Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1624520&r1=1624519&r2=1624520&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Fri Sep 12 12:31:01 2014 @@ -108,4 +108,34 @@ public abstract class Utility { file.readUnsignedShort(); // Unused access_flags } } + + protected static void swallowCodeException(DataInput file) + throws IOException { + file.readUnsignedShort(); // Unused start_pc + file.readUnsignedShort(); // Unused end_pc + file.readUnsignedShort(); // Unused handler_pc + file.readUnsignedShort(); // Unused catch_type + } + + protected static void swallowInnerClass(DataInput file) + throws IOException { + file.readUnsignedShort(); // Unused inner_class_index + file.readUnsignedShort(); // Unused outer_class_index + file.readUnsignedShort(); // Unused inner_name_index + file.readUnsignedShort(); // Unused inner_access_flags + } + + protected static void swallowLineNumber(DataInput file) throws IOException { + file.readUnsignedShort(); // Unused start_pc + file.readUnsignedShort(); // Unused line_number + } + + protected static void swallowLocalVariable(DataInput file) + throws IOException { + file.readUnsignedShort(); // Unused start_pc + file.readUnsignedShort(); // Unused length + file.readUnsignedShort(); // Unused name_index + file.readUnsignedShort(); // Unused signature_index + file.readUnsignedShort(); // Unused index + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org