You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/09/12 13:59:13 UTC
svn commit: r1624506 [1/2] - in /tomcat/tc7.0.x/trunk: ./
java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/
java/org/apache/tomcat/util/bcel/util/
Author: markt
Date: Fri Sep 12 11:59:12 2014
New Revision: 1624506
URL: http://svn.apache.org/r1624506
Log:
Merge removal of unused code from trunk
Removed:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/util/ByteSequence.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/Constants.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.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/ClassFormatException.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.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/CodeException.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInvokeDynamic.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodHandle.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodType.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Field.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/InnerClasses.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.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/LineNumberTable.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.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/Method.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleParameterAnnotations.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleParameterAnnotations.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Signature.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Synthetic.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:r1397953,1397957,1397960
Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
------------------------------------------------------------------------------
Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1397953,1397957,1397960
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java Fri Sep 12 11:59:12 2014
@@ -541,29 +541,4 @@ public interface Constants {
public static final byte ITEM_Object = 7;
public static final byte ITEM_NewObject = 8;
- public static final String[] ITEM_NAMES = {
- "Bogus", "Integer", "Float", "Double", "Long",
- "Null", "InitObject", "Object", "NewObject"
- };
-
- /** Constants used to identify StackMapEntry types.
- *
- * For those types which can specify a range, the
- * constant names the lowest value.
- */
- public static final int SAME_FRAME = 0;
- public static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64;
- public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247;
- public static final int CHOP_FRAME = 248;
- public static final int SAME_FRAME_EXTENDED = 251;
- public static final int APPEND_FRAME = 252;
- public static final int FULL_FRAME = 255;
-
- /** Constants that define the maximum value of
- * those constants which store ranges. */
-
- public static final int SAME_FRAME_MAX = 63;
- public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_MAX = 127;
- public static final int CHOP_FRAME_MAX = 250;
- public static final int APPEND_FRAME_MAX = 254;
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationDefault.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* represents the default value of a annotation for a method info
*
@@ -65,7 +63,7 @@ public class AnnotationDefault extends A
public AnnotationDefault(int name_index, int length,
ElementValue defaultValue, ConstantPool constant_pool)
{
- super(Constants.ATTR_ANNOTATION_DEFAULT, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setDefaultValue(defaultValue);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java Fri Sep 12 11:59:12 2014
@@ -18,7 +18,6 @@
package org.apache.tomcat.util.bcel.classfile;
import java.io.DataInputStream;
-import java.io.DataOutputStream;
import java.io.IOException;
/**
@@ -34,14 +33,13 @@ public abstract class Annotations extend
private AnnotationEntry[] annotation_table;
/**
- * @param annotation_type the subclass type of the annotation
* @param name_index Index pointing to the name <em>Code</em>
* @param length Content length in bytes
* @param file Input stream
* @param constant_pool Array of constants
*/
- public Annotations(byte annotation_type, int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
- this(annotation_type, name_index, length, (AnnotationEntry[]) null, constant_pool);
+ public Annotations(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
+ this(name_index, length, (AnnotationEntry[]) null, constant_pool);
final int annotation_table_length = (file.readUnsignedShort());
annotation_table = new AnnotationEntry[annotation_table_length];
for (int i = 0; i < annotation_table_length; i++) {
@@ -51,14 +49,13 @@ public abstract class Annotations extend
/**
- * @param annotation_type the subclass type of the annotation
* @param name_index Index pointing to the name <em>Code</em>
* @param length Content length in bytes
* @param annotation_table the actual annotations
* @param constant_pool Array of constants
*/
- public Annotations(byte annotation_type, int name_index, int length, AnnotationEntry[] annotation_table, ConstantPool constant_pool) {
- super(annotation_type, name_index, length, constant_pool);
+ public Annotations(int name_index, int length, AnnotationEntry[] annotation_table, ConstantPool constant_pool) {
+ super(name_index, length, constant_pool);
setAnnotationTable(annotation_table);
}
@@ -75,14 +72,4 @@ public abstract class Annotations extend
public AnnotationEntry[] getAnnotationEntries() {
return annotation_table;
}
-
- protected void writeAnnotations(DataOutputStream dos) throws IOException {
- if (annotation_table == null) {
- return;
- }
- dos.writeShort(annotation_table.length);
- for (int i = 0; i < annotation_table.length; i++) {
- annotation_table[i].dump(dos);
- }
- }
}
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -54,14 +54,11 @@ public abstract class Attribute implemen
protected int length; // Content length of attribute field
- protected byte tag; // Tag to distiguish subclasses
-
protected ConstantPool constant_pool;
- protected Attribute(byte tag, int name_index, int length,
+ protected Attribute(int name_index, int length,
ConstantPool constant_pool)
{
- this.tag = tag;
this.name_index = name_index;
this.length = length;
this.constant_pool = constant_pool;
@@ -187,16 +184,6 @@ public abstract class Attribute implemen
/**
- * @return Tag of attribute, i.e., its type. Value may not be altered, thus
- * there is no setTag() method.
- */
- public final byte getTag()
- {
- return tag;
- }
-
-
- /**
* Use copy() if you want to have a deep copy(), i.e., with all references
* copied correctly.
*
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java Fri Sep 12 11:59:12 2014
@@ -36,8 +36,4 @@ public class ClassFormatException extend
public ClassFormatException(String s) {
super(s);
}
-
- public ClassFormatException(String s, Throwable initCause) {
- super(s, initCause);
- }
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java Fri Sep 12 11:59:12 2014
@@ -157,8 +157,7 @@ public final class ClassParser {
}
// Return the information we have gathered in a new object
return new JavaClass(class_name_index, superclass_name_index,
- access_flags, constant_pool, interfaces, fields, methods,
- attributes);
+ access_flags, constant_pool, interfaces, attributes);
}
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents a chunk of Java byte code contained in a
* method. It is instantiated by the
@@ -99,7 +97,7 @@ public final class Code extends Attribut
*/
public Code(int name_index, int length, byte[] code,
CodeException[] exception_table, Attribute[] attributes, ConstantPool constant_pool) {
- super(Constants.ATTR_CODE, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setCode(code);
setExceptionTable(exception_table);
setAttributes(attributes); // Overwrites length!
@@ -107,19 +105,6 @@ public final class Code extends Attribut
/**
- * @return LocalVariableTable of Code, if it has one
- */
- public LocalVariableTable getLocalVariableTable() {
- for (int i = 0; i < attributes_count; i++) {
- if (attributes[i] instanceof LocalVariableTable) {
- return (LocalVariableTable) attributes[i];
- }
- }
- return null;
- }
-
-
- /**
* @return the internal length of this code attribute (minus the first 6 bytes)
* and excluding all its attributes
*/
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/CodeException.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/CodeException.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/CodeException.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/CodeException.java Fri Sep 12 11:59:12 2014
@@ -18,7 +18,6 @@
package org.apache.tomcat.util.bcel.classfile;
import java.io.DataInput;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
@@ -35,15 +34,6 @@ import org.apache.tomcat.util.bcel.Const
public final class CodeException implements Cloneable, Constants, Serializable {
private static final long serialVersionUID = -6351674720658890686L;
- private int start_pc; // Range in the code the exception handler is
- private int end_pc; // active. start_pc is inclusive, end_pc exclusive
- private int handler_pc; /* Starting address of exception handler, i.e.,
- * an offset from start of code.
- */
- private int catch_type; /* If this is zero the handler catches any
- * exception, otherwise it points to the
- * exception class which is to be caught.
- */
/**
@@ -52,40 +42,10 @@ public final class CodeException impleme
* @throws IOException
*/
CodeException(DataInput file) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), file
- .readUnsignedShort());
- }
-
-
- /**
- * @param start_pc Range in the code the exception handler is active,
- * start_pc is inclusive while
- * @param end_pc is exclusive
- * @param handler_pc Starting address of exception handler, i.e.,
- * an offset from start of code.
- * @param catch_type If zero the handler catches any
- * exception, otherwise it points to the exception class which is
- * to be caught.
- */
- public CodeException(int start_pc, int end_pc, int handler_pc, int catch_type) {
- this.start_pc = start_pc;
- this.end_pc = end_pc;
- this.handler_pc = handler_pc;
- this.catch_type = catch_type;
- }
-
-
- /**
- * Dump code exception to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump( DataOutputStream file ) throws IOException {
- file.writeShort(start_pc);
- file.writeShort(end_pc);
- file.writeShort(handler_pc);
- file.writeShort(catch_type);
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInvokeDynamic.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInvokeDynamic.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInvokeDynamic.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInvokeDynamic.java Fri Sep 12 11:59:12 2014
@@ -32,16 +32,6 @@ import org.apache.tomcat.util.bcel.Const
public final class ConstantInvokeDynamic extends Constant {
private static final long serialVersionUID = 4310367359017396174L;
- private int bootstrap_method_attr_index;
- private int name_and_type_index;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantInvokeDynamic(ConstantInvokeDynamic c) {
- this(c.getBootstrapMethodAttrIndex(), c.getNameAndTypeIndex());
- }
/**
@@ -51,34 +41,13 @@ public final class ConstantInvokeDynamic
* @throws IOException
*/
ConstantInvokeDynamic(DataInput file) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort());
+ this();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
}
- public ConstantInvokeDynamic(int bootstrap_method_attr_index,
- int name_and_type_index) {
+ public ConstantInvokeDynamic() {
super(Constants.CONSTANT_InvokeDynamic);
- this.bootstrap_method_attr_index = bootstrap_method_attr_index;
- this.name_and_type_index = name_and_type_index;
- }
-
-
- public int getBootstrapMethodAttrIndex() {
- return bootstrap_method_attr_index;
- }
-
-
- public void setBootstrapMethodAttrIndex(int bootstrap_method_attr_index) {
- this.bootstrap_method_attr_index = bootstrap_method_attr_index;
- }
-
-
- public int getNameAndTypeIndex() {
- return name_and_type_index;
- }
-
-
- public void setNameAndTypeIndex(int name_and_type_index) {
- this.name_and_type_index = name_and_type_index;
}
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodHandle.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodHandle.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodHandle.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodHandle.java Fri Sep 12 11:59:12 2014
@@ -32,16 +32,6 @@ import org.apache.tomcat.util.bcel.Const
public final class ConstantMethodHandle extends Constant {
private static final long serialVersionUID = -7875124116920198044L;
- private int reference_kind;
- private int reference_index;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantMethodHandle(ConstantMethodHandle c) {
- this(c.getReferenceKind(), c.getReferenceIndex());
- }
/**
@@ -51,33 +41,13 @@ public final class ConstantMethodHandle
* @throws IOException
*/
ConstantMethodHandle(DataInput file) throws IOException {
- this(file.readUnsignedByte(), file.readUnsignedShort());
+ this();
+ file.readUnsignedByte();
+ file.readUnsignedShort();
}
- public ConstantMethodHandle(int reference_kind, int reference_index) {
+ public ConstantMethodHandle() {
super(Constants.CONSTANT_MethodHandle);
- this.reference_kind = reference_kind;
- this.reference_index = reference_index;
- }
-
-
- public int getReferenceKind() {
- return reference_kind;
- }
-
-
- public void setReferenceKind(int reference_kind) {
- this.reference_kind = reference_kind;
- }
-
-
- public int getReferenceIndex() {
- return reference_index;
- }
-
-
- public void setReferenceIndex(int reference_index) {
- this.reference_index = reference_index;
}
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodType.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodType.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodType.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodType.java Fri Sep 12 11:59:12 2014
@@ -32,15 +32,6 @@ import org.apache.tomcat.util.bcel.Const
public final class ConstantMethodType extends Constant {
private static final long serialVersionUID = 6750768220616618881L;
- private int descriptor_index;
-
-
- /**
- * Initialize from another object.
- */
- public ConstantMethodType(ConstantMethodType c) {
- this(c.getDescriptorIndex());
- }
/**
@@ -50,22 +41,12 @@ public final class ConstantMethodType ex
* @throws IOException
*/
ConstantMethodType(DataInput file) throws IOException {
- this(file.readUnsignedShort());
+ this();
+ file.readUnsignedShort();
}
- public ConstantMethodType(int descriptor_index) {
+ public ConstantMethodType() {
super(Constants.CONSTANT_MethodType);
- this.descriptor_index = descriptor_index;
- }
-
-
- public int getDescriptorIndex() {
- return descriptor_index;
- }
-
-
- public void setDescriptorIndex(int descriptor_index) {
- this.descriptor_index = descriptor_index;
}
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java Fri Sep 12 11:59:12 2014
@@ -249,12 +249,4 @@ public class ConstantPool implements Clo
c = getConstant(i, Constants.CONSTANT_Utf8);
return ((ConstantUtf8) c).getBytes();
}
-
-
- /**
- * @return Length of constant pool.
- */
- public int getLength() {
- return constant_pool_count;
- }
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java Fri Sep 12 11:59:12 2014
@@ -19,8 +19,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and represents a constant
* value, i.e., a default value for initializing a class field.
@@ -55,7 +53,7 @@ public final class ConstantValue extends
*/
public ConstantValue(int name_index, int length,
ConstantPool constant_pool) {
- super(Constants.ATTR_CONSTANT_VALUE, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Deprecated.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and denotes that this is a
* deprecated method.
@@ -43,7 +41,7 @@ public final class Deprecated extends At
* @param constant_pool Array of constants
*/
public Deprecated(int name_index, int length, byte[] bytes, ConstantPool constant_pool) {
- super(Constants.ATTR_DEPRECATED, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
this.bytes = bytes;
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnclosingMethod.java Fri Sep 12 11:59:12 2014
@@ -19,8 +19,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This attribute exists for local or
* anonymous classes and ... there can be only one.
@@ -32,7 +30,7 @@ public class EnclosingMethod extends Att
// Ctors - and code to read an attribute in.
public EnclosingMethod(int nameIndex, int len, DataInputStream dis,
ConstantPool cpool) throws IOException {
- super(Constants.ATTR_ENCLOSING_METHOD, nameIndex, len, cpool);
+ super(nameIndex, len, cpool);
// Unused class index
dis.readUnsignedShort();
// Unused method index
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ExceptionTable.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents the table of exceptions that are thrown by a
* method. This attribute may be used once per method. The name of
@@ -48,7 +46,7 @@ public final class ExceptionTable extend
*/
public ExceptionTable(int name_index, int length, int[] exception_index_table,
ConstantPool constant_pool) {
- super(Constants.ATTR_EXCEPTIONS, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setExceptionIndexTable(exception_index_table);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Field.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Field.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Field.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Field.java Fri Sep 12 11:59:12 2014
@@ -20,7 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
import org.apache.tomcat.util.bcel.util.BCELComparator;
/**
@@ -62,19 +61,6 @@ public final class Field extends FieldOr
/**
- * @return constant value associated with this field (may be null)
- */
- public final ConstantValue getConstantValue() {
- for (int i = 0; i < attributes_count; i++) {
- if (attributes[i].getTag() == Constants.ATTR_CONSTANT_VALUE) {
- return (ConstantValue) attributes[i];
- }
- }
- return null;
- }
-
-
- /**
* Return value as defined by given BCELComparator strategy.
* By default two Field objects are said to be equal when
* their names and signatures are equal.
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/InnerClass.java Fri Sep 12 11:59:12 2014
@@ -18,7 +18,6 @@
package org.apache.tomcat.util.bcel.classfile;
import java.io.DataInput;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
@@ -33,11 +32,6 @@ import java.io.Serializable;
public final class InnerClass implements Cloneable, Serializable {
private static final long serialVersionUID = -4964694103982806087L;
- private int inner_class_index;
- private int outer_class_index;
- private int inner_name_index;
- private int inner_access_flags;
-
/**
* Construct object from file stream.
@@ -45,37 +39,10 @@ public final class InnerClass implements
* @throws IOException
*/
InnerClass(DataInput file) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), file
- .readUnsignedShort());
- }
-
-
- /**
- * @param inner_class_index Class index in constant pool of inner class
- * @param outer_class_index Class index in constant pool of outer class
- * @param inner_name_index Name index in constant pool of inner class
- * @param inner_access_flags Access flags of inner class
- */
- public InnerClass(int inner_class_index, int outer_class_index, int inner_name_index,
- int inner_access_flags) {
- this.inner_class_index = inner_class_index;
- this.outer_class_index = outer_class_index;
- this.inner_name_index = inner_name_index;
- this.inner_access_flags = inner_access_flags;
- }
-
-
- /**
- * Dump inner class attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump( DataOutputStream file ) throws IOException {
- file.writeShort(inner_class_index);
- file.writeShort(outer_class_index);
- file.writeShort(inner_name_index);
- file.writeShort(inner_access_flags);
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
}
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and denotes that this class
* is an Inner class of another.
@@ -46,7 +44,7 @@ public final class InnerClasses extends
*/
public InnerClasses(int name_index, int length, InnerClass[] inner_classes,
ConstantPool constant_pool) {
- super(Constants.ATTR_INNER_CLASSES, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setInnerClasses(inner_classes);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java Fri Sep 12 11:59:12 2014
@@ -75,25 +75,17 @@ public class JavaClass extends AccessFla
* @param access_flags Access rights defined by bit flags
* @param constant_pool Array of constants
* @param interfaces Implemented interfaces
- * @param fields Class fields
- * @param methods Class methods
* @param attributes Class attributes
*/
public JavaClass(int class_name_index, int superclass_name_index,
int access_flags, ConstantPool constant_pool, int[] interfaces,
- Field[] fields, Method[] methods, Attribute[] attributes) {
+ Attribute[] attributes) {
if (interfaces == null) {
interfaces = new int[0];
}
if (attributes == null) {
attributes = new Attribute[0];
}
- if (fields == null) {
- fields = new Field[0];
- }
- if (methods == null) {
- methods = new Method[0];
- }
this.access_flags = access_flags;
this.attributes = attributes;
annotationsOutOfDate = true;
@@ -173,10 +165,6 @@ public class JavaClass extends AccessFla
}
- public final boolean isSuper() {
- return (access_flags & Constants.ACC_SUPER) != 0;
- }
-
/**
* Return value as defined by given BCELComparator strategy.
* By default two JavaClass objects are said to be equal when
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LineNumber.java Fri Sep 12 11:59:12 2014
@@ -18,7 +18,6 @@
package org.apache.tomcat.util.bcel.classfile;
import java.io.DataInput;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
@@ -33,8 +32,6 @@ import java.io.Serializable;
public final class LineNumber implements Cloneable, Serializable {
private static final long serialVersionUID = 3393830630264494355L;
- private int start_pc; // Program Counter (PC) corresponds to line
- private int line_number; // number in source file
/**
@@ -43,29 +40,8 @@ public final class LineNumber implements
* @throws IOException
*/
LineNumber(DataInput file) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort());
- }
-
-
- /**
- * @param start_pc Program Counter (PC) corresponds to
- * @param line_number line number in source file
- */
- public LineNumber(int start_pc, int line_number) {
- this.start_pc = start_pc;
- this.line_number = line_number;
- }
-
-
- /**
- * Dump line number/pc pair to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump( DataOutputStream file ) throws IOException {
- file.writeShort(start_pc);
- file.writeShort(line_number);
+ file.readUnsignedShort();
+ file.readUnsignedShort();
}
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents a table of line numbers for debugging
* purposes. This attribute is used by the <em>Code</em> attribute. It
@@ -46,7 +44,7 @@ public final class LineNumberTable exten
*/
public LineNumberTable(int name_index, int length, LineNumber[] line_number_table,
ConstantPool constant_pool) {
- super(Constants.ATTR_LINE_NUMBER_TABLE, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setLineNumberTable(line_number_table);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/LocalVariable.java Fri Sep 12 11:59:12 2014
@@ -18,7 +18,6 @@
package org.apache.tomcat.util.bcel.classfile;
import java.io.DataInput;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
@@ -34,14 +33,6 @@ import org.apache.tomcat.util.bcel.Const
public final class LocalVariable implements Constants, Cloneable, Serializable {
private static final long serialVersionUID = -914189896372081589L;
- private int start_pc; // Range in which the variable is valid
- private int length;
- private int name_index; // Index in constant pool of variable name
- private int signature_index; // Index of variable signature
- private int index; /* Variable is `index'th local variable on
- * this method's frame.
- */
- private ConstantPool constant_pool;
/**
@@ -49,71 +40,12 @@ public final class LocalVariable impleme
* @param file Input stream
* @throws IOException
*/
- LocalVariable(DataInput file, ConstantPool constant_pool) throws IOException {
- this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), file
- .readUnsignedShort(), file.readUnsignedShort(), constant_pool);
- }
-
-
- /**
- * @param start_pc Range in which the variable
- * @param length ... is valid
- * @param name_index Index in constant pool of variable name
- * @param signature_index Index of variable's signature
- * @param index Variable is `index'th local variable on the method's frame
- * @param constant_pool Array of constants
- */
- public LocalVariable(int start_pc, int length, int name_index, int signature_index, int index,
- ConstantPool constant_pool) {
- this.start_pc = start_pc;
- this.length = length;
- this.name_index = name_index;
- this.signature_index = signature_index;
- this.index = index;
- this.constant_pool = constant_pool;
- }
-
-
- /**
- * Dump local variable to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump( DataOutputStream file ) throws IOException {
- file.writeShort(start_pc);
- file.writeShort(length);
- file.writeShort(name_index);
- file.writeShort(signature_index);
- file.writeShort(index);
- }
-
-
- /**
- * @return Variable name.
- */
- public final String getName() {
- ConstantUtf8 c;
- c = (ConstantUtf8) constant_pool.getConstant(name_index, CONSTANT_Utf8);
- return c.getBytes();
- }
-
-
- /**
- * @return Signature.
- */
- public final String getSignature() {
- ConstantUtf8 c;
- c = (ConstantUtf8) constant_pool.getConstant(signature_index, CONSTANT_Utf8);
- return c.getBytes();
- }
-
-
- /**
- * @return index of register where variable is stored
- */
- public final int getIndex() {
- return index;
+ LocalVariable(DataInput file) throws IOException {
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
+ file.readUnsignedShort();
}
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents colection of local variables in a
* method. This attribute is contained in the <em>Code</em> attribute.
@@ -45,7 +43,7 @@ public class LocalVariableTable extends
*/
public LocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table,
ConstantPool constant_pool) {
- super(Constants.ATTR_LOCAL_VARIABLE_TABLE, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setLocalVariableTable(local_variable_table);
}
@@ -64,30 +62,11 @@ public class LocalVariableTable extends
local_variable_table_length = (file.readUnsignedShort());
local_variable_table = new LocalVariable[local_variable_table_length];
for (int i = 0; i < local_variable_table_length; i++) {
- local_variable_table[i] = new LocalVariable(file, constant_pool);
+ local_variable_table[i] = new LocalVariable(file);
}
}
- /**
- *
- * @param index the variable slot
- *
- * @return the first LocalVariable that matches the slot or null if not found
- *
- * @deprecated since 5.2 because multiple variables can share the
- * same slot, use getLocalVariable(int index, int pc) instead.
- */
- @java.lang.Deprecated
- public final LocalVariable getLocalVariable( int index ) {
- for (int i = 0; i < local_variable_table_length; i++) {
- if (local_variable_table[i].getIndex() == index) {
- return local_variable_table[i];
- }
- }
- return null;
- }
-
public final void setLocalVariableTable( LocalVariable[] local_variable_table ) {
this.local_variable_table = local_variable_table;
local_variable_table_length = (local_variable_table == null)
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -19,8 +19,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
// The new table is used when generic types are about...
//LocalVariableTable_attribute {
@@ -57,7 +55,7 @@ private int local_variable_t
LocalVariable[] local_variable_table,
ConstantPool constant_pool)
{
- super(Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setLocalVariableTable(local_variable_table);
}
@@ -68,7 +66,7 @@ private int local_variable_t
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, cpool);
+ local_variable_type_table[i] = new LocalVariable(dis);
}
public final void setLocalVariableTable(LocalVariable[] local_variable_table)
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Method.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Method.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Method.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Method.java Fri Sep 12 11:59:12 2014
@@ -72,45 +72,6 @@ public final class Method extends FieldO
/**
- * @return Code attribute of method, if any
- */
- public final Code getCode() {
- for (int i = 0; i < attributes_count; i++) {
- if (attributes[i] instanceof Code) {
- return (Code) attributes[i];
- }
- }
- return null;
- }
-
-
- /**
- * @return ExceptionTable attribute of method, if any, i.e., list all
- * exceptions the method may throw not exception handlers!
- */
- public final ExceptionTable getExceptionTable() {
- for (int i = 0; i < attributes_count; i++) {
- if (attributes[i] instanceof ExceptionTable) {
- return (ExceptionTable) attributes[i];
- }
- }
- return null;
- }
-
-
- /** @return LocalVariableTable of code attribute if any, i.e. the call is forwarded
- * to the Code atribute.
- */
- public final LocalVariableTable getLocalVariableTable() {
- Code code = getCode();
- if (code == null) {
- return null;
- }
- return code.getLocalVariableTable();
- }
-
-
- /**
* Return value as defined by given BCELComparator strategy.
* By default two method objects are said to be equal when
* their names and signatures are equal.
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/PMGClass.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and represents a reference
* to a PMG attribute.
@@ -32,7 +30,6 @@ import org.apache.tomcat.util.bcel.Const
public final class PMGClass extends Attribute {
private static final long serialVersionUID = -1876065562391587509L;
- private int pmg_class_index, pmg_index;
/**
@@ -45,42 +42,19 @@ public final class PMGClass extends Attr
*/
PMGClass(int name_index, int length, DataInput file, ConstantPool constant_pool)
throws IOException {
- this(name_index, length, file.readUnsignedShort(), file.readUnsignedShort(), constant_pool);
+ this(name_index, length, constant_pool);
+ file.readUnsignedShort();
+ file.readUnsignedShort();
}
/**
* @param name_index Index in constant pool to CONSTANT_Utf8
* @param length Content length in bytes
- * @param pmg_index index in constant pool for source file name
- * @param pmg_class_index Index in constant pool to CONSTANT_Utf8
* @param constant_pool Array of constants
*/
- public PMGClass(int name_index, int length, int pmg_index, int pmg_class_index,
- ConstantPool constant_pool) {
- super(Constants.ATTR_PMG, name_index, length, constant_pool);
- this.pmg_index = pmg_index;
- this.pmg_class_index = pmg_class_index;
- }
-
-
- /**
- * @return PMG name.
- */
- public final String getPMGName() {
- ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(pmg_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
-
- /**
- * @return PMG class name.
- */
- public final String getPMGClassName() {
- ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(pmg_class_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
+ public PMGClass(int name_index, int length, ConstantPool constant_pool) {
+ super(name_index, length, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java Fri Sep 12 11:59:12 2014
@@ -34,15 +34,14 @@ public abstract class ParameterAnnotatio
/**
- * @param parameter_annotation_type the subclass type of the parameter annotation
* @param name_index Index pointing to the name <em>Code</em>
* @param length Content length in bytes
* @param file Input stream
* @param constant_pool Array of constants
*/
- ParameterAnnotations(byte parameter_annotation_type, int name_index, int length,
+ ParameterAnnotations(int name_index, int length,
DataInputStream file, ConstantPool constant_pool) throws IOException {
- this(parameter_annotation_type, name_index, length, (ParameterAnnotationEntry[]) null,
+ this(name_index, length, (ParameterAnnotationEntry[]) null,
constant_pool);
num_parameters = (file.readUnsignedByte());
parameter_annotation_table = new ParameterAnnotationEntry[num_parameters];
@@ -53,15 +52,14 @@ public abstract class ParameterAnnotatio
/**
- * @param parameter_annotation_type the subclass type of the parameter annotation
* @param name_index Index pointing to the name <em>Code</em>
* @param length Content length in bytes
* @param parameter_annotation_table the actual parameter annotations
* @param constant_pool Array of constants
*/
- public ParameterAnnotations(byte parameter_annotation_type, int name_index, int length,
+ public ParameterAnnotations(int name_index, int length,
ParameterAnnotationEntry[] parameter_annotation_table, ConstantPool constant_pool) {
- super(parameter_annotation_type, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setParameterAnnotationTable(parameter_annotation_table);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* represents an annotation that is represented in the class file but is not
* provided to the JVM.
@@ -47,7 +45,7 @@ public class RuntimeInvisibleAnnotations
DataInputStream file, ConstantPool constant_pool)
throws IOException
{
- super(Constants.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS, name_index, length,
+ super(name_index, length,
file, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleParameterAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleParameterAnnotations.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleParameterAnnotations.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleParameterAnnotations.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* represents a parameter annotation that is represented in the class file
* but is not provided to the JVM.
@@ -42,7 +40,7 @@ public class RuntimeInvisibleParameterAn
*/
RuntimeInvisibleParameterAnnotations(int name_index, int length, DataInputStream file,
ConstantPool constant_pool) throws IOException {
- super(Constants.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS, name_index, length, file,
+ super(name_index, length, file,
constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* represents an annotation that is represented in the class file and is
* provided to the JVM.
@@ -47,7 +45,7 @@ public class RuntimeVisibleAnnotations e
DataInputStream file, ConstantPool constant_pool)
throws IOException
{
- super(Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS, name_index, length,
+ super(name_index, length,
file, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleParameterAnnotations.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleParameterAnnotations.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleParameterAnnotations.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleParameterAnnotations.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* represents a parameter annotation that is represented in the class file
* and is provided to the JVM.
@@ -42,8 +40,7 @@ public class RuntimeVisibleParameterAnno
*/
RuntimeVisibleParameterAnnotations(int name_index, int length, DataInputStream file,
ConstantPool constant_pool) throws IOException {
- super(Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS, name_index, length, file,
- constant_pool);
+ super(name_index, length, file, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Signature.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Signature.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Signature.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Signature.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and represents a reference
* to a GJ attribute.
@@ -32,7 +30,6 @@ import org.apache.tomcat.util.bcel.Const
public final class Signature extends Attribute {
private static final long serialVersionUID = 7493781777025829964L;
- private int signature_index;
/**
@@ -45,29 +42,18 @@ public final class Signature extends Att
*/
Signature(int name_index, int length, DataInput file, ConstantPool constant_pool)
throws IOException {
- this(name_index, length, file.readUnsignedShort(), constant_pool);
+ this(name_index, length, constant_pool);
+ file.readUnsignedShort();
}
/**
* @param name_index Index in constant pool to CONSTANT_Utf8
* @param length Content length in bytes
- * @param signature_index Index in constant pool to CONSTANT_Utf8
* @param constant_pool Array of constants
*/
- public Signature(int name_index, int length, int signature_index, ConstantPool constant_pool) {
- super(Constants.ATTR_SIGNATURE, name_index, length, constant_pool);
- this.signature_index = signature_index;
- }
-
-
- /**
- * @return GJ signature.
- */
- public final String getSignature() {
- ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(signature_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
+ public Signature(int name_index, int length, ConstantPool constant_pool) {
+ super(name_index, length, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SourceFile.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInput;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and represents a reference
* to the source file of this class. At most one SourceFile attribute
@@ -34,7 +32,6 @@ import org.apache.tomcat.util.bcel.Const
public final class SourceFile extends Attribute {
private static final long serialVersionUID = 332346699609443704L;
- private int sourcefile_index;
/**
@@ -47,7 +44,8 @@ public final class SourceFile extends At
*/
SourceFile(int name_index, int length, DataInput file, ConstantPool constant_pool)
throws IOException {
- this(name_index, length, file.readUnsignedShort(), constant_pool);
+ this(name_index, length, constant_pool);
+ file.readUnsignedShort();
}
@@ -57,26 +55,9 @@ public final class SourceFile extends At
* @param length Content length in bytes, the value should be 2.
* @param constant_pool The constant pool that this attribute is
* associated with.
- * @param sourcefile_index Index in constant pool to CONSTANT_Utf8. This
- * string will be interpreted as the name of the file from which this
- * class was compiled. It will not be interpreted as indicating the name
- * of the directory contqining the file or an absolute path; this
- * information has to be supplied the consumer of this attribute - in
- * many cases, the JVM.
- */
- public SourceFile(int name_index, int length, int sourcefile_index, ConstantPool constant_pool) {
- super(Constants.ATTR_SOURCE_FILE, name_index, length, constant_pool);
- this.sourcefile_index = sourcefile_index;
- }
-
-
- /**
- * @return Source file name.
*/
- public final String getSourceFileName() {
- ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(sourcefile_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
+ public SourceFile(int name_index, int length, ConstantPool constant_pool) {
+ super(name_index, length, constant_pool);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents a stack map attribute used for
* preverification of Java classes for the <a
@@ -50,7 +48,7 @@ public final class StackMap extends Attr
* @param constant_pool Array of constants
*/
public StackMap(int name_index, int length, StackMapEntry[] map, ConstantPool constant_pool) {
- super(Constants.ATTR_STACK_MAP, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setStackMap(map);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java Fri Sep 12 11:59:12 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.io.Serializable;
@@ -35,59 +34,9 @@ public final class StackMapEntry impleme
private static final long serialVersionUID = 1L;
- private int byte_code_offset;
- private int number_of_locals;
- private StackMapType[] types_of_locals;
- private int number_of_stack_items;
- private StackMapType[] types_of_stack_items;
-
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
StackMapEntry(DataInputStream file) throws IOException {
- this(file.readShort(), file.readShort(), null, -1, null);
- types_of_locals = new StackMapType[number_of_locals];
- for (int i = 0; i < number_of_locals; i++) {
- types_of_locals[i] = new StackMapType(file);
- }
- number_of_stack_items = file.readShort();
- types_of_stack_items = new StackMapType[number_of_stack_items];
- for (int i = 0; i < number_of_stack_items; i++) {
- types_of_stack_items[i] = new StackMapType(file);
- }
- }
-
-
- public StackMapEntry(int byte_code_offset, int number_of_locals,
- StackMapType[] types_of_locals, int number_of_stack_items,
- StackMapType[] types_of_stack_items) {
- this.byte_code_offset = byte_code_offset;
- this.number_of_locals = number_of_locals;
- this.types_of_locals = types_of_locals;
- this.number_of_stack_items = number_of_stack_items;
- this.types_of_stack_items = types_of_stack_items;
- }
-
-
- /**
- * Dump stack map entry
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump( DataOutputStream file ) throws IOException {
- file.writeShort(byte_code_offset);
- file.writeShort(number_of_locals);
- for (int i = 0; i < number_of_locals; i++) {
- types_of_locals[i].dump(file);
- }
- file.writeShort(number_of_stack_items);
- for (int i = 0; i < number_of_stack_items; i++) {
- types_of_stack_items[i].dump(file);
- }
+ file.readShort();
+ file.readShort();
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents a stack map attribute used for
* preverification of Java classes for the <a
@@ -50,7 +48,7 @@ public final class StackMapTable extends
* @param constant_pool Array of constants
*/
public StackMapTable(int name_index, int length, StackMapTableEntry[] map, ConstantPool constant_pool) {
- super(Constants.ATTR_STACK_MAP_TABLE, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
setStackMapTable(map);
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java Fri Sep 12 11:59:12 2014
@@ -18,12 +18,9 @@
package org.apache.tomcat.util.bcel.classfile;
import java.io.DataInputStream;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class represents a stack map entry recording the types of
* local variables and the the of stack items at a given byte code offset.
@@ -37,13 +34,6 @@ public final class StackMapTableEntry im
private static final long serialVersionUID = 1L;
- private int frame_type;
- private int byte_code_offset_delta;
- private int number_of_locals;
- private StackMapType[] types_of_locals;
- private int number_of_stack_items;
- private StackMapType[] types_of_stack_items;
-
/**
* Construct object from file stream.
@@ -51,100 +41,7 @@ public final class StackMapTableEntry im
* @throws IOException
*/
StackMapTableEntry(DataInputStream file) throws IOException {
- this(file.read(), -1, -1, null, -1, null);
-
- if (frame_type >= Constants.SAME_FRAME && frame_type <= Constants.SAME_FRAME_MAX) {
- byte_code_offset_delta = frame_type - Constants.SAME_FRAME;
- } else if (frame_type >= Constants.SAME_LOCALS_1_STACK_ITEM_FRAME && frame_type <= Constants.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
- byte_code_offset_delta = frame_type - Constants.SAME_LOCALS_1_STACK_ITEM_FRAME;
- number_of_stack_items = 1;
- types_of_stack_items = new StackMapType[1];
- types_of_stack_items[0] = new StackMapType(file);
- } else if (frame_type == Constants.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
- byte_code_offset_delta = file.readShort();
- number_of_stack_items = 1;
- types_of_stack_items = new StackMapType[1];
- types_of_stack_items[0] = new StackMapType(file);
- } else if (frame_type >= Constants.CHOP_FRAME && frame_type <= Constants.CHOP_FRAME_MAX) {
- byte_code_offset_delta = file.readShort();
- } else if (frame_type == Constants.SAME_FRAME_EXTENDED) {
- byte_code_offset_delta = file.readShort();
- } else if (frame_type >= Constants.APPEND_FRAME && frame_type <= Constants.APPEND_FRAME_MAX) {
- byte_code_offset_delta = file.readShort();
- number_of_locals = frame_type - 251;
- types_of_locals = new StackMapType[number_of_locals];
- for (int i = 0; i < number_of_locals; i++) {
- types_of_locals[i] = new StackMapType(file);
- }
- } else if (frame_type == Constants.FULL_FRAME) {
- byte_code_offset_delta = file.readShort();
- number_of_locals = file.readShort();
- types_of_locals = new StackMapType[number_of_locals];
- for (int i = 0; i < number_of_locals; i++) {
- types_of_locals[i] = new StackMapType(file);
- }
- number_of_stack_items = file.readShort();
- types_of_stack_items = new StackMapType[number_of_stack_items];
- for (int i = 0; i < number_of_stack_items; i++) {
- types_of_stack_items[i] = new StackMapType(file);
- }
- } else {
- /* Can't happen */
- throw new ClassFormatException ("Invalid frame type found while parsing stack map table: " + frame_type);
- }
- }
-
-
- public StackMapTableEntry(int tag, int byte_code_offset_delta, int number_of_locals,
- StackMapType[] types_of_locals, int number_of_stack_items,
- StackMapType[] types_of_stack_items) {
- this.frame_type = tag;
- this.byte_code_offset_delta = byte_code_offset_delta;
- this.number_of_locals = number_of_locals;
- this.types_of_locals = types_of_locals;
- this.number_of_stack_items = number_of_stack_items;
- this.types_of_stack_items = types_of_stack_items;
- }
-
-
- /**
- * Dump stack map entry
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump( DataOutputStream file ) throws IOException {
- file.write(frame_type);
- if (frame_type >= Constants.SAME_FRAME && frame_type <= Constants.SAME_FRAME_MAX) {
- // nothing to be done
- } else if (frame_type >= Constants.SAME_LOCALS_1_STACK_ITEM_FRAME && frame_type <= Constants.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
- types_of_stack_items[0].dump(file);
- } else if (frame_type == Constants.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
- file.writeShort(byte_code_offset_delta);
- types_of_stack_items[0].dump(file);
- } else if (frame_type >= Constants.CHOP_FRAME && frame_type <= Constants.CHOP_FRAME_MAX) {
- file.writeShort(byte_code_offset_delta);
- } else if (frame_type == Constants.SAME_FRAME_EXTENDED) {
- file.writeShort(byte_code_offset_delta);
- } else if (frame_type >= Constants.APPEND_FRAME && frame_type <= Constants.APPEND_FRAME_MAX) {
- file.writeShort(byte_code_offset_delta);
- for (int i = 0; i < number_of_locals; i++) {
- types_of_locals[i].dump(file);
- }
- } else if (frame_type == Constants.FULL_FRAME) {
- file.writeShort(byte_code_offset_delta);
- file.writeShort(number_of_locals);
- for (int i = 0; i < number_of_locals; i++) {
- types_of_locals[i].dump(file);
- }
- file.writeShort(number_of_stack_items);
- for (int i = 0; i < number_of_stack_items; i++) {
- types_of_stack_items[i].dump(file);
- }
- } else {
- /* Can't happen */
- throw new ClassFormatException ("Invalid Stack map table tag: " + frame_type);
- }
+ file.read();
}
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java?rev=1624506&r1=1624505&r2=1624506&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java Fri Sep 12 11:59:12 2014
@@ -20,8 +20,6 @@ package org.apache.tomcat.util.bcel.clas
import java.io.DataInputStream;
import java.io.IOException;
-import org.apache.tomcat.util.bcel.Constants;
-
/**
* This class is derived from <em>Attribute</em> and declares this class as
* `synthetic', i.e., it needs special handling. The JVM specification
@@ -49,7 +47,7 @@ public final class Synthetic extends Att
* with.
*/
public Synthetic(int name_index, int length, byte[] bytes, ConstantPool constant_pool) {
- super(Constants.ATTR_SYNTHETIC, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
this.bytes = bytes;
}
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=1624506&r1=1624505&r2=1624506&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 11:59:12 2014
@@ -57,7 +57,7 @@ public final class Unknown extends Attri
* @param constant_pool Array of constants
*/
public Unknown(int name_index, int length, byte[] bytes, ConstantPool constant_pool) {
- super(Constants.ATTR_UNKNOWN, name_index, length, constant_pool);
+ super(name_index, length, constant_pool);
this.bytes = bytes;
name = ((ConstantUtf8) constant_pool.getConstant(name_index, Constants.CONSTANT_Utf8))
.getBytes();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org