Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/DescendingVisitor.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/DescendingVisitor.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/DescendingVisitor.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/DescendingVisitor.java Wed Mar 15 03:31:56 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
import java.util.Stack;
@@ -28,309 +28,347 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class DescendingVisitor implements Visitor {
- private JavaClass clazz;
- private Visitor visitor;
- private Stack stack = new Stack();
-
- /** @return container of current entitity, i.e., predecessor during traversal
- */
- public Object predecessor() {
- return predecessor(0);
- }
-
- /**
- * @param level nesting level, i.e., 0 returns the direct predecessor
- * @return container of current entitity, i.e., predecessor during traversal
- */
- public Object predecessor(int level) {
- int size = stack.size();
-
- if((size < 2) || (level < 0))
- return null;
- else
- return stack.elementAt(size - (level + 2)); // size - 1 == current
- }
-
- /** @return current object
- */
- public Object current() {
- return stack.peek();
- }
-
- /**
- * @param clazz Class to traverse
- * @param visitor visitor object to apply to all components
- */
- public DescendingVisitor(JavaClass clazz, Visitor visitor) {
- this.clazz = clazz;
- this.visitor = visitor;
- }
-
- /**
- * Start traversal.
- */
- public void visit() { clazz.accept(this); }
-
- public void visitJavaClass(JavaClass _clazz) {
- stack.push(_clazz);
- _clazz.accept(visitor);
-
- Field[] fields = _clazz.getFields();
- for(int i=0; i < fields.length; i++)
- fields[i].accept(this);
-
- Method[] methods = _clazz.getMethods();
- for(int i=0; i < methods.length; i++)
- methods[i].accept(this);
-
- Attribute[] attributes = _clazz.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
-
- _clazz.getConstantPool().accept(this);
- stack.pop();
- }
-
- public void visitAnnotation(Annotations annotation) {
- stack.push(annotation);
- annotation.accept(visitor);
-
- AnnotationEntry[] entries = annotation.getAnnotationEntries();
- for (int i=0; i < entries.length; i++)
- entries[i].accept(this);
- stack.pop();
- }
-
- public void visitAnnotationEntry(AnnotationEntry annotationEntry) {
- stack.push(annotationEntry);
- annotationEntry.accept(visitor);
- stack.pop();
- }
-
- public void visitField(Field field) {
- stack.push(field);
- field.accept(visitor);
-
- Attribute[] attributes = field.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
- stack.pop();
- }
-
- public void visitConstantValue(ConstantValue cv) {
- stack.push(cv);
- cv.accept(visitor);
- stack.pop();
- }
-
- public void visitMethod(Method method) {
- stack.push(method);
- method.accept(visitor);
-
- Attribute[] attributes = method.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
-
- stack.pop();
- }
-
- public void visitExceptionTable(ExceptionTable table) {
- stack.push(table);
- table.accept(visitor);
- stack.pop();
- }
-
- public void visitCode(Code code) {
- stack.push(code);
- code.accept(visitor);
-
- CodeException[] table = code.getExceptionTable();
- for(int i=0; i < table.length; i++)
- table[i].accept(this);
-
- Attribute[] attributes = code.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
- stack.pop();
- }
-
- public void visitCodeException(CodeException ce) {
- stack.push(ce);
- ce.accept(visitor);
- stack.pop();
- }
-
- public void visitLineNumberTable(LineNumberTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LineNumber[] numbers = table.getLineNumberTable();
- for(int i=0; i < numbers.length; i++)
- numbers[i].accept(this);
- stack.pop();
- }
-
- public void visitLineNumber(LineNumber number) {
- stack.push(number);
- number.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariableTable(LocalVariableTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LocalVariable[] vars = table.getLocalVariableTable();
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitStackMap(StackMap table) {
- stack.push(table);
- table.accept(visitor);
-
- StackMapEntry[] vars = table.getStackMap();
-
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitStackMapEntry(StackMapEntry var) {
- stack.push(var);
- var.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariable(LocalVariable var) {
- stack.push(var);
- var.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantPool(ConstantPool cp) {
- stack.push(cp);
- cp.accept(visitor);
-
- Constant[] constants = cp.getConstantPool();
- for(int i=1; i < constants.length; i++) {
- if(constants[i] != null)
- constants[i].accept(this);
- }
-
- stack.pop();
- }
-
- public void visitConstantClass(ConstantClass constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantDouble(ConstantDouble constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantFieldref(ConstantFieldref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantFloat(ConstantFloat constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantInteger(ConstantInteger constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantLong(ConstantLong constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantMethodref(ConstantMethodref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantNameAndType(ConstantNameAndType constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantString(ConstantString constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantUtf8(ConstantUtf8 constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitInnerClasses(InnerClasses ic) {
- stack.push(ic);
- ic.accept(visitor);
-
- InnerClass[] ics = ic.getInnerClasses();
- for(int i=0; i < ics.length; i++)
- ics[i].accept(this);
- stack.pop();
- }
-
- public void visitInnerClass(InnerClass inner) {
- stack.push(inner);
- inner.accept(visitor);
- stack.pop();
- }
-
- public void visitDeprecated(Deprecated attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSignature(Signature attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSourceFile(SourceFile attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSynthetic(Synthetic attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitUnknown(Unknown attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
+
+ private JavaClass clazz;
+ private Visitor visitor;
+ private Stack stack = new Stack();
+
+
+ /** @return container of current entitity, i.e., predecessor during traversal
+ */
+ public Object predecessor() {
+ return predecessor(0);
+ }
+
+
+ /**
+ * @param level nesting level, i.e., 0 returns the direct predecessor
+ * @return container of current entitity, i.e., predecessor during traversal
+ */
+ public Object predecessor( int level ) {
+ int size = stack.size();
+ if ((size < 2) || (level < 0)) {
+ return null;
+ } else {
+ return stack.elementAt(size - (level + 2)); // size - 1 == current
+ }
+ }
+
+
+ /** @return current object
+ */
+ public Object current() {
+ return stack.peek();
+ }
+
+
+ /**
+ * @param clazz Class to traverse
+ * @param visitor visitor object to apply to all components
+ */
+ public DescendingVisitor(JavaClass clazz, Visitor visitor) {
+ this.clazz = clazz;
+ this.visitor = visitor;
+ }
+
+
+ /**
+ * Start traversal.
+ */
+ public void visit() {
+ clazz.accept(this);
+ }
+
+
+ public void visitJavaClass( JavaClass _clazz ) {
+ stack.push(_clazz);
+ _clazz.accept(visitor);
+ Field[] fields = _clazz.getFields();
+ for (int i = 0; i < fields.length; i++) {
+ fields[i].accept(this);
+ }
+ Method[] methods = _clazz.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ methods[i].accept(this);
+ }
+ Attribute[] attributes = _clazz.getAttributes();
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i].accept(this);
+ }
+ _clazz.getConstantPool().accept(this);
+ stack.pop();
+ }
+
+
+ public void visitAnnotation( Annotations annotation ) {
+ stack.push(annotation);
+ annotation.accept(visitor);
+ AnnotationEntry[] entries = annotation.getAnnotationEntries();
+ for (int i = 0; i < entries.length; i++) {
+ entries[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitAnnotationEntry( AnnotationEntry annotationEntry ) {
+ stack.push(annotationEntry);
+ annotationEntry.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitField( Field field ) {
+ stack.push(field);
+ field.accept(visitor);
+ Attribute[] attributes = field.getAttributes();
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitConstantValue( ConstantValue cv ) {
+ stack.push(cv);
+ cv.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitMethod( Method method ) {
+ stack.push(method);
+ method.accept(visitor);
+ Attribute[] attributes = method.getAttributes();
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitExceptionTable( ExceptionTable table ) {
+ stack.push(table);
+ table.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitCode( Code code ) {
+ stack.push(code);
+ code.accept(visitor);
+ CodeException[] table = code.getExceptionTable();
+ for (int i = 0; i < table.length; i++) {
+ table[i].accept(this);
+ }
+ Attribute[] attributes = code.getAttributes();
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitCodeException( CodeException ce ) {
+ stack.push(ce);
+ ce.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitLineNumberTable( LineNumberTable table ) {
+ stack.push(table);
+ table.accept(visitor);
+ LineNumber[] numbers = table.getLineNumberTable();
+ for (int i = 0; i < numbers.length; i++) {
+ numbers[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitLineNumber( LineNumber number ) {
+ stack.push(number);
+ number.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitLocalVariableTable( LocalVariableTable table ) {
+ stack.push(table);
+ table.accept(visitor);
+ LocalVariable[] vars = table.getLocalVariableTable();
+ for (int i = 0; i < vars.length; i++) {
+ vars[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitStackMap( StackMap table ) {
+ stack.push(table);
+ table.accept(visitor);
+ StackMapEntry[] vars = table.getStackMap();
+ for (int i = 0; i < vars.length; i++) {
+ vars[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitStackMapEntry( StackMapEntry var ) {
+ stack.push(var);
+ var.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitLocalVariable( LocalVariable var ) {
+ stack.push(var);
+ var.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantPool( ConstantPool cp ) {
+ stack.push(cp);
+ cp.accept(visitor);
+ Constant[] constants = cp.getConstantPool();
+ for (int i = 1; i < constants.length; i++) {
+ if (constants[i] != null) {
+ constants[i].accept(this);
+ }
+ }
+ stack.pop();
+ }
+
+
+ public void visitConstantClass( ConstantClass constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantDouble( ConstantDouble constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantFieldref( ConstantFieldref constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantFloat( ConstantFloat constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantInteger( ConstantInteger constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantInterfaceMethodref( ConstantInterfaceMethodref constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantLong( ConstantLong constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantMethodref( ConstantMethodref constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantNameAndType( ConstantNameAndType constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantString( ConstantString constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitConstantUtf8( ConstantUtf8 constant ) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitInnerClasses( InnerClasses ic ) {
+ stack.push(ic);
+ ic.accept(visitor);
+ InnerClass[] ics = ic.getInnerClasses();
+ for (int i = 0; i < ics.length; i++) {
+ ics[i].accept(this);
+ }
+ stack.pop();
+ }
+
+
+ public void visitInnerClass( InnerClass inner ) {
+ stack.push(inner);
+ inner.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitDeprecated( Deprecated attribute ) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitSignature( Signature attribute ) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitSourceFile( SourceFile attribute ) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitSynthetic( Synthetic attribute ) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+
+ public void visitUnknown( Unknown attribute ) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValue.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValue.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValue.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValue.java Wed Mar 15 03:31:56 2006
@@ -26,62 +26,57 @@
* @version $Id: ElementValue
* @author <A HREF="mailto:[email protected]">D. Brosius</A>
*/
+public class ElementValue {
-public class ElementValue
-{
- private byte tag;
- private int const_value_index;
- private int type_name_index;
- private int const_name_index;
- private int class_info_index;
- private AnnotationEntry annotation;
- private int num_values;
- private ElementValue[] values;
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @param constant_pool the constant pool
- * @throws IOException
- */
- ElementValue(DataInputStream file, ConstantPool constant_pool)
- throws IOException
- {
- tag = (file.readByte());
- switch (tag) {
- case 'B':
- case 'C':
- case 'D':
- case 'F':
- case 'I':
- case 'J':
- case 'S':
- case 'Z':
- case 's':
- const_value_index = (file.readUnsignedShort());
- break;
-
- case 'e':
- type_name_index = (file.readUnsignedShort());
- const_name_index = (file.readUnsignedShort());
- break;
-
- case 'c':
- class_info_index = (file.readUnsignedShort());
- break;
-
- case '@':
- annotation = new AnnotationEntry(file, constant_pool);
- break;
-
- case '[':
- num_values = (file.readUnsignedShort());
- values = new ElementValue[num_values];
- for (int i = 0; i < num_values; i++)
- values[i] = new ElementValue(file, constant_pool);
- break;
-
- default:
- throw new IOException("Invalid ElementValue tag: " + tag );
- }
- }
+ private byte tag;
+ private int const_value_index;
+ private int type_name_index;
+ private int const_name_index;
+ private int class_info_index;
+ private AnnotationEntry annotation;
+ private int num_values;
+ private ElementValue[] values;
+
+
+ /**
+ * Construct object from file stream.
+ * @param file Input stream
+ * @param constant_pool the constant pool
+ * @throws IOException
+ */
+ ElementValue(DataInputStream file, ConstantPool constant_pool) throws IOException {
+ tag = (file.readByte());
+ switch (tag) {
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'F':
+ case 'I':
+ case 'J':
+ case 'S':
+ case 'Z':
+ case 's':
+ const_value_index = (file.readUnsignedShort());
+ break;
+ case 'e':
+ type_name_index = (file.readUnsignedShort());
+ const_name_index = (file.readUnsignedShort());
+ break;
+ case 'c':
+ class_info_index = (file.readUnsignedShort());
+ break;
+ case '@':
+ annotation = new AnnotationEntry(file, constant_pool);
+ break;
+ case '[':
+ num_values = (file.readUnsignedShort());
+ values = new ElementValue[num_values];
+ for (int i = 0; i < num_values; i++) {
+ values[i] = new ElementValue(file, constant_pool);
+ }
+ break;
+ default:
+ throw new IOException("Invalid ElementValue tag: " + tag);
+ }
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValuePair.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValuePair.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValuePair.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ElementValuePair.java Wed Mar 15 03:31:56 2006
@@ -19,28 +19,26 @@
import java.io.DataInputStream;
import java.io.IOException;
-
/**
* an annotation's element value pair
*
* @version $Id: ElementValuePair
* @author <A HREF="mailto:[email protected]">D. Brosius</A>
*/
-public class ElementValuePair
-{
- private int element_name_index;
- private ElementValue value;
+public class ElementValuePair {
+
+ private int element_name_index;
+ private ElementValue value;
+
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @param constant_pool the constant pool
- * @throws IOException
- */
- ElementValuePair(DataInputStream file, ConstantPool constant_pool)
- throws IOException
- {
- element_name_index = (file.readUnsignedShort());
- value = new ElementValue(file, constant_pool);
- }
+ /**
+ * Construct object from file stream.
+ * @param file Input stream
+ * @param constant_pool the constant pool
+ * @throws IOException
+ */
+ ElementValuePair(DataInputStream file, ConstantPool constant_pool) throws IOException {
+ element_name_index = (file.readUnsignedShort());
+ value = new ElementValue(file, constant_pool);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/EmptyVisitor.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/EmptyVisitor.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/EmptyVisitor.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/EmptyVisitor.java Wed Mar 15 03:31:56 2006
@@ -13,11 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
-
-
/**
* Visitor with empty method bodies, can be extended and used in conjunction with the
* DescendingVisitor class, e.g.
@@ -29,42 +27,151 @@
*
*/
public class EmptyVisitor implements Visitor {
- protected EmptyVisitor() { }
- public void visitAnnotation(Annotations obj) {}
- public void visitParameterAnnotation(ParameterAnnotations obj) {}
- public void visitAnnotationEntry(AnnotationEntry obj) {}
- public void visitAnnotationDefault(AnnotationDefault obj) {}
- public void visitCode(Code obj) {}
- public void visitCodeException(CodeException obj) {}
- public void visitConstantClass(ConstantClass obj) {}
- public void visitConstantDouble(ConstantDouble obj) {}
- public void visitConstantFieldref(ConstantFieldref obj) {}
- public void visitConstantFloat(ConstantFloat obj) {}
- public void visitConstantInteger(ConstantInteger obj) {}
- public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj) {}
- public void visitConstantLong(ConstantLong obj) {}
- public void visitConstantMethodref(ConstantMethodref obj) {}
- public void visitConstantNameAndType(ConstantNameAndType obj) {}
- public void visitConstantPool(ConstantPool obj) {}
- public void visitConstantString(ConstantString obj) {}
- public void visitConstantUtf8(ConstantUtf8 obj) {}
- public void visitConstantValue(ConstantValue obj) {}
- public void visitDeprecated(Deprecated obj) {}
- public void visitExceptionTable(ExceptionTable obj) {}
- public void visitField(Field obj) {}
- public void visitInnerClass(InnerClass obj) {}
- public void visitInnerClasses(InnerClasses obj) {}
- public void visitJavaClass(JavaClass obj) {}
- public void visitLineNumber(LineNumber obj) {}
- public void visitLineNumberTable(LineNumberTable obj) {}
- public void visitLocalVariable(LocalVariable obj) {}
- public void visitLocalVariableTable(LocalVariableTable obj) {}
- public void visitMethod(Method obj) {}
- public void visitSignature(Signature obj) {}
- public void visitSourceFile(SourceFile obj) {}
- public void visitSynthetic(Synthetic obj) {}
- public void visitUnknown(Unknown obj) {}
- public void visitStackMap(StackMap obj) {}
- public void visitStackMapEntry(StackMapEntry obj) {}
+ protected EmptyVisitor() {
+ }
+
+
+ public void visitAnnotation( Annotations obj ) {
+ }
+
+
+ public void visitParameterAnnotation( ParameterAnnotations obj ) {
+ }
+
+
+ public void visitAnnotationEntry( AnnotationEntry obj ) {
+ }
+
+
+ public void visitAnnotationDefault( AnnotationDefault obj ) {
+ }
+
+
+ public void visitCode( Code obj ) {
+ }
+
+
+ public void visitCodeException( CodeException obj ) {
+ }
+
+
+ public void visitConstantClass( ConstantClass obj ) {
+ }
+
+
+ public void visitConstantDouble( ConstantDouble obj ) {
+ }
+
+
+ public void visitConstantFieldref( ConstantFieldref obj ) {
+ }
+
+
+ public void visitConstantFloat( ConstantFloat obj ) {
+ }
+
+
+ public void visitConstantInteger( ConstantInteger obj ) {
+ }
+
+
+ public void visitConstantInterfaceMethodref( ConstantInterfaceMethodref obj ) {
+ }
+
+
+ public void visitConstantLong( ConstantLong obj ) {
+ }
+
+
+ public void visitConstantMethodref( ConstantMethodref obj ) {
+ }
+
+
+ public void visitConstantNameAndType( ConstantNameAndType obj ) {
+ }
+
+
+ public void visitConstantPool( ConstantPool obj ) {
+ }
+
+
+ public void visitConstantString( ConstantString obj ) {
+ }
+
+
+ public void visitConstantUtf8( ConstantUtf8 obj ) {
+ }
+
+
+ public void visitConstantValue( ConstantValue obj ) {
+ }
+
+
+ public void visitDeprecated( Deprecated obj ) {
+ }
+
+
+ public void visitExceptionTable( ExceptionTable obj ) {
+ }
+
+
+ public void visitField( Field obj ) {
+ }
+
+
+ public void visitInnerClass( InnerClass obj ) {
+ }
+
+
+ public void visitInnerClasses( InnerClasses obj ) {
+ }
+
+
+ public void visitJavaClass( JavaClass obj ) {
+ }
+
+
+ public void visitLineNumber( LineNumber obj ) {
+ }
+
+
+ public void visitLineNumberTable( LineNumberTable obj ) {
+ }
+
+
+ public void visitLocalVariable( LocalVariable obj ) {
+ }
+
+
+ public void visitLocalVariableTable( LocalVariableTable obj ) {
+ }
+
+
+ public void visitMethod( Method obj ) {
+ }
+
+
+ public void visitSignature( Signature obj ) {
+ }
+
+
+ public void visitSourceFile( SourceFile obj ) {
+ }
+
+
+ public void visitSynthetic( Synthetic obj ) {
+ }
+
+
+ public void visitUnknown( Unknown obj ) {
+ }
+
+
+ public void visitStackMap( StackMap obj ) {
+ }
+
+
+ public void visitStackMapEntry( StackMapEntry obj ) {
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ExceptionTable.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ExceptionTable.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ExceptionTable.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/ExceptionTable.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -35,138 +34,147 @@
* @see Code
*/
public final class ExceptionTable extends Attribute {
- private int number_of_exceptions; // Table of indices into
- private int[] exception_index_table; // constant pool
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public ExceptionTable(ExceptionTable c) {
- this(c.getNameIndex(), c.getLength(), c.getExceptionIndexTable(),
- c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param exception_index_table Table of indices in constant pool
- * @param constant_pool Array of constants
- */
- public ExceptionTable(int name_index, int length,
- int[] exception_index_table,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_EXCEPTIONS, name_index, length, constant_pool);
- setExceptionIndexTable(exception_index_table);
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- ExceptionTable(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (int[])null, constant_pool);
-
- number_of_exceptions = file.readUnsignedShort();
- exception_index_table = new int[number_of_exceptions];
-
- for(int i=0; i < number_of_exceptions; i++)
- exception_index_table[i] = file.readUnsignedShort();
- }
-
- /**
- * 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
- */
- public void accept(Visitor v) {
- v.visitExceptionTable(this);
- }
-
- /**
- * Dump exceptions attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(number_of_exceptions);
- for(int i=0; i < number_of_exceptions; i++)
- file.writeShort(exception_index_table[i]);
- }
-
- /**
- * @return Array of indices into constant pool of thrown exceptions.
- */
- public final int[] getExceptionIndexTable() {return exception_index_table;}
- /**
- * @return Length of exception table.
- */
- public final int getNumberOfExceptions() { return number_of_exceptions; }
-
- /**
- * @return class names of thrown exceptions
- */
- public final String[] getExceptionNames() {
- String[] names = new String[number_of_exceptions];
- for(int i=0; i < number_of_exceptions; i++)
- names[i] = constant_pool.getConstantString(exception_index_table[i],
- Constants.CONSTANT_Class).
- replace('/', '.');
- return names;
- }
-
- /**
- * @param exception_index_table the list of exception indexes
- * Also redefines number_of_exceptions according to table length.
- */
- public final void setExceptionIndexTable(int[] exception_index_table) {
- this.exception_index_table = exception_index_table;
- number_of_exceptions = (exception_index_table == null)? 0 :
- exception_index_table.length;
- }
- /**
- * @return String representation, i.e., a list of thrown exceptions.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer("");
- String str;
-
- for(int i=0; i < number_of_exceptions; i++) {
- str = constant_pool.getConstantString(exception_index_table[i],
- Constants.CONSTANT_Class);
- buf.append(Utility.compactClassName(str, false));
-
- if(i < number_of_exceptions - 1)
- buf.append(", ");
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool _constant_pool) {
- ExceptionTable c = (ExceptionTable)clone();
-
- if (exception_index_table != null) {
- c.exception_index_table = new int[exception_index_table.length];
- System.arraycopy(exception_index_table, 0, c.exception_index_table, 0, exception_index_table.length);
- }
-
- c.constant_pool = _constant_pool;
- return c;
- }
+ private int number_of_exceptions; // Table of indices into
+ private int[] exception_index_table; // constant pool
+
+
+ /**
+ * Initialize from another object. Note that both objects use the same
+ * references (shallow copy). Use copy() for a physical copy.
+ */
+ public ExceptionTable(ExceptionTable c) {
+ this(c.getNameIndex(), c.getLength(), c.getExceptionIndexTable(), c.getConstantPool());
+ }
+
+
+ /**
+ * @param name_index Index in constant pool
+ * @param length Content length in bytes
+ * @param exception_index_table Table of indices in constant pool
+ * @param constant_pool Array of constants
+ */
+ public ExceptionTable(int name_index, int length, int[] exception_index_table,
+ ConstantPool constant_pool) {
+ super(Constants.ATTR_EXCEPTIONS, name_index, length, constant_pool);
+ setExceptionIndexTable(exception_index_table);
+ }
+
+
+ /**
+ * Construct object from file stream.
+ * @param name_index Index in constant pool
+ * @param length Content length in bytes
+ * @param file Input stream
+ * @param constant_pool Array of constants
+ * @throws IOException
+ */
+ ExceptionTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
+ throws IOException {
+ this(name_index, length, (int[]) null, constant_pool);
+ number_of_exceptions = file.readUnsignedShort();
+ exception_index_table = new int[number_of_exceptions];
+ for (int i = 0; i < number_of_exceptions; i++) {
+ exception_index_table[i] = file.readUnsignedShort();
+ }
+ }
+
+
+ /**
+ * 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
+ */
+ public void accept( Visitor v ) {
+ v.visitExceptionTable(this);
+ }
+
+
+ /**
+ * Dump exceptions attribute to file stream in binary format.
+ *
+ * @param file Output file stream
+ * @throws IOException
+ */
+ public final void dump( DataOutputStream file ) throws IOException {
+ super.dump(file);
+ file.writeShort(number_of_exceptions);
+ for (int i = 0; i < number_of_exceptions; i++) {
+ file.writeShort(exception_index_table[i]);
+ }
+ }
+
+
+ /**
+ * @return Array of indices into constant pool of thrown exceptions.
+ */
+ public final int[] getExceptionIndexTable() {
+ return exception_index_table;
+ }
+
+
+ /**
+ * @return Length of exception table.
+ */
+ public final int getNumberOfExceptions() {
+ return number_of_exceptions;
+ }
+
+
+ /**
+ * @return class names of thrown exceptions
+ */
+ public final String[] getExceptionNames() {
+ String[] names = new String[number_of_exceptions];
+ for (int i = 0; i < number_of_exceptions; i++) {
+ names[i] = constant_pool.getConstantString(exception_index_table[i],
+ Constants.CONSTANT_Class).replace('/', '.');
+ }
+ return names;
+ }
+
+
+ /**
+ * @param exception_index_table the list of exception indexes
+ * Also redefines number_of_exceptions according to table length.
+ */
+ public final void setExceptionIndexTable( int[] exception_index_table ) {
+ this.exception_index_table = exception_index_table;
+ number_of_exceptions = (exception_index_table == null) ? 0 : exception_index_table.length;
+ }
+
+
+ /**
+ * @return String representation, i.e., a list of thrown exceptions.
+ */
+ public final String toString() {
+ StringBuffer buf = new StringBuffer("");
+ String str;
+ for (int i = 0; i < number_of_exceptions; i++) {
+ str = constant_pool.getConstantString(exception_index_table[i],
+ Constants.CONSTANT_Class);
+ buf.append(Utility.compactClassName(str, false));
+ if (i < number_of_exceptions - 1) {
+ buf.append(", ");
+ }
+ }
+ return buf.toString();
+ }
+
+
+ /**
+ * @return deep copy of this attribute
+ */
+ public Attribute copy( ConstantPool _constant_pool ) {
+ ExceptionTable c = (ExceptionTable) clone();
+ if (exception_index_table != null) {
+ c.exception_index_table = new int[exception_index_table.length];
+ System.arraycopy(exception_index_table, 0, c.exception_index_table, 0,
+ exception_index_table.length);
+ }
+ c.constant_pool = _constant_pool;
+ return c;
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Field.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Field.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Field.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Field.java Wed Mar 15 03:31:56 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
import java.io.DataInputStream;
@@ -30,154 +30,161 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public final class Field extends FieldOrMethod {
- private static BCELComparator _cmp = new BCELComparator() {
- public boolean equals(Object o1, Object o2) {
- Field THIS = (Field)o1;
- Field THAT = (Field)o2;
-
- return THIS.getName().equals(THAT.getName())
- && THIS.getSignature().equals(THAT.getSignature());
- }
-
- public int hashCode(Object o) {
- Field THIS = (Field)o;
- return THIS.getSignature().hashCode() ^ THIS.getName().hashCode();
- }
- };
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Field(Field c) {
- super(c);
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- */
- Field(DataInputStream file, ConstantPool constant_pool)
- throws IOException, ClassFormatException {
- super(file, constant_pool);
- }
-
- /**
- * @param access_flags Access rights of field
- * @param name_index Points to field name in constant pool
- * @param signature_index Points to encoded signature
- * @param attributes Collection of attributes
- * @param constant_pool Array of constants
- */
- public Field(
- int access_flags,
- int name_index,
- int signature_index,
- Attribute[] attributes,
- ConstantPool constant_pool) {
- super(access_flags, name_index, signature_index, attributes, constant_pool);
- }
-
- /**
- * 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
- */
- public void accept(Visitor v) {
- v.visitField(this);
- }
-
- /**
- * @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 string representation close to declaration format,
- * `public static final short MAX = 100', e.g..
- *
- * @return String representation of field, including the signature.
- */
- public final String toString() {
- String name, signature, access; // Short cuts to constant pool
-
- // Get names from constant pool
- access = Utility.accessToString(access_flags);
- access = access.equals("") ? "" : (access + " ");
- signature = Utility.signatureToString(getSignature());
- name = getName();
-
- StringBuffer buf = new StringBuffer(64);
- buf.append(access).append(signature).append(" ").append(name);
- ConstantValue cv = getConstantValue();
-
- if (cv != null)
- buf.append(" = ").append(cv);
-
- for (int i = 0; i < attributes_count; i++) {
- Attribute a = attributes[i];
-
- if (!(a instanceof ConstantValue))
- buf.append(" [").append(a.toString()).append("]");
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this field
- */
- public final Field copy(ConstantPool _constant_pool) {
- return (Field)copy_(_constant_pool);
- }
-
- /**
- * @return type of field
- */
- public Type getType() {
- return Type.getReturnType(getSignature());
- }
-
- /**
- * @return Comparison strategy object
- */
- public static BCELComparator getComparator() {
- return _cmp;
- }
-
- /**
- * @param comparator Comparison strategy object
- */
- public static void setComparator(BCELComparator comparator) {
- _cmp = comparator;
- }
-
- /**
- * 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.
- *
- * @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 field's name XOR signature.
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return _cmp.hashCode(this);
- }
+
+ private static BCELComparator _cmp = new BCELComparator() {
+
+ public boolean equals( Object o1, Object o2 ) {
+ Field THIS = (Field) o1;
+ Field THAT = (Field) o2;
+ return THIS.getName().equals(THAT.getName())
+ && THIS.getSignature().equals(THAT.getSignature());
+ }
+
+
+ public int hashCode( Object o ) {
+ Field THIS = (Field) o;
+ return THIS.getSignature().hashCode() ^ THIS.getName().hashCode();
+ }
+ };
+
+
+ /**
+ * Initialize from another object. Note that both objects use the same
+ * references (shallow copy). Use clone() for a physical copy.
+ */
+ public Field(Field c) {
+ super(c);
+ }
+
+
+ /**
+ * Construct object from file stream.
+ * @param file Input stream
+ */
+ Field(DataInputStream file, ConstantPool constant_pool) throws IOException,
+ ClassFormatException {
+ super(file, constant_pool);
+ }
+
+
+ /**
+ * @param access_flags Access rights of field
+ * @param name_index Points to field name in constant pool
+ * @param signature_index Points to encoded signature
+ * @param attributes Collection of attributes
+ * @param constant_pool Array of constants
+ */
+ public Field(int access_flags, int name_index, int signature_index, Attribute[] attributes,
+ ConstantPool constant_pool) {
+ super(access_flags, name_index, signature_index, attributes, constant_pool);
+ }
+
+
+ /**
+ * 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
+ */
+ public void accept( Visitor v ) {
+ v.visitField(this);
+ }
+
+
+ /**
+ * @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 string representation close to declaration format,
+ * `public static final short MAX = 100', e.g..
+ *
+ * @return String representation of field, including the signature.
+ */
+ public final String toString() {
+ String name, signature, access; // Short cuts to constant pool
+ // Get names from constant pool
+ access = Utility.accessToString(access_flags);
+ access = access.equals("") ? "" : (access + " ");
+ signature = Utility.signatureToString(getSignature());
+ name = getName();
+ StringBuffer buf = new StringBuffer(64);
+ buf.append(access).append(signature).append(" ").append(name);
+ ConstantValue cv = getConstantValue();
+ if (cv != null) {
+ buf.append(" = ").append(cv);
+ }
+ for (int i = 0; i < attributes_count; i++) {
+ Attribute a = attributes[i];
+ if (!(a instanceof ConstantValue)) {
+ buf.append(" [").append(a.toString()).append("]");
+ }
+ }
+ return buf.toString();
+ }
+
+
+ /**
+ * @return deep copy of this field
+ */
+ public final Field copy( ConstantPool _constant_pool ) {
+ return (Field) copy_(_constant_pool);
+ }
+
+
+ /**
+ * @return type of field
+ */
+ public Type getType() {
+ return Type.getReturnType(getSignature());
+ }
+
+
+ /**
+ * @return Comparison strategy object
+ */
+ public static BCELComparator getComparator() {
+ return _cmp;
+ }
+
+
+ /**
+ * @param comparator Comparison strategy object
+ */
+ public static void setComparator( BCELComparator comparator ) {
+ _cmp = comparator;
+ }
+
+
+ /**
+ * 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.
+ *
+ * @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 field's name XOR signature.
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return _cmp.hashCode(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/FieldOrMethod.java Wed Mar 15 03:31:56 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
import java.io.DataInputStream;
@@ -27,187 +27,180 @@
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public abstract class FieldOrMethod extends AccessFlags
- implements Cloneable, Node
-{
- protected int name_index; // Points to field name in constant pool
- protected int signature_index; // Points to encoded signature
- protected int attributes_count; // No. of attributes
- protected Attribute[] attributes; // Collection of attributes
- protected ConstantPool constant_pool;
-
- FieldOrMethod() {
- }
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- protected FieldOrMethod(FieldOrMethod c) {
- this(
- c.getAccessFlags(),
- c.getNameIndex(),
- c.getSignatureIndex(),
- c.getAttributes(),
- c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- * @throws ClassFormatException
- */
- protected FieldOrMethod(DataInputStream file, ConstantPool constant_pool)
- throws IOException, ClassFormatException {
- this(
- file.readUnsignedShort(),
- file.readUnsignedShort(),
- file.readUnsignedShort(),
- null,
- constant_pool);
-
- attributes_count = file.readUnsignedShort();
- attributes = new Attribute[attributes_count];
- for (int i = 0; i < attributes_count; i++)
- attributes[i] = Attribute.readAttribute(file, constant_pool);
- }
-
- /**
- * @param access_flags Access rights of method
- * @param name_index Points to field name in constant pool
- * @param signature_index Points to encoded signature
- * @param attributes Collection of attributes
- * @param constant_pool Array of constants
- */
- protected FieldOrMethod(
- int access_flags,
- int name_index,
- int signature_index,
- Attribute[] attributes,
- ConstantPool constant_pool) {
- this.access_flags = access_flags;
- this.name_index = name_index;
- this.signature_index = signature_index;
- this.constant_pool = constant_pool;
-
- setAttributes(attributes);
- }
-
- /**
- * Dump object to file stream on binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException {
- file.writeShort(access_flags);
- file.writeShort(name_index);
- file.writeShort(signature_index);
- file.writeShort(attributes_count);
-
- for (int i = 0; i < attributes_count; i++)
- attributes[i].dump(file);
- }
-
- /**
- * @return Collection of object attributes.
- */
- public final Attribute[] getAttributes() {
- return attributes;
- }
-
- /**
- * @param attributes Collection of object attributes.
- */
- public final void setAttributes(Attribute[] attributes) {
- this.attributes = attributes;
- attributes_count = (attributes == null) ? 0 : attributes.length;
- }
-
- /**
- * @return Constant pool used by this object.
- */
- public final ConstantPool getConstantPool() {
- return constant_pool;
- }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- */
- public final void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-
- /**
- * @return Index in constant pool of object's name.
- */
- public final int getNameIndex() {
- return name_index;
- }
-
- /**
- * @param name_index Index in constant pool of object's name.
- */
- public final void setNameIndex(int name_index) {
- this.name_index = name_index;
- }
-
- /**
- * @return Index in constant pool of field signature.
- */
- public final int getSignatureIndex() {
- return signature_index;
- }
-
- /**
- * @param signature_index Index in constant pool of field signature.
- */
- public final void setSignatureIndex(int signature_index) {
- this.signature_index = signature_index;
- }
-
- /**
- * @return Name of object, i.e., method name or field name
- */
- public final String getName() {
- ConstantUtf8 c;
- c =
- (ConstantUtf8)constant_pool.getConstant(
- name_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return String representation of object's type signature (java style)
- */
- public final String getSignature() {
- ConstantUtf8 c;
- c =
- (ConstantUtf8)constant_pool.getConstant(
- signature_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return deep copy of this field
- */
- protected FieldOrMethod copy_(ConstantPool _constant_pool) {
-
- try {
- FieldOrMethod c = (FieldOrMethod)clone();
- c.constant_pool = _constant_pool;
- c.attributes = new Attribute[attributes_count];
-
- for (int i = 0; i < attributes_count; i++)
- c.attributes[i] = attributes[i].copy(_constant_pool);
-
- return c;
- } catch (CloneNotSupportedException e) {
- return null;
+public abstract class FieldOrMethod extends AccessFlags implements Cloneable, Node {
+
+ protected int name_index; // Points to field name in constant pool
+ protected int signature_index; // Points to encoded signature
+ protected int attributes_count; // No. of attributes
+ protected Attribute[] attributes; // Collection of attributes
+ protected ConstantPool constant_pool;
+
+
+ FieldOrMethod() {
+ }
+
+
+ /**
+ * Initialize from another object. Note that both objects use the same
+ * references (shallow copy). Use clone() for a physical copy.
+ */
+ protected FieldOrMethod(FieldOrMethod c) {
+ this(c.getAccessFlags(), c.getNameIndex(), c.getSignatureIndex(), c.getAttributes(), c
+ .getConstantPool());
+ }
+
+
+ /**
+ * Construct object from file stream.
+ * @param file Input stream
+ * @throws IOException
+ * @throws ClassFormatException
+ */
+ protected FieldOrMethod(DataInputStream file, ConstantPool constant_pool) throws IOException,
+ ClassFormatException {
+ this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), null,
+ constant_pool);
+ attributes_count = file.readUnsignedShort();
+ attributes = new Attribute[attributes_count];
+ for (int i = 0; i < attributes_count; i++) {
+ attributes[i] = Attribute.readAttribute(file, constant_pool);
+ }
+ }
+
+
+ /**
+ * @param access_flags Access rights of method
+ * @param name_index Points to field name in constant pool
+ * @param signature_index Points to encoded signature
+ * @param attributes Collection of attributes
+ * @param constant_pool Array of constants
+ */
+ protected FieldOrMethod(int access_flags, int name_index, int signature_index,
+ Attribute[] attributes, ConstantPool constant_pool) {
+ this.access_flags = access_flags;
+ this.name_index = name_index;
+ this.signature_index = signature_index;
+ this.constant_pool = constant_pool;
+ setAttributes(attributes);
+ }
+
+
+ /**
+ * Dump object to file stream on binary format.
+ *
+ * @param file Output file stream
+ * @throws IOException
+ */
+ public final void dump( DataOutputStream file ) throws IOException {
+ file.writeShort(access_flags);
+ file.writeShort(name_index);
+ file.writeShort(signature_index);
+ file.writeShort(attributes_count);
+ for (int i = 0; i < attributes_count; i++) {
+ attributes[i].dump(file);
+ }
+ }
+
+
+ /**
+ * @return Collection of object attributes.
+ */
+ public final Attribute[] getAttributes() {
+ return attributes;
+ }
+
+
+ /**
+ * @param attributes Collection of object attributes.
+ */
+ public final void setAttributes( Attribute[] attributes ) {
+ this.attributes = attributes;
+ attributes_count = (attributes == null) ? 0 : attributes.length;
+ }
+
+
+ /**
+ * @return Constant pool used by this object.
+ */
+ public final ConstantPool getConstantPool() {
+ return constant_pool;
+ }
+
+
+ /**
+ * @param constant_pool Constant pool to be used for this object.
+ */
+ public final void setConstantPool( ConstantPool constant_pool ) {
+ this.constant_pool = constant_pool;
+ }
+
+
+ /**
+ * @return Index in constant pool of object's name.
+ */
+ public final int getNameIndex() {
+ return name_index;
+ }
+
+
+ /**
+ * @param name_index Index in constant pool of object's name.
+ */
+ public final void setNameIndex( int name_index ) {
+ this.name_index = name_index;
+ }
+
+
+ /**
+ * @return Index in constant pool of field signature.
+ */
+ public final int getSignatureIndex() {
+ return signature_index;
+ }
+
+
+ /**
+ * @param signature_index Index in constant pool of field signature.
+ */
+ public final void setSignatureIndex( int signature_index ) {
+ this.signature_index = signature_index;
+ }
+
+
+ /**
+ * @return Name of object, i.e., method name or field name
+ */
+ public final String getName() {
+ ConstantUtf8 c;
+ c = (ConstantUtf8) constant_pool.getConstant(name_index, Constants.CONSTANT_Utf8);
+ return c.getBytes();
+ }
+
+
+ /**
+ * @return String representation of object's type signature (java style)
+ */
+ public final String getSignature() {
+ ConstantUtf8 c;
+ c = (ConstantUtf8) constant_pool.getConstant(signature_index, Constants.CONSTANT_Utf8);
+ return c.getBytes();
}
- }
+
+ /**
+ * @return deep copy of this field
+ */
+ protected FieldOrMethod copy_( ConstantPool _constant_pool ) {
+ try {
+ FieldOrMethod c = (FieldOrMethod) clone();
+ c.constant_pool = _constant_pool;
+ c.attributes = new Attribute[attributes_count];
+ for (int i = 0; i < attributes_count; i++) {
+ c.attributes[i] = attributes[i].copy(_constant_pool);
+ }
+ return c;
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClass.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClass.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClass.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClass.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -33,155 +32,183 @@
* @see InnerClasses
*/
public final class InnerClass implements Cloneable, Node, Serializable {
- private int inner_class_index;
- private int outer_class_index;
- private int inner_name_index;
- private int inner_access_flags;
-
- /**
- * Initialize from another object.
- */
- public InnerClass(InnerClass c) {
- this(c.getInnerClassIndex(), c.getOuterClassIndex(), c.getInnerNameIndex(),
- c.getInnerAccessFlags());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- InnerClass(DataInputStream 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;
- }
-
- /**
- * 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
- */
- public void accept(Visitor v) {
- v.visitInnerClass(this);
- }
- /**
- * 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);
- }
- /**
- * @return access flags of inner class.
- */
- public final int getInnerAccessFlags() { return inner_access_flags; }
- /**
- * @return class index of inner class.
- */
- public final int getInnerClassIndex() { return inner_class_index; }
- /**
- * @return name index of inner class.
- */
- public final int getInnerNameIndex() { return inner_name_index; }
- /**
- * @return class index of outer class.
- */
- public final int getOuterClassIndex() { return outer_class_index; }
- /**
- * @param inner_access_flags access flags for this inner class
- */
- public final void setInnerAccessFlags(int inner_access_flags) {
- this.inner_access_flags = inner_access_flags;
- }
- /**
- * @param inner_class_index index into the constant pool for this class
- */
- public final void setInnerClassIndex(int inner_class_index) {
- this.inner_class_index = inner_class_index;
- }
- /**
- * @param inner_name_index index into the constant pool for this class's name
- */
- public final void setInnerNameIndex(int inner_name_index) {
- this.inner_name_index = inner_name_index;
- }
- /**
- * @param outer_class_index index into the constant pool for the owning class
- */
- public final void setOuterClassIndex(int outer_class_index) {
- this.outer_class_index = outer_class_index;
- }
- /**
- * @return String representation.
- */
- public final String toString() {
- return "InnerClass(" + inner_class_index + ", " + outer_class_index +
- ", " + inner_name_index + ", " + inner_access_flags + ")";
- }
-
- /**
- * @return Resolved string representation
- */
- public final String toString(ConstantPool constant_pool) {
- String inner_class_name, outer_class_name, inner_name, access;
-
- inner_class_name = constant_pool.getConstantString(inner_class_index,
- Constants.CONSTANT_Class);
- inner_class_name = Utility.compactClassName(inner_class_name);
-
- if (outer_class_index != 0) {
- outer_class_name = constant_pool.getConstantString(outer_class_index,
- Constants.CONSTANT_Class);
- outer_class_name = Utility.compactClassName(outer_class_name);
- }
- else
- outer_class_name = "<not a member>";
-
- if(inner_name_index != 0)
- inner_name = ((ConstantUtf8)constant_pool.
- getConstant(inner_name_index, Constants.CONSTANT_Utf8)).getBytes();
- else
- inner_name = "<anonymous>";
-
- access = Utility.accessToString(inner_access_flags, true);
- access = access.equals("")? "" : (access + " ");
-
- return "InnerClass:" + access + inner_class_name +
- "(\"" + outer_class_name + "\", \"" + inner_name + "\")";
- }
-
- /**
- * @return deep copy of this object
- */
- public InnerClass copy() {
- try {
- return (InnerClass)clone();
- } catch(CloneNotSupportedException e) {}
- return null;
- }
+ private int inner_class_index;
+ private int outer_class_index;
+ private int inner_name_index;
+ private int inner_access_flags;
+
+
+ /**
+ * Initialize from another object.
+ */
+ public InnerClass(InnerClass c) {
+ this(c.getInnerClassIndex(), c.getOuterClassIndex(), c.getInnerNameIndex(), c
+ .getInnerAccessFlags());
+ }
+
+
+ /**
+ * Construct object from file stream.
+ * @param file Input stream
+ * @throws IOException
+ */
+ InnerClass(DataInputStream 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;
+ }
+
+
+ /**
+ * 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
+ */
+ public void accept( Visitor v ) {
+ v.visitInnerClass(this);
+ }
+
+
+ /**
+ * 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);
+ }
+
+
+ /**
+ * @return access flags of inner class.
+ */
+ public final int getInnerAccessFlags() {
+ return inner_access_flags;
+ }
+
+
+ /**
+ * @return class index of inner class.
+ */
+ public final int getInnerClassIndex() {
+ return inner_class_index;
+ }
+
+
+ /**
+ * @return name index of inner class.
+ */
+ public final int getInnerNameIndex() {
+ return inner_name_index;
+ }
+
+
+ /**
+ * @return class index of outer class.
+ */
+ public final int getOuterClassIndex() {
+ return outer_class_index;
+ }
+
+
+ /**
+ * @param inner_access_flags access flags for this inner class
+ */
+ public final void setInnerAccessFlags( int inner_access_flags ) {
+ this.inner_access_flags = inner_access_flags;
+ }
+
+
+ /**
+ * @param inner_class_index index into the constant pool for this class
+ */
+ public final void setInnerClassIndex( int inner_class_index ) {
+ this.inner_class_index = inner_class_index;
+ }
+
+
+ /**
+ * @param inner_name_index index into the constant pool for this class's name
+ */
+ public final void setInnerNameIndex( int inner_name_index ) {
+ this.inner_name_index = inner_name_index;
+ }
+
+
+ /**
+ * @param outer_class_index index into the constant pool for the owning class
+ */
+ public final void setOuterClassIndex( int outer_class_index ) {
+ this.outer_class_index = outer_class_index;
+ }
+
+
+ /**
+ * @return String representation.
+ */
+ public final String toString() {
+ return "InnerClass(" + inner_class_index + ", " + outer_class_index + ", "
+ + inner_name_index + ", " + inner_access_flags + ")";
+ }
+
+
+ /**
+ * @return Resolved string representation
+ */
+ public final String toString( ConstantPool constant_pool ) {
+ String inner_class_name, outer_class_name, inner_name, access;
+ inner_class_name = constant_pool.getConstantString(inner_class_index,
+ Constants.CONSTANT_Class);
+ inner_class_name = Utility.compactClassName(inner_class_name);
+ if (outer_class_index != 0) {
+ outer_class_name = constant_pool.getConstantString(outer_class_index,
+ Constants.CONSTANT_Class);
+ outer_class_name = Utility.compactClassName(outer_class_name);
+ } else {
+ outer_class_name = "<not a member>";
+ }
+ if (inner_name_index != 0) {
+ inner_name = ((ConstantUtf8) constant_pool.getConstant(inner_name_index,
+ Constants.CONSTANT_Utf8)).getBytes();
+ } else {
+ inner_name = "<anonymous>";
+ }
+ access = Utility.accessToString(inner_access_flags, true);
+ access = access.equals("") ? "" : (access + " ");
+ return "InnerClass:" + access + inner_class_name + "(\"" + outer_class_name + "\", \""
+ + inner_name + "\")";
+ }
+
+
+ /**
+ * @return deep copy of this object
+ */
+ public InnerClass copy() {
+ try {
+ return (InnerClass) clone();
+ } catch (CloneNotSupportedException e) {
+ }
+ return null;
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClasses.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClasses.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClasses.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/InnerClasses.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.classfile;
-
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
@@ -33,113 +32,119 @@
* @see Attribute
*/
public final class InnerClasses extends Attribute {
- private InnerClass[] inner_classes;
- private int number_of_classes;
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public InnerClasses(InnerClasses c) {
- this(c.getNameIndex(), c.getLength(), c.getInnerClasses(),
- c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param inner_classes array of inner classes attributes
- * @param constant_pool Array of constants
- */
- public InnerClasses(int name_index, int length,
- InnerClass[] inner_classes,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_INNER_CLASSES, name_index, length, constant_pool);
- setInnerClasses(inner_classes);
- }
-
- /**
- * Construct object from file stream.
- *
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- InnerClasses(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (InnerClass[])null, constant_pool);
-
- number_of_classes = file.readUnsignedShort();
- inner_classes = new InnerClass[number_of_classes];
-
- for(int i=0; i < number_of_classes; i++)
- inner_classes[i] = new InnerClass(file);
- }
- /**
- * 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
- */
- public void accept(Visitor v) {
- v.visitInnerClasses(this);
- }
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(number_of_classes);
-
- for(int i=0; i < number_of_classes; i++)
- inner_classes[i].dump(file);
- }
-
- /**
- * @return array of inner class "records"
- */
- public final InnerClass[] getInnerClasses() { return inner_classes; }
-
- /**
- * @param inner_classes the array of inner classes
- */
- public final void setInnerClasses(InnerClass[] inner_classes) {
- this.inner_classes = inner_classes;
- number_of_classes = (inner_classes == null)? 0 : inner_classes.length;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer();
-
- for(int i=0; i < number_of_classes; i++)
- buf.append(inner_classes[i].toString(constant_pool)).append("\n");
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool _constant_pool) {
- InnerClasses c = (InnerClasses)clone();
-
- c.inner_classes = new InnerClass[number_of_classes];
- for(int i=0; i < number_of_classes; i++)
- c.inner_classes[i] = inner_classes[i].copy();
-
- c.constant_pool = _constant_pool;
- return c;
- }
+ private InnerClass[] inner_classes;
+ private int number_of_classes;
+
+
+ /**
+ * Initialize from another object. Note that both objects use the same
+ * references (shallow copy). Use clone() for a physical copy.
+ */
+ public InnerClasses(InnerClasses c) {
+ this(c.getNameIndex(), c.getLength(), c.getInnerClasses(), c.getConstantPool());
+ }
+
+
+ /**
+ * @param name_index Index in constant pool to CONSTANT_Utf8
+ * @param length Content length in bytes
+ * @param inner_classes array of inner classes attributes
+ * @param constant_pool Array of constants
+ */
+ public InnerClasses(int name_index, int length, InnerClass[] inner_classes,
+ ConstantPool constant_pool) {
+ super(Constants.ATTR_INNER_CLASSES, name_index, length, constant_pool);
+ setInnerClasses(inner_classes);
+ }
+
+
+ /**
+ * Construct object from file stream.
+ *
+ * @param name_index Index in constant pool to CONSTANT_Utf8
+ * @param length Content length in bytes
+ * @param file Input stream
+ * @param constant_pool Array of constants
+ * @throws IOException
+ */
+ InnerClasses(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
+ throws IOException {
+ this(name_index, length, (InnerClass[]) null, constant_pool);
+ number_of_classes = file.readUnsignedShort();
+ inner_classes = new InnerClass[number_of_classes];
+ for (int i = 0; i < number_of_classes; i++) {
+ inner_classes[i] = new InnerClass(file);
+ }
+ }
+
+
+ /**
+ * 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
+ */
+ public void accept( Visitor v ) {
+ v.visitInnerClasses(this);
+ }
+
+
+ /**
+ * Dump source file attribute to file stream in binary format.
+ *
+ * @param file Output file stream
+ * @throws IOException
+ */
+ public final void dump( DataOutputStream file ) throws IOException {
+ super.dump(file);
+ file.writeShort(number_of_classes);
+ for (int i = 0; i < number_of_classes; i++) {
+ inner_classes[i].dump(file);
+ }
+ }
+
+
+ /**
+ * @return array of inner class "records"
+ */
+ public final InnerClass[] getInnerClasses() {
+ return inner_classes;
+ }
+
+
+ /**
+ * @param inner_classes the array of inner classes
+ */
+ public final void setInnerClasses( InnerClass[] inner_classes ) {
+ this.inner_classes = inner_classes;
+ number_of_classes = (inner_classes == null) ? 0 : inner_classes.length;
+ }
+
+
+ /**
+ * @return String representation.
+ */
+ public final String toString() {
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < number_of_classes; i++) {
+ buf.append(inner_classes[i].toString(constant_pool)).append("\n");
+ }
+ return buf.toString();
+ }
+
+
+ /**
+ * @return deep copy of this attribute
+ */
+ public Attribute copy( ConstantPool _constant_pool ) {
+ InnerClasses c = (InnerClasses) clone();
+ c.inner_classes = new InnerClass[number_of_classes];
+ for (int i = 0; i < number_of_classes; i++) {
+ c.inner_classes[i] = inner_classes[i].copy();
+ }
+ c.constant_pool = _constant_pool;
+ return c;
+ }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.