From 35d3446a5996867adf9981ff7ab904ead1b05c53 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 16 Sep 2009 00:43:49 +0000 Subject: [PATCH] unused code --- .../apache/bcel/classfile/ConstantCP.java | 6 +- .../apache/bcel/classfile/ConstantClass.java | 6 +- .../apache/bcel/classfile/ConstantDouble.java | 6 +- .../bcel/classfile/ConstantFieldref.java | 6 +- .../apache/bcel/classfile/ConstantFloat.java | 14 +---- .../bcel/classfile/ConstantInteger.java | 10 +--- .../classfile/ConstantInterfaceMethodref.java | 6 +- .../apache/bcel/classfile/ConstantLong.java | 6 +- .../bcel/classfile/ConstantMethodref.java | 24 +------- .../bcel/classfile/ConstantNameAndType.java | 26 +------- .../apache/bcel/classfile/ConstantString.java | 7 +-- .../apache/bcel/classfile/ConstantUtf8.java | 10 +--- .../apache/bcel/classfile/ConstantValue.java | 60 +------------------ 13 files changed, 14 insertions(+), 173 deletions(-) diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantCP.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantCP.java index a2811914e..a476c4d15 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantCP.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantCP.java @@ -62,7 +62,7 @@ import org.aspectj.apache.bcel.Constants; /** * Abstract super class for Fieldref and Methodref constants. * - * @version $Id: ConstantCP.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantCP.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see ConstantFieldref * @see ConstantMethodref @@ -72,10 +72,6 @@ public abstract class ConstantCP extends Constant { protected int classIndex, nameAndTypeIndex; - public ConstantCP(ConstantCP c) { - this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex()); - } - ConstantCP(byte tag, DataInputStream file) throws IOException { this(tag, file.readUnsignedShort(), file.readUnsignedShort()); } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantClass.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantClass.java index ee6b0e403..883f3b25f 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantClass.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantClass.java @@ -64,17 +64,13 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to a (external) class. * - * @version $Id: ConstantClass.java,v 1.5 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantClass.java,v 1.6 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @author Andy Clement */ public final class ConstantClass extends Constant { private int nameIndex; - public ConstantClass(ConstantClass c) { - this(c.getNameIndex()); - } - ConstantClass(DataInputStream file) throws IOException { super(Constants.CONSTANT_Class); this.nameIndex = file.readUnsignedShort(); diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantDouble.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantDouble.java index 9f4f1628a..813aec72a 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantDouble.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantDouble.java @@ -64,7 +64,7 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to a Double object. * - * @version $Id: ConstantDouble.java,v 1.5 2009/09/10 15:35:04 aclement Exp $ + * @version $Id: ConstantDouble.java,v 1.6 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @author Andy Clement */ @@ -76,10 +76,6 @@ public final class ConstantDouble extends Constant implements SimpleConstant { this.value = value; } - public ConstantDouble(ConstantDouble c) { - this(c.getValue()); - } - ConstantDouble(DataInputStream file) throws IOException { this(file.readDouble()); } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFieldref.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFieldref.java index babe174bc..056f3e3fd 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFieldref.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFieldref.java @@ -62,15 +62,11 @@ import org.aspectj.apache.bcel.Constants; /** * This class represents a constant pool reference to a field. * - * @version $Id: ConstantFieldref.java,v 1.4 2009/09/10 15:35:04 aclement Exp $ + * @version $Id: ConstantFieldref.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm */ public final class ConstantFieldref extends ConstantCP { - public ConstantFieldref(ConstantFieldref c) { - super(Constants.CONSTANT_Fieldref, c.getClassIndex(), c.getNameAndTypeIndex()); - } - ConstantFieldref(DataInputStream file) throws IOException { super(Constants.CONSTANT_Fieldref, file); } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFloat.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFloat.java index 7e016db81..985c28125 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFloat.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantFloat.java @@ -64,7 +64,7 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to a float object. * - * @version $Id: ConstantFloat.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantFloat.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Constant */ @@ -76,10 +76,6 @@ public final class ConstantFloat extends Constant implements SimpleConstant { this.floatValue = floatValue; } - public ConstantFloat(ConstantFloat c) { - this(c.getValue()); - } - ConstantFloat(DataInputStream file) throws IOException { this(file.readFloat()); } @@ -104,14 +100,6 @@ public final class ConstantFloat extends Constant implements SimpleConstant { return Float.toString(floatValue); } - public final float getFloatValue() { - return floatValue; - } - - public final void setBytes(float bytes) { - this.floatValue = bytes; - } - @Override public final String toString() { return super.toString() + "(bytes = " + floatValue + ")"; diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInteger.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInteger.java index 503a23024..415706eed 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInteger.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInteger.java @@ -64,7 +64,7 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to an int object. * - * @version $Id: ConstantInteger.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantInteger.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Constant */ @@ -76,10 +76,6 @@ public final class ConstantInteger extends Constant implements SimpleConstant { this.intValue = intValue; } - public ConstantInteger(ConstantInteger c) { - this(c.getValue()); - } - ConstantInteger(DataInputStream file) throws IOException { this(file.readInt()); } @@ -95,10 +91,6 @@ public final class ConstantInteger extends Constant implements SimpleConstant { file.writeInt(intValue); } - public final void setBytes(int bytes) { - this.intValue = bytes; - } - @Override public final String toString() { return super.toString() + "(bytes = " + intValue + ")"; diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java index f51010950..b973c726e 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java @@ -62,15 +62,11 @@ import org.aspectj.apache.bcel.Constants; /** * This class represents a constant pool reference to an interface method. * - * @version $Id: ConstantInterfaceMethodref.java,v 1.4 2009/09/10 15:35:04 aclement Exp $ + * @version $Id: ConstantInterfaceMethodref.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm */ public final class ConstantInterfaceMethodref extends ConstantCP { - public ConstantInterfaceMethodref(ConstantInterfaceMethodref c) { - super(Constants.CONSTANT_InterfaceMethodref, c.getClassIndex(), c.getNameAndTypeIndex()); - } - ConstantInterfaceMethodref(DataInputStream file) throws IOException { super(Constants.CONSTANT_InterfaceMethodref, file); } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantLong.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantLong.java index b8fea1bcd..1d56b98a3 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantLong.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantLong.java @@ -64,7 +64,7 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to a long object. * - * @version $Id: ConstantLong.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantLong.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Constant */ @@ -76,10 +76,6 @@ public final class ConstantLong extends Constant implements SimpleConstant { this.longValue = longValue; } - public ConstantLong(ConstantLong c) { - this(c.getValue()); - } - ConstantLong(DataInputStream file) throws IOException { this(file.readLong()); } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantMethodref.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantMethodref.java index 8697541cc..29b37c5d7 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantMethodref.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantMethodref.java @@ -62,41 +62,19 @@ import org.aspectj.apache.bcel.Constants; /** * This class represents a constant pool reference to a method. * - * @version $Id: ConstantMethodref.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantMethodref.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm */ public final class ConstantMethodref extends ConstantCP { - /** - * Initialize from another object. - */ - public ConstantMethodref(ConstantMethodref c) { - super(Constants.CONSTANT_Methodref, c.getClassIndex(), c.getNameAndTypeIndex()); - } - /** - * Initialize instance from file data. - * - * @param file input stream - * @throws IOException - */ ConstantMethodref(DataInputStream file) throws IOException { super(Constants.CONSTANT_Methodref, file); } - /** - * @param class_index Reference to the class containing the method - * @param name_and_type_index and the method signature - */ public ConstantMethodref(int class_index, int name_and_type_index) { super(Constants.CONSTANT_Methodref, class_index, name_and_type_index); } - /** - * Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the - * hierarchy of methods, fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ @Override public void accept(ClassVisitor v) { v.visitConstantMethodref(this); diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java index 1a2219ed4..8af80fab2 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java @@ -64,7 +64,7 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to the name and signature of a field or method. * - * @version $Id: ConstantNameAndType.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantNameAndType.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Constant */ @@ -72,13 +72,6 @@ public final class ConstantNameAndType extends Constant { private int name_index; // Name of field/method private int signature_index; // and its signature. - /** - * Initialize from another object. - */ - public ConstantNameAndType(ConstantNameAndType c) { - this(c.getNameIndex(), c.getSignatureIndex()); - } - /** * Initialize instance from file data. * @@ -151,23 +144,6 @@ public final class ConstantNameAndType extends Constant { return cp.constantToString(getSignatureIndex(), Constants.CONSTANT_Utf8); } - /** - * @param name_index. - */ - public final void setNameIndex(int name_index) { - this.name_index = name_index; - } - - /** - * @param signature_index. - */ - public final void setSignatureIndex(int signature_index) { - this.signature_index = signature_index; - } - - /** - * @return String representation - */ @Override public final String toString() { return super.toString() + "(name_index = " + name_index + ", signature_index = " + signature_index + ")"; diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantString.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantString.java index c29b8bba9..ef9da55db 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantString.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantString.java @@ -64,16 +64,13 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to a String object. * - * @version $Id: ConstantString.java,v 1.4 2009/09/10 15:35:04 aclement Exp $ + * @version $Id: ConstantString.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Constant */ public final class ConstantString extends Constant { - private int stringIndex; - public ConstantString(ConstantString c) { - this(c.getStringIndex()); - } + private int stringIndex; ConstantString(DataInputStream file) throws IOException { this(file.readUnsignedShort()); diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantUtf8.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantUtf8.java index b3f8f12b7..f8200db47 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantUtf8.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantUtf8.java @@ -64,17 +64,13 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from the abstract Constant class and * represents a reference to a Utf8 encoded string. * - * @version $Id: ConstantUtf8.java,v 1.4 2009/09/10 15:35:05 aclement Exp $ + * @version $Id: ConstantUtf8.java,v 1.5 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Constant */ public final class ConstantUtf8 extends Constant implements SimpleConstant { private String string; - public ConstantUtf8(ConstantUtf8 c) { - this(c.getValue()); - } - ConstantUtf8(DataInputStream file) throws IOException { super(Constants.CONSTANT_Utf8); string = file.readUTF(); @@ -97,10 +93,6 @@ public final class ConstantUtf8 extends Constant implements SimpleConstant { file.writeUTF(string); } - public final void setBytes(String bytes) { - this.string = bytes; - } - @Override public final String toString() { return super.toString() + "(\"" + Utility.replace(string, "\n", "\\n") + "\")"; diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantValue.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantValue.java index 67cc0851e..730e8aff0 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantValue.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantValue.java @@ -64,85 +64,37 @@ import org.aspectj.apache.bcel.Constants; * This class is derived from Attribute and represents a constant value, i.e., a default value for initializing a class * field. This class is instantiated by the Attribute.readAttribute() method. * - * @version $Id: ConstantValue.java,v 1.5 2009/09/15 19:40:12 aclement Exp $ + * @version $Id: ConstantValue.java,v 1.6 2009/09/16 00:43:49 aclement Exp $ * @author M. Dahm * @see Attribute */ public final class ConstantValue extends Attribute { private int constantvalue_index; - /** - * Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical - * copy. - */ - public ConstantValue(ConstantValue c) { - this(c.getNameIndex(), c.getLength(), c.getConstantValueIndex(), c.getConstantPool()); - } - - /** - * Construct object from file stream. - * - * @param name_index Name index in constant pool - * @param length Content length in bytes - * @param file Input stream - * @param constant_pool Array of constants - * @throw IOException - */ ConstantValue(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException { this(name_index, length, file.readUnsignedShort(), constant_pool); } - /** - * @param name_index Name index in constant pool - * @param length Content length in bytes - * @param constantvalue_index Index in constant pool - * @param constant_pool Array of constants - */ 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; } - /** - * Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the - * hierarchy of methods, fields, attributes, etc. spawns a tree of objects. - * - * @param v Visitor object - */ @Override public void accept(ClassVisitor v) { v.visitConstantValue(this); } - /** - * Dump constant value attribute to file stream on binary format. - * - * @param file Output file stream - * @throws IOException - */ @Override public final void dump(DataOutputStream file) throws IOException { super.dump(file); file.writeShort(constantvalue_index); } - /** - * @return Index in constant pool of constant value. - */ public final int getConstantValueIndex() { return constantvalue_index; } - /** - * @param constantvalue_index. - */ - public final void setConstantValueIndex(int constantvalue_index) { - this.constantvalue_index = constantvalue_index; - } - - /** - * @return String representation of constant value. - */ @Override public final String toString() { Constant c = cpool.getConstant(constantvalue_index); @@ -176,14 +128,4 @@ public final class ConstantValue extends Attribute { return buf; } - // - // /** - // * @return deep copy of this attribute - // */ - // @Override - // public Attribute copy(ConstantPool constant_pool) { - // ConstantValue c = (ConstantValue) clone(); - // c.cpool = constant_pool; - // return c; - // } } -- 2.39.5