You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/18 01:15:49 UTC
svn commit: r1696350 - in /commons/proper/bcel/trunk/src: changes/
main/java/org/apache/commons/bcel6/classfile/
main/java/org/apache/commons/bcel6/generic/
Author: sebb
Date: Mon Aug 17 23:15:48 2015
New Revision: 1696350
URL: http://svn.apache.org/r1696350
Log:
Revert BCEL-235 and BCEL-233
Modified:
commons/proper/bcel/trunk/src/changes/changes.xml
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Annotations.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/CodeException.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantClass.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantDouble.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantFloat.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantInteger.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantLong.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodHandle.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodType.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantNameAndType.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantPool.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantString.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantValue.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Deprecated.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClass.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClasses.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/JavaClass.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumber.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTypeTable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameter.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameters.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SimpleElementValue.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMap.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTable.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTableEntry.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapType.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Synthetic.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Unknown.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java
Modified: commons/proper/bcel/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/changes/changes.xml?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/changes/changes.xml (original)
+++ commons/proper/bcel/trunk/src/changes/changes.xml Mon Aug 17 23:15:48 2015
@@ -72,9 +72,7 @@ The <action> type attribute can be add,u
<action issue="BCEL-217" type="fix">long type instructions are not searched by InstructionFinder using regular expression</action>
<action issue="BCEL-244" type="update" dev="ggregory">Update Java requirement from 5 to 7</action>
<action issue="BCEL-239" type="fix">Interfaces should not be used to define constants</action>
- <action issue="BCEL-235" type="remove">Remove unused setters</action>
<action issue="BCEL-232" type="fix">Make mutable fields private</action>
- <action issue="BCEL-233" type="fix">The access_flags field in AccessFlags class should be final</action>
<action issue="BCEL-234" type="fix">Code must not swallow Throwable</action>
<action issue="BCEL-222" type="update">
Major release of BCEL requires updating package name and maven coordinates.
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java Mon Aug 17 23:15:48 2015
@@ -28,11 +28,10 @@ import org.apache.commons.bcel6.Constant
public abstract class AccessFlags implements java.io.Serializable {
private static final long serialVersionUID = 2845404654039163061L;
- private final int access_flags;
+ protected int access_flags;
public AccessFlags() {
- this(0);
}
@@ -60,76 +59,180 @@ public abstract class AccessFlags implem
}
+ /** Set access flags aka "modifiers".
+ * @param access_flags Access flags of the object.
+ */
+ public final void setAccessFlags( int access_flags ) {
+ this.access_flags = access_flags;
+ }
+
+
+ /** Set access flags aka "modifiers".
+ * @param access_flags Access flags of the object.
+ */
+ public final void setModifiers( int access_flags ) {
+ setAccessFlags(access_flags);
+ }
+
+
+ private void setFlag( int flag, boolean set ) {
+ if ((access_flags & flag) != 0) { // Flag is set already
+ if (!set) {
+ access_flags ^= flag;
+ }
+ } else { // Flag not set
+ if (set) {
+ access_flags |= flag;
+ }
+ }
+ }
+
+
+ public final void isPublic( boolean flag ) {
+ setFlag(Constants.ACC_PUBLIC, flag);
+ }
+
+
public final boolean isPublic() {
return (access_flags & Constants.ACC_PUBLIC) != 0;
}
+ public final void isPrivate( boolean flag ) {
+ setFlag(Constants.ACC_PRIVATE, flag);
+ }
+
+
public final boolean isPrivate() {
return (access_flags & Constants.ACC_PRIVATE) != 0;
}
+ public final void isProtected( boolean flag ) {
+ setFlag(Constants.ACC_PROTECTED, flag);
+ }
+
+
public final boolean isProtected() {
return (access_flags & Constants.ACC_PROTECTED) != 0;
}
+ public final void isStatic( boolean flag ) {
+ setFlag(Constants.ACC_STATIC, flag);
+ }
+
+
public final boolean isStatic() {
return (access_flags & Constants.ACC_STATIC) != 0;
}
+ public final void isFinal( boolean flag ) {
+ setFlag(Constants.ACC_FINAL, flag);
+ }
+
+
public final boolean isFinal() {
return (access_flags & Constants.ACC_FINAL) != 0;
}
+ public final void isSynchronized( boolean flag ) {
+ setFlag(Constants.ACC_SYNCHRONIZED, flag);
+ }
+
+
public final boolean isSynchronized() {
return (access_flags & Constants.ACC_SYNCHRONIZED) != 0;
}
+ public final void isVolatile( boolean flag ) {
+ setFlag(Constants.ACC_VOLATILE, flag);
+ }
+
+
public final boolean isVolatile() {
return (access_flags & Constants.ACC_VOLATILE) != 0;
}
+ public final void isTransient( boolean flag ) {
+ setFlag(Constants.ACC_TRANSIENT, flag);
+ }
+
+
public final boolean isTransient() {
return (access_flags & Constants.ACC_TRANSIENT) != 0;
}
+ public final void isNative( boolean flag ) {
+ setFlag(Constants.ACC_NATIVE, flag);
+ }
+
+
public final boolean isNative() {
return (access_flags & Constants.ACC_NATIVE) != 0;
}
+ public final void isInterface( boolean flag ) {
+ setFlag(Constants.ACC_INTERFACE, flag);
+ }
+
+
public final boolean isInterface() {
return (access_flags & Constants.ACC_INTERFACE) != 0;
}
+ public final void isAbstract( boolean flag ) {
+ setFlag(Constants.ACC_ABSTRACT, flag);
+ }
+
+
public final boolean isAbstract() {
return (access_flags & Constants.ACC_ABSTRACT) != 0;
}
+ public final void isStrictfp( boolean flag ) {
+ setFlag(Constants.ACC_STRICT, flag);
+ }
+
+
public final boolean isStrictfp() {
return (access_flags & Constants.ACC_STRICT) != 0;
}
+ public final void isSynthetic( boolean flag ) {
+ setFlag(Constants.ACC_SYNTHETIC, flag);
+ }
+
+
public final boolean isSynthetic() {
return (access_flags & Constants.ACC_SYNTHETIC) != 0;
}
+ public final void isAnnotation( boolean flag ) {
+ setFlag(Constants.ACC_ANNOTATION, flag);
+ }
+
+
public final boolean isAnnotation() {
return (access_flags & Constants.ACC_ANNOTATION) != 0;
}
+ public final void isEnum( boolean flag ) {
+ setFlag(Constants.ACC_ENUM, flag);
+ }
+
+
public final boolean isEnum() {
return (access_flags & Constants.ACC_ENUM) != 0;
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AnnotationDefault.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ public class AnnotationDefault extends A
private static final long serialVersionUID = -4017327188724019487L;
- private final ElementValue default_value; // TODO could this be made final?
+ private ElementValue default_value;
/**
* @param name_index Index pointing to the name <em>Code</em>
@@ -42,7 +42,8 @@ public class AnnotationDefault extends A
* @param constant_pool Array of constants
*/
AnnotationDefault(int name_index, int length, DataInput input, ConstantPool constant_pool) throws IOException {
- this(name_index, length, ElementValue.readElementValue(input, constant_pool), constant_pool);
+ this(name_index, length, (ElementValue) null, constant_pool);
+ default_value = ElementValue.readElementValue(input, constant_pool);
}
/**
@@ -69,6 +70,13 @@ public class AnnotationDefault extends A
}
/**
+ * @param defaultValue the default value of this methodinfo's annotation
+ */
+ public final void setDefaultValue(ElementValue defaultValue) {
+ default_value = defaultValue;
+ }
+
+ /**
* @return the default value
*/
public final ElementValue getDefaultValue() {
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Annotations.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Annotations.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Annotations.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Annotations.java Mon Aug 17 23:15:48 2015
@@ -31,7 +31,7 @@ public abstract class Annotations extend
private static final long serialVersionUID = 1L;
- private final AnnotationEntry[] annotation_table;
+ private AnnotationEntry[] annotation_table;
private final boolean isRuntimeVisible;
/**
@@ -42,16 +42,12 @@ public abstract class Annotations extend
* @param constant_pool Array of constants
*/
Annotations(byte annotation_type, int name_index, int length, DataInput input, ConstantPool constant_pool, boolean isRuntimeVisible) throws IOException {
- this(annotation_type, name_index, length, makeAnnotationTable(input, constant_pool, isRuntimeVisible), constant_pool, isRuntimeVisible);
- }
-
- static AnnotationEntry[] makeAnnotationTable(DataInput input, ConstantPool constant_pool, boolean isRuntimeVisible) throws IOException {
+ this(annotation_type, name_index, length, (AnnotationEntry[]) null, constant_pool, isRuntimeVisible);
final int annotation_table_length = (input.readUnsignedShort());
- AnnotationEntry[] at = new AnnotationEntry[annotation_table_length];
+ annotation_table = new AnnotationEntry[annotation_table_length];
for (int i = 0; i < annotation_table_length; i++) {
- at[i] = AnnotationEntry.read(input, constant_pool, isRuntimeVisible);
+ annotation_table[i] = AnnotationEntry.read(input, constant_pool, isRuntimeVisible);
}
- return at;
}
/**
@@ -79,6 +75,13 @@ public abstract class Annotations extend
}
/**
+ * @param annotation_table the entries to set in this annotation
+ */
+ public final void setAnnotationTable(AnnotationEntry[] annotation_table) {
+ this.annotation_table = annotation_table;
+ }
+
+ /**
* returns the array of annotation entries in this annotation
*/
public AnnotationEntry[] getAnnotationEntries() {
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java Mon Aug 17 23:15:48 2015
@@ -52,7 +52,7 @@ public abstract class Attribute implemen
{
private static final long serialVersionUID = -1707826820310002955L;
- private final int name_index; // Points to attribute name in constant pool
+ private int name_index; // Points to attribute name in constant pool
private int length; // Content length of attribute field
@@ -259,6 +259,14 @@ public abstract class Attribute implemen
}
/**
+ * @param name_index of attribute.
+ */
+ public final void setNameIndex(int name_index)
+ {
+ this.name_index = name_index;
+ }
+
+ /**
* @return Name index in constant pool of attribute name.
*/
public final int getNameIndex()
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/BootstrapMethod.java Mon Aug 17 23:15:48 2015
@@ -37,12 +37,12 @@ public class BootstrapMethod implements
private static final long serialVersionUID = -4517534834047695344L;
/** Index of the CONSTANT_MethodHandle_info structure in the constant_pool table */
- private final int bootstrap_method_ref;
+ private int bootstrap_method_ref;
private final int num_bootstrap_arguments;
/** Array of references to the constant_pool table */
- private final int[] bootstrap_arguments;
+ private int[] bootstrap_arguments;
/**
@@ -59,9 +59,9 @@ public class BootstrapMethod implements
* @throws IOException
*/
BootstrapMethod(DataInput input) throws IOException {
- this.bootstrap_method_ref = input.readUnsignedShort();
- this.num_bootstrap_arguments = input.readUnsignedShort();
- this.bootstrap_arguments = new int[num_bootstrap_arguments];
+ this(input.readUnsignedShort(), input.readUnsignedShort(), (int[]) null);
+
+ bootstrap_arguments = new int[num_bootstrap_arguments];
for (int i = 0; i < num_bootstrap_arguments; i++) {
bootstrap_arguments[i] = input.readUnsignedShort();
}
@@ -87,6 +87,13 @@ public class BootstrapMethod implements
}
/**
+ * @param bootstrap_method_ref int index into constant_pool of CONSTANT_MethodHandle
+ */
+ public void setBootstrapMethodRef(int bootstrap_method_ref) {
+ this.bootstrap_method_ref = bootstrap_method_ref;
+ }
+
+ /**
* @return int[] of bootstrap_method indices into constant_pool of CONSTANT_<type>_info
*/
public int[] getBootstrapArguments() {
@@ -101,6 +108,13 @@ public class BootstrapMethod implements
}
/**
+ * @param bootstrap_arguments int[] indices into constant_pool of CONSTANT_<type>_info
+ */
+ public void setBootstrapArguments(int[] bootstrap_arguments) {
+ this.bootstrap_arguments = bootstrap_arguments;
+ }
+
+ /**
* @return String representation.
*/
@Override
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/CodeException.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/CodeException.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/CodeException.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/CodeException.java Mon Aug 17 23:15:48 2015
@@ -35,12 +35,12 @@ import org.apache.commons.bcel6.Constant
public final class CodeException implements Cloneable, Node, Serializable {
private static final long serialVersionUID = 2972500041254967221L;
- private final int start_pc; // Range in the code the exception handler is
- private final int end_pc; // active. start_pc is inclusive, end_pc exclusive
- private final int handler_pc; /* Starting address of exception handler, i.e.,
+ private int start_pc; // Range in the code the exception handler is
+ private int end_pc; // active. start_pc is inclusive, end_pc exclusive
+ private int handler_pc; /* Starting address of exception handler, i.e.,
* an offset from start of code.
*/
- private final int catch_type; /* If this is zero the handler catches any
+ private int catch_type; /* If this is zero the handler catches any
* exception, otherwise it points to the
* exception class which is to be caught.
*/
@@ -143,6 +143,38 @@ public final class CodeException impleme
}
+ /**
+ * @param catch_type the type of exception that is caught
+ */
+ public final void setCatchType( int catch_type ) {
+ this.catch_type = catch_type;
+ }
+
+
+ /**
+ * @param end_pc end of handled block
+ */
+ public final void setEndPC( int end_pc ) {
+ this.end_pc = end_pc;
+ }
+
+
+ /**
+ * @param handler_pc where the actual code is
+ */
+ public final void setHandlerPC( int handler_pc ) { // TODO unused
+ this.handler_pc = handler_pc;
+ }
+
+
+ /**
+ * @param start_pc start of handled block
+ */
+ public final void setStartPC( int start_pc ) { // TODO unused
+ this.start_pc = start_pc;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantClass.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantClass.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantClass.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantClass extends Constant implements ConstantObject {
private static final long serialVersionUID = -1083450233715258720L;
- private final int name_index; // Identical to ConstantString except for the name
+ private int name_index; // Identical to ConstantString except for the name
/**
@@ -99,6 +99,14 @@ public final class ConstantClass extends
}
+ /**
+ * @param name_index the name index in the constant pool of this Constant Class
+ */
+ public final void setNameIndex( int name_index ) {
+ this.name_index = name_index;
+ }
+
+
/** @return String object
*/
@Override
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantDouble.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantDouble.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantDouble.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantDouble.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantDouble extends Constant implements ConstantObject {
private static final long serialVersionUID = -7394764537394782136L;
- private final double bytes;
+ private double bytes;
/**
@@ -98,6 +98,14 @@ public final class ConstantDouble extend
}
+ /**
+ * @param bytes the raw bytes that represent the double value
+ */
+ public final void setBytes( double bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantFloat.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantFloat.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantFloat.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantFloat.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantFloat extends Constant implements ConstantObject {
private static final long serialVersionUID = -2316732495687628398L;
- private final float bytes;
+ private float bytes;
/**
@@ -99,6 +99,14 @@ public final class ConstantFloat extends
}
+ /**
+ * @param bytes the raw bytes that represent this float
+ */
+ public final void setBytes( float bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantInteger.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantInteger.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantInteger.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantInteger.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantInteger extends Constant implements ConstantObject {
private static final long serialVersionUID = -7040676276945754375L;
- private final int bytes;
+ private int bytes;
/**
@@ -98,6 +98,14 @@ public final class ConstantInteger exten
}
+ /**
+ * @param bytes the raw bytes that represent this integer
+ */
+ public final void setBytes( int bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantLong.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantLong.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantLong.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantLong.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantLong extends Constant implements ConstantObject {
private static final long serialVersionUID = 8495971186433816161L;
- private final long bytes;
+ private long bytes;
/**
@@ -98,6 +98,14 @@ public final class ConstantLong extends
}
+ /**
+ * @param bytes the raw bytes that represent this long
+ */
+ public final void setBytes( long bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodHandle.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodHandle.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodHandle.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodHandle.java Mon Aug 17 23:15:48 2015
@@ -33,8 +33,8 @@ import org.apache.commons.bcel6.Constant
public final class ConstantMethodHandle extends Constant {
private static final long serialVersionUID = -7875124116920198044L;
- private final int reference_kind;
- private final int reference_index;
+ private int reference_kind;
+ private int reference_index;
/**
@@ -95,11 +95,21 @@ public final class ConstantMethodHandle
}
+ public void setReferenceKind(int reference_kind) {
+ this.reference_kind = reference_kind;
+ }
+
+
public int getReferenceIndex() {
return reference_index;
}
+ public void setReferenceIndex(int reference_index) {
+ this.reference_index = reference_index;
+ }
+
+
/**
* @return String representation
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodType.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodType.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodType.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantMethodType.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantMethodType extends Constant {
private static final long serialVersionUID = 6750768220616618881L;
- private final int descriptor_index;
+ private int descriptor_index;
/**
@@ -92,6 +92,11 @@ public final class ConstantMethodType ex
}
+ public void setDescriptorIndex(int descriptor_index) {
+ this.descriptor_index = descriptor_index;
+ }
+
+
/**
* @return String representation
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantNameAndType.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantNameAndType.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantNameAndType.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantNameAndType.java Mon Aug 17 23:15:48 2015
@@ -34,8 +34,8 @@ import org.apache.commons.bcel6.Constant
public final class ConstantNameAndType extends Constant {
private static final long serialVersionUID = -7913354727264034451L;
- private final int name_index; // Name of field/method
- private final int signature_index; // and its signature.
+ private int name_index; // Name of field/method
+ private int signature_index; // and its signature.
/**
@@ -125,6 +125,22 @@ public final class ConstantNameAndType e
}
+ /**
+ * @param name_index the name index of this constant
+ */
+ public final void setNameIndex( int name_index ) {
+ this.name_index = name_index;
+ }
+
+
+ /**
+ * @param signature_index the signature index in the constant pool of this type
+ */
+ public final void setSignatureIndex( int signature_index ) {
+ this.signature_index = signature_index;
+ }
+
+
/**
* @return String representation
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantPool.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantPool.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantPool.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantPool.java Mon Aug 17 23:15:48 2015
@@ -39,7 +39,7 @@ import org.apache.commons.bcel6.Constant
public class ConstantPool implements Cloneable, Node, Serializable {
private static final long serialVersionUID = -9093478476423540196L;
- private Constant[] constant_pool; // TODO this could be final if the copy() method were rewritten
+ private Constant[] constant_pool;
/**
@@ -324,6 +324,22 @@ public class ConstantPool implements Clo
}
+ /**
+ * @param constant Constant to set
+ */
+ public void setConstant( int index, Constant constant ) {
+ constant_pool[index] = constant;
+ }
+
+
+ /**
+ * @param constant_pool
+ */
+ public void setConstantPool( Constant[] constant_pool ) {
+ this.constant_pool = constant_pool;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantString.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantString.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantString.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantString.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantString extends Constant implements ConstantObject {
private static final long serialVersionUID = 6603144389219397225L;
- private final int string_index; // Identical to ConstantClass except for this name
+ private int string_index; // Identical to ConstantClass except for this name
/**
@@ -98,6 +98,14 @@ public final class ConstantString extend
}
+ /**
+ * @param string_index the index into the constant of the string value
+ */
+ public final void setStringIndex( int string_index ) {
+ this.string_index = string_index;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantValue.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantValue.java Mon Aug 17 23:15:48 2015
@@ -34,7 +34,7 @@ import org.apache.commons.bcel6.Constant
public final class ConstantValue extends Attribute {
private static final long serialVersionUID = -5668999920978520157L;
- private final int constantvalue_index;
+ private int constantvalue_index;
/**
@@ -107,6 +107,14 @@ public final class ConstantValue extends
}
+ /**
+ * @param constantvalue_index the index info the constant pool of this constant value
+ */
+ public final void setConstantValueIndex( int constantvalue_index ) {
+ this.constantvalue_index = constantvalue_index;
+ }
+
+
/**
* @return String representation of constant value.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Deprecated.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Deprecated.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Deprecated.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Deprecated.java Mon Aug 17 23:15:48 2015
@@ -34,7 +34,7 @@ import org.apache.commons.bcel6.Constant
public final class Deprecated extends Attribute {
private static final long serialVersionUID = -2242528405240201000L;
- private byte[] bytes; // TODO could be final if copy() were rewritten
+ private byte[] bytes;
/**
@@ -114,6 +114,14 @@ public final class Deprecated extends At
}
+ /**
+ * @param bytes the raw bytes that represents this byte array
+ */
+ public final void setBytes( byte[] bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return attribute name
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/EnclosingMethod.java Mon Aug 17 23:15:48 2015
@@ -34,7 +34,7 @@ public class EnclosingMethod extends Att
// Pointer to the CONSTANT_Class_info structure representing the
// innermost class that encloses the declaration of the current class.
- private final int classIndex;
+ private int classIndex;
// If the current class is not immediately enclosed by a method or
// constructor, then the value of the method_index item must be zero.
@@ -44,7 +44,7 @@ public class EnclosingMethod extends Att
// to in the class_index. *It is the compiler responsibility* to
// ensure that the method identified by this index is the closest
// lexically enclosing method that includes the local/anonymous class.
- private final int methodIndex;
+ private int methodIndex;
// Ctors - and code to read an attribute in.
EnclosingMethod(int nameIndex, int len, DataInput input, ConstantPool cpool) throws IOException {
@@ -73,6 +73,9 @@ public class EnclosingMethod extends Att
public final int getEnclosingClassIndex() { return classIndex; }
public final int getEnclosingMethodIndex(){ return methodIndex;}
+ public final void setEnclosingClassIndex(int idx) {classIndex = idx;}
+ public final void setEnclosingMethodIndex(int idx){methodIndex= idx;}
+
public final ConstantClass getEnclosingClass() {
ConstantClass c =
(ConstantClass)super.getConstantPool().getConstant(classIndex,Constants.CONSTANT_Class);
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ExceptionTable.java Mon Aug 17 23:15:48 2015
@@ -140,6 +140,15 @@ public final class ExceptionTable extend
/**
+ * @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 != null ? exception_index_table : new int[0];
+ }
+
+
+ /**
* @return String representation, i.e., a list of thrown exceptions.
*/
@Override
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Field.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.util.BCE
public final class Field extends FieldOrMethod {
private static final long serialVersionUID = -4604082205545049134L;
- private static final BCELComparator _cmp = new BCELComparator() {
+ private static BCELComparator _cmp = new BCELComparator() {
@Override
public boolean equals( Object o1, Object o2 ) {
@@ -163,6 +163,14 @@ public final class Field extends FieldOr
}
+ /**
+ * @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
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java Mon Aug 17 23:15:48 2015
@@ -32,8 +32,8 @@ public abstract class FieldOrMethod exte
private static final long serialVersionUID = -1833306330869469714L;
- private final int name_index; // Points to field name in constant pool
- private final int signature_index; // Points to encoded signature
+ private int name_index; // Points to field name in constant pool
+ private int signature_index; // Points to encoded signature
private Attribute[] attributes; // Collection of attributes
private AnnotationEntry[] annotationEntries; // annotations defined on the field or method
private ConstantPool constant_pool;
@@ -41,9 +41,7 @@ public abstract class FieldOrMethod exte
private String signatureAttributeString = null;
private boolean searchedForSignatureAttribute = false;
- FieldOrMethod() { // TODO is this ctor needed?
- this.name_index = 0;
- this.signature_index = 0;
+ FieldOrMethod() {
}
@@ -149,6 +147,14 @@ public abstract class FieldOrMethod exte
/**
+ * @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() {
@@ -156,6 +162,14 @@ public abstract class FieldOrMethod exte
}
+ /**
+ * @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
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClass.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClass.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClass.java Mon Aug 17 23:15:48 2015
@@ -35,10 +35,10 @@ import org.apache.commons.bcel6.Constant
public final class InnerClass implements Cloneable, Node, Serializable {
private static final long serialVersionUID = -7200195918166127614L;
- private final int inner_class_index;
- private final int outer_class_index;
- private final int inner_name_index;
- private final int inner_access_flags;
+ private int inner_class_index;
+ private int outer_class_index;
+ private int inner_name_index;
+ private int inner_access_flags;
/**
@@ -135,6 +135,38 @@ public final class InnerClass implements
}
+ /**
+ * @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 ) { // TODO unused
+ 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 ) { // TODO unused
+ this.outer_class_index = outer_class_index;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClasses.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClasses.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClasses.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/InnerClasses.java Mon Aug 17 23:15:48 2015
@@ -35,7 +35,7 @@ import org.apache.commons.bcel6.Constant
public final class InnerClasses extends Attribute {
private static final long serialVersionUID = 4570147726361753700L;
- private InnerClass[] inner_classes; // TODO could be final (would need to recode the copy method)
+ private InnerClass[] inner_classes;
/**
@@ -117,6 +117,14 @@ public final class InnerClasses extends
}
+ /**
+ * @param inner_classes the array of inner classes
+ */
+ public final void setInnerClasses( InnerClass[] inner_classes ) {
+ this.inner_classes = inner_classes != null ? inner_classes : new InnerClass[0];
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/JavaClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/JavaClass.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/JavaClass.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/JavaClass.java Mon Aug 17 23:15:48 2015
@@ -74,7 +74,7 @@ public class JavaClass extends AccessFla
static boolean debug = false; // Debugging on/off
final static char sep = File.separatorChar; // directory separator
- private static final BCELComparator _cmp = new BCELComparator() {
+ private static BCELComparator _cmp = new BCELComparator() {
@Override
public boolean equals( Object o1, Object o2 ) {
@@ -486,6 +486,118 @@ public class JavaClass extends AccessFla
/**
+ * @param attributes .
+ */
+ public void setAttributes( Attribute[] attributes ) {
+ this.attributes = attributes;
+ }
+
+
+ /**
+ * @param class_name .
+ */
+ public void setClassName( String class_name ) {
+ this.class_name = class_name;
+ }
+
+
+ /**
+ * @param class_name_index .
+ */
+ public void setClassNameIndex( int class_name_index ) {
+ this.class_name_index = class_name_index;
+ }
+
+
+ /**
+ * @param constant_pool .
+ */
+ public void setConstantPool( ConstantPool constant_pool ) {
+ this.constant_pool = constant_pool;
+ }
+
+
+ /**
+ * @param fields .
+ */
+ public void setFields( Field[] fields ) {
+ this.fields = fields;
+ }
+
+
+ /**
+ * Set File name of class, aka SourceFile attribute value
+ */
+ public void setFileName( String file_name ) {
+ this.file_name = file_name;
+ }
+
+
+ /**
+ * @param interface_names .
+ */
+ public void setInterfaceNames( String[] interface_names ) {
+ this.interface_names = interface_names;
+ }
+
+
+ /**
+ * @param interfaces .
+ */
+ public void setInterfaces( int[] interfaces ) {
+ this.interfaces = interfaces;
+ }
+
+
+ /**
+ * @param major .
+ */
+ public void setMajor( int major ) {
+ this.major = major;
+ }
+
+
+ /**
+ * @param methods .
+ */
+ public void setMethods( Method[] methods ) {
+ this.methods = methods;
+ }
+
+
+ /**
+ * @param minor .
+ */
+ public void setMinor( int minor ) {
+ this.minor = minor;
+ }
+
+
+ /**
+ * Set absolute path to file this class was read from.
+ */
+ public void setSourceFileName( String source_file_name ) {
+ this.source_file_name = source_file_name;
+ }
+
+
+ /**
+ * @param superclass_name .
+ */
+ public void setSuperclassName( String superclass_name ) {
+ this.superclass_name = superclass_name;
+ }
+
+
+ /**
+ * @param superclass_name_index .
+ */
+ public void setSuperclassNameIndex( int superclass_name_index ) {
+ this.superclass_name_index = superclass_name_index;
+ }
+
+
+ /**
* @return String representing class contents.
*/
@Override
@@ -773,6 +885,14 @@ public class JavaClass extends AccessFla
}
+ /**
+ * @param comparator Comparison strategy object
+ */
+ public static void setComparator( BCELComparator comparator ) {
+ _cmp = comparator;
+ }
+
+
/**
* Return value as defined by given BCELComparator strategy.
* By default two JavaClass objects are said to be equal when
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumber.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumber.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumber.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumber.java Mon Aug 17 23:15:48 2015
@@ -35,10 +35,10 @@ public final class LineNumber implements
private static final long serialVersionUID = 169537400672820016L;
/** Program Counter (PC) corresponds to line */
- private final short start_pc;
+ private short start_pc;
/** number in source file */
- private final short line_number;
+ private short line_number;
/**
* Initialize from another object.
@@ -112,6 +112,22 @@ public final class LineNumber implements
}
+ /**
+ * @param line_number the source line number
+ */
+ public final void setLineNumber( int line_number ) {
+ this.line_number = (short) line_number;
+ }
+
+
+ /**
+ * @param start_pc the pc for this line number
+ */
+ public final void setStartPC( int start_pc ) {
+ this.start_pc = (short) start_pc;
+ }
+
+
/**
* @return String representation
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LineNumberTable.java Mon Aug 17 23:15:48 2015
@@ -36,7 +36,7 @@ public final class LineNumberTable exten
private static final long serialVersionUID = -6967221519632128904L;
- private LineNumber[] line_number_table; // Table of line/numbers pairs // TODO could be final (copy() would need adjusting)
+ private LineNumber[] line_number_table; // Table of line/numbers pairs
/*
@@ -117,6 +117,14 @@ public final class LineNumberTable exten
}
+ /**
+ * @param line_number_table the line number entries for this table
+ */
+ public final void setLineNumberTable( LineNumber[] line_number_table ) {
+ this.line_number_table = line_number_table;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariable.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariable.java Mon Aug 17 23:15:48 2015
@@ -34,11 +34,11 @@ import org.apache.commons.bcel6.Constant
public final class LocalVariable implements Cloneable, Node, Serializable {
private static final long serialVersionUID = -51081099265972179L;
- private final int start_pc; // Range in which the variable is valid
- private final int length;
- private final int name_index; // Index in constant pool of variable name
- private final int signature_index; // Index of variable signature
- private final int index; /* Variable is `index'th local variable on
+ private int start_pc; // Range in which the variable is valid
+ private int length;
+ private int name_index; // Index in constant pool of variable name
+ private int signature_index; // Index of variable signature
+ private int index; /* Variable is `index'th local variable on
* this method's frame.
*/
private ConstantPool constant_pool;
@@ -191,6 +191,54 @@ public final class LocalVariable impleme
}
+ /**
+ * @param constant_pool Constant pool to be used for this object.
+ */
+ public final void setConstantPool( ConstantPool constant_pool ) {
+ this.constant_pool = constant_pool;
+ }
+
+
+ /**
+ * @param length the length of this local variable
+ */
+ public final void setLength( int length ) {
+ this.length = length;
+ }
+
+
+ /**
+ * @param name_index the index into the constant pool for the name of this variable
+ */
+ public final void setNameIndex( int name_index ) { // TODO unused
+ this.name_index = name_index;
+ }
+
+
+ /**
+ * @param signature_index the index into the constant pool for the signature of this variable
+ */
+ public final void setSignatureIndex( int signature_index ) { // TODO unused
+ this.signature_index = signature_index;
+ }
+
+
+ /**
+ * @param index the index in the local variable table of this variable
+ */
+ public final void setIndex( int index ) { // TODO unused
+ this.index = index;
+ }
+
+
+ /**
+ * @param start_pc Specify range where the local variable is valid.
+ */
+ public final void setStartPC( int start_pc ) { // TODO unused
+ this.start_pc = start_pc;
+ }
+
+
/**
* @return string representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTable.java Mon Aug 17 23:15:48 2015
@@ -34,7 +34,7 @@ import org.apache.commons.bcel6.Constant
public class LocalVariableTable extends Attribute {
private static final long serialVersionUID = 6780929007774637689L;
- private LocalVariable[] local_variable_table; // variables TODO could be final if copy() were recoded
+ private LocalVariable[] local_variable_table; // variables
/**
@@ -136,6 +136,11 @@ public class LocalVariableTable extends
}
+ public final void setLocalVariableTable( LocalVariable[] local_variable_table ) {
+ this.local_variable_table = local_variable_table;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTypeTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTypeTable.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTypeTable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/LocalVariableTypeTable.java Mon Aug 17 23:15:48 2015
@@ -108,6 +108,10 @@ public class LocalVariableTypeTable exte
return null;
}
+ public final void setLocalVariableTable(LocalVariable[] local_variable_table) {
+ this.local_variable_type_table = local_variable_table;
+ }
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameter.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameter.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameter.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameter.java Mon Aug 17 23:15:48 2015
@@ -35,14 +35,12 @@ public class MethodParameter implements
private static final long serialVersionUID = 6014494029439440326L;
/** Index of the CONSTANT_Utf8_info structure in the constant_pool table representing the name of the parameter */
- private final int name_index;
+ private int name_index;
/** The access flags */
- private final int access_flags;
+ private int access_flags;
public MethodParameter() {
- this.access_flags = 0;
- this.name_index = 0;
}
/**
@@ -61,6 +59,10 @@ public class MethodParameter implements
return name_index;
}
+ public void setNameIndex(int name_index) {
+ this.name_index = name_index;
+ }
+
/**
* Returns the name of the parameter.
*/
@@ -75,6 +77,10 @@ public class MethodParameter implements
return access_flags;
}
+ public void setAccessFlags(int access_flags) {
+ this.access_flags = access_flags;
+ }
+
public boolean isFinal() {
return (access_flags & Constants.ACC_FINAL) != 0;
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameters.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameters.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/MethodParameters.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ public class MethodParameters extends At
private static final long serialVersionUID = 2500272580422360140L;
- private MethodParameter[] parameters = new MethodParameter[0]; // TODO could be final if copy() were recoded
+ private MethodParameter[] parameters = new MethodParameter[0];
MethodParameters(int name_index, int length, DataInput input, ConstantPool constant_pool) throws IOException {
super(Constants.ATTR_METHOD_PARAMETERS, name_index, length, constant_pool);
@@ -49,6 +49,10 @@ public class MethodParameters extends At
return parameters;
}
+ public void setParameters(MethodParameter[] parameters) {
+ this.parameters = parameters;
+ }
+
@Override
public void accept(Visitor v) {
v.visitMethodParameters(this);
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/PMGClass.java Mon Aug 17 23:15:48 2015
@@ -33,7 +33,7 @@ import org.apache.commons.bcel6.Constant
public final class PMGClass extends Attribute {
private static final long serialVersionUID = -7075964153234211509L;
- private final int pmg_class_index, pmg_index;
+ private int pmg_class_index, pmg_index;
/**
@@ -111,6 +111,14 @@ public final class PMGClass extends Attr
/**
+ * @param pmg_class_index
+ */
+ public final void setPMGClassIndex( int pmg_class_index ) {
+ this.pmg_class_index = pmg_class_index;
+ }
+
+
+ /**
* @return Index in constant pool of source file name.
*/
public final int getPMGIndex() {
@@ -118,6 +126,14 @@ public final class PMGClass extends Attr
}
+ /**
+ * @param pmg_index
+ */
+ public final void setPMGIndex( int pmg_index ) {
+ this.pmg_index = pmg_index;
+ }
+
+
/**
* @return PMG name.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ParameterAnnotations.java Mon Aug 17 23:15:48 2015
@@ -32,7 +32,7 @@ public abstract class ParameterAnnotatio
private static final long serialVersionUID = 5234607357644462705L;
/** Table of parameter annotations */
- private ParameterAnnotationEntry[] parameter_annotation_table; // TODO could be final would need to recode ctor and copy method
+ private ParameterAnnotationEntry[] parameter_annotation_table;
/**
* @param parameter_annotation_type the subclass type of the parameter annotation
@@ -80,6 +80,14 @@ public abstract class ParameterAnnotatio
}
+ /**
+ * @param parameter_annotation_table the entries to set in this parameter annotation
+ */
+ public final void setParameterAnnotationTable(ParameterAnnotationEntry[] parameter_annotation_table ) {
+ this.parameter_annotation_table = parameter_annotation_table;
+ }
+
+
/**
* @return the parameter annotation entry table
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Signature.java Mon Aug 17 23:15:48 2015
@@ -34,7 +34,7 @@ import org.apache.commons.bcel6.Constant
public final class Signature extends Attribute {
private static final long serialVersionUID = 5808807822688827177L;
- private final int signature_index;
+ private int signature_index;
/**
@@ -107,6 +107,14 @@ public final class Signature extends Att
}
+ /**
+ * @param signature_index the index info the constant pool of this signature
+ */
+ public final void setSignatureIndex( int signature_index ) {
+ this.signature_index = signature_index;
+ }
+
+
/**
* @return GJ signature.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SimpleElementValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SimpleElementValue.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SimpleElementValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SimpleElementValue.java Mon Aug 17 23:15:48 2015
@@ -27,7 +27,7 @@ import org.apache.commons.bcel6.Constant
*/
public class SimpleElementValue extends ElementValue
{
- private final int index;
+ private int index;
public SimpleElementValue(int type, int index, ConstantPool cpool)
{
@@ -43,6 +43,11 @@ public class SimpleElementValue extends
return index;
}
+ public void setIndex(int index)
+ {
+ this.index = index;
+ }
+
public String getValueString()
{
if (type != STRING) {
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/SourceFile.java Mon Aug 17 23:15:48 2015
@@ -35,7 +35,7 @@ import org.apache.commons.bcel6.Constant
public final class SourceFile extends Attribute {
private static final long serialVersionUID = -804226255663222912L;
- private final int sourcefile_index;
+ private int sourcefile_index;
/**
@@ -114,6 +114,14 @@ public final class SourceFile extends At
}
+ /**
+ * @param sourcefile_index
+ */
+ public final void setSourceFileIndex( int sourcefile_index ) {
+ this.sourcefile_index = sourcefile_index;
+ }
+
+
/**
* @return Source file name.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMap.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMap.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMap.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMap.java Mon Aug 17 23:15:48 2015
@@ -40,7 +40,7 @@ import org.apache.commons.bcel6.Constant
public final class StackMap extends Attribute {
private static final long serialVersionUID = -6238662431726968495L;
- private StackMapEntry[] map; // Table of stack map entries // TODO could be final if ctor and copy() were recoded
+ private StackMapEntry[] map; // Table of stack map entries
/*
@@ -98,6 +98,14 @@ public final class StackMap extends Attr
}
+ /**
+ * @param map Array of stack map entries
+ */
+ public final void setStackMap( StackMapEntry[] map ) {
+ this.map = map;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java Mon Aug 17 23:15:48 2015
@@ -35,10 +35,10 @@ public final class StackMapEntry impleme
private static final long serialVersionUID = 1L;
- private final int byte_code_offset;
- private final StackMapType[] types_of_locals;
- private final StackMapType[] types_of_stack_items;
- private final ConstantPool constant_pool;
+ private int byte_code_offset;
+ private StackMapType[] types_of_locals;
+ private StackMapType[] types_of_stack_items;
+ private ConstantPool constant_pool;
/**
@@ -126,6 +126,11 @@ public final class StackMapEntry impleme
}
+ public void setByteCodeOffset( int b ) {
+ byte_code_offset = b;
+ }
+
+
public int getByteCodeOffset() {
return byte_code_offset;
}
@@ -136,6 +141,11 @@ public final class StackMapEntry impleme
}
+ public void setTypesOfLocals( StackMapType[] types ) {
+ types_of_locals = types != null ? types : new StackMapType[0];
+ }
+
+
public StackMapType[] getTypesOfLocals() {
return types_of_locals;
}
@@ -146,6 +156,11 @@ public final class StackMapEntry impleme
}
+ public void setTypesOfStackItems( StackMapType[] types ) {
+ types_of_stack_items = types != null ? types : new StackMapType[0];
+ }
+
+
public StackMapType[] getTypesOfStackItems() {
return types_of_stack_items;
}
@@ -182,4 +197,11 @@ public final class StackMapEntry impleme
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;
+ }
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTable.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTable.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTable.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTable.java Mon Aug 17 23:15:48 2015
@@ -41,7 +41,7 @@ import org.apache.commons.bcel6.Constant
public final class StackMapTable extends Attribute {
private static final long serialVersionUID = -5802191977296683162L;
- private StackMapTableEntry[] map; // Table of stack map entries TODO could be final if copy() and ctor were rewritten
+ private StackMapTableEntry[] map; // Table of stack map entries
/*
@@ -98,6 +98,14 @@ public final class StackMapTable extends
}
+ /**
+ * @param map Array of stack map entries
+ */
+ public final void setStackMapTable( StackMapTableEntry[] map ) {
+ this.map = map;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTableEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTableEntry.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTableEntry.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapTableEntry.java Mon Aug 17 23:15:48 2015
@@ -39,10 +39,10 @@ public final class StackMapTableEntry im
private static final long serialVersionUID = 1L;
private final int frame_type;
- private int byte_code_offset_delta; // TODO could be final if ctor were rewritten
- private StackMapType[] types_of_locals; // TODO could be final if ctor were rewritten
- private StackMapType[] types_of_stack_items; // TODO could be final if ctor were rewritten
- private final ConstantPool constant_pool; // TODO could be final if ctor were rewritten
+ private int byte_code_offset_delta;
+ private StackMapType[] types_of_locals;
+ private StackMapType[] types_of_stack_items;
+ private ConstantPool constant_pool;
/**
@@ -196,6 +196,11 @@ public final class StackMapTableEntry im
}
+ public void setByteCodeOffsetDelta( int b ) {
+ byte_code_offset_delta = b;
+ }
+
+
public int getByteCodeOffsetDelta() {
return byte_code_offset_delta;
}
@@ -206,6 +211,11 @@ public final class StackMapTableEntry im
}
+ public void setTypesOfLocals( StackMapType[] types ) {
+ types_of_locals = types != null ? types : new StackMapType[0];
+ }
+
+
public StackMapType[] getTypesOfLocals() {
return types_of_locals;
}
@@ -216,6 +226,11 @@ public final class StackMapTableEntry im
}
+ public void setTypesOfStackItems( StackMapType[] types ) {
+ types_of_stack_items = types != null ? types : new StackMapType[0];
+ }
+
+
public StackMapType[] getTypesOfStackItems() {
return types_of_stack_items;
}
@@ -252,4 +267,11 @@ public final class StackMapTableEntry im
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;
+ }
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapType.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapType.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapType.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapType.java Mon Aug 17 23:15:48 2015
@@ -37,9 +37,9 @@ public final class StackMapType implemen
private static final long serialVersionUID = 1L;
- private final byte type;
- private final int index; // Index to CONSTANT_Class or offset
- private final ConstantPool constant_pool;
+ private byte type;
+ private int index = -1; // Index to CONSTANT_Class or offset
+ private ConstantPool constant_pool;
/**
@@ -48,12 +48,10 @@ public final class StackMapType implemen
* @throws IOException
*/
StackMapType(DataInput file, ConstantPool constant_pool) throws IOException {
- byte type = file.readByte();
- if ((type < Constants.ITEM_Bogus) || (type > Constants.ITEM_NewObject)) {
- throw new RuntimeException("Illegal type for StackMapType: " + type);
+ this(file.readByte(), -1, constant_pool);
+ if (hasIndex()) {
+ this.index = (int) file.readShort();
}
- this.type = type;
- this.index = hasIndex() ? (int) file.readShort() : -1;
this.constant_pool = constant_pool;
}
@@ -72,11 +70,24 @@ public final class StackMapType implemen
}
+ public void setType( byte t ) {
+ if ((t < Constants.ITEM_Bogus) || (t > Constants.ITEM_NewObject)) {
+ throw new RuntimeException("Illegal type for StackMapType: " + t);
+ }
+ type = t;
+ }
+
+
public byte getType() {
return type;
}
+ public void setIndex( int t ) {
+ index = t;
+ }
+
+
/** @return index to constant pool if type == ITEM_Object, or offset
* in byte code, if type == ITEM_NewObject, and -1 otherwise
*/
@@ -148,4 +159,11 @@ public final class StackMapType implemen
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;
+ }
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Synthetic.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Synthetic.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Synthetic.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Synthetic.java Mon Aug 17 23:15:48 2015
@@ -38,7 +38,7 @@ import org.apache.commons.bcel6.Constant
public final class Synthetic extends Attribute {
private static final long serialVersionUID = -123334426995458366L;
- private byte[] bytes; // TODO could be final if copy() and ctor were recoded
+ private byte[] bytes;
/**
@@ -120,6 +120,14 @@ public final class Synthetic extends Att
}
+ /**
+ * @param bytes
+ */
+ public final void setBytes( byte[] bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Unknown.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Unknown.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Unknown.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Unknown.java Mon Aug 17 23:15:48 2015
@@ -41,7 +41,7 @@ import org.apache.commons.bcel6.Constant
public final class Unknown extends Attribute {
private static final long serialVersionUID = -4099655108069755015L;
- private byte[] bytes; // TODO could be final if copy() were adjusted
+ private byte[] bytes;
private final String name;
private static final Map<String, Unknown> unknown_attributes = new HashMap<>();
@@ -146,6 +146,14 @@ public final class Unknown extends Attri
}
+ /**
+ * @param bytes the bytes to set
+ */
+ public final void setBytes( byte[] bytes ) {
+ this.bytes = bytes;
+ }
+
+
/**
* @return String representation.
*/
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java?rev=1696350&r1=1696349&r2=1696350&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ConstantPoolGen.java Mon Aug 17 23:15:48 2015
@@ -54,7 +54,7 @@ public class ConstantPoolGen implements
private static final long serialVersionUID = 6664071417323174824L;
private int size;
- private Constant[] constants;
+ protected Constant[] constants;
private int index = 1; // First entry (0) used by JVM
private static final String METHODREF_DELIM = ":";
private static final String IMETHODREF_DELIM = "#";
@@ -688,6 +688,17 @@ public class ConstantPoolGen implements
}
+ /**
+ * Use with care!
+ *
+ * @param i index in constant pool
+ * @param c new constant pool entry at index i
+ */
+ public void setConstant( int i, Constant c ) {
+ constants[i] = c;
+ }
+
+
/**
* @return intermediate constant pool
*/