A little more cleanup. UCDetector claims there is no more to clean. I'm not yet convi...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 7 Dec 2009 14:14:49 +0000 (14:14 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 7 Dec 2009 14:14:49 +0000 (14:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@887927 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/bcel/Constants.java
java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
java/org/apache/tomcat/util/bcel/generic/BasicType.java [deleted file]
java/org/apache/tomcat/util/bcel/generic/ClassGen.java [deleted file]
java/org/apache/tomcat/util/bcel/generic/Select.java

index 63be196..3c23ec6 100644 (file)
@@ -24,11 +24,7 @@ package org.apache.tomcat.util.bcel;
  */
 public interface Constants {
 
-  
-
-  
-
-  /** One of the access flags for fields, methods, or classes.
+    /** One of the access flags for fields, methods, or classes.
    *  @see #ACC_PUBLIC
    */
   public final static short ACC_FINAL        = 0x0010;
@@ -271,11 +267,6 @@ public interface Constants {
    * @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc.html">Opcode definitions in The Java Virtual Machine Specification</a> */
   public static final short JSR_W            = 201;
 
-  
-  
-  
-  
-
   /** Illegal opcode. */
   public static final short  UNDEFINED      = -1;
   /** Illegal opcode. */
@@ -287,32 +278,18 @@ public interface Constants {
   /** Mnemonic for an illegal type. */
   public static final String ILLEGAL_TYPE   = "<illegal type>";
 
-  /** Boolean data type. */
-  public static final byte T_BOOLEAN = 4;
-  /** Char data type. */
-  public static final byte T_CHAR    = 5;
-  /** Float data type. */
-  public static final byte T_FLOAT   = 6;
-  /** Double data type. */
-  public static final byte T_DOUBLE  = 7;
   /** Byte data type. */
   public static final byte T_BYTE    = 8;
   /** Short data type. */
   public static final byte T_SHORT   = 9;
   /** Int data type. */
   public static final byte T_INT     = 10;
-  /** Long data type. */
-  public static final byte T_LONG    = 11;
 
-  /** Void data type (non-standard). */
-  public static final byte T_VOID      = 12; // Non-standard
-  
   /** Object data type. */
   public static final byte T_OBJECT    = 14;
   
   /** Unknown data type. */
   public static final byte T_UNKNOWN   = 15;
-  
 
   /** The primitive type names corresponding to the T_XX constants,
    * e.g., TYPE_NAMES[T_INT] = "int"
@@ -323,14 +300,7 @@ public interface Constants {
     "void", "array", "object", "unknown", "address"
   };
 
-  /** The signature characters corresponding to primitive types,
-   * e.g., SHORT_TYPE_NAMES[T_INT] = "I"
-   */
-  public static final String[] SHORT_TYPE_NAMES = {
-    ILLEGAL_TYPE, ILLEGAL_TYPE,  ILLEGAL_TYPE, ILLEGAL_TYPE,
-    "Z", "C", "F", "D", "B", "S", "I", "J",
-    "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
-  };
+  
 
   /**
    * Number of byte code operands for each opcode, i.e., number of bytes after the tag byte
index 30d9138..23d7f21 100644 (file)
@@ -31,7 +31,6 @@ import org.apache.tomcat.util.bcel.util.BCELComparator;
  * should see the <a href="../generic/ClassGen.html">ClassGen</a> class.
 
  * @version $Id$
- * @see org.apache.tomcat.util.bcel.generic.ClassGen
  * @author  <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
  */
 public class JavaClass extends AccessFlags implements Cloneable, Comparable {
@@ -49,8 +48,8 @@ public class JavaClass extends AccessFlags implements Cloneable, Comparable {
     private Attribute[] attributes; // attributes defined in the class
     private AnnotationEntry[] annotations;   // annotations defined on the class
     
-    public static final byte FILE = 2;
-    public static final byte ZIP = 3;
+    
+    
     
     
     
diff --git a/java/org/apache/tomcat/util/bcel/generic/BasicType.java b/java/org/apache/tomcat/util/bcel/generic/BasicType.java
deleted file mode 100644 (file)
index 7a32aae..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright  2000-2009 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); 
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License. 
- *
- */
-package org.apache.tomcat.util.bcel.generic;
-
-import org.apache.tomcat.util.bcel.Constants;
-
-/** 
- * Denotes basic type such as int.
- *
- * @version $Id$
- * @author  <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
- */
-public final class BasicType extends Type {
-
-    /**
-     * Constructor for basic types such as int, long, `void'
-     *
-     * @param type one of T_INT, T_BOOLEAN, ..., T_VOID
-     * @see org.apache.tomcat.util.bcel.Constants
-     */
-    BasicType(byte type) {
-        super(type, Constants.SHORT_TYPE_NAMES[type]);
-        if ((type < Constants.T_BOOLEAN) || (type > Constants.T_VOID)) {
-            throw new ClassGenException("Invalid type: " + type);
-        }
-    }
-
-
-    
-
-
-    /** @return a hash code value for the object.
-     */
-    public int hashCode() {
-        return type;
-    }
-
-
-    /** @return true if both type objects refer to the same type
-     */
-    public boolean equals( Object _type ) {
-        return (_type instanceof BasicType) ? ((BasicType) _type).type == this.type : false;
-    }
-}
diff --git a/java/org/apache/tomcat/util/bcel/generic/ClassGen.java b/java/org/apache/tomcat/util/bcel/generic/ClassGen.java
deleted file mode 100644 (file)
index ab29692..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright  2000-2009 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); 
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License. 
- *
- */
-package org.apache.tomcat.util.bcel.generic;
-
-import org.apache.tomcat.util.bcel.classfile.AccessFlags;
-import org.apache.tomcat.util.bcel.classfile.JavaClass;
-import org.apache.tomcat.util.bcel.util.BCELComparator;
-
-/** 
- * Template class for building up a java class. May be initialized with an
- * existing java class (file).
- *
- * @see JavaClass
- * @version $Id$
- * @author  <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
- */
-public class ClassGen extends AccessFlags implements Cloneable {
-
-    /* Corresponds to the fields found in a JavaClass object.
-     */
-    private String class_name;
-       
-    private static BCELComparator _cmp = new BCELComparator() {
-
-        public boolean equals( Object o1, Object o2 ) {
-            ClassGen THIS = (ClassGen) o1;
-            ClassGen THAT = (ClassGen) o2;
-            return THIS.getClassName().equals(THAT.getClassName());
-        }
-
-
-        public int hashCode( Object o ) {
-            ClassGen THIS = (ClassGen) o;
-            return THIS.getClassName().hashCode();
-        }
-    };
-    
-    
-    public String getClassName() {
-        return class_name;
-    }
-
-    
-    public Object clone() {
-        try {
-            return super.clone();
-        } catch (CloneNotSupportedException e) {
-            System.err.println(e);
-            return null;
-        }
-    }
-
-    
-    /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default two ClassGen objects are said to be equal when
-     * their class names are equal.
-     * 
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    public boolean equals( Object obj ) {
-        return _cmp.equals(this, obj);
-    }
-
-
-    /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default return the hashcode of the class name.
-     * 
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode() {
-        return _cmp.hashCode(this);
-    }
-}
index 4240f9e..5d7ee99 100644 (file)
@@ -36,7 +36,7 @@ public abstract class Select extends BranchInstruction implements VariableLength
     protected int[] match; // matches, i.e., case 1: ...
     protected int[] indices; // target offsets
     protected InstructionHandle[] targets; // target objects in instruction list
-    protected int fixed_length; // fixed length defined by subclasses
+    
     protected int match_length; // number of cases
     protected int padding = 0; // number of pad bytes for alignment