tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1384055 - in /tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile: Code.java ConstantValue.java JavaClass.java StackMap.java StackMapEntry.java StackMapTable.java StackMapTableEntry.java StackMapType.java
Date Wed, 12 Sep 2012 17:53:06 GMT
Author: markt
Date: Wed Sep 12 17:53:06 2012
New Revision: 1384055

URL: http://svn.apache.org/viewvc?rev=1384055&view=rev
Log:
Follow the trail of unused code identified by Eclipse and remove it.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Code.java Wed Sep 12 17:53:06
2012
@@ -44,8 +44,6 @@ import org.apache.tomcat.util.bcel.Const
 public final class Code extends Attribute {
 
     private static final long serialVersionUID = 8936843273318969602L;
-    private int max_stack; // Maximum size of stack used by this method
-    private int max_locals; // Number of local variables
     private int code_length; // Length of code in bytes
     private byte[] code; // Actual byte code
     private int exception_table_length;
@@ -105,8 +103,6 @@ public final class Code extends Attribut
     public Code(int name_index, int length, int max_stack, int max_locals, byte[] code,
             CodeException[] exception_table, Attribute[] attributes, ConstantPool constant_pool)
{
         super(Constants.ATTR_CODE, name_index, length, constant_pool);
-        this.max_stack = max_stack;
-        this.max_locals = max_locals;
         setCode(code);
         setExceptionTable(exception_table);
         setAttributes(attributes); // Overwrites length!

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantValue.java Wed Sep 12
17:53:06 2012
@@ -33,7 +33,6 @@ import org.apache.tomcat.util.bcel.Const
 public final class ConstantValue extends Attribute {
 
     private static final long serialVersionUID = -388222612752527969L;
-    private int constantvalue_index;
 
 
     /**
@@ -59,7 +58,6 @@ public final class ConstantValue extends
     public ConstantValue(int name_index, int length, int constantvalue_index,
             ConstantPool constant_pool) {
         super(Constants.ATTR_CONSTANT_VALUE, name_index, length, constant_pool);
-        this.constantvalue_index = constantvalue_index;
     }
 
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java Wed Sep 12 17:53:06
2012
@@ -38,16 +38,9 @@ public class JavaClass extends AccessFla
         implements Cloneable, Comparable<JavaClass> {
 
     private static final long serialVersionUID = 7029227708237523236L;
-    private String file_name;
-    private String source_file_name = "<Unknown>";
     private String class_name;
     private String superclass_name;
-    private int major, minor; // Compiler version
-    private ConstantPool constant_pool; // Constant pool
-    private int[] interfaces; // implemented interfaces
     private String[] interface_names;
-    private Field[] fields; // Fields, i.e., variables of class
-    private Method[] methods; // methods defined in the class
     private Attribute[] attributes; // attributes defined in the class
     private AnnotationEntry[] annotations;   // annotations defined on the class
 
@@ -105,23 +98,10 @@ public class JavaClass extends AccessFla
         if (methods == null) {
             methods = new Method[0];
         }
-        this.file_name = file_name;
-        this.major = major;
-        this.minor = minor;
         this.access_flags = access_flags;
-        this.constant_pool = constant_pool;
-        this.interfaces = interfaces;
-        this.fields = fields;
-        this.methods = methods;
         this.attributes = attributes;
         annotationsOutOfDate = true;
-        // Get source file name if available
-        for (int i = 0; i < attributes.length; i++) {
-            if (attributes[i] instanceof SourceFile) {
-                source_file_name = ((SourceFile) attributes[i]).getSourceFileName();
-                break;
-            }
-        }
+
         /* According to the specification the following entries must be of type
          * `ConstantClass' but we check that anyway via the
          * `ConstPool.getConstant' method.

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java Wed Sep 12 17:53:06
2012
@@ -70,7 +70,7 @@ public final class StackMap extends Attr
         map_length = file.readUnsignedShort();
         map = new StackMapEntry[map_length];
         for (int i = 0; i < map_length; i++) {
-            map[i] = new StackMapEntry(file, constant_pool);
+            map[i] = new StackMapEntry(file);
         }
     }
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapEntry.java Wed Sep 12
17:53:06 2012
@@ -48,16 +48,16 @@ public final class StackMapEntry impleme
      * @param file Input stream
      * @throws IOException
      */
-    StackMapEntry(DataInputStream file, ConstantPool constant_pool) 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, constant_pool);
+            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, constant_pool);
+            types_of_stack_items[i] = new StackMapType(file);
         }
     }
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.java Wed Sep 12
17:53:06 2012
@@ -70,7 +70,7 @@ public final class StackMapTable extends
         map_length = file.readUnsignedShort();
         map = new StackMapTableEntry[map_length];
         for (int i = 0; i < map_length; i++) {
-            map[i] = new StackMapTableEntry(file, constant_pool);
+            map[i] = new StackMapTableEntry(file);
         }
     }
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTableEntry.java Wed Sep
12 17:53:06 2012
@@ -51,7 +51,7 @@ public final class StackMapTableEntry im
      * @param file Input stream
      * @throws IOException
      */
-    StackMapTableEntry(DataInputStream file, ConstantPool constant_pool) 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)
{
@@ -60,12 +60,12 @@ public final class StackMapTableEntry im
             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, constant_pool);
+            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, constant_pool);
+            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) {
@@ -75,19 +75,19 @@ public final class StackMapTableEntry im
             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, constant_pool);
+                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, constant_pool);
+                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, constant_pool);
+                types_of_stack_items[i] = new StackMapType(file);
             }
         } else {
             /* Can't happen */

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java?rev=1384055&r1=1384054&r2=1384055&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapType.java Wed Sep 12 17:53:06
2012
@@ -40,7 +40,6 @@ public final class StackMapType implemen
 
     private byte type;
     private int index = -1; // Index to CONSTANT_Class or offset
-    private ConstantPool constant_pool;
 
 
     /**
@@ -48,12 +47,11 @@ public final class StackMapType implemen
      * @param file Input stream
      * @throws IOException
      */
-    StackMapType(DataInput file, ConstantPool constant_pool) throws IOException {
-        this(file.readByte(), -1, constant_pool);
+    StackMapType(DataInput file) throws IOException {
+        this(file.readByte(), -1);
         if (hasIndex()) {
             setIndex(file.readShort());
         }
-        setConstantPool(constant_pool);
     }
 
 
@@ -61,10 +59,9 @@ public final class StackMapType implemen
      * @param type type tag as defined in the Constants interface
      * @param index index to constant pool, or byte code offset
      */
-    public StackMapType(byte type, int index, ConstantPool constant_pool) {
+    public StackMapType(byte type, int index) {
         setType(type);
         setIndex(index);
-        setConstantPool(constant_pool);
     }
 
 
@@ -108,26 +105,4 @@ public final class StackMapType implemen
     public final boolean hasIndex() {
         return ((type == Constants.ITEM_Object) || (type == Constants.ITEM_NewObject));
     }
-
-
-    private String printIndex() {
-        if (type == Constants.ITEM_Object) {
-            if (index < 0) {
-                return ", class=<unknown>";
-            }
-            return ", class=" + constant_pool.constantToString(index, Constants.CONSTANT_Class);
-        } else if (type == Constants.ITEM_NewObject) {
-            return ", offset=" + index;
-        } else {
-            return "";
-        }
-    }
-
-
-    /**
-     * @param constant_pool Constant pool to be used for this object.
-     */
-    public final void setConstantPool( ConstantPool constant_pool ) {
-        this.constant_pool = constant_pool;
-    }
 }



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


Mime
View raw message