From 5ef371fc0f6b491ab1928e1ad7c0e928418395a4 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 7 Dec 2009 14:14:49 +0000 Subject: [PATCH] A little more cleanup. UCDetector claims there is no more to clean. I'm not yet convinced. 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 | 34 +-------- .../tomcat/util/bcel/classfile/JavaClass.java | 5 +- .../apache/tomcat/util/bcel/generic/BasicType.java | 58 -------------- .../apache/tomcat/util/bcel/generic/ClassGen.java | 89 ---------------------- .../apache/tomcat/util/bcel/generic/Select.java | 2 +- 5 files changed, 5 insertions(+), 183 deletions(-) delete mode 100644 java/org/apache/tomcat/util/bcel/generic/BasicType.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/ClassGen.java diff --git a/java/org/apache/tomcat/util/bcel/Constants.java b/java/org/apache/tomcat/util/bcel/Constants.java index 63be19629..3c23ec67d 100644 --- a/java/org/apache/tomcat/util/bcel/Constants.java +++ b/java/org/apache/tomcat/util/bcel/Constants.java @@ -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 Opcode definitions in The Java Virtual Machine Specification */ 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 = ""; - /** 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 diff --git a/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java b/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java index 30d913836..23d7f2160 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java +++ b/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java @@ -31,7 +31,6 @@ import org.apache.tomcat.util.bcel.util.BCELComparator; * should see the ClassGen class. * @version $Id$ - * @see org.apache.tomcat.util.bcel.generic.ClassGen * @author M. Dahm */ 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 index 7a32aae3e..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/BasicType.java +++ /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 M. Dahm - */ -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 index ab2969296..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/ClassGen.java +++ /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 M. Dahm - */ -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); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/Select.java b/java/org/apache/tomcat/util/bcel/generic/Select.java index 4240f9e99..5d7ee99d5 100644 --- a/java/org/apache/tomcat/util/bcel/generic/Select.java +++ b/java/org/apache/tomcat/util/bcel/generic/Select.java @@ -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 -- 2.11.0